Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Extras » AU_Index/SourceCode

AU_Index/SourceCode

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199607.adf » Extras
Filename: AU_Index/SourceCode
Read OK:
File size: 2A3B5 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     Name : AUIndex (Source Code)
   20REM  Purpose : Easy Location Of Acorn User Articles
   30REM   Author : (c) The Flying Twig, 1994-96
   40REM           AKA Paul Burns
   50REM  Version : 1.00 (20 Dec 1995)
   60
   70ONERROR ONERROROFF:PRINT REPORT$;" at line ";ERL:END
   80
   90DIM code%  1024*28                     :REM reserve 28k for assembler
  100
  110REM---------------------------------------------------------------------------
  120
  130FOR pass%=0TO2 STEP2
  140P%=code%
  150[OPTpass%
  160
  170B       getstack                        ;Set up Stack Pointer
  180
  190.continue
  200
  210STMFD   R13!,{R0-R12}
  220
  230 FNLongAdr("",11,menu%)                 ;Pointer to Menu Data
  240 ADR     R12,data%                      ;Pointer to Wimp Data
  250 ADD     R10,R12,#&1E00                 ;Pointer to Program Data
  260 ADD     R9,R10,#&300                   ;Pointer to Misc String buffer
  270 B       Start
  280
  290;-----------------------------------------------------------------------------
  300; This section reserves space for Data (&2300 bytes)
  310
  320.data%
  330]
  340
  350FOR i =0 TO &2300 STEP 4
  360 [OPT pass%
  370  EQUD    0
  380 ]
  390NEXT
  400
  410REM---------------------------------------------------------------------------
  420REM This section sets up variables as offsets within the workspace to allow
  430REM easy reference to data.
  440
  450REM  Wimp Data Labels
  460
  470version%=&00
  480task%=&04
  490iconbar%=&08
  500display%=&0C
  510info%=&10
  520search%=&14
  530edit%=&18
  540save%=&1C
  550quit%=&20               :data%!quit%=0
  560currentmenu%=&24
  570templates=&28           :$(data%+templates)="<AUIndex$Resource>.Templates"
  580spritename=&45          :$(data%+spritename)="!AUIndex"
  590appname=&46
  600edit=&50                :$(data%+edit)="edit"
  610display=&55             :$(data%+display)="display"
  620info=&5E                :$(data%+info)="info"
  630search=&63              :$(data%+search)="search"
  640save=&6A                :$(data%+save)="save"
  650version=&70             :$(data%+version)="1.00 (20 Dec 1995)"
  660block%=&84              :$(data%+block%+24)="!AUIndex"
  670fonts%=&190
  680update=&290             :$(data%+update)="update"
  690update%=&298
  700icons%=&3A0
  710templates%=&1200
  720
  730indexdata%=data%+&1E00
  740
  750REM  Data Labels for Program Specific Data
  760
  770indexhandle%=&00
  780searchhandle%=&04
  790indexmax%=&08
  800searchmax%=&0C
  810show%=&10
  820filehandle%=&14
  830indexrecord%=&18
  840searchrecord%=&1C
  850record%=&20
  860max%=&24
  870searchfile=&28          :$(indexdata%+searchfile)="<Wimp$ScrapDir>.SearchFile"
  880indexfile=&46           :$(indexdata%+indexfile)="<AUIndex$Resource>.IndexFile"
  890backslash=&66           :$(indexdata%+backslash)="\"
  900editmonth%=&68
  910displaymonth%=&6C
  920multiple%=&70           :!(indexdata%+multiple%)=0
  930editrecord%=&74
  940scrapref%=&78
  950updating%=&7C           :!updating%=0
  960months%=&130
  970$(indexdata%+months%+&00)="Jan"
  980$(indexdata%+months%+&10)="Feb"
  990$(indexdata%+months%+&20)="Mar"
 1000$(indexdata%+months%+&30)="Apr"
 1010$(indexdata%+months%+&40)="May"
 1020$(indexdata%+months%+&50)="Jun"
 1030$(indexdata%+months%+&60)="Jul"
 1040$(indexdata%+months%+&70)="Aug"
 1050$(indexdata%+months%+&80)="Sep"
 1060$(indexdata%+months%+&90)="Oct"
 1070$(indexdata%+months%+&A0)="Nov"
 1080$(indexdata%+months%+&B0)="Dec"
 1090$(indexdata%+months%+&C0)="Xmas"
 1100record=&200
 1110
 1120REM---------------------------------------------------------------------------
 1130REM This section reserves space for the stack (&100 bytes).
 1140
 1150FOR i= 0 TO &100 STEP4
 1160 [OPT pass%
 1170  EQUD    0
 1180 ]
 1190NEXT
 1200
 1210REM---------------------------------------------------------------------------
 1220REM  Save Link and Stack Pointer onto stack
 1230
 1240[OPT pass%
 1250ALIGN
 1260
 1270.getstack
 1280STR     R14,getstack-4
 1290STR     R13,getstack-8
 1300ADR     R13,getstack-8
 1310B       continue
 1320
 1330;-----------------------------------------------------------------------------
 1340; MenuData
 1350; This section sets up Menu Templates which can be passed to
 1360; "MessageTrans_MakeMenu" to create a menu structure using the strings
 1370; supplied in the Messages file.
 1380
 1390.menulist
 1400EQUD    0                              ;This reserves three words for storing
 1410EQUD    0                              ;the address of the Menu structures
 1420EQUD    0                              ;when they are created.
 1430
 1440.menu%
 1450.ibmenu%
 1460EQUS    "IM0"+CHR$0                    ;Message Token for the menu title.
 1470EQUB    7                              ;Menu Title foreground colour.
 1480EQUB    2                              ;Menu Title background colour.
 1490EQUB    7                              ;Menu work area foreground colour.
 1500EQUB    0                              ;Menu work area background colour.
 1510EQUB    44                             ;Height of each menu item (in OS units).
 1520EQUB    0                              ;Vertical gap between menu items.
 1530
 1540
 1550EQUS    "IM1"+CHR$0                    ;Message Token for first menu item
 1560ALIGN
 1570EQUD    0                              ;Menu Item flags
 1580EQUD    0                              ;Submenu pointer
 1590EQUD    &7000021                       ;Icon flags
 1600
 1610EQUS    "IM2"+CHR$0                    ;Message Token for second menu item
 1620ALIGN
 1630EQUD    &80                            ;Menu Item flags (&80=last item)
 1640EQUD    0                              ;Submenu pointer
 1650EQUD    &7000021                       ;Icon flags
 1660
 1670EQUB    0                              ;terminating byte
 1680ALIGN
 1690
 1700.mainmenu%
 1710EQUS    "MM0"+CHR$0                    ;Message Token for the menu title.
 1720EQUB    7                              ;Menu Title foreground colour.
 1730EQUB    2                              ;Menu Title background colour.
 1740EQUB    7                              ;Menu work area foreground colour.
 1750EQUB    0                              ;Menu work area background colour.
 1760EQUB    44                             ;Height of each menu item (in OS units).
 1770EQUB    0                              ;Vertical gap between menu items.
 1780
 1790EQUS    "MM1"+CHR$0                    ;Message Token for first menu item
 1800ALIGN
 1810EQUD    0                              ;Menu Item flags
 1820EQUD    0                              ;Submenu pointer
 1830EQUD    &7000021                       ;Icon flags
 1840
 1850EQUS    "MM2"+CHR$0                    ;Message Token for second menu item
 1860ALIGN
 1870EQUD    0                              ;Menu Item flags
 1880EQUD    0                              ;Submenu pointer
 1890EQUD    &7000021                       ;Icon flags
 1900
 1910
 1920EQUS    "MM3"+CHR$0                    ;Message Token for third menu item
 1930ALIGN
 1940EQUD    0                              ;Menu Item flags
 1950EQUD    0                              ;Submenu pointer
 1960EQUD    &7000021                       ;Icon flags
 1970
 1980EQUS    "MM4"+CHR$0                    ;Message Token for fourth menu item
 1990ALIGN
 2000EQUD    0                              ;Menu Item flags
 2010EQUD    0                              ;Submenu pointer
 2020EQUD    &7000021                       ;Icon flags
 2030
 2040EQUS    "MM5"+CHR$0                    ;Message Token for fifth menu item
 2050ALIGN
 2060EQUD    &80                            ;Menu Item flags (&80=last item)
 2070EQUD    0                              ;Submenu pointer
 2080EQUD    &7000021                       ;Icon flags
 2090
 2100EQUB    0                              ;Terminating byte
 2110ALIGN
 2120
 2130.topicmenu%
 2140EQUS    "TM0"+CHR$0                    ;Message Token for the menu title.
 2150EQUB    7                              ;Menu Title foreground colour.
 2160EQUB    2                              ;Menu Title background colour.
 2170EQUB    7                              ;Menu work area foreground colour.
 2180EQUB    0                              ;Menu work area background colour.
 2190EQUB    44                             ;Height of each menu item (in OS units).
 2200EQUB    0                              ;Vertical gap between menu items.
 2210
 2220]
 2230FOR i=1 TO 32
 2240[OPT pass%
 2250
 2260EQUS    "TM"+STR$(i)+CHR$0             ;Message Token for ith menu item
 2270ALIGN
 2280EQUD    0                              ;Menu Item flags
 2290EQUD    0                              ;Submenu pointer
 2300EQUD    &7000121                       ;Icon flags
 2310
 2320]
 2330NEXT
 2340[OPT pass%
 2350
 2360EQUS    "TM33"+CHR$0                   ;Message Token for 33rd menu item
 2370ALIGN
 2380EQUD    &84                            ;Menu Item flags(&84=Writeable/last item)
 2390EQUD    0                              ;Submenu pointer
 2400EQUD    &7000121
 2410
 2420EQUB    0                              ;Terminating byte
 2430ALIGN
 2440
 2450
 2460.writeabletext
 2470]
 2480FOR i=0TO256 STEP4
 2490 [OPT pass%
 2500  EQUD    0                            ;256 byte array for text from writeable
 2510                                       ;menu item.
 2520 ]
 2530NEXT
 2540
 2550REM---------------------------------------------------------------------------
 2560REM Program code starts here
 2570
 2580[OPT pass%
 2590
 2600.Start
 2610
 2620;-----------------------------------------------------------------------------
 2630;                            *** Initialise Wimp ***
 2640; This section calls the Window Manager which will return its version number
 2650; and our unique Task handle.
 2660
 2670MOV     R0,#200                        ;Minimum Version Number *100
 2680MOV     R1,   #&4B000000               ;"TASK"
 2690ADD     R1,R1,#&00530000
 2700ADD     R1,R1,#&00004100
 2710ADD     R1,R1,#&00000054
 2720ADD     R2,R12,#appname                ;Name to appear on Task Display
 2730SWI     "XWimp_Initialise"
 2740 BVS     SeriousError
 2750STR     R0,[R12,#version%]             ;Wimp Version number *100
 2760STR     R1,[R12,#task%]                ;Our Task handle
 2770
 2780;-----------------------------------------------------------------------------
 2790; This subroutine sets up our icon on the icon bar.
 2800
 2810MVN     R0,#0                          ;Window handle (-1 Left side of IBar)
 2820STR     R0,[R12,#block%+0]
 2830MOV     R0,#0                          ;Minimum X
 2840STR     R0,[R12,#block%+4]
 2850MOV     R0,#0                          ;Minimum Y
 2860STR     R0,[R12,#block%+8]
 2870MOV     R0,#170                        ;Maximum X
 2880STR     R0,[R12,#block%+12]
 2890MOV     R0,#68                         ;Maximum Y
 2900STR     R0,[R12,#block%+16]
 2910MOV     R0,   #&3000                   ;Icon flags
 2920ADD     R0,R0,#&0002
 2930STR     R0,[R12,#block%+20]
 2940ADD     R1,R12,#block%
 2950SWI     "XWimp_CreateIcon"
 2960 BVS     SeriousError
 2970STR     R0,[R12,#iconbar%]             ;Icon bar icon number
 2980
 2990;-----------------------------------------------------------------------------
 3000; This section loads the window template files and creates the windows.
 3010
 3020ADD     R1,R12,#templates
 3030SWI     "XWimp_OpenTemplate"
 3040 BVS     SeriousError
 3050ADD     R1,R12,#templates%             ;Space for template data
 3060ADD     R2,R12,#icons%                 ;Space for indirected Icon data
 3070ADD     R3,R2,#templates%-icons%       ;Size of space for indirected data
 3080ADD     R4,R12,#fonts%                 ;256 byte font count array
 3090
 3100ADD     R5,R12,#display                ;Main Display Window
 3110MOV     R6,#0                          ;Template to start searching from
 3120SWI     "XWimp_LoadTemplate"
 3130 BVS     SeriousError
 3140SWI     "XWimp_CreateWindow"
 3150 BVS     SeriousError
 3160STR     R0,[R12,#display%]             ;Display window handle
 3170
 3180ADD     R5,R12,#info                   ;Info Dialogue box
 3190MOV     R6,#0
 3200SWI     "XWimp_LoadTemplate"
 3210 BVS     SeriousError
 3220SWI     "XWimp_CreateWindow"
 3230 BVS     SeriousError
 3240STR     R0,[R12,#info%]                ;Info window handle
 3250
 3260ADD     R5,R12,#search                 ;Search Dialogue box
 3270MOV     R6,#0
 3280SWI     "XWimp_LoadTemplate"
 3290 BVS     SeriousError
 3300SWI     "XWimp_CreateWindow"
 3310 BVS     SeriousError
 3320STR     R0,[R12,#search%]              ;Search window handle
 3330
 3340ADD     R5,R12,#edit                   ;Edit window
 3350MOV     R6,#0
 3360SWI     "XWimp_LoadTemplate"
 3370 BVS     SeriousError
 3380SWI     "XWimp_CreateWindow"
 3390 BVS     SeriousError
 3400STR     R0,[R12,#edit%]                ;Edit window handle
 3410
 3420ADD     R5,R12,#save                   ;Save Dialogue box
 3430MOV     R6,#0
 3440SWI     "XWimp_LoadTemplate"
 3450 BVS     SeriousError
 3460SWI     "XWimp_CreateWindow"
 3470 BVS     SeriousError
 3480STR     R0,[R12,#save%]                ;Save window handle
 3490
 3500
 3510ADD     R5,R12,#update                   ;Update Dialogue box
 3520MOV     R6,#0
 3530SWI     "XWimp_LoadTemplate"
 3540 BVS     SeriousError
 3550SWI     "XWimp_CreateWindow"
 3560 BVS     SeriousError
 3570STR     R0,[R12,#update%]                ;Update window handle
 3580
 3590SWI     "XWimp_CloseTemplate"
 3600
 3610;-----------------------------------------------------------------------------
 3620; This routine fills in the version number in the Info dialogue box.
 3630
 3640LDR     R0,[R12,#info%]
 3650MOV     R1,#7
 3660ADD     R2,R12,#version
 3670BL      WriteIcon
 3680;-----------------------------------------------------------------------------
 3690
 3700BL      Init                           ;Initialise files
 3710
 3720;-----------------------------------------------------------------------------
 3730;                              *** Wimp_Poll ***
 3740; This routine repeatedly polls the wimp to find out what is happening
 3750; around the desktop. The wimp returns an Event Reason Code and fills the
 3760; parameter block with data dependant on the Event.
 3770
 3780 .mainloop
 3790
 3800MOV     R0,   #%11100000000000
 3810ADD     R0,R0,#%00000000010000         ;Mask out unwanted reason codes
 3820
 3830ADD     R1,R12,#block%
 3840SWI     "Wimp_Poll"
 3850
 3860 CMP     R0,#0: BLEQ    ContUpdating
 3870 CMP     R0,#1: BLEQ    RedrawWindowRequest
 3880 CMP     R0,#2: BLEQ    OpenWindowRequest
 3890 CMP     R0,#3: SWIEQ   "Wimp_CloseWindow"
 3900;CMP     R0,#4                         ;Pointer_Leaving_Window
 3910 CMP     R0,#5:                        ;Pointer_Entering_Window
 3920 CMP     R0,#6: BLEQ    MouseButtonClicked
 3930 CMP     R0,#7: BLEQ    DragFinished
 3940 CMP     R0,#8: BLEQ    KeyPressed
 3950 CMP     R0,#9: BLEQ    MenuOptionSelected
 3960;CMP     R0,#10                        ;Scroll_Request
 3970;CMP     R0,#11                        ;Losing_Caret
 3980;CMP     R0,#12                        ;Gaining_Caret
 3990 CMP     R0,#17                        ;User_MessageReceived
 4000 CMPNE   R0,#18:BLEQ    UserMessageReceived
 4010;CMP     R0,#19                        ;User_Message_Ack
 4020
 4030
 4040 LDR     R0,[R12,#quit%]               ;Check if we have been asked to quit
 4050 CMP     R0,#0
 4060 BEQ     mainloop
 4070
 4080;----------------------------------------------------------------------------
 4090; This routine safley closes down our task.
 4100
 4110 LDR     R0,[R12,#task%]               ;This section tells the WIMP that we
 4120 MOV     R1,   #&4B000000              ;are about to close down our task.
 4130 ADD     R1,R1,#&00530000
 4140 ADD     R1,R1,#&00004100
 4150 ADD     R1,R1,#&00000054
 4160 SWI     "XWimp_CloseDown"
 4170
 4180 MOV     R0,#6
 4190 ADD     R1,R10,#searchfile
 4200 SWI     "OS_File"
 4210
 4220 FNLongAdr("",0,messages)              ;This closes the Message file if it is
 4230 SWI     "XMessageTrans_CloseFile"     ;still open.
 4240
 4250 SWI     "XOS_Exit"                    ;This closes down our task.
 4260
 4270;-----------------------------------------------------------------------------
 4280;                    *** Redraw_Window_Request ***
 4290; This routine is called when part of one of our windows needs redrawing.
 4300; Since none of our windows contain any 'User' graphics we can pass the call
 4310; straight back to the Wimp to redraw the icons itself. A loop is needed to
 4320; get a list of all the Rectangles that need redrawing.
 4330
 4340.RedrawWindowRequest
 4350
 4360STMFD   R13!,{R0-R12,R14}
 4370 ADD     R1,R12,#block%
 4380 SWI     "Wimp_RedrawWindow"
 4390 .redrawloop
 4400 CMP     R0,#0
 4410 LDMEQFD R13!,{R0-R12,PC}^
 4420 SWI     "Wimp_GetRectangle"
 4430B       redrawloop
 4440
 4450;-----------------------------------------------------------------------------
 4460;                      *** Open_Window_Request ***
 4470; This routine is called when one of our windows needs opening or has been
 4480; scrolled and needs redrawing with new scroll offsets. No special action
 4490; needs to be performed so we simply open the window as requested.
 4500
 4510.OpenWindowRequest
 4520
 4530STMFD   R13!,{R0-R12,R14}
 4540
 4550 SWI     "Wimp_OpenWindow"
 4560
 4570LDMFD   R13!,{R0-R12,PC}^
 4580
 4590;-----------------------------------------------------------------------------
 4600;                       *** Mouse_Button_Click ***
 4610; This routine is called when the mouse buttons change state while the
 4620; pointer is over one of our windows - Dependant on the button type of the icon
 4630; it is over, if any.
 4640
 4650.MouseButtonClicked
 4660
 4670STMFD   R13!,{R0-R12,R14}
 4680 LDR     R2,[R12,#block%+0]            ;X coordinate
 4690 LDR     R3,[R12,#block%+4]            ;Y coordinate
 4700 LDR     R4,[R12,#block%+8]            ;Mouse Button State
 4710 LDR     R5,[R12,#block%+12]           ;Window handle
 4720 LDR     R6,[R12,#block%+16]           ;Icon number
 4730 LDR     R7,[R12,#display%]
 4740 LDR     R8,[R12,#search%]
 4750
 4760 CMP     R5,R7                         ;This section will display the topic
 4770  CMP     R6,#43                       ;selection menu if the menu button is
 4780   FNLongAdr("EQ",1,menuinfo)          ;pressed over the pop-up menu icon in
 4790   MOVEQ   R0,#0                       ;the Display window.
 4800   STREQ   R0,[R1,#4]
 4810   FNLongAdr("EQ",8,menulist)
 4820   LDREQ   R1,[R8,#8]
 4830   STREQ   R1,[R12,#currentmenu%]
 4840   SUBEQ   R2,R2,#64
 4850   STREQ   R2,[R9,#0]
 4860   STREQ   R3,[R9,#4]
 4870   SWIEQ   "Wimp_CreateMenu"
 4880   LDMEQFD R13!,{R0-R12,PC}^
 4890
 4900 CMP     R5,R7                         ;This section will display the main
 4910  CMPEQ   R4,#2                        ;Menu if the Menu button is pressed
 4920   BLEQ    UpdateStartEnd              ;anywhere else in the Display window
 4930   BLEQ    UpdateLeafName              ;after first updating the Save dialogue
 4940   FNLongAdr("EQ",8,menulist)          ;box with the current issue number
 4950   LDREQ   R1,[R8,#4]
 4960   STREQ   R1,[R12,#currentmenu%]
 4970   SUBEQ   R2,R2,#64
 4980   STREQ   R2,[R9,#0]
 4990   STREQ   R3,[R9,#4]
 5000   SWIEQ   "Wimp_CreateMenu"
 5010   LDMEQFD R13!,{R0-R12,PC}^
 5020
 5030 CMN     R5,#2                         ;This section displays the Icon Bar
 5040  CMPEQ   R4,#2                        ;Menu if the menu button is pressed
 5050   FNLongAdr("EQ",8,menulist)          ;over our icon bar icon.
 5060   LDREQ   R1,[R8,#0]
 5070   STREQ   R1,[R12,#currentmenu%]
 5080   MOVEQ   R3,#96
 5090   ADDEQ   R3,R3,#88                   ; 44 units per menu item
 5100   SUBEQ   R2,R2,#64
 5110   STREQ   R2,[R9,#0]
 5120   STREQ   R3,[R9,#4]
 5130   SWIEQ   "Wimp_CreateMenu"
 5140   LDMEQFD R13!,{R0-R12,PC}^
 5150
 5160 CMN     R5,#2                         ;This section will open the main window
 5170  STREQ   R7,[R12,#block%+0]           ;if Select or adjust is pressed over
 5180  ADDEQ   R1,R12,#block%               ;our icon bar icon
 5190  SWIEQ   "Wimp_GetWindowState"
 5200  BLEQ    OpenWindowRequest
 5210
 5220 CMP     R5,R7                         ;This section will call a subroutine
 5230  TSTEQ   R4,#(NOT 4) AND 7            ;to deal with Select being pressed over
 5240   BLEQ    SelectInDisplay             ;the Display window.
 5250   LDMEQFD R13!,{R0-R12,PC}^
 5260
 5270 CMP     R5,R7                         ;This section will call a subroutine
 5280  TSTEQ   R4,#(NOT 1) AND 7            ;to deal with adjust being pressed over
 5290   BLEQ    AdjustInDisplay             ;the Display window
 5300   LDMEQFD R13!,{R0-R12,PC}^
 5310
 5320 CMP     R5,R8                         ;This section will start a search if
 5330  CMPEQ   R6,#2                        ;the OK icon clicked in the Search
 5340    BLEQ   StartSearch                 ;Dialogue box. If Select was used it
 5350    TSTEQ  R4,#(NOT 4) AND 7           ;will also close the Menu structure
 5360    MVNEQ  R1,#0
 5370    SWIEQ  "Wimp_CreateMenu"
 5380    LDMEQFD R13!,{R0-R12,PC}^
 5390
 5400 LDR     R8,[R12,#edit%]
 5410 CMP     R5,R8                         ;This section displays the topic
 5420  CMPEQ   R6,#25                       ;selection menu when Menu is pressed
 5430   FNLongAdr("EQ",1,menuinfo)          ;over the pop-up menu icon in the
 5440   MVNEQ   R0,#0                       ;Edit window.
 5450   STREQ   R0,[R1,#4]
 5460   FNLongAdr("EQ",1,menulist)
 5470   LDR     R1,[R1,#8]
 5480   STREQ   R1,[R12,#currentmenu%]
 5490   SUBEQ   R2,R2,#64
 5500   STREQ   R2,[R9,#0]
 5510   STREQ   R3,[R9,#4]
 5520   SWIEQ   "Wimp_CreateMenu"
 5530   LDMEQFD R13!,{R0-R12,PC}^
 5540
 5550 CMP     R5,R8                         ;This section calls a subroutine to
 5560  TSTEQ   R4,#(NOT 4) AND 7            ;deal with Select being pressed over
 5570   BLEQ    SelectInEdit                ;the Edit window.
 5580   LDMEQFD R13!,{R0-R12,PC}^
 5590
 5600 CMP     R5,R8                         ;This section calls a subroutine to
 5610  TSTEQ   R4,#(NOT 1) AND 7            ;deal with Adjust being pressed over
 5620   BLEQ    AdjustInEdit                ;the Edit window
 5630   LDMEQFD R13!,{R0-R12,PC}^
 5640
 5650 LDR     R8,[R12,#save%]
 5660 CMP     R5,R8                         ;This section will call a subroutine
 5670  TSTEQ   R4,#(NOT 4) AND 7            ;to deal with Select being pressed
 5680   BLEQ    SelectInSave                ;in the save dialogue box.
 5690   LDMEQFD R13!,{R0-R12,PC}^
 5700
 5710 CMP     R5,R8                         ;This section will call a subroutine
 5720  TSTEQ   R4,#(NOT 1) AND 7            ;to deal with Adjust being pressed
 5730   BLEQ    AdjustInSave                ;in the save dialogue box
 5740   LDMEQFD R13!,{R0-R12,PC}^
 5750
 5760 LDR     R8,[R12,#update%]
 5770 CMP     R5,R8
 5780  CMP     R6,#5
 5790   MOVEQ   R0,#1
 5800   STREQ   R0,[R10,#updating%]
 5810
 5820 CMP     R5,R8
 5830  CMP     R6,#6
 5840   MOVEQ   R0,#0
 5850   STREQ   R0,[R10,#updating%]
 5860   STREQ   R8,[R12,#block%+0]
 5870   ADDEQ   R1,R12,#block%
 5880   SWIEQ   "Wimp_CloseWindow"
 5890
 5900LDMFD   R13!,{R0-R12,PC}^
 5910
 5920;-----------------------------------------------------------------------------
 5930;                      *** SelectInDisplay ***
 5940; This subroutine deals with Select being clicked over the Display window.
 5950
 5960.SelectInDisplay
 5970
 5980STMFD   R13!,{R0-R12,R14}
 5990
 6000 LDR     R0,[R10,#show%]               ;This section open the appropriate
 6010 CMP     R0,#1                         ;file for the current display mode,
 6020  MOV     R0,#&4F                      ;either Indexfile or Searchfile
 6030   ADDEQ   R1,R10,#indexfile
 6040   ADDNE   R1,R10,#searchfile
 6050  SWI    "XOS_Find"
 6060   BVS     norecords
 6070  STR     R0,[R10,#filehandle%]
 6080   STREQ   R0,[R10,#indexhandle%]
 6090   STRNE   R0,[R10,#searchhandle%]
 6100
 6110 CMP     R6,#20                        ;This section displays the previous
 6120 SWIEQ   "Hourglass_On"                ;record when the single left arrow is
 6130  MOVEQ   R0,#1                        ;clicked on with Select.
 6140  MOVEQ   R1,#1
 6150  BLEQ    GetRecords
 6160  BLEQ    Update
 6170  SWIEQ   "Hourglass_Off"
 6180  BEQ     selectclosefile
 6190
 6200 CMP     R6,#21                        ;This section reads back 10 records
 6210  SWIEQ   "Hourglass_On"               ;when the double left arrow is clicked
 6220  MOVEQ   R0,#10                       ;on with Select.
 6230  MOVEQ   R1,#1
 6240  BLEQ    GetRecords
 6250  BLEQ    Update
 6260  SWIEQ   "Hourglass_Off"
 6270  BEQ     selectclosefile
 6280
 6290 CMP     R6,#22                        ;This section reads back 100 records
 6300  SWIEQ   "Hourglass_On"               ;when the triple left arrow is clicked
 6310  MOVEQ   R0,#100                      ;on with Select
 6320  MOVEQ   R1,#1
 6330  BLEQ    GetRecords
 6340  BLEQ    Update
 6350  SWIEQ   "Hourglass_Off"
 6360  BEQ     selectclosefile
 6370
 6380 CMP     R6,#23                        ;This section reads the next record
 6390  SWIEQ   "Hourglass_On"               ;when the single right arrow is clicked
 6400  MOVEQ   R0,#1                        ;on with select.
 6410  MOVEQ   R1,#0
 6420  BLEQ    GetRecords
 6430  BLEQ    Update
 6440  SWIEQ   "Hourglass_Off"
 6450  BEQ     selectclosefile
 6460
 6470 CMP     R6,#24                        ;This section reads forward 10 records
 6480  SWIEQ   "Hourglass_On"               ;when the double right arrow is clicked
 6490  MOVEQ  R0,#10                        ;on with Select.
 6500  MOVEQ  R1,#0
 6510  BLEQ   GetRecords
 6520  BLEQ    Update
 6530  SWIEQ   "Hourglass_Off"
 6540  BEQ     selectclosefile
 6550
 6560 CMP     R6,#25                        ;This section reads forward 100 records
 6570  SWIEQ   "Hourglass_On"               ;when the triple right arrow is clicked
 6580  MOVEQ   R0,#100                      ;on with Select.
 6590  MOVEQ   R1,#0
 6600  BLEQ    GetRecords
 6610  BLEQ    Update
 6620  SWIEQ   "Hourglass_Off"
 6630  BEQ     selectclosefile
 6640
 6650 CMP     R6,#26                        ;This section calls a subroutine which
 6660  BLEQ    ShowIndex                    ;switches mode to display the Entire
 6670  MOVEQ   R0,#0                        ;Index when Select is clicked over the
 6680  LDREQ   R1,[R10,#filehandle%]        ;Entire Index icon.
 6690  SWIEQ   "XOS_Find"                   ;It then closes the currently active
 6700  MOVEQ   R0,#&4F                      ;file and opens the Indexfile as the
 6710  ADDEQ   R1,R10,#indexfile            ;currently active file.
 6720  SWIEQ   "XOS_Find"
 6730   BVS     noindex
 6740  STREQ   R0,[R10,#filehandle%]
 6750  LDREQ   R0,[R10,#record%]
 6760  MOVEQ   R1,#2
 6770  BLEQ    GetRecords
 6780  BLEQ    Update
 6790  BEQ     selectclosefile
 6800
 6810 CMP     R6,#27                        ;This section calls a subroutine which
 6820  BLEQ    ShowSearch                   ;swithces modes to display the
 6830  MOVEQ   R0,#0                        ;Last Search when Select is clicked
 6840  LDREQ   R1,[R10,#filehandle%]        ;over the Last Search icon.
 6850  SWIEQ   "XOS_Find"                   ;It then closes the currently active
 6860  MOVEQ   R0,#&4F                      ;file and opens the Searchfile as the
 6870  ADDEQ   R1,R10,#searchfile           ;currently active file.
 6880  SWIEQ   "XOS_Find"
 6890   BVS     nosearch
 6900  STREQ   R0,[R10,#filehandle%]
 6910  LDREQ   R0,[R10,#record%]
 6920  MOVEQ   R1,#2
 6930  BLEQ    GetRecords
 6940  BLEQ    Update
 6950  BEQ     selectclosefile
 6960
 6970 CMP     R6,#37                        ;This section calls a subroutine to
 6980  BLEQ    editrecord                   ;to edit the current record when Select
 6990  BEQ     selectclosefile              ;is clicked over the Edit Record icon.
 7000
 7010 CMP     R6,#39                        ;This section calls a subroutine to
 7020  BLEQ    lastmonth                    ;read back 1 issue when Select is
 7030  BEQ     selectclosefile              ;clicked over the Month Down icon.
 7040
 7050 CMP     R6,#40                        ;This section calls a subroutine to
 7060  BLEQ    nextmonth                    ;read forward 1 issue when Select is
 7070  BEQ     selectclosefile              ;clicked over the Month Up icon.
 7080
 7090 CMP     R6,#41                        ;This section calls a subroutine to
 7100  BLEQ    lastyear                     ;read back 12 issues when Select is
 7110  BEQ     selectclosefile              ;clicked over the Year Down icon.
 7120
 7130 CMP     R6,#42                        ;This section calls a subroutine to
 7140  BLEQ    nextyear                     ;read forward 12 issues when Select is
 7150  BEQ     selectclosefile              ;clicked over the Year Up icon.
 7160
 7170 .selectclosefile                      ;This section closes both the currently
 7180 MOV    R0,#0                          ;active file prior to returning to the
 7190 LDR    R1,[R10,#filehandle%]          ;Wimp_Poll loop.
 7200 SWI    "XOS_Find"
 7210
 7220LDMFD   R13!,{R0-R12,PC}^
 7230
 7240;-----------------------------------------------------------------------------
 7250;                        *** AdjustInDisplay ***
 7260; This subroutine is is called to deal with Adjust being clicked over the
 7270; Display window.
 7280; NB; When Adjust is clicked over adjuster icons the RISC OS Style Guide
 7290; requires the adjustment to be made in the opposite direction to the arrows.
 7300
 7310.AdjustInDisplay
 7320
 7330STMFD   R13!,{R0-R12,R14}
 7340
 7350 LDR     R0,[R10,#show%]               ;This section opens the appropriate
 7360 CMP     R0,#1                         ;file for the current display mode
 7370  MOV     R0,#&4F                      ;either Indexfile or Searchfile.
 7380   ADDEQ   R1,R10,#indexfile
 7390   ADDNE   R1,R10,#searchfile
 7400  SWI    "XOS_Find"
 7410   BVS     norecords
 7420  STR     R0,[R10,#filehandle%]
 7430   STREQ   R0,[R10,#indexhandle%]
 7440   STRNE   R0,[R10,#searchhandle%]
 7450
 7460 CMP     R6,#20                        ;This section reads the next record
 7470  SWIEQ   "Hourglass_On"               ;when the single left arrow is clicked
 7480  MOVEQ   R0,#1                        ;on with Adjust.
 7490  MOVEQ   R1,#0
 7500  BLEQ    GetRecords
 7510  BLEQ    Update
 7520  SWIEQ   "Hourglass_Off"
 7530  BEQ     adjustclosefile
 7540
 7550 CMP     R6,#21                        ;This section reads forward 10 records
 7560  SWIEQ   "Hourglass_On"               ;when the double left arrow is clicked
 7570  MOVEQ   R0,#10                       ;on with Adjust.
 7580  MOVEQ   R1,#0
 7590  BLEQ    GetRecords
 7600  BLEQ    Update
 7610  SWIEQ   "Hourglass_Off"
 7620  BEQ     adjustclosefile
 7630
 7640 CMP     R6,#22                        ;This section reads forward 100 records
 7650  SWIEQ   "Hourglass_On"               ;when the triple left arrow is clicked
 7660  MOVEQ   R0,#100                      ;on with Adjust.
 7670  MOVEQ   R1,#0
 7680  BLEQ    GetRecords
 7690  BLEQ    Update
 7700  SWIEQ   "Hourglass_Off"
 7710  BEQ     adjustclosefile
 7720
 7730 CMP     R6,#23                        ;This section reads Back 1 record
 7740  SWIEQ   "Hourglass_On"               ;when the single right arrow is clicked
 7750  MOVEQ   R0,#1                        ;on with Adjust.
 7760  MOVEQ   R1,#1
 7770  BLEQ    GetRecords
 7780  BLEQ    Update
 7790  SWIEQ   "Hourglass_Off"
 7800  BEQ     adjustclosefile
 7810
 7820 CMP     R6,#24                        ;This section reads back 10 records
 7830  SWIEQ   "Hourglass_On"               ;when the double right arrow is clicked
 7840  MOVEQ   R0,#10                       ;on with Adjust.
 7850  MOVEQ   R1,#1
 7860  BLEQ    GetRecords
 7870  BLEQ    Update
 7880  SWIEQ   "Hourglass_Off"
 7890  BEQ     adjustclosefile
 7900
 7910 CMP     R6,#25                        ;This section reads back 100 records
 7920  SWIEQ   "Hourglass_On"               ;when the triple right arrow is clicked
 7930  MOVEQ   R0,#100                      ;on with Adjust.
 7940  MOVEQ   R1,#1
 7950  BLEQ    GetRecords
 7960  BLEQ    Update
 7970  SWIEQ   "Hourglass_Off"
 7980  BEQ     adjustclosefile
 7990
 8000 CMP     R6,#26                        ;This section calls a subroutine which
 8010  BLEQ    ShowIndex                    ;switches modes to display the Entire
 8020  MOVEQ   R0,#0                        ;Index when Adjust is clicked over the
 8030  LDREQ   R1,[R10,#filehandle%]        ;Entire Index icon.
 8040  SWIEQ   "XOS_Find"                   ;It then closes the currently active
 8050  MOVEQ   R0,#&4F                      ;file and opens the IndexFile as the
 8060  ADDEQ   R1,R10,#indexfile            ;currently active file.
 8070  SWIEQ   "XOS_Find"
 8080   BVS     noindex
 8090  STREQ   R0,[R10,#filehandle%]
 8100  LDREQ   R0,[R10,#record%]
 8110  MOVEQ   R1,#2
 8120  BLEQ    GetRecords
 8130  BLEQ    Update
 8140  BEQ     adjustclosefile
 8150
 8160 CMP     R6,#27                        ;This section calls a subroutine which
 8170  BLEQ    ShowSearch                   ;switches modes to display the Last
 8180  MOVEQ   R0,#0                        ;Search when Adjust is clicked over the
 8190  LDREQ   R1,[R10,#filehandle%]        ;Last Search icon.
 8200  SWIEQ   "XOS_Find"
 8210  MOVEQ   R0,#&4F
 8220  ADDEQ   R1,R10,#searchfile
 8230  SWIEQ   "XOS_Find"
 8240   BVS     nosearch
 8250  STREQ   R0,[R10,#filehandle%]
 8260  LDREQ   R0,[R10,#record%]
 8270  MOVEQ   R1,#2
 8280  BLEQ    GetRecords
 8290  BLEQ    Update
 8300  BEQ     adjustclosefile
 8310
 8320 CMP     R6,#37                        ;This section calls a subroutine to
 8330  BLEQ    editrecord                   ;to edit the current record when
 8340  BEQ     adjustclosefile              ;Adjust is clicked over the Edit icon.
 8350
 8360 CMP     R6,#39                        ;This section calls a subroutine which
 8370  BLEQ    nextmonth                    ;reads forward 1 Issue when Adjust is
 8380  BEQ     adjustclosefile              ;clicked over the Month Down icon.
 8390
 8400 CMP     R6,#40                        ;This section calls a subroutine which
 8410  BLEQ    lastmonth                    ;reads back 1 Issue when Adjust is
 8420  BEQ     adjustclosefile              ;clicked over the Month Up icon.
 8430
 8440 CMP     R6,#41                        ;This section calls a subroutine which
 8450  BLEQ    nextyear                     ;reads forward 12 Issues when Adjust is
 8460  BEQ     adjustclosefile              ;clicked over the Year Down icon.
 8470
 8480 CMP     R6,#42                        ;This section calls a subroutine which
 8490  BLEQ    lastyear                     ;reads back 12 Issues when Adjust is
 8500  BEQ     adjustclosefile              ;clicked over the Year Up icon.
 8510
 8520 .adjustclosefile                      ;This section closes the currently
 8530 MOV    R0,#0                          ;active file prior to returning to
 8540 LDR    R1,[R10,#filehandle%]          ;the Wimp_Poll loop.
 8550 SWI    "XOS_Find"
 8560
 8570LDMFD   R13!,{R0-R12,PC}^
 8580
 8590;-----------------------------------------------------------------------------
 8600;                             *** ShowIndex ***
 8610; This subroutine is called when the 'Entire Index' icon is clicked on in the
 8620; Display window. It changes the values of the Current Record and Maximum
 8630; Record number etc. for displaying the Entire Index.
 8640
 8650.ShowIndex
 8660
 8670STMFD   R13!,{R0,R14}
 8680
 8690 LDR     R0,[R10,#show%]               ;This section ensures that we are
 8700 CMP     R0,#1                         ;initially showing the Last Search
 8710  LDMEQFD R13!,{R0,PC}^                ;otherwise we just Return.
 8720
 8730 LDR     R0,[R10,#indexmax%]           ;Set up Current Maximum Record as the
 8740 STR     R0,[R10,#max%]                ;Maximum Record for the Entire Index.
 8750
 8760 LDR     R0,[R10,#record%]             ;Store Current Record as Current Search
 8770 STR     R0,[R10,#searchrecord%]       ;Record.
 8780
 8790 LDR     R0,[R10,#indexrecord%]        ;Store Current Index Record as Current
 8800 STR     R0,[R10,#record%]             ;Record.
 8810
 8820 MOV     R0,#1                         ;Set current mode to 1 to indicate
 8830 STR     R0,[R10,#show%]               ; we are showing the 'Entire Index'.
 8840
 8850 LDR     R0,[R12,#display%]
 8860 STR     R0,[R12,#block%+0]
 8870
 8880 MOV     R0,#37                        ;This section unshades the 'Edit
 8890 STR     R0,[R12,#block%+4]            ;record' icon.
 8900 MOV     R0,#0
 8910 STR     R0,[R12,#block%+8]
 8920 MOV     R0,#%1<<22
 8930 STR     R0,[R12,#block%+12]
 8940 ADD     R1,R12,#block%
 8950 SWI     "Wimp_SetIconState"
 8960
 8970 MOV     R0,#26                        ;This section makes the 'Entire Index'
 8980 STR     R0,[R12,#block%+4]            ;icon Selected.
 8990 MOV     R0,#%1<<21
 9000 STR     R0,[R12,#block%+8]
 9010 MOV     R0,#%1<<21
 9020 STR     R0,[R12,#block%+12]
 9030 ADD     R1,R12,#block%
 9040 SWI     "Wimp_SetIconState"
 9050
 9060 MOV     R0,#27                        ;This section makes the 'Last Search'
 9070 STR     R0,[R12,#block%+4]            ;icon Deselected.
 9080 MOV     R0,#0
 9090 STR     R0,[R12,#block%+8]
 9100 MOV     R0,#%1<<21
 9110 STR     R0,[R12,#block%+12]
 9120 ADD     R1,R12,#block%
 9130 SWI     "Wimp_SetIconState"
 9140
 9150LDMFD   R13!,{R0,PC}^
 9160
 9170;-----------------------------------------------------------------------------
 9180;                         *** ShowSearch ***
 9190; This subroutine is called when the 'Last Search' icon is clicked on in the
 9200; Display window. It changes the values of the Current Record and the Current
 9210; Maximum Record etc. for displaying the Last Search.
 9220
 9230.ShowSearch
 9240
 9250STMFD   R13!,{R0-R1,R14}
 9260
 9270 LDR     R0,[R10,#show%]               ;This section ensures that we are
 9280 CMP     R0,#0                         ;initially showing the 'Entire Index'
 9290  LDMEQFD R13!,{R0-R1,PC}^             ;otherwise we just return.
 9300
 9310 LDR     R0,[R10,#searchmax%]          ;Set up Current Maximum as the Current
 9320 STR     R0,[R10,#max%]                ;Search Maximum.
 9330
 9340 LDR     R0,[R10,#record%]             ;Store the Current Record number as
 9350 STR     R0,[R10,#indexrecord%]        ;the Current Index Record number.
 9360
 9370 LDR     R0,[R10,#searchrecord%]       ;Set up the Current Record number as
 9380 STR     R0,[R10,#record%]             ;the Current Search Record number.
 9390
 9400 MOV     R0,#0                         ;Set the current mode to 0 to indicate
 9410 STR     R0,[R10,#show%]               ;we are showing the 'Last Search'.
 9420
 9430 LDR     R0,[R12,#display%]
 9440 STR     R0,[R12,#block%+0]
 9450
 9460 MOV     R0,#37                        ;This section Shades the 'Edit Record'
 9470 STR     R0,[R12,#block%+4]            ;icon.
 9480 MOV     R0,#1<<22
 9490 STR     R0,[R12,#block%+8]
 9500 STR     R0,[R12,#block%+12]
 9510 ADD     R1,R12,#block%
 9520 SWI     "Wimp_SetIconState"
 9530
 9540 MOV     R0,#27                        ;This section makes the 'Last Search'
 9550 STR     R0,[R12,#block%+4]            ;icon selected.
 9560 MOV     R0,#%1<<21
 9570 STR     R0,[R12,#block%+8]
 9580 MOV     R0,#%1<<21
 9590 STR     R0,[R12,#block%+12]
 9600 ADD     R1,R12,#block%
 9610 SWI     "Wimp_SetIconState"
 9620
 9630 MOV     R0,#26                        ;This section makes the 'Entire Index'
 9640 STR     R0,[R12,#block%+4]            ;icon selected.
 9650 MOV     R0,#0
 9660 STR     R0,[R12,#block%+8]
 9670 MOV     R0,#%1<<21
 9680 STR     R0,[R12,#block%+12]
 9690 ADD     R1,R12,#block%
 9700 SWI     "Wimp_SetIconState"
 9710LDMFD   R13!,{R0-R1,PC}^
 9720
 9730;-----------------------------------------------------------------------------
 9740;                          *** Edit Current Record ***
 9750; This subroutine is called when the 'Edit Record' icon is clicked on in the
 9760; Display window. It opens the Edit window and positions the Caret in the
 9770; window.
 9780
 9790.editrecord
 9800
 9810STMFD   R13!,{R0-R12,R14}
 9820
 9830 BL      geteditdetails                ;Fill in details of the current record
 9840
 9850 LDR     R0,[R10,#record%]             ;Store Current Record Number as
 9860 STR     R0,[R10,#editrecord%]         ; the Current Edit Record Number.
 9870
 9880 LDR     R3,[R12,#edit%]               ;This section opens the Edit window.
 9890 STR     R3,[R12,#block%]
 9900 ADD     R1,R12,#block%
 9910 SWI     "Wimp_GetWindowState"
 9920 SWI     "Wimp_OpenWindow"
 9930
 9940 MOV     R0,R3                         ;This section reads the string from
 9950 MOV     R1,#20                        ;the Page Number icon and finds its
 9960 MOV     R2,R9                         ;length.
 9970 BL      ReadIcon
 9980 MOV     R0,R9
 9990 MOV     R1,#13
10000 SWI     "String_Len"
10010 MOV     R5,R1
10020
10030 MOV     R0,R3                         ;This section positions the caret at
10040 MOV     R1,#20                        ;the end of the Page Number icon.
10050 MVN     R4,#0
10060 SWI     "Wimp_SetCaretPosition"
10070
10080LDMFD   R13!,{R0-R12,PC}^
10090
10100;-----------------------------------------------------------------------------
10110;                          *** GetEditDetails ***
10120; This subroutine copies the details of the current record from the Display
10130; window into the Edit window for editing.
10140
10150.geteditdetails
10160
10170STMFD   R13!,{R0-R12,R14}
10180
10190 MOV     R2,R9
10200 LDR     R8,[R12,#display%]
10210 LDR     R7,[R12,#edit%]
10220
10230 LDR     R0,[R10,#displaymonth%]
10240 STR     R0,[R10,#editmonth%]
10250
10260 MOV     R0,R8
10270 MOV     R1,#32                        ;The following sections read the string
10280 BL      ReadIcon                      ;from icons in the Display window and
10290 MOV     R0,R7                         ;writes them into the equiveleant icon
10300 MOV     R1,#17                        ;in the Edit window, to allow them to
10310 BL      WriteIcon                     ;edited.
10320
10330 MOV     R0,R8
10340 MOV     R1,#33
10350 BL      ReadIcon
10360 MOV     R0,R7
10370 MOV     R1,#18
10380 BL      WriteIcon
10390
10400 MOV     R0,R8
10410 MOV     R1,#34
10420 BL      ReadIcon
10430 MOV     R0,R7
10440 MOV     R1,#19
10450 BL      WriteIcon
10460
10470 MOV     R0,R8
10480 MOV     R1,#35
10490 BL      ReadIcon
10500 MOV     R0,R7
10510 MOV     R1,#20
10520 BL      WriteIcon
10530
10540 MOV     R0,R8
10550 MOV     R1,#30
10560 BL      ReadIcon
10570 MOV     R0,R7
10580 MOV     R1,#21
10590 BL      WriteIcon
10600
10610 MOV     R0,R8
10620 MOV     R1,#31
10630 BL      ReadIcon
10640 MOV     R0,R7
10650 MOV     R1,#22
10660 BL      WriteIcon
10670
10680 STR      R0,[R12,#block%+0]           ;This section displays the 'Delete'
10690 MOV      R0,#26                       ;icon in the Edit window by clearing
10700 STR      R0,[R12,#block%+4]           ;its Deleted bit.
10710 MOV      R0,#0
10720 STR      R0,[R12,#block%+8]
10730 MOV      R0,#%1<<23
10740 STR      R0,[R12,#block%+12]
10750
10760 ADD      R1,R12,#block%
10770 SWI      "Wimp_SetIconState"
10780
10790LDMFD   R13!,{R0-R12,PC}^
10800
10810;-----------------------------------------------------------------------------
10820;                            *** SelectInEdit ***
10830; This subroutine deals with Select being pressed over the Edit Window.
10840
10850.SelectInEdit
10860
10870STMFD    R13!,{R0-R12,R14}
10880
10890 MOV      R0,R8
10900
10910 CMP      R6,#9                        ;This section decreases the Month icon.
10920  BLEQ     monthdown
10930
10940 CMP      R6,#10                       ;This section increases the Month icon.
10950  BLEQ     monthup
10960
10970 CMP      R6,#11                       ;This section decreases the Year icon.
10980  MOVEQ    R1,#18
10990  BLEQ     down
11000
11010 CMP      R6,#12                       ;This section increases the Year icon.
11020  MOVEQ    R1,#18
11030  BLEQ     up
11040
11050 CMP      R6,#13                       ;This section decreases the Issue icon.
11060  MOVEQ    R1,#19
11070  BLEQ     down
11080
11090 CMP      R6,#14                       ;This section increases the Issue icon.
11100  MOVEQ    R1,#19
11110  BLEQ     up
11120
11130 CMP      R6,#15                       ;This section decreases the Page icon.
11140  MOVEQ    R1,#20
11150  BLEQ     down
11160
11170 CMP      R6,#16                       ;This section increases the Page icon.
11180  MOVEQ    R1,#20
11190  BLEQ     up
11200
11210 CMP      R6,#23                       ;This section calls a subroutine to
11220  BLEQ     storerecord                 ;add and/or delete the record.
11230  MOVEQ    R0,#13
11240  STREQB   R0,[R9]
11250  LDREQ    R0,[R12,#edit%]
11260  MOVEQ    R2,R9
11270  MOVEQ    R1,#22
11280  BLEQ     WriteIcon
11290
11300 CMP      R6,#24                       ;This section calls a subroutine to
11310  BLEQ     canceledit                  ;to close the edit window.
11320
11330 CMP      R6,#26                       ;This section calls a subroutine to
11340  BLEQ     storerecord                 ;delete the record.
11350
11360LDMFD    R13!,{R0-R12,PC}^
11370
11380;-----------------------------------------------------------------------------
11390;                            *** AdjustInEdit ***
11400; This subroutine deals with Adjust being clicked over the Edit window.
11410; NB; When Adjust is clicked over the adjuster icons, the Risc OS Style Guide
11420; requires the adjustment to be made in the opposite direction to the arrow.
11430
11440.AdjustInEdit
11450
11460STMFD    R13!,{R0-R12,R14}
11470
11480 MOV      R0,R8
11490
11500 CMP      R6,#9                        ;This section increases the Month icon.
11510  BLEQ     monthup
11520
11530 CMP      R6,#10                       ;This section decreases the Month Icon.
11540  BLEQ     monthdown
11550
11560 CMP      R6,#11                       ;This section increases the Year icon.
11570  MOVEQ    R1,#18
11580  BLEQ     up
11590
11600 CMP      R6,#12                       ;This section decreases the Year icon.
11610  MOVEQ    R1,#18
11620  BLEQ     down
11630
11640 CMP      R6,#13                       ;This section increases the Issue icon.
11650  MOVEQ    R1,#19
11660  BLEQ     up
11670
11680 CMP      R6,#14                       ;This section decreases the Issue icon.
11690  MOVEQ    R1,#19
11700  BLEQ     down
11710
11720 CMP      R6,#15                       ;This section increases the Page icon.
11730  MOVEQ    R1,#20
11740  BLEQ     up
11750
11760 CMP      R6,#16                       ;This section decreases the Page icon.
11770  MOVEQ    R1,#20
11780  BLEQ     down
11790
11800 CMP      R6,#23                       ;This section calls a subroutine to
11810  BLEQ     storerecord                 ;Add and/or Delete the record.
11820  MOVEQ    R0,#13
11830  STREQB   R0,[R9]
11840  LDREQ    R0,[R12,#edit%]
11850  MOVEQ    R2,R9
11860  MOVEQ    R1,#22
11870  BLEQ     WriteIcon
11880
11890 CMP      R6,#24                       ;This section calls a subroutine to
11900  BLEQ     canceledit                  ;close the Edit window
11910
11920 CMP      R6,#26                       ;This section calls a subroutine to
11930  BLEQ     storerecord                 ;delete the record.
11940
11950LDMFD    R13!,{R0-R12,PC}^
11960
11970;-----------------------------------------------------------------------------
11980;                             *** CancelEdit ***
11990; This subroutine closes the Edit Window.
12000
12010.canceledit
12020
12030STMFD    R13!,{R0-R12,R14}
12040
12050 LDR      R0,[R12,#edit%]
12060 STR      R0,[R12,#block%+0]
12070 ADD      R1,R12,#block%
12080 SWI      "Wimp_CloseWindow"
12090
12100LDMFD    R13!,{R0-R12,PC}^
12110
12120;-----------------------------------------------------------------------------
12130;                           *** MonthDown ***
12140; This subroutine decreases the value in the Month icon.
12150
12160.monthdown
12170
12180STMFD    R13!,{R0-R12,R14}
12190
12200 LDR      R0,[R10,#editmonth%]      ;This section decreases the value of
12210 CMP      R0,#1                        ;the Current Month. It is set to 13
12220  MOVEQ    R0,#13                      ;if it was originally 1.
12230  SUBNE    R0,R0,#1
12240 STR      R0,[R10,#editmonth%]
12250
12260 MOV      R2,#months%-&10              ;This section gets the name of the
12270 ADD      R2,R2,R0,LSL #4              ;of the Current Month from a look-up
12280 ADD      R2,R10,R2                    ;table and writes it into the Month
12290 MOV      R1,#17                       ;icon.
12300 LDR      R0,[R12,#edit%]
12310 BL       WriteIcon
12320
12330LDMFD    R13!,{R0-R12,PC}^
12340
12350;-----------------------------------------------------------------------------
12360;                           *** MonthUp ***
12370; This subroutine increases the value of the Month icon.
12380
12390.monthup
12400
12410STMFD    R13!,{R0-R12,R14}
12420
12430 LDR      R0,[R10,#editmonth%]      ;This section increases the value of
12440 CMP      R0,#13                       ;the Current Month. It is set to 1 if
12450  MOVEQ    R0,#1                       ;if it was originally 13.
12460  ADDNE    R0,R0,#1
12470 STR      R0,[R10,#editmonth%]
12480
12490 MOV      R2,#months%-&10              ;This section gets the name of the
12500 ADD      R2,R2,R0,LSL #4              ;the current month from a look-up
12510 ADD      R2,R10,R2                    ;table and writes it into the month
12520 MOV      R1,#17                       ;icon.
12530 LDR      R0,[R12,#edit%]
12540 BL       WriteIcon
12550
12560LDMFD    R13!,{R0-R12,PC}^
12570
12580;-----------------------------------------------------------------------------
12590;                              *** Up ***
12600; This subroutine increases the value of the icon specified by the Window
12610; Handle in R0 and an Icon Handle in R1.
12620
12630.up
12640
12650STMFD    R13!,{R0-R12,R14}
12660
12670 MOV      R2,R9                        ;This section reads the string from
12680 BL       ReadIcon                     ;the icon specified and find its value.
12690 MOV      R8,R0
12700 MOV      R7,R1
12710 MOV      R0,R2
12720 MOV      R1,#13
12730 SWI      "String_Val"
12740
12750 MOV      R0,   #&2700                 ;This section checks if the value is
12760 ADD      R0,R0,#&000F                 ;9999 (&270F) and if so sets the value
12770 CMP      R1,R0                        ;to zero otherwise it incements it.
12780  MOVEQ    R1,#0
12790  ADDNE    R1,R1,#1
12800
12810 MOV      R0,R1                        ;This section converts the new value
12820 MOV      R1,R9                        ;to its string equivelent and writes
12830 MOV      R6,#&100                     ;it back into appropriate icon.
12840 SWI      "OS_ConvertInteger2"
12850 MOV      R0,#13
12860 STRB     R0,[R1]
12870 MOV      R0,R8
12880 MOV      R1,R7
12890 MOV      R2,R9
12900 BL       WriteIcon
12910
12920LDMFD    R13!,{R0-R12,PC}^
12930
12940;-----------------------------------------------------------------------------
12950;                            *** Down ***
12960; This subroutine decreases the value of the icon specified by the Window
12970; handle in R0 and the Icon handle in R1.
12980
12990.down
13000
13010STMFD    R13!,{R0-R12,R14}
13020
13030 MOV      R2,R9                        ;This section reads the string from the
13040 BL       ReadIcon                     ;icon specified and fins its value.
13050 MOV      R8,R0
13060 MOV      R7,R1
13070 MOV      R0,R2
13080 MOV      R1,#13
13090 SWI      "String_Val"
13100
13110 CMP      R1,#0                        ;This section checks if the value is 0
13120  MOVEQ    R1,   #&2700                ;and if so sets it to 9999 (&2704)
13130  ADDEQ    R1,R1,#&000F                ;otherwise it decrements it.
13140  SUBNE    R1,R1,#1
13150
13160 MOV      R0,R1                        ;This section converts the new value
13170 MOV      R1,R9                        ;to its string equivelent and writes
13180 MOV      R6,#&100                     ;it back into the appropriate icon.
13190 SWI      "OS_ConvertInteger2"
13200 MOV      R0,#13
13210 STRB     R0,[R1]
13220 MOV      R0,R8
13230 MOV      R1,R7
13240 MOV      R2,R9
13250 BL       WriteIcon
13260
13270LDMFD    R13!,{R0-R12,PC}^
13280
13290;-----------------------------------------------------------------------------
13300;                           *** Next Month ***
13310; This procedure reads in records until the issue number is increased by at
13320; least one.
13330
13340.nextmonth
13350
13360STMFD    R13!,{R0-R12,R14}
13370
13380 SWI     "Hourglass_On"
13390
13400 LDR     R0,[R12,#display%]            ;This section reads the Issue Number
13410 MOV     R1,#34                        ;icon from the Display window.
13420 MOV     R2,R9
13430 BL      ReadIcon
13440
13450 MOV     R0,R9                         ;This section gets the value of the
13460 MOV     R1,#13                        ;Issue Number.
13470 SWI     "String_Val"
13480 MOV     R8,R1
13490
13500 .nextmonthloop                        ;This is the start of a loop.
13510 LDR     R0,[R10,#record%]             ;This section exits the loop if we have
13520 LDR     R1,[R10,#max%]                ;reached the last record in the Index.
13530 CMP     R0,R1
13540 BEQ     nextmonthloopend
13550
13560 MOV     R0,#1                         ;This section reads in the next record.
13570 MOV     R1,#0
13580 BL      GetRecords
13590
13600 ADD     R0,R10,#record                ;This section finds the start of the
13610 ADD     R1,R10,#backslash             ;third field (Issue number).
13620 MOV     R2,#13
13630 MOV     R3,#0
13640 SWI     "String_Instr"
13650 ADD     R3,R3,#1
13660 SWI     "String_Instr"
13670
13680 ADD     R0,R0,R3                      ;This section gets the value of the
13690 ADD     R0,R0,#1                      ;Issue Number field.
13700 MOV     R1,#ASC("\")
13710 SWI     "String_Val"
13720
13730 CMP     R1,R8                         ;This section compares the issue number
13740 BLE     nextmonthloop                 ;that we're looking for with the issue
13750 .nextmonthloopend                     ;number that we have found.
13760
13770 BL      Update
13780
13790 SWI     "Hourglass_Off"
13800
13810LDMFD    R13!,{R0-R12,PC}^
13820
13830;-----------------------------------------------------------------------------
13840;                              *** LastMonth ***
13850; This subroutine reads back records until the Issue Number is decreased by
13860; at least one.
13870
13880.lastmonth
13890
13900STMFD    R13!,{R0-R12,R14}
13910
13920 SWI     "Hourglass_On"
13930
13940 LDR     R0,[R12,#display%]            ;This section reads the Issue Number
13950 MOV     R1,#34                        ;from the Display window.
13960 MOV     R2,R9
13970 BL      ReadIcon
13980
13990 MOV     R0,R9                         ;This section gets the value of the
14000 MOV     R1,#13                        ;Issue Number.
14010 SWI     "String_Val"
14020 SUB     R8,R1,#1
14030
14040 MOV     R0,#1                         ;This section reads back to the start
14050 MOV     R1,#1                         ;of the current record.
14060 BL      GetRecords
14070
14080 .lastmonthloop                        ;This is the start of a loop.
14090 LDR     R0,[R10,#record%]             ;This section exits the loop if we have
14100 MOV     R1,#1                         ;reached the first record in the file.
14110 CMP     R0,R1
14120 BEQ     lastmonthloopend
14130
14140 MOV     R0,#1                         ;This section reads back a record.
14150 MOV     R1,#1
14160 BL      GetRecords
14170
14180 ADD     R0,R10,#record                ;This section finds the start of the
14190 ADD     R1,R10,#backslash             ;third field (Issue Number).
14200 MOV     R2,#13
14210 MOV     R3,#0
14220 SWI     "String_Instr"
14230 ADD     R3,R3,#1
14240 SWI     "String_Instr"
14250
14260 ADD     R0,R0,R3                      ;This section gets the value of the
14270 ADD     R0,R0,#1                      ;Issue Number field.
14280 MOV     R1,#ASC("\")
14290 SWI     "String_Val"
14300
14310 CMP     R1,R8                         ;This section compares the Issue number
14320 BGE     lastmonthloop                 ;that we're looking for with the Issue
14330                                       ;number that we've found.
14340 .lastmonthloopend
14350
14360 MOV     R0,#1
14370 MOV     R1,#0
14380 BL      GetRecords
14390
14400 BL      Update
14410 SWI     "Hourglass_Off"
14420
14430LDMFD    R13!,{R0-R12,PC}^
14440
14450;-----------------------------------------------------------------------------
14460;                              *** NextYear ***
14470; This subroutine reads in records until the Issue Number is increased by at
14480; least 12.
14490
14500.nextyear
14510
14520STMFD    R13!,{R0-R12,R14}
14530
14540 SWI     "Hourglass_On"
14550
14560 LDR     R0,[R12,#display%]            ;This section reads the Issue number
14570 MOV     R1,#34                        ;from the Display window.
14580 MOV     R2,R9
14590 BL      ReadIcon
14600
14610 MOV     R0,R9                         ;This section gets the value of the
14620 MOV     R1,#13                        ;Issue Number.
14630 SWI     "String_Val"
14640 ADD     R8,R1,#11
14650
14660 .nextyearloop                         ;This is the start of a loop.
14670 LDR     R0,[R10,#record%]             ;This section exits the loop if we have
14680 LDR     R1,[R10,#max%]                ;reached the last record in the Index.
14690 CMP     R0,R1
14700 BEQ     nextyearloopend
14710
14720 MOV     R0,#1                         ;This section reads in the next record.
14730 MOV     R1,#0
14740 BL      GetRecords
14750
14760 ADD     R0,R10,#record                ;This section finds the start of the
14770 ADD     R1,R10,#backslash             ;third field (Issue Number).
14780 MOV     R2,#13
14790 MOV     R3,#0
14800 SWI     "String_Instr"
14810 ADD     R3,R3,#1
14820 SWI     "String_Instr"
14830
14840 ADD     R0,R0,R3                      ;This section gets the value of the
14850 ADD     R0,R0,#1                      ;Issue Number.
14860 MOV     R1,#ASC("\")
14870 SWI     "String_Val"
14880
14890 CMP     R1,R8                         ;This section compares the Issue Number
14900 BLE     nextyearloop                  ;that we're looking for with the Issue
14910                                       ;Number that we've found.
14920 .nextyearloopend
14930
14940 BL      Update
14950 SWI     "Hourglass_Off"
14960
14970LDMFD    R13!,{R0-R12,PC}^
14980
14990;-----------------------------------------------------------------------------
15000;                           *** LastYear ***
15010; This subroutine reads back records until the Issue number is decreased by
15020; at least 12.
15030
15040.lastyear
15050
15060STMFD    R13!,{R0-R12,R14}
15070
15080 SWI     "Hourglass_On"
15090
15100 LDR     R0,[R12,#display%]            ;This section reads the Issue Number
15110 MOV     R1,#34                        ;from the Display window.
15120 MOV     R2,R9
15130 BL      ReadIcon
15140
15150 MOV     R0,R9                         ;This section gets the value of the
15160 MOV     R1,#13                        ;Issue Number.
15170 SWI     "String_Val"
15180 SUB     R8,R1,#12
15190
15200 MOV     R0,#1                         ;This section reads back to the start
15210 MOV     R1,#1                         ;of the current record.
15220 BL      GetRecords
15230
15240 .lastyearloop                         ;This is the start of a loop.
15250 LDR     R0,[R10,#record%]             ;This section exits the loop if we have
15260 MOV     R1,#1                         ;reached the first record.
15270 CMP     R0,R1
15280 BEQ     lastyearloopend
15290
15300 MOV     R0,#1                         ;This section reads back 1 record.
15310 MOV     R1,#1
15320 BL      GetRecords
15330
15340 ADD     R0,R10,#record                ;This section finds the start of the
15350 ADD     R1,R10,#backslash             ;third field (Issue Number).
15360 MOV     R2,#13
15370 MOV     R3,#0
15380 SWI     "String_Instr"
15390 ADD     R3,R3,#1
15400 SWI     "String_Instr"
15410
15420 ADD     R0,R0,R3                      ;This section gets the value of the
15430 ADD     R0,R0,#1                      ;Issue Number
15440 MOV     R1,#ASC("\")
15450 SWI     "String_Val"
15460
15470 CMP     R1,R8                         ;This section compares the Issue number
15480 BGE     lastyearloop                  ;that we're looking for with the Issue
15490                                       ;Number that we've found.
15500 .lastyearloopend
15510
15520 BL      Update
15530 SWI     "Hourglass_Off"
15540
15550LDMFD    R13!,{R0-R12,PC}^
15560
15570;-----------------------------------------------------------------------------
15580;                           *** SelectInSave ***
15590;This subroutine deals with Select being clicked over the Save Dialogue Box.
15600
15610.SelectInSave
15620
15630STMFD    R13!,{R0-R12,R14}
15640
15650 MOV      R0,R8
15660
15670 CMP      R6,#4                        ;This section changes the state of the
15680  LDREQ    R0,[R10,#multiple%]         ;Multiple Issue icon and updates the
15690  EOREQ    R0,R0,#1                    ;Leafname as appropriate when Select
15700  STREQ    R0,[R10,#multiple%]         ;is clicked over the Multiple icon.
15710  BLEQ     UpdateLeafName
15720
15730 CMP      R6,#1                        ;This calls a subroutine to start a
15740  BLEQ     StartDrag                   ;Drag when the user drags the File Icon
15750
15760 CMP      R6,#3                        ;This section reads the Filename from
15770  MOVEQ    R1,#2                       ;the icon when Select is clicked over
15780  MOVEQ    R2,R9                       ;the 'OK' icon. It then saves the
15790  BLEQ     ReadIcon                    ;records to the file and closes the
15800  BLEQ     SaveIssue                   ;Menu Structure.
15810  MVNEQ    R1,#0
15820  SWIEQ    "Wimp_CreateMenu"
15830
15840 MOV      R1,#7                        ;This is Start Issue icon number
15850
15860 CMP      R6,#8                        ;This decreses the value of the Start
15870  BLEQ     down                        ;Issue Icon and updates the Leafname
15880  LDREQ    R1,[R10,#multiple%]         ;if neccessary, when Select is clicked
15890  CMPEQ    R1,#0                       ;over the Start Down icon in the Save
15900   MOVEQ    R1,#7                      ;Dialogue box.
15910   MOVEQ    R2,R9
15920   BLEQ     ReadIcon
15930   MOVEQ    R1,#10
15940   BLEQ     WriteIcon
15950   BLEQ     UpdateLeafName
15960
15970 CMP      R6,#9                        ;This increases the value of the Start
15980  BLEQ     up                          ;Issue Icon and updates the Leafname
15990  LDREQ    R1,[R10,#multiple%]         ;if neccessary, when Select is clicked
16000  CMPEQ    R1,#0                       ;over the Start Up icon in the Save
16010   MOVEQ    R1,#7                      ;Dialogue box.
16020   MOVEQ    R2,R9
16030   BLEQ     ReadIcon
16040   MOVEQ    R1,#10
16050   BLEQ     WriteIcon
16060   BLEQ     UpdateLeafName
16070
16080 MOV      R1,#10                       ;This is the End Issue Icon number.
16090
16100 CMP      R6,#11                       ;This section decreases the End Issue
16110  BLEQ     down                        ;icon when Select is clicked.
16120
16130 CMP      R6,#12                       ;This section increases the End Issue
16140  BLEQ     up                          ;icon when Select is clicked.
16150
16160LDMFD    R13!,{R0-R12,PC}^
16170
16180;-----------------------------------------------------------------------------
16190;                            *** AdjustInSave ***
16200; This subroutine deals with Adjust being clicked over the Save dialogue box.
16210; NB ; When Adjust is clicked over the adjuster icons, the Risc OS Style Guide
16220; requires the adjustment to be made in the opposite direction to the arrow.
16230
16240.AdjustInSave
16250
16260STMFD    R13!,{R0-R12,R14}
16270
16280 MOV      R0,R8                        ;Save window handle.
16290
16300 CMP      R6,#4                        ;This section updates the multiple
16310  LDREQ    R0,[R10,#multiple%]         ;flag and calls a subroutine to update
16320  EOREQ    R0,R0,#1                    ;the leafname in the filename icon.
16330  STREQ    R0,[R10,#multiple%]
16340  BLEQ     UpdateLeafName
16350
16360 CMP      R6,#1                        ;This calls a subroutine to start a
16370  BLEQ     StartDrag                   ;Drag when the user drags the fileicon.
16380
16390 CMP      R6,#3                        ;This section reads the filename from
16400  MOVEQ    R1,#2                       ;the filename icon and calls a subroutine
16410  MOVEQ    R2,R9                       ;to save the selected issues.
16420  BLEQ     ReadIcon
16430  BLEQ     SaveIssue
16440
16450 MOV      R1,#7                        ;'Start' icon number.
16460
16470 CMP      R6,#8                        ;This section increases the value in
16480  BLEQ     up                          ;Start icon and calls a subroutine to
16490    LDREQ    R1,[R10,#multiple%]       ;change the leafname in the filename
16500    CMPEQ    R1,#0                     ;icon.
16510     MOVEQ    R1,#7
16520     MOVEQ    R2,R9
16530     BLEQ     ReadIcon
16540     MOVEQ    R1,#10
16550     BLEQ     WriteIcon
16560     BLEQ     UpdateLeafName
16570
16580 CMP      R6,#9                        ;This section decreases the value of
16590  BLEQ     down                        ;Start icon and calls a subroutine to
16600    LDREQ    R1,[R10,#multiple%]       ;change the leafname in the filename
16610    CMPEQ    R1,#0                     ;icon.
16620     MOVEQ    R1,#7
16630     MOVEQ    R2,R9
16640     BLEQ     ReadIcon
16650     MOVEQ    R1,#10
16660     BLEQ     WriteIcon
16670     BLEQ     UpdateLeafName
16680
16690 MOV      R1,#10                       ;'End' icon number.
16700
16710 CMP      R6,#11                       ;This section increases the value of
16720  BLEQ     up                          ;the End icon.
16730
16740 CMP      R6,#12                       ;This section decreases the value of
16750  BLEQ     down                        ;the End icon.
16760
16770LDMFD    R13!,{R0-R12,PC}^
16780
16790;-----------------------------------------------------------------------------
16800;                             *** StartDrag ***
16810; This subroutine initiates a drag operation when the user drags our file icon
16820; from the Save dialogue box. Depending on how the host computer is configured
16830; either a dashed outline or a solid sprite will follow the mouse pointer for
16840; the duration of the drag. A 'Drag_Finished' reason code will be returned to
16850; us by Wimp_Poll when the user releases all the mouse buttons.
16860
16870.StartDrag
16880
16890STMFD    R13!,{R0-R12,R14}
16900
16910 LDR      R0,[R12,#save%]              ;This section stores the Save window
16920 STR      R0,[R12,#block%+0]           ;handle in the Wimp Parameter Block and
16930 STR      R0,[R9,#0]                   ;the Misc. workspace.
16940
16950 MOV      R0,#1                        ;This section stores the icon handle of
16960 STR      R0,[R12,#block%+4]           ;the File icon in the Wimp Block.
16970
16980 ADD      R1,R12,#block%               ;This section gets information about
16990 SWI      "Wimp_GetIconState"          ;the position of the File icon.
17000
17010 MOV      R1,R9                        ;This section gets information about
17020 SWI      "Wimp_GetWindowState"        ;the position of the Save Dialogue box.
17030
17040 LDR      R1,[R9,#4]                   ;Visible area minimum x coordinate
17050 LDR      R2,[R9,#20]                  ;Scroll x offset relative to work origin
17060 SUB      R1,R1,R2                     ;calculate x offset of icon in window.
17070
17080 LDR      R2,[R9,#16]                  ;Visible area maximum y coordinate.
17090 LDR      R3,[R9,#24]                  ;Scroll y offset relative to work origin
17100 SUB      R2,R2,R3                     ;calculate y offset of icon in window.
17110
17120 LDR      R0,[R12,#block%+8]           ;This section calculates the actual max
17130 ADD      R0,R0,R1                     ;y coordinate of the icon in screen
17140 STR      R0,[R12,#block%+8]           ;coordinates.
17150
17160 LDR      R0,[R12,#block%+12]          ;This section calculates the actual max
17170 ADD      R0,R0,R2                     ;x coordinate of the icon in screen
17180 STR      R0,[R12,#block%+12]          ;coordinates.
17190
17200 LDR      R0,[R12,#block%+16]          ;This section calculates the actual min
17210 ADD      R0,R0,R1                     ;y coordinate of the icon in screen
17220 STR      R0,[R12,#block%+16]          ;coordinates.
17230
17240 LDR      R0,[R12,#block%+20]          ;This section calculates the actual min
17250 ADD      R0,R0,R2                     ;x coordinate of the icon in screen
17260 STR      R0,[R12,#block%+20]          ;coordinates.
17270
17280 MOV      R0,#5                        ;Drag type 5 - Drag fixed sixe box
17290 STR      R0,[R12,#block%+4]
17300
17310 MOV      R0,#0                        ;This section sets the parent box, which
17320 STR      R0,[R12,#block%+24]          ;the icon can be dragged around inside,
17330 STR      R0,[R12,#block%+28]          ;to maximum size.
17340 MVN      R0,#0
17350 STR      R0,[R12,#block%+32]
17360 STR      R0,[R12,#block%+36]
17370
17380 ADD      R1,R12,#block%               ;This section starts a drag operation.
17390 SWI      "Wimp_DragBox"
17400
17410LDMFD    R13!,{R0-R12,PC}^
17420
17430;------------------------------------------------------------------------------
17440;                           *** KeyPressed ***
17450; This section deals with keypresses in any of our writeable icons. Printable
17460; characters which are allowed by the icons validation string will be written
17470; automatically into the writable icon. Only non printable characters are
17480; returned to us via a 'Key_Pressed' reason code from Wimp_Poll.
17490
17500.KeyPressed
17510
17520STMFD    R13!,{R0-R12,R14}
17530
17540 LDR      R2,[R12,#block%+0]           ;Window handle.
17550 LDR      R3,[R12,#block%+4]           ;Icon handle.
17560 LDR      R4,[R12,#block%+24]          ;Keycode pressed.
17570 LDR      R5,[R12,#search%]            ;Search window handle.
17580 LDR      R6,[R12,#edit%]              ;Edit window handle.
17590
17600 CMP      R2,R5                        ;This section starts a search if Return
17610  CMPEQ    R3,#1                       ;is pressed in the writeable icon in
17620   CMPEQ    R4,#13                     ;Search Window. It also removes the
17630     BLEQ    StartSearch               ;Menu from the screen.
17640     MVNEQ   R1,#0
17650     SWIEQ   "Wimp_CreateMenu"
17660     LDMEQFD R13!,{R0-R12,PC}^
17670                                       ;This section calls a subroutine to
17680 CMP      R6,R2                        ;move the caret down into the next
17690  CMPEQ    R4,#13                      ;writeable icon when Return is pressed
17700   BLEQ     movecaretdown              ;in the Edit window.
17710   LDMEQFD  R13!,{R0-R12,PC}^
17720
17730 CMP      R6,R2                        ;This section calls a subroutine to
17740  MOVEQ    R8,   #&100                 ;move the caret down into the next
17750  ADDEQ    R8,R8,#&08E                 ;writeable icon when the Down arrow is
17760  CMPEQ    R4,R8                       ;pressed within the Edit window.
17770   BLEQ     movecaretdown
17780   LDMEQFD  R13!,{R0-R12,PC}^
17790
17800 CMP      R6,R2                        ;This section calls a subroutine to
17810  MOVEQ    R8,   #&100                 ;move the caret up into the next
17820  ADDEQ    R8,R8,#&08F                 ;writeable icon when the Up arrow is
17830  CMPEQ    R4,R8                       ;pressed within the Edit window.
17840   BLEQ     movecaretup
17850   LDMEQFD  R13!,{R0-R12,PC}^
17860
17870 LDR      R8,[R12,#save%]              ;This section calls a subroutine to
17880 CMP      R2,R8                        ;save or export article data when
17890  CMPEQ    R4,#13                      ;Return is pressed within the Filename
17900   CMPEQ    R3,#2                      ;icon in the Save dialogue box. It
17910    MOVEQ    R0,R8                     ;also closes the menu.
17920    MOVEQ    R1,#2
17930    MOVEQ    R2,R9
17940    BLEQ     ReadIcon
17950    BLEQ     SaveIssue
17960    MVNEQ    R1,#0
17970    SWIEQ    "Wimp_CreateMenu"
17980    LDMEQFD  R13!,{R0-R12,PC}^
17990
18000 CMP      R2,R8                        ;This section updates the default
18010  CMPEQ    R4,#13                      ;Filename when Return is pressed in
18020   CMPEQ    R3,#7                      ;Start issue icon.
18030    LDREQ    R0,[R10,#multiple%]
18040    CMPEQ    R0,#0
18050     MOVEQ    R0,R8
18060     MOVEQ    R1,#7
18070     MOVEQ    R2,R9
18080     BLEQ     ReadIcon
18090     MOVEQ    R1,#10
18100     BLEQ     WriteIcon
18110     BLEQ     UpdateLeafName
18120     LDMEQFD  R13!,{R0-R12,PC}^
18130
18140 LDR      R0,[R12,#block%+24]          ;This section passes any keypresses we
18150 SWI      "Wimp_ProcessKey"            ;don't understand back to the WIMP.
18160
18170LDMFD    R13!,{R0-R12,PC}^
18180
18190;------------------------------------------------------------------------------
18200;                         *** MoveCaretUp ***
18210; This section moves the caret into the previous icon in the Edit window.
18220
18230.movecaretup
18240
18250STMFD    R13!,{R0-R12,R14}
18260
18270 CMP      R3,#18                       ;This section checks that the caret is
18280  LDMLSFD  R13!,{R0-R12,PC}^           ;not in the first writeable icon.
18290
18300 SUB      R7,R3,#1                     ;This section reads the contents of
18310 MOV      R0,R2                        ;previous icon into the misc. buffer.
18320 MOV      R1,R7
18330 MOV      R2,R9
18340 BL       ReadIcon
18350
18360 MOV      R0,R9                        ;This section finds the length of the
18370 MOV      R1,#13                       ;string in the previous writeable icon.
18380 SWI      "String_Len"
18390                                       ;This section moves the caret to after
18400 MOV      R5,R1                        ;the last character in the previous
18410 MOV      R0,R6                        ;writeable icon.
18420 MOV      R1,R7
18430 MVN      R4,#0
18440 SWI      "Wimp_SetCaretPosition"
18450
18460LDMFD    R13!,{R0-R12,PC}^
18470
18480;------------------------------------------------------------------------------
18490;                       *** MoveCaretDown ***
18500; This section moves the caret into the next writeable icon in the Edit
18510; window.
18520
18530.movecaretdown
18540
18550STMFD    R13!,{R0-R12,R14}
18560
18570 CMP      R3,#22                       ;This section checks that the caret is
18580  ADDLT    R7,R3,#1                    ;not in the last icon already and then
18590  MOVLT    R0,R2                       ;reads the string into misc. buffer.
18600  MOVLT    R1,R7
18610  MOVLT    R2,R9
18620  BLLT     ReadIcon
18630
18640  MOVLT    R0,R9                       ;This section finds the length of the
18650  MOVLT    R1,#13                      ;string.
18660  SWILT    "String_Len"
18670
18680  MOVLT    R5,R1                       ;This section positions the caret after
18690  MOVLT    R0,R6                       ;the last character in the next icon.
18700  MOVLT    R1,R7
18710  MVNLT    R4,#0
18720  SWILT    "Wimp_SetCaretPosition"
18730  LDMLTFD  R13!,{R0-R12,PC}^
18740
18750 CMP      R4,#13                       ;This section checks if the Return key
18760  LDMNEFD  R13!,{R0-R12,PC}^           ;was pressed else ends the subroutine
18770
18780 BL       storerecord                  ;This section calls a subroutine to
18790 MOV      R0,#13                       ;update the IndexFile with the edited
18800 STRB     R0,[R9]                      ;record. The description icon is then
18810 LDR      R0,[R12,#edit%]              ;cleared.
18820 MOV      R2,R9
18830 MOV      R1,#22
18840 BL       WriteIcon
18850
18860 LDR      R6,[R10,#editrecord%]        ;This section checks to see if we have
18870 CMP      R6,#0                        ;been adding new records. If so the
18880  MOVEQ    R1,#20                      ;caret is positioned at the end of the
18890  MOVEQ    R2,R9                       ;Page No. icon, ready for the next
18900  BLEQ     ReadIcon                    ;record to be input.
18910  MOVEQ    R0,R9
18920  MOVEQ    R1,#13
18930  SWIEQ    "String_Len"
18940  MOVEQ    R5,R1
18950  LDREQ    R0,[R12,#edit%]
18960  MOVEQ    R1,#20
18970  MVNEQ    R4,#0
18980  SWIEQ    "Wimp_SetCaretPosition"
18990
19000LDMFD    R13!,{R0-R12,PC}^
19010
19020;------------------------------------------------------------------------------
19030;                            *** StoreRecord ***
19040; This subroutine updates the IndexFile by removing and adding the record as
19050; appropriate. If the record is a new one it is simply added. If it is being
19060; edited the older version of the record is removed first. If the record is
19070; to be deleted it is just removed.
19080
19090.storerecord
19100
19110STMFD    R13!,{R0-R12,R14}
19120
19130 SWI      "Hourglass_On"
19140
19150 LDR      R8,[R12,#edit%]
19160                                       ;The first part of this subroutine
19170                                       ;creates a record from the contents of
19180                                       ;all the icons in the Edit window.
19190
19200 LDR      R0,[R10,#editmonth%]      ;This is section converts the numeric
19210 ADD      R1,R10,#record               ;month number into a string which
19220 MOV      R2,#&100                     ;represents the number.
19230 SWI      "OS_ConvertInteger1"
19240 MOV      R2,R1
19250 MOV      R0,#ASC("\")
19260 STRB     R0,[R2],#1
19270
19280 MOV      R0,R8                        ;This section adds the year.
19290 MOV      R1,#18
19300 BL       ReadIcon
19310 MOV      R0,R2
19320 MOV      R1,#13
19330 SWI      "String_Len"
19340 CMP      R1,#0
19350  MOVEQ    R1,#1
19360  MOVEQ    R0,#ASC("0")
19370  STREQB   R0,[R2]
19380 ADD      R2,R2,R1
19390 MOV      R0,#ASC("\")
19400 STRB     R0,[R2],#1
19410
19420 MOV      R0,R8                        ;This section adds the Issue No.
19430 MOV      R1,#19
19440 BL       ReadIcon
19450 MOV      R0,R2
19460 MOV      R1,#13
19470 SWI      "String_Len"
19480 CMP      R1,#0
19490  MOVEQ    R1,#1
19500  MOVEQ    R0,#ASC("0")
19510  STREQB   R0,[R2]
19520 ADD      R2,R2,R1
19530 MOV      R0,#ASC("\")
19540 STRB     R0,[R2],#1
19550                                       ;This section adds the Page No.
19560 MOV      R0,R8
19570 MOV      R1,#20
19580 BL       ReadIcon
19590 MOV      R0,R2
19600 MOV      R1,#13
19610 SWI      "String_Len"
19620 CMP      R1,#0
19630  MOVEQ    R1,#1
19640  MOVEQ    R0,#ASC("0")
19650  STREQB   R0,[R2]
19660 ADD      R2,R2,R1
19670 MOV      R0,#ASC("\")
19680 STRB     R0,[R2],#1
19690
19700 MOV      R0,R8                        ;This section adds the Topic.
19710 MOV      R1,#21
19720 BL       ReadIcon
19730 MOV      R0,R2
19740 MOV      R1,#13
19750 SWI      "String_Len"
19760 ADD      R2,R2,R1
19770 MOV      R0,#ASC("\")
19780 STRB     R0,[R2],#1
19790
19800 MOV      R0,R8                        ;This section adds the Description.
19810 MOV      R1,#22
19820 BL       ReadIcon
19830 MOV      R0,R2
19840 MOV      R1,#13
19850 SWI      "String_Len"
19860 CMP      R1,#1
19870  SWILE   "Hourglass_Off"
19880  LDMLEFD R13!,{R0-R12,PC}^
19890 ADD      R2,R2,R1
19900 MOV      R0,#13
19910 STRB     R0,[R2],#1
19920
19930 MOV      R0,#&CF                      ;This section opens the IndexFile for
19940 ADD      R1,R10,#indexfile            ;updating.
19950 SWI      "XOS_Find"
19960  BVS      noindex
19970 STR      R0,[R10,#indexhandle%]
19980 STR      R0,[R10,#filehandle%]
19990
20000 LDR      R0,[R10,#editrecord%]        ;This section removes the old record
20010 CMP      R0,#0                        ;if neccesary and closes the edit
20020  BLNE     remove                      ;window afterwards.
20030  LDRNE    R0,[R12,#edit%]
20040  STRNE    R0,[R12,#block%+0]
20050  ADDNE    R1,R12,#block%
20060  SWINE    "Wimp_CloseWindow"
20070
20080 CMP     R6,#26                        ;This section adds the record to the
20090  MOVNE    R8,#0
20100  BLNE     findplace
20110  BLNE     insert                      ;index if necessay.
20120
20130 LDR      R0,[R10,#show%]              ;This section updates a count of the
20140 CMP      R0,#1                        ;number of records in the current file
20150  LDREQ    R1,[R10,#indexmax%]         ;if necessary.
20160  STREQ    R1,[R10,#max%]
20170
20180 LDR      R0,[R10,#record%]            ;This section checks if the new record
20190 LDR      R1,[R10,#max%]               ;is greater than the maximum and if so
20200 CMP      R0,R1                        ;updates the maximum.
20210  STRGT    R1,[R10,#record%]
20220  MOVGT    R0,R1
20230
20240 MOV      R1,#2                        ;This section reads the current record
20250 BL       GetRecords                   ;into the record buffer
20260
20270 MOV      R0,#0                        ;This section closes the index file
20280 LDR      R1,[R10,#indexhandle%]
20290 SWI      "XOS_Find"
20300
20310 BL       Update
20320 SWI      "Hourglass_Off"
20330
20340LDMFD    R13!,{R0-R12,PC}^
20350
20360;------------------------------------------------------------------------------
20370;                          *** Remove ***
20380; This section removes the original copy of the record which is being edited
20390; from the index file.
20400
20410;On Entry
20420;        R0 = Number of record to be deleted
20430
20440.remove
20450
20460STMFD    R13!,{R0-R12,R14}
20470
20480 LDR      R7,[R10,#indexmax%]          ;This section multiplies the number of
20490 SUB      R7,R7,R0                     ;records 'til the end of the file by
20500 MOV      R8,   R7, LSL #3             ;by 88 - the length of each record.
20510 ADD      R8,R8,R7, LSL #4
20520 ADD      R8,R8,R7, LSL #6
20530 MOV      R5,R0
20540
20550 CMP      R8,#0                        ;This section moves the file extent
20560  MOVEQ    R0,#2                       ;back by 88 bytes - one record.
20570  LDREQ    R1,[R10,#indexhandle%]
20580  SWIEQ    "OS_Args"
20590  MOVEQ    R0,#3
20600  SUBEQ    R2,R2,#88
20610  SWIEQ    "OS_Args"
20620  LDREQ    R0,[R10,#indexmax%]
20630  SUBEQ    R0,R0,#1
20640  STREQ    R0,[R10,#indexmax%]
20650  LDMEQFD  R13!,{R0-R12,PC}^
20660
20670 MOV      R0,#2                        ;This section grabs enough memory to
20680 FNLongAdr("",1,heap)                  ;store the records after the record to
20690 MOV      R3,R8                        ;be deleted.
20700 SWI      "XOS_Heap"
20710   BLVS    noroom
20720   LDMVSFD R13!,{R0-R12,PC}^
20730 MOV      R6,R2
20740
20750 MOV      R7,   R5, LSL #3
20760 ADD      R7,R7,R5, LSL #4
20770 ADD      R7,R7,R5, LSL #6
20780
20790 MOV      R0,#3                        ;This section loads in all the records
20800 LDR      R1,[R10,#indexhandle%]       ;after the record to be deleted
20810 MOV      R3,R8
20820 MOV      R4,R7
20830 SWI      "XOS_GBPB"
20840  BVS      noindex
20850
20860 ADD      R2,R7,R8                     ;This section moves the file pointer
20870 SUB      R2,R2,#88                    ;back 1 record - 88 bytes.
20880 SWI      "XOS_Args"
20890  BVS      noindex
20900
20910 MOV      R0,#1                        ;This section saves out the records
20920 MOV      R2,R6                        ;Thus deleting the required record.
20930 MOV      R3,R8
20940 SUB      R4,R7,#88
20950 SWI      "XOS_GBPB"
20960  BCS      cantupdate
20970
20980 MOV      R0,#3                        ;This section releases the memory
20990 FNLongAdr("",1,heap)                  ;claimed.
21000 MOV      R2,R6
21010 SWI      "XOS_Heap"
21020  BVS      noheap
21030
21040 LDR      R0,[R10,#indexmax%]          ;This section decrements the number of
21050 SUB      R0,R0,#1                     ;records.
21060 STR      R0,[R10,#indexmax%]
21070
21080LDMFD    R13!,{R0-R12,PC}^
21090
21100;------------------------------------------------------------------------------
21110;                           *** FindPlace ***
21120; This subroutine locates the position in the file where the new record needs
21130; to inserted. It checks the Issue Number and the Page number.
21140
21150;On Exit
21160;        R8 = Position in file where the record should be inserted after.
21170
21180.findplace
21190
21200STMFD    R13!,{R0-R7,R9-R12,R14}
21210
21220 ADD      R0,R10,#record               ;Get Issue Number to Search For and
21230 ADD      R1,R10,#backslash            ;holds it in R6
21240 MOV      R2,#13
21250 MOV      R3,#0
21260 SWI      "String_Instr"
21270 ADD      R3,R3,#1
21280 SWI      "String_Instr"
21290 ADD      R3,R3,#1
21300 ADD      R0,R0,R3
21310 MOV      R1,#ASC("\")
21320 SWI      "String_Val"
21330 MOV      R6,R1
21340
21350
21360 .issueloop                            ;This loop steps through the records
21370                                       ;until the correct issue is found.
21380
21390 MOV      R0,#2                        ;This section finds the length
21400 LDR      R1,[R10,#indexhandle%]       ;of the file and checks that the
21410 SWI      "XOS_Args"                   ;end has not been reached.
21420  BVS      noindex
21430 CMP      R8,R2
21440  LDMGEFD    R13!,{R0-R7,R9-R12,PC}^
21450
21460 MOV      R0,#1                        ;This section positions the file
21470 MOV      R2,R8                        ;pointer
21480 SWI      "XOS_Args"
21490  BVS      noindex
21500
21510 MOV      R0,R9                        ;This section reads each record into a
21520 MOV      R2,#256                      ;buffer
21530 MOV      R3,#13
21540 MOV      R4,#0
21550 SWI      "XString_Get$#"
21560  BVS      noindex
21570
21580 MOV      R0,R9                        ;This section isolates the Issue number
21590 ADD      R1,R10,#backslash            ;and and gets its value into R1
21600 MOV      R2,#13
21610 MOV      R3,#0
21620 SWI      "String_Instr"
21630 ADD      R3,R3,#1
21640 SWI      "String_Instr"
21650 ADD      R3,R3,#1
21660 ADD      R0,R0,R3
21670 MOV      R1,#ASC("\")
21680 SWI      "String_Val"
21690
21700 CMP      R1,R6                        ;This section compares the issue number
21710  ADDLT    R8,R8,#88                   ;of the current record with the issue
21720  BLT      issueloop                   ;number we are looking for and repeats
21730                                       ;the loop if it is less.
21740
21750
21760 ADD      R0,R10,#record               ;This section gets the page number to
21770 ADD      R1,R10,#backslash            ;search for and holds the result in R6
21780 MOV      R2,#13
21790 MOV      R3,#0
21800 SWI      "String_Instr"
21810 ADD      R3,R3,#1
21820 SWI      "String_Instr"
21830 ADD      R3,R3,#1
21840 SWI      "String_Instr"
21850 ADD      R3,R3,#1
21860 ADD      R0,R0,R3
21870 MOV      R1,#ASC("\")
21880 SWI      "String_Val"
21890 MOV      R6,R1
21900
21910 MOV      R5,#0
21920
21930 .pageloop                             ;This loop steps through the records
21940                                       ;until the correct page is found.
21950
21960 MOV      R0,#2                        ;This section finds the length of the
21970 LDR      R1,[R10,#indexhandle%]       ;file and checks we have not reached
21980 SWI      "XOS_Args"                   ;the end already
21990  BVS      noindex
22000 CMP      R2,R8
22010  LDMLEFD    R13!,{R0-R7,R9-R12,PC}^
22020
22030 MOV      R0,#1                        ;This section reads each record into
22040 MOV      R2,R8                        ;a buffer.
22050 SWI      "XOS_Args"
22060  BVS      noindex
22070 MOV      R0,R9
22080 MOV      R2,#256
22090 MOV      R3,#13
22100 MOV      R4,#0
22110 SWI      "XString_Get$#"
22120  BVS      noindex
22130
22140 MOV      R0,R9                        ;This section isolates the Page number
22150 ADD      R1,R10,#backslash            ;from each record.
22160 MOV      R2,#13
22170 MOV      R3,#0
22180 SWI      "String_Instr"
22190 ADD      R3,R3,#1
22200 SWI      "String_Instr"
22210 ADD      R3,R3,#1
22220 SWI      "String_Instr"
22230 ADD      R3,R3,#1
22240 ADD      R0,R0,R3
22250 MOV      R1,#ASC("\")
22260 SWI      "String_Val"
22270
22280 CMP      R1,R5                        ;This section compares the two page
22290  MOVLT    R2,R8                       ;numbers and exits the subroutine if
22300  LDMLTFD  R13!,{R0-R7,R9-R12,PC}^     ;necessary.
22310
22320 MOV      R5,R1
22330
22340 CMP    R1,R6                          ;This section repeats the loop if
22350  ADDLE    R8,R8,#88                   ;the page numbers are not equal.
22360  BLE      pageloop
22370
22380 MOV      R2,R8
22390
22400LDMFD    R13!,{R0-R7,R9-R12,PC}^
22410
22420;-----------------------------------------------------------------------------
22430;                          *** Insert ***
22440; This subroutine inserts the new record into the file at the place pointed to
22450; by 'findplace'.
22460
22470.insert
22480
22490STMFD    R13!,{R0-R12,R14}
22500
22510 MOV      R8,#0
22520 BL       findplace
22530
22540 LDR      R0,[R10,#indexmax%]          ;This section calculates the length of
22550 MOV      R7,   R0, LSL #3             ;the indexfile by multiplying the
22560 ADD      R7,R7,R0, LSL #4             ;number of records by 88. The number
22570 ADD      R7,R7,R0, LSL #6             ;of bytes after the insertion point is
22580 SUB      R7,R7,R8                     ;calculated from R8.
22590
22600 CMP      R7,#0                        ;The next section is skipped if the new
22610  BLE      saverecord                  ;record is to go at the end of the file
22620
22630 MOV      R0,#2                        ;This section claims enough free memory
22640 FNLongAdr("",1,heap)                  ;to load in the records after the
22650 MOV      R3,R7                        ;insertion point.
22660 SWI      "XOS_Heap"
22670   BLVS    noroom
22680   LDMVSFD R13!,{R0-R12,PC}^
22690 MOV      R6,R2
22700
22710 MOV      R0,#3                        ;This section loads in all the records
22720 LDR      R1,[R10,#indexhandle%]       ;after the insertion point.
22730 MOV      R3,R7
22740 MOV      R4,R8
22750 SWI      "XOS_GBPB"
22760  BVS      cantupdate
22770
22780 .saverecord
22790 ADD      R0,R10,#record               ;This section calculates the number of
22800 MOV      R1,#13                       ;of bytes needed to pad the new record
22810 SWI      "String_Len"                 ;out to 88 bytes.
22820 MOV      R2,#13
22830 STRB     R2,[R0,R1]
22840 ADD      R0,R0,R1
22850 RSB      R1,R1,#87
22860 SUB      R1,R1,#1
22870
22880 MOV      R2,#0                        ;This section fills the remainder of
22890.insertloop                            ;the record with zero bytes.
22900 STRB     R2,[R0,R1]
22910 SUBS     R1,R1,#1
22920  BNE      insertloop
22930
22940 MOV      R0,#1                        ;This section saves the new record into
22950 LDR      R1,[R10,#indexhandle%]       ;the index file.
22960 ADD      R2,R10,#record
22970 MOV      R3,#88
22980 MOV      R4,R8
22990 SWI      "XOS_GBPB"
23000  BVS      cantupdate
23010
23020 LDR      R0,[R10,#indexmax%]          ;This section increments the maximum
23030 ADD      R0,R0,#1                     ;record number.
23040 STR      R0,[R10,#indexmax%]
23050
23060 CMP      R7,#0                        ;This section ends the subroutine if
23070  LDMEQFD  R13!,{R0-R12,PC}^           ;the record was inserted at the end.
23080
23090 MOV      R0,#1                        ;This section writes the remainder of
23100 MOV      R2,R6                        ;the records back into the file.
23110 MOV      R3,R7
23120 SWI      "XOS_GBPB"
23130  BVS      cantupdate
23140
23150 MOV     R0,#3                         ;This section releases the memory
23160 FNLongAdr("",1,heap)                  ;claimed.
23170 MOV     R2,R6
23180 SWI     "XOS_Heap"
23190  BVS     noheap
23200
23210LDMFD    R13!,{R0-R12,PC}^
23220
23230;------------------------------------------------------------------------------
23240;                           *** DragFinished ***
23250; This subroutine is called when the user releases all the mouse buttons after
23260; performing a drag operation. i.e. dragging our save icon to a directory
23270; display.
23280
23290.DragFinished
23300
23310STMFD    R13!,{R0-R12,R14}
23320
23330 LDR      R0,[R12,#save%]              ;This section reads the string from
23340 MOV      R1,#2                        ;the filename icon (#2) in the save
23350 MOV      R2,R9                        ;dialogue.
23360 BL       ReadIcon
23370
23380 MOV      R0,R9                        ;This section finds the length of the
23390 MOV      R1,#13                       ;filename.
23400 SWI      "String_Len"
23410 MOV      R8,R1
23420
23430 SUB      R1,R1,#1                     ;This section locates the last '.' in
23440 .dragfinishedloop                     ;filename. Note; Sub-directory names
23450  LDRB     R0,[R9,R1]                  ;are seperated by a full stop, so the
23460  CMP      R0,#ASC(".")                ;name after the final full stop is the
23470   ADDEQ    R1,R1,#1                   ;leafname.
23480   CMPNE    R1,#0
23490    SUBNE    R1,R1,#1
23500 BNE      dragfinishedloop
23510
23520 SUB      R8,R8,R1
23530
23540 MOV      R0,R9                        ;This section isolates the leafname.
23550 MOV      R1,R9
23560 MOV      R2,#13
23570 MOV      R3,R8
23580 SWI      "String_Right$"
23590
23600 ADD      R1,R12,#block%               ;This section gets details of the mouse
23610 SWI      "Wimp_GetPointerInfo"        ;pointer and uses the information to
23620                                       ;create a message block. This message
23630                                       ;is then sent to the Task Manager.
23640
23650 LDR      R0,[R12,#block%+0]           ;Mouse X coordinate
23660 STR      R0,[R12,#block%+28]
23670
23680 LDR      R0,[R12,#block%+4]           ;Mouse Y coordinate
23690 STR      R0,[R12,#block%+32]
23700
23710 LDR      R0,[R12,#block%+12]          ;Window Handle
23720 STR      R0,[R12,#block%+20]
23730
23740 LDR      R3,[R12,#block%+16]          ;Icon Handle
23750 STR      R3,[R12,#block%+24]
23760
23770 MOV      R0,#0                        ;Our Reference - 0 for initial message
23780 STR      R0,[R12,#block%+12]
23790
23800 MOV      R0,#1                        ;Message number - 1 DataSave
23810 STR      R0,[R12,#block%+16]
23820
23830 MOV      R0,#88                       ;Estimated size of file
23840 STR      R0,[R12,#block%+36]          ;The file will always be at least 88
23850
23860 MOV      R0,#&0AC                     ;Filetype
23870 STR      R0,[R12,#block%+40]
23880
23890 MOV      R0,R9                        ;Proposed Leafname
23900 ADD      R1,R12,#block%+44
23910 MOV      R2,#13
23920 SWI      "String_Move$"
23930
23940 MOV      R0,#0                        ;This section adds a terminating zero
23950 ADD      R2,R12,#block%+44            ;byte to the leafname.
23960 ADD      R1,R2,R8
23970 STRB     R0,[R1],#1
23980
23990 ADD      R2,R8,#44+3                  ;This section finds the length of the
24000 BIC      R2,R2,#%11                   ;entire message block and rounds it up
24010 STR      R2,[R12,#block%+0]           ;to the nearest word.
24020
24030 MOV      R0,#18                       ;This section calls the Wimp to pass
24040 ADD      R1,R12,#block%               ;our message block to the Task Manager
24050 LDR      R2,[R12,#block%+20]
24060 SWI      "Wimp_SendMessage"
24070
24080LDMFD    R13!,{R0-R12,PC}^
24090
24100;------------------------------------------------------------------------------
24110;                       *** DataSaveAck ***
24120; This subroutine is called when the target task acknolwlegdes that we can go
24130; ahead and save our data. The 'target task' will be either the Filer if the
24140; user wants to save the file to disc or another application if the user wants
24150; to export our data.
24160
24170.DataSaveAck
24180
24190STMFD    R13!,{R0-R12,R14}
24200
24210 ADD      R0,R12,#block%+44            ;This section copies the filename from
24220 MOV      R1,R9                        ;the message block into workspace.
24230 MOV      R2,#0
24240 SWI      "String_Move$"
24250
24260
24270 LDR      R0,[R12,#block%+0]           ;This section copies the contents of
24280 LDR      R8,[R12,#block%+4]           ;the message block into R0-R8 so that
24290 LDR      R1,[R12,#block%+8]           ;the message block can be rebuilt as
24300 LDR      R2,[R12,#block%+20]          ;soon as we have finished saving.
24310 LDR      R3,[R12,#block%+24]
24320 LDR      R4,[R12,#block%+28]
24330 LDR      R5,[R12,#block%+32]
24340 LDR      R6,[R12,#block%+36]
24350 LDR      R7,[R12,#block%+40]
24360
24370 BL       SaveIssue
24380
24390 STR      R0,[R12,#block%+0]           ;The section rebuilds the wimp message
24400 STR      R1,[R12,#block%+12]          ;block.
24410 STR      R2,[R12,#block%+20]
24420 STR      R3,[R12,#block%+24]
24430 STR      R4,[R12,#block%+28]
24440 STR      R5,[R12,#block%+32]
24450 STR      R6,[R12,#block%+36]
24460 STR      R7,[R12,#block%+40]
24470 MOV      R0,#3
24480 STR      R0,[R12,#block%+16]
24490
24500 MOV      R0,#18                       ;This section sends a 'Data_Load'
24510 ADD      R1,R12,#block%               ;message to the target task, to confirm
24520 MOV      R2,R8                        ;that we have sent all our data.
24530 SWI      "Wimp_SendMessage"
24540
24550 MVN      R1,#0                        ;This section ensures that the menu
24560 SWI      "Wimp_CreateMenu"            ;is removed from the screen.
24570
24580LDMFD    R13!,{R0-R12,PC}^
24590
24600
24610;------------------------------------------------------------------------------
24620;                          *** SaveIssue ***
24630; This subroutine performs the actual save operation after the Wimp protocol
24640; has been performed.
24650
24660.SaveIssue
24670
24680STMFD    R13!,{R0-R12,R14}
24690
24700 MOV      R0,#11                       ;This section creates an empty file of
24710 MOV      R1,R9                        ;type &0AC (IndexFile).
24720 MOV      R2,#&0AC
24730 MOV      R4,#0
24740 MOV      R5,#0
24750 SWI      "XOS_File"
24760  BVS      NonSeriousError
24770
24780 MOV      R0,#&CF                      ;This section opens the new file for
24790 MOV      R1,R9                        ;read/write access.
24800 SWI      "XOS_Find"
24810  BVS      NonSeriousError
24820 STR      R0,[R10,#searchhandle%]
24830
24840 MOV      R0,#&4F                      ;This section opens the Index for read
24850 ADD      R1,R10,#indexfile            ;access.
24860 SWI      "XOS_Find"
24870  BVS      noindex
24880 STR      R0,[R10,#filehandle%]
24890
24900 LDR      R0,[R10,#record%]            ;This section updates the current
24910 LDR      R1,[R10,#show%]              ;record number for the current display
24920 CMP      R1,#1                        ;mode.
24930  STREQ    R0,[R10,#indexrecord%]
24940  STRNE    R0,[R10,#searchrecord%]
24950
24960 LDR      R0,[R12,#save%]              ;This section finds the value of the
24970 MOV      R1,#7                        ;start issue.
24980 MOV      R2,R9
24990 BL       ReadIcon
25000 MOV      R0,R9
25010 MOV      R1,#13
25020 SWI      "String_Val"
25030 MOV      R7,R1
25040
25050 LDR      R0,[R12,#save%]              ;This section finds the value of the
25060 MOV      R1,#10                       ;end issue. All records belonging to
25070 MOV      R2,R9                        ;these issues will be saved.
25080 BL       ReadIcon
25090 MOV      R0,R9
25100 MOV      R1,#13
25110 SWI      "String_Val"
25120 MOV      R6,R1
25130 CMP      R6,R7
25140  MOVLT    R6,R7
25150 ADD      R6,R6,#1
25160
25170 MOV      R5,#1
25180
25190 .startloop                            ;This section checks if the end of the
25200  LDR    R0,[R10,#indexmax%]           ;file has been reached.
25210  CMP    R5,R0
25220   LDRGT  R7,[R10,#record%]
25230   BGT    startloopend
25240                                       ;This section reads in a record
25250  MOV    R0,R5
25260  MOV    R1,#2
25270  BL     GetRecords
25280
25290  ADD     R0,R10,#record               ;This section extract the issue number
25300  ADD     R1,R10,#backslash            ;from the record string.
25310  MOV     R2,#13
25320  MOV     R3,#0
25330  SWI     "String_Instr"
25340  ADD     R3,R3,#1
25350  SWI     "String_Instr"
25360
25370  ADD     R0,R0,R3
25380  ADD     R0,R0,#1
25390  MOV     R1,#ASC("\")
25400  SWI     "String_Val"
25410
25420  CMP     R1,R7                        ;This section compares the Start issue
25430   ADDLT   R5,R5,#1                    ;with the issue of the record.
25440   BLT     startloop
25450   LDR    R7,[R10,#record%]
25460   SUBGT   R7,R7,#1
25470 .startloopend
25480
25490 .endloop
25500  LDR    R0,[R10,#indexmax%]           ;This section checks if the end of the
25510  CMP    R5,R0                         ;file has been reached.
25520   BGT    endloopend
25530
25540  MOV    R0,R5                         ;This section reads in a record.
25550  MOV    R1,#2
25560  BL     GetRecords
25570
25580  ADD     R0,R10,#record               ;This section extracts the issue number
25590  ADD     R1,R10,#backslash            ;from the record string.
25600  MOV     R2,#13
25610  MOV     R3,#0
25620  SWI     "String_Instr"
25630  ADD     R3,R3,#1
25640  SWI     "String_Instr"
25650
25660  ADD     R0,R0,R3
25670  ADD     R0,R0,#1
25680  MOV     R1,#ASC("\")
25690  SWI     "String_Val"
25700
25710  CMP     R1,R6                        ;This section compares the end issue
25720   ADDLT   R5,R5,#1                    ;number with the issue number of the
25730   BLT     endloop                     ;record.
25740
25750 .endloopend
25760  LDR     R6,[R10,#record%]
25770
25780 MOV      R0,   R7, LSL #3             ;This section multiplies the record no.
25790 ADD      R0,R0,R7, LSL #4             ;of the Start record by 88 to get its
25800 ADD      R0,R0,R7, LSL #6             ;position in the file.
25810 MOV      R7,R0
25820
25830 MOV      R0,   R6, LSL #3             ;This section multiplies the record no.
25840 ADD      R0,R0,R6, LSL #4             ;of the End record by 88 to get its
25850 ADD      R0,R0,R6, LSL #6             ;position in the file.
25860 MOV      R6,R0
25870                                       ;This section claims enough memory to
25880 MOV      R0,#2                        ;load in the records to be saved.
25890 FNLongAdr("",1,heap)
25900 SUBS    R3,R6,R7
25910  MOVEQ    R3,#1
25920 SWI      "XOS_Heap"
25930  BVS      noroom
25940 MOV      R5,R2
25950
25960 MOV      R0,#3                        ;This section loads in the records
25970 LDR      R1,[R10,#filehandle%]        ;which are to be saved.
25980 SUB      R3,R6,R7
25990 MOV      R4,R7
26000 SWI      "XOS_GBPB"
26010  BVS      noindex
26020
26030 MOV      R0,#0                        ;This section closes the index file.
26040 SWI      "XOS_Find"
26050
26060 MOV      R0,#1                        ;This section saves the recordfs to the
26070 LDR      R1,[R10,#searchhandle%]      ;specified file.
26080 MOV      R2,R5
26090 SUB      R3,R6,R7
26100 MOV      R4,#0
26110 SWI      "XOS_GBPB"
26120  BVS      NonSeriousError
26130
26140 MOV      R0,#0                        ;This section closes the new file.
26150 SWI      "XOS_Find"
26160
26170LDMFD    R13!,{R0-R12,PC}^
26180
26190;------------------------------------------------------------------------------
26200;                            *** UserMessageRecieved ***
26210; This subroutine deals with all User Messages which are sent by other tasks
26220; to us.
26230
26240.breakpoint
26250MOV PC,R14
26260
26270.UserMessageReceived
26280
26290STMFD    R13!,{R0-R12,R14}
26300
26310 LDR      R0,[R12,#block%+16]          ;This gets the message Reason code.
26320
26330 CMP      R0,#0                        ;This message tells us to close down
26340  MOVEQ    R0,#1                       ;our application.
26350  STREQ    R0,[R12,#quit%]
26360
26370 CMP      R0,#1                        ;Another application is trying to save
26380  BLEQ     DataSave                    ;data and wants us to import it.
26390
26400 CMP      R0,#2                        ;Another task is giving us the go ahead
26410  BLEQ    DataSaveAck                  ;to save our data.
26420
26430 CMP      R0,#3                        ;The filer wants us to load a file.
26440  BLEQ     DataLoad
26450;  BLEQ     breakpoint
26460
26470 MOV      R1,   #&500                  ;A task is requesting interactive help
26480 ADD      R1,R1,#&002                  ;from us.
26490 CMP      R0,R1
26500  BLEQ     sendhelp
26510
26520 MOV      R1,   #&40000                ;Our application updates files from
26530 ADD      R1,R1,#&000C2                ;within our resources directory. If
26540 CMP      R0,R1                        ;two copies of our application are
26550  ADDEQ    R0,R12,#block%+28           ;running then this could cause one copy
26560  ADDEQ    R1,R12,#appname             ;to crash when the first copy updated a
26570  MOVEQ    R2,#13                      ;a file that was expected to be
26580  MOVEQ    R3,#0                       ;unchanged.
26590  SWIEQ    "String_Instr"              ;This message is broadcast every time
26600  CMPEQ    R3,#0                       ;a new application is registered with
26610   MOVEQ    R0,#1                      ;the Wimp. We examine the new task name
26620   STREQ    R0,[R12,#quit%]            ;and if it is identical to our own then
26630   LDREQ    R0,[R12,#task%]            ;we must terminate.
26640   LDREQ    R1,[R12,#block%+4]
26650   CMPEQ    R0,R1
26660    MOVEQ    R0,#0
26670    STREQ    R0,[R12,#quit%]
26680
26690LDMFD    R13!,{R0-R12,PC}^
26700
26710;-----------------------------------------------------------------------------
26720;                             *** SendHelp ***
26730; This subroutine is called when an Interactive Help application request help
26740; information about our application.
26750
26760.sendhelp
26770
26780STMFD    R13!,{R0-R12,R14}
26790
26800 LDR      R0,[R12,#block%+32]          ;This is handle of the window needing
26810                                       ;help
26820
26830 LDR      R1,[R12,#display%]           ;This section deals with help about
26840 CMP      R0,R1                        ;the Display window.
26850  BLEQ     displayhelp
26860  LDMEQFD  R13!,{R0-R12,PC}^
26870
26880 LDR      R1,[R12,#edit%]              ;This section deals with help about
26890 CMP      R0,R1                        ;the Edit window.
26900  BLEQ     edithelp
26910  LDMEQFD  R13!,{R0-R12,PC}^
26920
26930 LDR      R1,[R12,#search%]            ;This section deals with help about
26940 CMP      R0,R1                        ;the Search window.
26950  BLEQ     searchhelp
26960
26970LDMFD    R13!,{R0-R12,PC}^
26980
26990;-----------------------------------------------------------------------------
27000;                            *** DisplayHelp ***
27010;This subroutine sends help messages about icons within the Display window.
27020
27030.displayhelp
27040
27050STMFD    R13!,{R0-R12,R14}
27060
27070 LDR      R0,[R12,#block%+36]
27080 ADR      R1,dispnoicon
27090
27100 CMP      R0,#20                       ;This section checks the icon number
27110  ADREQ   R1,disp20help                ;of the icon that the pointer is over
27120 CMP      R0,#21                       ;and sets R1 to point to a message
27130  ADREQ   R1,disp21help                ;token.
27140 CMP      R0,#22
27150  ADREQ   R1,disp22help
27160 CMP      R0,#23
27170  ADREQ   R1,disp23help
27180 CMP      R0,#24
27190  ADREQ   R1,disp24help
27200 CMP      R0,#25
27210  ADREQ   R1,disp25help
27220 CMP      R0,#26
27230  ADREQ   R1,disp26help
27240 CMP      R0,#27
27250  ADREQ   R1,disp27help
27260 CMP      R0,#28
27270  ADREQ   R1,disp28help
27280 CMP      R0,#29
27290  ADREQ   R1,disp29help
27300 CMP      R0,#30
27310  ADREQ   R1,disp30help
27320 CMP      R0,#31
27330  ADREQ   R1,disp31help
27340 CMP      R0,#32
27350  ADREQ   R1,disp32help
27360 CMP      R0,#33
27370  ADREQ   R1,disp33help
27380 CMP      R0,#34
27390  ADREQ   R1,disp34help
27400 CMP      R0,#35
27410  ADREQ   R1,disp35help
27420 CMP      R0,#37
27430  ADREQ   R1,disp37help
27440 CMP      R0,#38
27450  ADREQ   R1,disp38help
27460 CMP      R0,#39
27470  ADREQ   R1,disp39help
27480 CMP      R0,#40
27490  ADREQ   R1,disp40help
27500 CMP      R0,#41
27510  ADREQ   R1,disp41help
27520 CMP      R0,#42
27530  ADREQ   R1,disp42help
27540 CMP      R0,#43
27550  ADREQ   R1,disp43help
27560
27570 BL       sendhelpmessage
27580
27590LDMFD    R13!,{R0-R12,PC}^
27600
27610;-----------------------------------------------------------------------------
27620; The following section contains message tokens which are to be looked up and
27630; sent to the requesting task.
27640
27650
27660.dispnoicon :EQUS "HDNoIcon"+CHR$0
27670.disp20help :EQUS "HDBack1"+CHR$0
27680.disp21help :EQUS "HDBack10"+CHR$0
27690.disp22help :EQUS "HDBack100"+CHR$0
27700.disp23help :EQUS "HDForward1"+CHR$0
27710.disp24help :EQUS "HDForward10"+CHR$0
27720.disp25help :EQUS "HDForward100"+CHR$0
27730.disp26help :EQUS "HDIndex"+CHR$0
27740.disp27help :EQUS "HDSearch"+CHR$0
27750.disp28help :EQUS "HDRecord"+CHR$0
27760.disp29help :EQUS "HDMax"+CHR$0
27770.disp30help :EQUS "HDTopic"+CHR$0
27780.disp31help :EQUS "HDDetails"+CHR$0
27790.disp32help :EQUS "HDMonth"+CHR$0
27800.disp33help :EQUS "HDYear"+CHR$0
27810.disp34help :EQUS "HDIssue"+CHR$0
27820.disp35help :EQUS "HDPage"+CHR$0
27830.disp37help :EQUS "HDEdit"+CHR$0
27840.disp38help :EQUS "HDNotFound"+CHR$0
27850.disp39help :EQUS "HDBackM"+CHR$0
27860.disp40help :EQUS "HDForwardM"+CHR$0
27870.disp41help :EQUS "HDBackY"+CHR$0
27880.disp42help :EQUS "HDForwardY"+CHR$0
27890.disp43help :EQUS "HDTopicMenu"+CHR$0
27900
27910ALIGN
27920
27930;-----------------------------------------------------------------------------
27940;                             *** EditHelp ***
27950;This subroutine sends help messages about icons within the Edit window.
27960
27970.edithelp
27980
27990STMFD    R13!,{R0-R12,R14}^
28000
28010 LDR      R0,[R12,#block%+36]
28020
28030 ADR      R1,editnoicon                ;This scetion checks the icon number of
28040 CMP      R0,#9                        ;the icon the pointer is over and sets
28050  ADREQ    R1,edit9help                ;R1 to point to a message token.
28060 CMP      R0,#10
28070  ADREQ    R1,edit10help
28080 CMP      R0,#11
28090  ADREQ    R1,edit11help
28100 CMP      R0,#12
28110  ADREQ    R1,edit12help
28120 CMP      R0,#13
28130  ADREQ    R1,edit13help
28140 CMP      R0,#14
28150  ADREQ    R1,edit14help
28160 CMP      R0,#15
28170  ADREQ    R1,edit15help
28180 CMP      R0,#16
28190  ADREQ    R1,edit16help
28200 CMP      R0,#17
28210  ADREQ    R1,edit17help
28220 CMP      R0,#18
28230  ADREQ    R1,edit18help
28240 CMP      R0,#19
28250  ADREQ    R1,edit19help
28260 CMP      R0,#20
28270  ADREQ    R1,edit20help
28280 CMP      R0,#21
28290  ADREQ    R1,edit21help
28300 CMP      R0,#22
28310  ADREQ    R1,edit22help
28320 CMP      R0,#23
28330  ADREQ    R1,edit23help
28340 CMP      R0,#24
28350  ADREQ    R1,edit24help
28360 CMP      R0,#25
28370  ADREQ    R1,edit25help
28380 CMP      R0,#26
28390  ADREQ    R1,edit26help
28400
28410 BL       sendhelpmessage
28420
28430LDMFD    R13!,{R0-R12,PC}^
28440
28450;------------------------------------------------------------------------------
28460; This section contins message tokens which are to be looked up and sent to
28470; the requesting task.
28480
28490.editnoicon :EQUS "HENoIcon"+CHR$(0)
28500.edit9help  :EQUS "HEBackM"+CHR$(0)
28510.edit10help :EQUS "HEForwardM"+CHR$(0)
28520.edit11help :EQUS "HEBackY"+CHR$(0)
28530.edit12help :EQUS "HEForwardY"+CHR$(0)
28540.edit13help :EQUS "HEBackI"+CHR$(0)
28550.edit14help :EQUS "HEForwardI"+CHR$(0)
28560.edit15help :EQUS "HEBackP"+CHR$(0)
28570.edit16help :EQUS "HEForwardP"+CHR$(0)
28580.edit17help :EQUS "HEMonth"+CHR$(0)
28590.edit18help :EQUS "HEYear"+CHR$(0)
28600.edit19help :EQUS "HEIssue"+CHR$(0)
28610.edit20help :EQUS "HEPage"+CHR$(0)
28620.edit21help :EQUS "HETopic"+CHR$(0)
28630.edit22help :EQUS "HEDetails"+CHR$(0)
28640.edit23help :EQUS "HEOK"+CHR$(0)
28650.edit24help :EQUS "HECancel"+CHR$(0)
28660.edit25help :EQUS "HETopicMenu"+CHR$(0)
28670.edit26help :EQUS "HEDelete"+CHR$(0)
28680ALIGN
28690
28700;------------------------------------------------------------------------------
28710;                               *** SearchHelp ***
28720; This subroutine sends help messages about icons in the Search dialogue box.
28730
28740.searchhelp
28750
28760STMFD    R13!,{R0-R12,R14}^
28770
28780 LDR      R0,[R12,#block%+36]
28790 ADR      R1,searchnoicon
28800 CMP      R0,#1
28810  ADREQ    R1,search1help
28820 CMP      R0,#2
28830  ADREQ    R1,search2help
28840 BL       sendhelpmessage
28850
28860LDMFD    R13!,{R0-R12,PC}^
28870
28880;-----------------------------------------------------------------------------
28890; This section contains message tokens which are to be looked up and sent to
28900; the requesting task.
28910
28920.searchnoicon:EQUS "HSNoIcon"+CHR$(0)
28930.search1help :EQUS "HSWriteable"+CHR$(0)
28940.search2help :EQUS "HSOK"+CHR$(0)
28950ALIGN
28960
28970;-----------------------------------------------------------------------------
28980;                           *** SendHelpMessage ***
28990; This subroutine looks up the message token pointed to by R1 in the Messages
29000; file and sends the Help Text back to the Task which requested it.
29010
29020.sendhelpmessage
29030
29040STMFD    R13!,{R0-R12,R14}
29050
29060 LDR      R0,[R12,#block%+8]           ;This copies the Task handle from
29070 STR      R0,[R12,#block%+12]          ;Sender field to the Destination field.
29080
29090 MOV      R0,   #&500                  ;&503 is the message number of a reply
29100 ADD      R0,R0,#&003                  ;to a help request.
29110 STR      R0,[R12,#block%+16]
29120
29130 FNLongAdr("",0,messages)              ;This section looks up the actual text
29140 ADD      R2,R12,#block%+20            ;in our Messages file.
29150 MOV      R3,#256-20
29160 SWI      "MessageTrans_Lookup"
29170
29180 ADD      R1,R3,#24                    ;This section sends the Help text
29190 BIC      R1,R1,#%11                   ;message to the Task that requested it.
29200 STR      R1,[R12,#block%+0]
29210 MOV      R0,#17
29220 ADD      R1,R12,#block%
29230 LDR      R2,[R12,#block%+4]
29240 SWI      "Wimp_SendMessage"
29250
29260LDMFD    R13!,{R0-R12,PC}^
29270
29280;-----------------------------------------------------------------------------
29290;                           *** DataLoad ***
29300; This subroutine is called when a file icon is dragged to our iconbar icon.
29310; If the file is of a filetype we understand then we must try to load it.
29320; In our case a user will drag a file to our icon when they want to add its
29330; contents to the Index.
29340
29350.DataLoad
29360
29370STMFD    R13!,{R0-R12,R14}
29380
29390
29400 LDR      R0,[R12,#block%+40]          ;This section ensures that the file is
29410 MOV      R1,   #&0AC                  ;of Filetype &0AC (IndexFile).
29420 CMP      R0,R1
29430  LDMNEFD  R13!,{R0-R12,PC}^
29440
29450 SWI      "Hourglass_On"
29460
29470 MOV      R0,#&4F                      ;This section opens the users file for
29480 ADD      R1,R12,#block%+44            ;read access only.
29490 SWI      "XOS_Find"
29500  BLVS     noinput
29510  LDMVSFD  R13!,{R0-R12,PC}^
29520 MOV       R7,R0
29530                                       ;This section loads the first record of
29540  MOV      R0,#3                       ;the users file.
29550  MOV      R1,R7
29560  ADD      R2,R10,#record
29570  MOV      R3,#88
29580  MOV      R4,#0
29590  SWI      "XOS_GBPB"
29600   BLVS     noinput
29610   LDMVSFD  R13!,{R0-R12,PC}^
29620
29630 MOV      R0,#0                        ;This section closes the users file.
29640 MOV      R1,R7
29650 SWI      "XOS_Find"
29660
29670 MOV      R0,#&4F                      ;This section opens the index file for
29680 ADD      R1,R10,#indexfile            ;read access only.
29690 SWI      "XOS_Find"
29700  BLVS     noindex
29710  LDMVSFD  R13!,{R0-R12,PC}^
29720 STR      R0,[R10,#indexhandle%]
29730
29740 MOV     R8,#0
29750 BL      findplace
29760
29770 MOV      R0,#0                        ;This section closes the index file.
29780 LDR      R1,[R10,#indexhandle%]
29790 SWI      "XOS_Find"
29800  BVS      noindex
29810
29820 SWI     "Hourglass_Off"
29830
29840 LDR     R0,[R10,#indexmax%]
29850 MOV     R1,   R0,LSL #6
29860 ADD     R1,R1,R0,LSL #4
29870 ADD     R1,R1,R0,LSL #3
29880 CMP     R8,R1
29890  MOVEQ   R0,#1
29900  MOVNE   R0,#0
29910 STR     R0,UpdateType
29920
29930 LDR      R0,[R12,#update%]
29940 MOV      R1,#2
29950 ADD      R2,R12,#block%+44
29960 BL       WriteIcon
29970
29980 LDR      R0,[R12,#update%]
29990 MOV      R1,#3
30000 MOV      R2,#0
30010 BL       WriteIconNo
30020
30030 STR      R0,[R12,#block%+0]
30040 ADD      R1,R12,#block%
30050 SWI      "Wimp_GetWindowState"
30060 BL       OpenWindowRequest
30070
30080 MOV      R0,#0
30090 STR      R0,UpdatePointer
30100 STR      R0,currentplace
30110
30120LDMFD    R13!,{R0-R12,PC}^
30130
30140;-----------------------------------------------------------------------------
30150
30160.ContUpdating
30170
30180LDR      R8,[R10,#updating%]
30190CMP      R8,#0
30200 MOVEQS   PC,R14
30210
30220STMFD    R13!,{R0-R12,R14}
30230
30240 LDR      R0,UpdateType
30250 CMP      R0,#0
30260  BLNE     AppendFile
30270  LDMNEFD  R13!,{R0-R12,PC}^
30280
30290 MOV      R0,#&CF                      ;This section opens our indexfile for
30300 ADD      R1,R10,#indexfile            ;update.
30310 SWI      "XOS_Find"
30320 STR      R0,[R10,#indexhandle%]
30330 MOV      R1,R0
30340 MOV      R0,#254
30350 SWI      "OS_Args"
30360 TST      R0,#%1<<7
30370  BLEQ     cantupdate
30380
30390 MOV      R0,#&4F                      ;This section opens the users file for
30400 ADD      R1,R12,#block%+44            ;read access only.
30410 SWI      "XOS_Find"
30420  BLVS     noinput
30430  LDMVSFD  R13!,{R0-R12,PC}^
30440 MOV      R7,R0
30450
30460                                       ;This section loads each record of the
30470  MOV      R0,#3                       ;users file and uses the 'insert'
30480  MOV      R1,R7                       ;to add it in the correct position in
30490  ADD      R2,R10,#record              ;the Index file.
30500  MOV      R3,#88
30510  LDR      R4,UpdatePointer
30520  SWI      "XOS_GBPB"
30530   BLVS     noinput
30540   LDMVSFD  R13!,{R0-R12,PC}^
30550  LDRCC    R8,currentplace
30560  BLCC     findplace
30570  STRCC    R8,currentplace
30580  BLCC     insert
30590  BLCS     FinishUpdating
30600  STR      R4,UpdatePointer
30610
30620 LDR      R0,[R12,#update%]
30630 MOV      R1,#3
30640 BL       ReadIconNo
30650 ADD      R2,R2,#1
30660 BL       WriteIconNo
30670
30680 MOV      R0,#0                        ;This section closes the Index file.
30690 LDR      R1,[R10,#indexhandle%]
30700 SWI      "XOS_Find"
30710
30720 MOV      R0,#0                        ;This section closes the users file.
30730 MOV      R1,R7
30740 SWI      "XOS_Find"
30750
30760LDMFD     R13!,{R0-R12,PC}^
30770
30780;-----------------------------------------------------------------------------
30790.currentplace
30800EQUD     0
30810.UpdateType
30820EQUD     0
30830
30840.FinishUpdating
30850
30860STMFD    R13!,{R0-R12,R14}
30870
30880
30890 MOV      R0,#0
30900 STR      R0,[R10,#updating%]
30910
30920 LDR      R0,[R12,#update%]
30930 STR      R0,[R12,#block%+0]
30940 ADD      R1,R12,#block%
30950 SWI      "Wimp_CloseWindow"
30960
30970 LDR      R0,[R10,#show%]              ;This section ensures that the program
30980 CMP      R0,#1                        ;is in Entire Index mode when the
30990  LDREQ    R0,[R10,#indexhandle%]      ;subroutine ends. Otherwise problems
31000  STREQ    R0,[R10,#filehandle%]       ;occur if the user switches back to
31010  LDREQ    R0,[R10,#indexmax%]         ;display the Entire Index later on.
31020  STREQ    R0,[R10,#max%]
31030  LDREQ    R0,[R10,#record%]
31040  MOVEQ    R1,#2
31050  BLEQ     GetRecords
31060
31070 BL       Update
31080
31090LDMFD    R13!,{R0-R12,PC}^
31100
31110
31120.UpdatePointer
31130EQUD    0
31140
31150;-----------------------------------------------------------------------------
31160
31170.AppendFile
31180
31190STMFD   R13!,{R0-R12,R14}
31200
31210 SWI      "Hourglass_On"
31220
31230 MOV      R0,#5
31240 ADD      R1,R12,#block%+44
31250 SWI      "XOS_File"
31260  BLVS     noinput
31270
31280 MOV      R3,R4
31290 MOV      R7,R4
31300 MOV      R0,#6
31310 SWI      "XOS_Module"
31320 BVS      noroom
31330
31340 MOV      R8,R2
31350 MOV      R0,#&FF
31360 ADD      R1,R12,#block%+44
31370 MOV      R2,R8
31380 MOV      R3,#0
31390 SWI      "XOS_File"
31400  BLVS     noinput
31410
31420 MOV      R0,#&CF
31430 ADD      R1,R10,#indexfile
31440 SWI      "XOS_Find"
31450  BLVS      cantupdate
31460 STR      R0,[R10,#indexhandle%]
31470
31480 MOV      R1,R0
31490 MOV      R0,#2
31500 SWI      "XOS_Args"
31510  BVS      noindex
31520
31530 MOV      R4,R2
31540 MOV      R2,R8
31550 MOV      R0,#1
31560 MOV      R3,R7
31570 SWI      "XOS_GBPB"
31580  BLVS     cantupdate
31590
31600 LDR      R1,[R10,#indexmax%]
31610 LDR      R0,[R10,#indexhandle%]
31620 BL       CountRecords
31630 STR      R0,[R10,#indexmax%]
31640
31650 SUB      R2,R0,R1
31660 LDR      R0,[R12,#update%]
31670 MOV      R1,#3
31680 BL       WriteIconNo
31690
31700 SWI      "Hourglass_Off"
31710 BL       FinishUpdating
31720
31730 MOV      R0,#0
31740 LDR      R1,[R10,#indexhandle%]
31750 SWI      "XOS_Find"
31760
31770 MOV      R0,#7
31780 MOV      R2,R8
31790 SWI      "XOS_Module"
31800
31810
31820LDMFD   R13!,{R0-R12,PC}^
31830
31840;-----------------------------------------------------------------------------
31850;                           *** DataSave ***
31860; This subroutine is called when an external task wants to save data to our
31870; application. This would be if the user dragged a file icon from a save
31880; dialogue box onto our icon.
31890
31900.DataSave
31910
31920STMFD    R13!,{R0-R12,R14}
31930
31940 LDR      R0,[R12,#block%+4]           ;This section ensures that we are not
31950 LDR      R1,[R12,#task%]              ;trying to load our own data. ie the
31960 CMP      R0,R1                        ;message was sent by a task other than
31970  LDMEQFD  R13!,{R0-R12,PC}^           ;ourselves.
31980
31990 ADR      R0,scrapfilename             ;This section ensures that <Wimp$Scrap>
32000 MOV      R1,R9                        ;has been asigned a value.
32010 MVN      R2,#0
32020 MOV      R3,#0
32030 SWI      "XOS_ReadVarVal"
32040 CMP      R2,#0
32050  BLEQ    noscrapfile
32060  LDMEQFD R13!,{R0-R12,PC}^
32070
32080 MOV      R1,#60                       ;Length Of Block
32090 STR      R1,[R12,#block%+0]
32100
32110 LDR      R1,[R12,#block%+8]           ;This is the senders reference.
32120 STR      R1,[R10,#scrapref%]
32130 STR      R1,[R12,#block%+12]
32140
32150 MOV      R1,#2                        ;Message number - 2 DataSaveAck
32160 STR      R1,[R12,#block%+16]
32170
32180 ADR      R0,scrapfile                 ;This section tags the filename
32190 ADD      R1,R12,#block%+44            ;<Wimp$Scrap> to the end of the message
32200 MOV      R2,#0
32210 SWI      "String_Move$"
32220
32230 MVN      R1,#0                        ;This tells the saving application that
32240 STR      R1,[R12,#block%+36]          ;the saved data is not 'safe' ie on disc
32250
32260 MOV      R0,#17                       ;This section sends the DataSaveAck
32270 ADD      R1,R12,#block%               ;message to the saving task.
32280 LDR      R2,[R12,#block%+4]
32290 SWI      "Wimp_SendMessage"
32300
32310LDMFD    R13!,{R0-R12,PC}^
32320
32330;-----------------------------------------------------------------------------
32340; This section contains strings which are used by the above subroutines.
32350
32360.scrapfile
32370
32380EQUS     "<Wimp$Scrap>"
32390EQUB     0
32400ALIGN
32410
32420.scrapfilename
32430
32440EQUS     "Wimp$Scrap"
32450EQUB     0
32460ALIGN
32470
32480;-----------------------------------------------------------------------------
32490; This section contains two words of memory which are used to store
32500; information about the currently open menu structure.
32510
32520.menuinfo
32530EQUD     0
32540EQUD     0
32550ALIGN
32560
32570;-----------------------------------------------------------------------------
32580;                          *** MenuOptionSelected ***
32590; This subroutine is called when the user selects a menu option from one of
32600; our menus.
32610
32620.MenuOptionSelected
32630
32640STMFD    R13!,{R0-R12,R14}
32650
32660 ADR      R7,menuinfo                  ;This section finds out which mouse
32670 MOV      R1,R9                        ;button was used to make the selection
32680 SWI      "Wimp_GetPointerInfo"        ;If Adjust was used the menu should
32690 LDR      R0,[R9,#8]                   ;remain on screen.
32700 STR      R0,[R7]
32710
32720 FNLongAdr("",8,menulist)              ;This section loads the addresses of
32730 LDR      R0,[R12,#currentmenu%]       ;each of the three possible menus
32740 LDR      R1,[R8,#0]
32750 LDR      R2,[R8,#4]
32760 LDR      R3,[R8,#8]
32770
32780
32790 CMP      R0,R1                        ;This section deals with the Icon Bar
32800  BLEQ     DecodeIBMenu                ;menu.
32810
32820 CMP      R0,R2                        ;This section deals with the Main menu
32830  BLEQ     DecodeMainMenu              ;over the Display window.
32840
32850 CMP      R0,R3                        ;This section deals with the Topic menu
32860  BLEQ     DecodeTopicMenu             ;over the pop-up menu icons.
32870
32880 LDR      R1,[R7]                      ;This section checks which mouse button
32890 TST      R1,#(NOT 1) AND 255          ;was used to select the menu option.
32900  LDREQ    R1,[R12,#currentmenu%]      ;If Adjust was used the menu is kept
32910  SWIEQ    "Wimp_CreateMenu"           ;open.
32920
32930LDMFD    R13!,{R0-R12,PC}^
32940
32950;-----------------------------------------------------------------------------
32960;                              *** DecodeMainMenu ***
32970;This section deals with options selected from the Main menu.
32980
32990.DecodeMainMenu
33000
33010STMFD    R13!,{R0-R12,R14}
33020
33030 LDR      R1,[R12,#block%+0]           ;This section starts a search if the
33040 CMP      R1,#1                        ;user selects Search from the menu.
33050  BLEQ     StartSearch
33060
33070 CMP      R1,#2                        ;This section opens the Edit window to
33080  MOVEQ    R0,#0                       ;allow the Index to be Updated.
33090  STREQ    R0,[R10,#editrecord%]       ;It also positions the caret in the
33100  BLEQ     getcurrentissue             ;page number icon.
33110  LDREQ    R0,[R12,#edit%]
33120  ADDEQ    R1,R12,#block%
33130  STREQ    R0,[R12,#block%]
33140  SWIEQ    "Wimp_GetWindowState"
33150  SWIEQ    "Wimp_OpenWindow"
33160  LDREQ    R0,[R12,#edit%]
33170  MOVEQ    R1,#20
33180  MVNEQ    R4,#0
33190  MOVEQ    R5,#0
33200  SWIEQ    "Wimp_SetCaretPosition"
33210
33220 CMP      R1,#4                        ;This ssection sets our Quit flag to
33230  MOVEQ    R1,#1                       ;1 to indicate that we should quit when
33240  STREQ    R1,[R12,#quit%]             ;we return to our Wimp_Poll loop.
33250
33260LDMFD    R13!,{R0-R12,PC}^
33270
33280;-----------------------------------------------------------------------------
33290; This section contains strings that are used to get the Month and Year from
33300; the UTC format that the internal system clock gives into a suitable format
33310; for use by our application.
33320
33330.monthstring
33340
33350EQUS     "%MN"                         ;Month as a number.
33360EQUB     0
33370
33380
33390.yearstring
33400
33410EQUS     "%CE%YR"                      ;Century number and year number.
33420EQUB     0
33430
33440;-----------------------------------------------------------------------------
33450; This section contains a five-byte data block which is filled with the UTC
33460; (Universal Time Coordinate) from the System clock.
33470
33480.time
33490
33500EQUB     3
33510EQUB     0
33520EQUB     0
33530EQUB     0
33540EQUB     0
33550ALIGN
33560
33570;-----------------------------------------------------------------------------
33580;                          *** GetCurrentIssue ***
33590; This section reads the time from the system clock and uses it to calculate
33600; values for the current Month, Year and Issue Number. This assists the user
33610; when they come to update the index with a new issue.
33620
33630.getcurrentissue
33640
33650STMFD    R13!,{R0-R12,R14}
33660
33670 MOV      R0,#14                       ;Read CMOS Clock
33680 ADR      R1,time
33690 SWI      "OS_Word"
33700
33710 MOV      R0,R1                        ;This section converts the 5-byte UTC
33720 MOV      R1,R9                        ;into a Month number as a string.
33730 MOV      R2,#&100
33740 ADR      R3,monthstring
33750 SWI      "OS_ConvertDateAndTime"
33760
33770 MOV      R1,#0                        ;This gets the value of the current
33780 SWI      "String_Val"                 ;month number and stores it for later
33790 ADD      R8,R1,#1                     ;reference to the month look-up table.
33800 STR      R8,[R10,#editmonth%]
33810
33820 MOV      R2,#months%-&10              ;This section looks up the month number
33830 ADD      R2,R2,R8,LSL #4              ;in the look-up table and fills in the
33840 ADD      R2,R10,R2                    ;Month icon in the Edit window.
33850 MOV      R1,#17
33860 LDR      R0,[R12,#edit%]
33870 BL       WriteIcon
33880
33890 ADR      R0,time                      ;This section converts the 5-byte UTC
33900 MOV      R1,R9                        ;to a Year number as a string.
33910 MOV      R2,#&100
33920 ADR      R3,yearstring
33930 SWI      "OS_ConvertDateAndTime"
33940
33950 MOV      R0,#13                       ;This section gets the value of the
33960 STRB     R0,[R1]                      ;Year number.
33970 MOV      R0,R9
33980 MOV      R1,#13
33990 SWI      "String_Val"
34000 MOV      R7,R1
34010
34020 MOV      R1,#18                       ;This section writes the string of the
34030 LDR      R0,[R12,#edit%]              ;year number into the Year icon in the
34040 MOV      R2,R9                        ;Edit window.
34050 BL       WriteIcon
34060
34070
34080 MOV      R0,   #&7C0      ; 1994      ;This section calculates the Issue
34090 ADD      R0,R0,#&00A                  ;number of the current issue.
34100 SUB      R7,R7,R0
34110 MOV      R0,   R7, LSL #3 ; *13
34120 ADD      R0,R0,R7, LSL #2
34130 ADD      R0,R0,R7
34140 ADD      R0,R0,R8
34150 ADD      R0,R0,#137
34160 MOV      R1,R9
34170 MOV      R2,#&100
34180 SWI      "OS_ConvertInteger2"
34190 MOV      R0,#13
34200 STRB     R0,[R1]
34210
34220 MOV      R1,#19                       ;This section writes the Issue number
34230 LDR      R0,[R12,#edit%]              ;into the appropriate icon.
34240 MOV      R2,R9
34250 BL       WriteIcon
34260
34270 MOV      R0,#13                       ;This section blanks the page number,
34280 STR      R0,[R9]                      ;topic and description icons.
34290 LDR      R0,[R12,#edit%]
34300 MOV      R2,R9
34310 MOV      R1,#20
34320 BL       WriteIcon
34330 MOV      R1,#21
34340 BL       WriteIcon
34350 MOV      R1,#22
34360 BL       WriteIcon
34370
34380 STR      R0,[R12,#block%+0]           ;This section
34390 MOV      R0,#26
34400 STR      R0,[R12,#block%+4]
34410 MOV      R0,#%1<<23
34420 STR      R0,[R12,#block%+8]
34430 STR      R0,[R12,#block%+12]
34440 ADD      R1,R12,#block%
34450 SWI      "Wimp_SetIconState"
34460
34470LDMFD    R13!,{R0-R12,PC}^
34480
34490;-----------------------------------------------------------------------------
34500;                             *** UpdateLeafName ***
34510; This section changes the default leafname, which is written into the
34520; filename icon in the save window, when the user changes the Issue that they
34530; wish to save.
34540
34550.UpdateLeafName
34560
34570STMFD    R13!,{R0-R12,R14}
34580
34590 LDR       R0,[R10,#multiple%]         ;This section shades the multiple
34600 CMP       R0,#0                       ;issues section of the window if the
34610  LDRNE    R0,[R12,#save%]             ;Multiple option is not selected.
34620  MOVNE    R1,#2                       ;If it is selected then a default name
34630  ADRNE    R2,multiple                 ;of 'Multiple' is used.
34640  BLNE     WriteIcon
34650  BLNE     UnshadeSave
34660  BLEQ     ShadeSave
34670  LDMNEFD  R13!,{R0-R12,PC}^
34680
34690 LDR      R0,[R12,#save%]              ;This section reads the contents of
34700 MOV      R1,#7                        ;start issue number and finds its
34710 MOV      R2,R9                        ;value.
34720 BL       ReadIcon
34730 MOV      R0,R9
34740 MOV      R1,#13
34750 SWI      "String_Val"
34760
34770 CMP      R1,#137
34780 BGT      AfterDec93
34790
34800 ADD      R0,R1,#6                     ;This section gets the first 3 letters
34810 MOV      R1,#12                       ;of the Month of issue.
34820 BL       Divide
34830 MOV      R8,R2
34840 MOV      R0,#months%
34850 ADD      R0,R0,R3,LSL #4
34860 ADD      R0,R10,R0
34870 MOV      R1,R9
34880 MOV      R2,#13
34890 MOV      R3,#3
34900 SWI      "String_Left$"
34910
34920
34930 ADD      R0,R8,#82                    ;This section gets the string of the
34940 ADD      R1,R9,#3                     ;year of issue and adds it to the
34950 MOV      R2,#253                      ;month name (eg 'Apr95').
34960 SWI      "OS_ConvertInteger1"
34970 MOV      R0,#13
34980 STRB     R0,[R1]
34990 LDR      R0,[R12,#save%]
35000 MOV      R1,#2
35010 MOV      R2,R9
35020 BL       WriteIcon
35030
35040LDMFD    R13!,{R0-R12,PC}^
35050
35060
35070.AfterDec93
35080 SUB      R0,R1,#138
35090 MOV      R1,#13
35100 BL       Divide
35110 MOV      R8,R2
35120 MOV      R0,#months%
35130 ADD      R0,R0,R3,LSL #4
35140 ADD      R0,R10,R0
35150 MOV      R1,R9
35160 MOV      R2,#13
35170 MOV      R3,#3
35180 SWI      "String_Left$"
35190
35200 ADD      R0,R8,#94                    ;This section gets the string of the
35210 ADD      R1,R9,#3                     ;year of issue and adds it to the
35220 MOV      R2,#253                      ;month name (eg 'Apr95').
35230 SWI      "OS_ConvertInteger1"
35240 MOV      R0,#13
35250 STRB     R0,[R1]
35260 LDR      R0,[R12,#save%]
35270 MOV      R1,#2
35280 MOV      R2,R9
35290 BL       WriteIcon
35300
35310LDMFD    R13!,{R0-R12,PC}^
35320
35330
35340;-----------------------------------------------------------------------------
35350;                             *** UpdateStartEnd ***
35360; This section fills the Start and End icons in with the Issue number of the
35370; Record being displyed.
35380
35390.UpdateStartEnd
35400
35410STMFD    R13!,{R0-R12,R14}
35420
35430 LDR      R0,[R12,#display%]           ;This section reads the Issue number
35440 MOV      R1,#34                       ;from the Display window.
35450 MOV      R2,R9
35460 BL       ReadIcon
35470
35480 LDR      R0,[R12,#save%]              ;This section writes the Issue number
35490 MOV      R1,#7                        ;into the Start and End icons in the
35500 BL       WriteIcon                    ;Save window.
35510 MOV      R1,#10
35520 BL       WriteIcon
35530
35540LDMFD    R13!,{R0-R12,PC}^
35550
35560;-----------------------------------------------------------------------------
35570; This section contains the string 'Multiple' which is copied into the
35580; filename icon as the default filename if more than one issue is to be saved.
35590
35600.multiple
35610
35620EQUS     "Multiple"
35630EQUB     0
35640ALIGN
35650
35660;-----------------------------------------------------------------------------
35670;                             *** DecodeIBMenu ***
35680;This section deals with options selected from the IconBar menu.
35690
35700.DecodeIBMenu
35710
35720STMFD    R13!,{R0-R12,R14}
35730
35740 LDR      R1,[R12,#block%+0]           ;This section sets our Quit flag to
35750 CMP      R1,#1                        ;to 1 to indicate that we should quit
35760  MOVEQ    R1,#1                       ;when we return to our Wimp_Poll loop.
35770  STREQ    R1,[R12,#quit%]
35780
35790LDMFD    R13!,{R0-R12,PC}^
35800
35810;-----------------------------------------------------------------------------
35820;                            *** DecodeTopicMenu ***
35830
35840.DecodeTopicMenu
35850
35860STMFD    R13!,{R0-R12,R14}
35870
35880 SWI     "Hourglass_On"
35890
35900 FNLongAdr("",1,menulist)              ;This section gets the address of the
35910 LDR     R1,[R1,#8]                    ;menu structure and converts it to its
35920 ADD     R2,R12,#block%                ;textual equivilent.
35930 MOV     R3,R9
35940 SWI     "Wimp_DecodeMenu"
35950
35960 FNLongAdr("",0,menuinfo)              ;This section checks which window
35970 LDR     R0,[R0,#4]                    ;was used to invoke the menu.
35980 CMN     R0,#1
35990
36000  LDREQ   R0,[R12,#edit%]              ;If the Edit menu was used this section
36010  MOVEQ   R1,#21                       ;copies the menu option into the Topic
36020  MOVEQ   R2,R9                        ;icon in the edit window.
36030  BLEQ    WriteIcon
36040  SWIEQ   "Hourglass_Off"
36050  LDMEQFD R13!,{R0-R12,PC}^
36060
36070 MOV     R0,R9                         ;This section converts the Topic to all
36080 MOV     R1,#13                        ;lowercase letters.
36090 SWI     "String_ToLowerCase"
36100
36110 LDR     R8,[R10,#record%]             ;This section notes the record to stop
36120 SUBS    R8,R8,#1                      ;at if a matching topic is not located.
36130 LDREQ   R8,[R10,#max%]
36140
36150 LDR     R0,[R10,#show%]               ;This section opens the currently
36160 CMP     R0,#1                         ;active file.
36170 MOV     R0,#&4F
36180 ADDEQ   R1,R10,#indexfile
36190 ADDNE   R1,R10,#searchfile
36200 SWI     "XOS_Find"
36210  BVS     norecords
36220 STR     R0,[R10,#filehandle%]
36230
36240 .topicmenuloop                        ;This section reads in records until
36250                                       ;one is found which matches the chosen
36260                                       ;topic.
36270 LDR     R0,[R10,#max%]
36280 LDR     R1,[R10,#record%]
36290
36300 CMP     R1,R8                         ;This section checks if we have gone
36310  MOVEQ   R0,#1                        ;through the entire file without
36320  MOVEQ   R1,#0                        ;finding a match.
36330  BLEQ    GetRecords
36340  BLEQ    Update
36350  SWIEQ   "Hourglass_Off"
36360  BEQ     topicmenuloopend
36370
36380 MOV     R0,#1                         ;This section reads in a record and
36390 MOV     R1,#0                         ;copies it into another buffer.
36400 BL      GetRecords
36410 ADD     R0,R10,#record
36420 ADD     R1,R12,#block%
36430 MOV     R2,#13
36440 SWI     "String_Move$"
36450
36460 MOV     R0,R1                         ;This section changes the record to
36470 MOV     R1,R2                         ;lowercase letters.
36480 SWI     "String_ToLowerCase"
36490
36500 ADD     R1,R10,#backslash             ;This section isolates the Topic
36510 MOV     R2,#13                        ;field.
36520 MOV     R3,#0
36530 SWI     "String_Instr"
36540 ADD     R3,R3,#1
36550 SWI     "String_Instr"
36560 ADD     R3,R3,#1
36570 SWI     "String_Instr"
36580 ADD     R3,R3,#1
36590 SWI     "String_Instr"
36600
36610 ADD     R5,R3,#1                      ;This section compares the two topics
36620 MOV     R1,R9
36630 SWI     "String_Instr"
36640
36650 CMP     R3,R5                         ;This section loops back if they are
36660  BNE     topicmenuloop                ;not the same.
36670
36680 .topicmenuloopend
36690 MOV     R0,#0                         ;This section closes the file.
36700 LDR     R1,[R10,#filehandle%]
36710 SWI     "XOS_Find"
36720
36730 BL      Update
36740 SWI     "Hourglass_Off"
36750
36760LDMFD    R13!,{R0-R12,PC}^
36770
36780;-----------------------------------------------------------------------------
36790;                          *** StartSearch ***
36800; This subroutine performs a search on the index file using the string given
36810; in the Search window.
36820
36830.StartSearch
36840
36850STMFD    R13!,{R0-R12,R14}
36860
36870 SWI      "Hourglass_On"
36880
36890 LDR      R0,[R12,#search%]            ;This section reads in the string to
36900 MOV      R1,#1                        ;search for.
36910 MOV      R2,R9
36920 BL       ReadIcon
36930
36940 MOV      R0,R9                        ;This section converts it to lower case
36950 MOV      R1,#13
36960 SWI      "String_ToLowerCase"
36970
36980 LDR      R1,[R10,#show%]              ;This section stores the current record
36990 CMP      R1,#1                        ;if the Indexfile is being displayed.
37000  LDREQ    R0,[R10,#record%]
37010  STREQ    R0,[R10,#indexrecord%]
37020
37030 MOV      R0,#&8F                      ;This section opens the Search file
37040 ADD      R1,R10,#searchfile           ;for write access.
37050 SWI      "XOS_Find"
37060  BVS      nosearch
37070 STR      R0,[R10,#searchhandle%]
37080
37090 MOV      R0,#&4F                      ;This section opens the Indexfile for
37100 ADD      R1,R10,#indexfile            ;read access.
37110 SWI      "XOS_Find"
37120  BVS      noindex
37130 STR      R0,[R10,#indexhandle%]
37140 STR      R0,[R10,#filehandle%]
37150
37160 MOV      R8,#1
37170
37180.searchloop
37190 BL       percentage                   ;This shows percentage completion
37200                                       ;underneath the Hourglass.
37210 MOV      R0,R8                        ;This section reads in a record.
37220 MOV      R1,#2
37230 BL       GetRecords
37240
37250 ADD      R0,R10,#record               ;This section copies the string and
37260 ADD      R1,R9,#90                    ;converts it to lower case.
37270 MOV      R2,#13
37280 SWI      "String_Move$"
37290 MOV      R1,#13
37300 SWI      "String_ToLowerCase"
37310
37320 MOV      R1,R9                        ;This checks if the search string is
37330 MOV      R2,#13                       ;contained in the record.
37340 MOV      R3,#0
37350 SWI      "String_Instr"
37360
37370 CMN      R3,#1
37380  BEQ      searchloopend
37390
37400 MOV      R0,#0                        ;This section finds the position in
37410 LDR      R1,[R10,#searchhandle%]      ;in the search file of the file
37420 SWI      "XOS_Args"                   ;pointer.
37430  BVS      nosearch
37440 MOV      R7,R2
37450
37460 ADD      R0,R9,#90                    ;This scetion saves the record into
37470 MOV      R2,#13                       ;the Searchfile.
37480 SWI      "XString_Put$#"
37490  BVS       nosearch
37500
37510 ADD      R2,R7,#88                    ;This section moves the file pointer
37520 MOV      R0,#1                        ;on by 88 bytes (one record).
37530 SWI      "XOS_Args"
37540  BVS      nosearch
37550
37560 .searchloopend
37570 LDR      R1,[R10,#indexmax%]          ;This section loops back if we have
37580 CMP      R8,R1                        ;not reached the end of the file.
37590  ADDNE    R8,R8,#1
37600  BNE      searchloop
37610
37620 MOV      R0,#100                      ;This turns of the percentage indicator
37630 SWI      "Hourglass_Percentage"
37640
37650 LDR      R0,[R10,#searchhandle%]      ;This section counts the number of
37660 BL       CountRecords                 ;records in the Searchfile.
37670 STR      R0,[R10,#searchmax%]
37680
37690 CMP      R0,#0                       ;If no matches wee found this sounds a
37700  BLEQ     shadesearch                ;short bleep and ensures that the user
37710  SWIEQ    &100+7 ; Bleep             ;cannot switch to display the Searchfile
37720  BLNE     unshadesearch
37730
37740 MOV      R0,#1                        ;This section sets the current record
37750 STR      R0,[R10,#searchrecord%]      ;in the Search file to no.1
37760
37770 LDR      R0,[R10,#show%]              ;This section loads back the record
37780 CMP      R0,#1                        ;that was showing before the search
37790  LDREQ    R0,[R10,#indexrecord%]      ;was started.
37800  MOVEQ    R1,#2
37810  BLEQ     GetRecords
37820
37830  LDRNE    R0,[R10,#searchhandle%]     ;This section switches to showing the
37840  STRNE    R0,[R10,#filehandle%]       ;searchfile.
37850  LDRNE    R0,[R10,#searchmax%]
37860  STRNE    R0,[R10,#max%]
37870  LDRNE    R0,[R10,#searchrecord%]
37880  MOVNE    R1,#2
37890  BLNE     GetRecords
37900
37910  MOV     R0,#0                        ;This section closes the search file.
37920  LDR     R1,[R10,#searchhandle%]
37930  SWI     "XOS_Find"
37940
37950  MOV     R0,#0                        ;This section closes the Indexfile.
37960  LDR     R1,[R10,#indexhandle%]
37970  SWI     "XOS_Find"
37980
37990  BL       Update
38000 SWI      "Hourglass_Off"
38010
38020LDMFD    R13!,{R0-R12,PC}^
38030
38040;-----------------------------------------------------------------------------
38050;                            *** Percentage ***
38060; This section shows a percentage indicator underneath the hourglass, showing
38070; the percentage of the search completed.
38080
38090.percentage
38100
38110STMFD    R13!,{R0-R12,R14}
38120
38130 MOV     R0,#0                         ;This finds the current position in
38140 LDR     R1,[R10,#indexhandle%]        ;Indexfile.
38150 SWI     "OS_Args"
38160
38170 MOV     R4,R2,LSL #3                  ;This section multiplies the position
38180 ADD     R4,R4,R2,LSL #1               ;by 100
38190 MOV     R3,R4,LSL #3
38200 ADD     R3,R3,R4,LSL #1
38210
38220 MOV     R0,#2                         ;This section finds the total extent
38230 SWI     "OS_Args"                     ;of the file.
38240 MOV     R1,R2
38250 MOV     R0,R3
38260
38270 BL      Divide                        ;This divides one by the other to find
38280                                       ;the percentage complete.
38290
38300 MOV     R0,R2                         ;This section displays the percentage
38310 SWI     "Hourglass_Percentage"        ;under the hourglass.
38320
38330LDMFD    R13!,{R0-R12,PC}^
38340
38350;-----------------------------------------------------------------------------
38360;                           *** ShadeSearch ***
38370; This subroutine greys out the 'Last Search' icon in the Display window so
38380; that it is unselectable when no matches could be found with the last search.
38390
38400.shadesearch
38410
38420STMFD    R13!,{R0-R1,R14}
38430
38440 LDR      R0,[R12,#display%]
38450 STR      R0,[R12,#block%+0]
38460 MOV      R0,#38
38470 STR      R0,[R12,#block%+4]
38480 MOV      R0,#0
38490 STR      R0,[R12,#block%+8]
38500 MOV      R0,#%1<<23
38510 STR      R0,[R12,#block%+12]
38520
38530 ADD      R1,R12,#block%
38540 SWI      "Wimp_SetIconState"
38550
38560 BL       ShowIndex
38570
38580LDMFD    R13!,{R0-R1,PC}^
38590
38600;-----------------------------------------------------------------------------
38610;                         *** UnshadeSeacrh ***
38620; This section ensures that the 'Last Search' icon is selectable after a
38630; search has found some matching records. It also ensures that the 'Not Found'
38640; icon has its Deleted bit set so that it is not displayed.
38650
38660.unshadesearch
38670
38680STMFD    R13!,{R0-R1,R14}
38690
38700 LDR      R0,[R12,#display%]           ;This section deletes the 'Not Found'
38710 STR      R0,[R12,#block%+0]           ;icon.
38720 MOV      R0,#38
38730 STR      R0,[R12,#block%+4]
38740 MOV      R0,#%1<<23
38750 STR      R0,[R12,#block%+8]
38760 STR      R0,[R12,#block%+12]
38770 ADD      R1,R12,#block%
38780 SWI      "Wimp_SetIconState"
38790
38800 MOV      R0,#27                       ;This section ensures that the 'greyed
38810 STR      R0,[R12,#block%+4]           ;out' bit is not set for the 'Last
38820 MOV      R0,#0                        ;Search' icon.
38830 STR      R0,[R12,#block%+8]
38840 MOV      R0,#1<<22
38850 STR      R0,[R12,#block%+12]
38860
38870 ADD      R1,R12,#block%
38880 SWI      "Wimp_SetIconState"
38890
38900 BL       ShowSearch
38910
38920LDMFD    R13!,{R0-R1,PC}^
38930
38940;-----------------------------------------------------------------------------
38950;                          *** ShadeSave ***
38960; This subroutine shades out the icons in the bottom section of the Save
38970; dialogue box when the 'Multiple' icon is not selected.
38980
38990.ShadeSave
39000
39010STMFD    R13!,{R0-R1,R14}
39020
39030 LDR      R0,[R12,#save%]              ;This section sets up the details that
39040 STR      R0,[R12,#block%+0]           ;apply to all the icons.
39050 MOV      R0,#%1<<22
39060 STR      R0,[R12,#block%+8]
39070 STR      R0,[R12,#block%+12]
39080
39090 ADD      R1,R12,#block%
39100 MOV      R2,#10
39110
39120.shadesaveloop                         ;This loop greys out each icon in turn.
39130 STR      R2,[R12,#block%+4]
39140 SWI      "Wimp_SetIconState"
39150 CMP      R2,#12
39160  ADDNE    R2,R2,#1
39170  BNE      shadesaveloop
39180
39190LDMFD    R13!,{R0-R1,PC}^
39200
39210;-----------------------------------------------------------------------------
39220;                           *** UnshadeSave ***
39230; This subroutine ensures that the icons in the bottom part of the Save
39240; dialogue box are unshaded and selectable, when the 'Multiple' icon is
39250; selected.
39260
39270.UnshadeSave
39280
39290STMFD    R13!,{R0-R1,R14}
39300
39310 LDR      R0,[R12,#save%]              ;This section sets up the details that
39320 STR      R0,[R12,#block%+0]           ;that apply to all the icons.
39330 MOV      R0,#0
39340 STR      R0,[R12,#block%+8]
39350 MOV      R0,#%1<<22
39360 STR      R0,[R12,#block%+12]
39370 ADD      R1,R12,#block%
39380 MOV      R2,#10
39390
39400.unshadesaveloop                       ;This section unshades each icon in
39410 STR      R2,[R12,#block%+4]           ;turn.
39420 SWI      "Wimp_SetIconState"
39430 CMP      R2,#12
39440  ADDNE    R2,R2,#1
39450  BNE      unshadesaveloop
39460
39470LDMFD    R13!,{R0-R1,PC}^
39480
39490;-----------------------------------------------------------------------------
39500;                             *** WriteIcon ***
39510;This subroutine takes a string pointed to by R2 and copies it into the
39520;indirection buffer of the icon specified by R0/R1.
39530
39540.WriteIcon
39550;R0=WindowHandle
39560;R1=IconHandle
39570;R2=PointerToText
39580
39590STMFD    R13!,{R0-R8,R14}
39600
39610 MOV      R7,R0                        ;This section copies the parameters
39620 MOV      R6,R1                        ;into high numbered registers for later
39630 MOV      R5,R2                        ;use.
39640
39650 MOV      R0,R2                        ;This section finds the length of the
39660 MOV      R1,#13                       ;text string.
39670 SWI      "String_Len"
39680 MOV      R8,R1
39690
39700 STR      R7,[R12,#block%+0]           ;This section gets the icons details
39710 STR      R6,[R12,#block%+4]           ;which include the address of its
39720 ADD      R1,R12,#block%               ;indirection buffer.
39730 SWI      "Wimp_GetIconState"
39740
39750 LDR      R2,[R12,#block%+36]          ;This section ensures that the string
39760 CMP      R8,R2                        ;supplied is not longer than the icons
39770  MOVGT    R1,#13                      ;indirection buffer. If it is then the
39780  STRGT    R1,[R5,R2]                  ;string is truncated.
39790  MOVGT    R8,R2
39800
39810 MOV      R0,R5                        ;This section copies the string into
39820 LDR      R1,[R12,#block%+28]          ;the icons indirection buffer.
39830 MOV      R2,#13
39840 SWI      "String_Move$"
39850
39860 ADD     R1,R12,#block%                ;This section checks if the caret is in
39870 SWI     "Wimp_GetCaretPosition"       ;the icon that has been updated. If so
39880 LDR     R0,[R12,#block%+0]            ;the caret needs to be redrawn.
39890 LDR     R1,[R12,#block%+4]
39900 LDR     R2,[R12,#block%+20]
39910 CMP     R0,R7
39920  CMPEQ   R1,R6
39930   BNE     wicontinue
39940 CMP     R2,R8
39950  MOVGT   R5,R8
39960  MOVLE   R5,R2
39970 MVN     R4,#0
39980 SWI     "Wimp_SetCaretPosition"
39990
40000 .wicontinue                           ;This section ensures that the icon is
40010 ADD      R1,R12,#block%               ;redrawn by the Wimp after it has been
40020 STR      R7,[R12,#block%+0]           ;updated.
40030 STR      R6,[R12,#block%+4]
40040 MOV      R3,#0
40050 STR      R3,[R12,#block%+8]
40060 STR      R3,[R12,#block%+12]
40070 SWI      "Wimp_SetIconState"
40080
40090LDMFD    R13!,{R0-R8,PC}^
40100
40110;-----------------------------------------------------------------------------
40120;                             *** WriteIconNo ***
40130;This subroutine takes a value R2 and copies it's string equivilent into the
40140;indirection buffer of the icon specified by R0/R1.
40150
40160.WriteIconNo
40170;R0=Window Handle
40180;R1=Icon Handle
40190;R2=Value
40200
40210STMFD  R13!,{R0-R12,R14}
40220
40230MOV     R7,R0
40240MOV     R8,R1
40250
40260MOV     R0,R2
40270MOV     R1,R9
40280MOV     R2,#255
40290SWI     "OS_BinaryToDecimal"
40300
40310MOV     R0,#13
40320STRB    R0,[R9,R2]
40330
40340MOV     R0,R7
40350MOV     R1,R8
40360MOV     R2,R9
40370BL      WriteIcon
40380
40390LDMFD  R13!,{R0-R12,PC}^
40400
40410;-----------------------------------------------------------------------------
40420;                            *** ReadIcon ***
40430; This subroutine copies the contents of an icon into the buffer pointed to by
40440; R2.
40450
40460.ReadIcon
40470;R0=Window Handle
40480;R1=IconHandle
40490;R2=Pointer to buffer
40500
40510STMFD    R13!,{R0-R2,R14}
40520
40530 STR      R0,[R12,#block%+0]           ;This section gets the details of the
40540 STR      R1,[R12,#block%+4]           ;icon, including the address of it's
40550 ADD      R1,R12,#block%               ;indirection buffer which contains the
40560 SWI      "XWimp_GetIconState"         ;text string.
40570
40580 LDR      R0,[R12,#block%+28]          ;This section copies the string into
40590 MOV      R1,R2                        ;the specified buffer.
40600 MOV      R2,#13
40610 SWI      "String_Move$"
40620
40630LDMFD    R13!,{R0-R2,PC}^
40640
40650;-----------------------------------------------------------------------------
40660;                            *** ReadIconNo ***
40670; This subroutine copies the contents of an icon into the buffer pointed to by
40680; R2, converting it into a decimal integer.
40690
40700.ReadIconNo
40710;R0=Window Handle
40720;R1=IconHandle
40730
40740STMFD  R13!,{R0-R1,R3-R12,R14}
40750
40760MOV     R2,R9
40770BL      ReadIcon
40780
40790MOV     R0,#10
40800MOV     R1,R9
40810SWI     "OS_ReadUnsigned"
40820
40830LDMFD  R13!,{R0-R1,R3-R12,PC}^
40840
40850;-----------------------------------------------------------------------------
40860;                          *** Init ***
40870
40880.Init
40890
40900STMFD    R13!,{R0-R12,R14}
40910
40920 BL       InitMessages
40930
40940 LDR      R0,[R12,#display%]           ;This section ensures that the 'Not
40950 STR      R0,[R12,#block%+0]           ;Found' icon has its 'Deleted' bit set
40960 MOV      R0,#38                       ;so that it is initially not displayed.
40970 STR      R0,[R12,#block%+4]
40980 MOV      R0,#1<<23
40990 STR      R0,[R12,#block%+8]
41000 STR      R0,[R12,#block%+12]
41010 ADD      R1,R12,#block%
41020 SWI      "XWimp_SetIconState"
41030
41040 BL       ShadeSave
41050
41060 MOV      R0,#&4F                      ;This section trys to open the Search
41070 ADD      R1,R10,#searchfile           ;file. If it cannot be found a new one
41080 SWI      "XOS_Find"                   ;is created.
41090  STRVC    R0,[R10,#searchhandle%]
41100  BLVS     CreateSearchFile
41110  LDRVS    R0,[R10,#searchhandle%]
41120
41130 BL       CountRecords                 ;The number of records in the Search
41140 STR      R0,[R10,#searchmax%]         ;file is counted. If there are no
41150 CMP      R0,#0                        ;then the 'Last Search' icon is greyed
41160  LDREQ    R0,[R12,#display%]          ;out so that it cannot be selected by
41170  STREQ    R0,[R12,#block%+0]          ;the user.
41180  MOVEQ    R0,#27
41190  STREQ    R0,[R12,#block%+4]
41200  MOVEQ    R0,#%1<<22
41210  STREQ    R0,[R12,#block%+8]
41220  STREQ    R0,[R12,#block%+12]
41230  ADD      R1,R12,#block%
41240  SWI      "Wimp_SetIconState"
41250
41260 MOV      R0,#&4F                      ;This section opens the Indexfile.
41270 ADD      R1,R10,#indexfile
41280 SWI      "XOS_Find"
41290  BVS      noindex
41300 STR      R0,[R10,#indexhandle%]
41310 STR      R0,[R10,#filehandle%]
41320
41330 BL       CountRecords                 ;This section counts the number of
41340 STR      R0,[R10,#indexmax%]          ;records in the Indexfile.
41350 STR      R0,[R10,#max%]
41360 STR      R0,[R10,#record%]
41370 STR      R0,[R10,#indexrecord%]
41380
41390 MOV      R0,#1                        ;This section initialises the variables
41400 STR      R0,[R10,#show%]
41410 STR      R0,[R10,#searchrecord%]
41420
41430 MOV      R0,#2                        ;This section moves the Indexfile file
41440 LDR      R1,[R10,#indexhandle%]       ;pointer to the end of the file.
41450 SWI      "XOS_Args"
41460  BVS      noindex
41470 MOV      R0,#1
41480 SWI      "XOS_Args"
41490  BVS      noindex
41500
41510 LDR      R0,[R10,#record%]            ;This section reads in the latest
41520 MOV      R1,#2                        ;in the Indexfile.
41530 BL       GetRecords
41540
41550 MOV      R0,#0                        ;This section closes the indexfile.
41560 LDR      R1,[R10,#indexhandle%]       ;It is bad practice to leave file open
41570 SWI      "XOS_Find"                   ;ocross calls to Wimp_Poll
41580
41590 MOV      R0,#0                        ;This section closes the Searchfile
41600 LDR      R1,[R10,#searchhandle%]
41610 SWI      "XOS_Find"
41620
41630 BL       Update                       ;This updates the Display window.
41640
41650LDMFD    R13!,{R0-R12,PC}^
41660
41670;-----------------------------------------------------------------------------
41680;                      *** CreateSearchFile ***
41690; This subroutine is called when no Searchfile can be found during
41700; initialisation. It creates a blank Searchfile.
41710
41720.CreateSearchFile
41730
41740STMFD    R13!,{R0-R12,R14}
41750
41760 MOV      R0,#11                       ;This section creates an empty file
41770 ADD      R1,R10,#searchfile           ;of type &0AC (IndexFile).
41780 MOV      R2,#&0AC
41790 MOV      R4,#0
41800 MOV      R5,#0
41810 SWI      "XOS_File"
41820  BVS      nosearch
41830
41840 MOV      R0,#&4F                      ;This section opens the file.
41850 ADD      R1,R10,#searchfile
41860 SWI      "XOS_Find"
41870  BVS      nosearch
41880
41890 STR     R0,[R10,#searchhandle%]
41900
41910LDMFD    R13!,{R0-R12,PC}^
41920
41930;-----------------------------------------------------------------------------
41940;                          *** InitMessages ***
41950; This section opens the applications Messages file and creates look-up tables
41960; and Menu structures from the messages.
41970
41980.InitMessages
41990
42000STMFD    R13!,{R0-R12,R14}
42010
42020 MOV      R0,#0                        ;This section finds the upper memory
42030 MOV      R1,#0                        ;limit that can be accessed by our
42040 SWI      "XOS_ChangeEnvironment"      ;application.
42050  BVS      SeriousError
42060 SUB      R0,R1,#1
42070 BIC      R0,R0,#%11
42080
42090 FNLongAdr("",1,heap)                  ;This section asigns the memory between
42100 SUB      R3,R0,R1                     ;the end of the program and the end of
42110 MOV      R0,#0                        ;our application space to be used as a
42120 SWI      "XOS_Heap"                   ;Heap.
42130  BVS      SeriousError
42140
42150 ADR      R1,messagefilename           ;This section finds out how big the
42160 SWI      "XMessageTrans_FileInfo"     ;Messages file is and claims a heap
42170  BVS      nomessages                  ;block of the same size.
42180 MOV      R0,#2
42190 FNLongAdr("",1,heap)
42200 MOV      R3,R2
42210 SWI      "XOS_Heap"
42220  BLVS     noroom
42230  LDMVSFD  R13!,{R0-R12,PC}^
42240
42250 ADR      R0,messages                 ;This section opens the messages file
42260 ADR      R1,messagefilename          ;and loads it into the heap block.
42270 SWI      "XMessageTrans_OpenFile"
42280  BVS      nomessages
42290
42300 FNLongAdr("",0,messages)             ;The following section reads in the
42310 ADD      R8,R10,#months%             ;Month names from the file and builds
42320 MOV      R9,#0                       ;up a look-up table of names.
42330
42340 .IMloop1
42350 ADD      R1,R8,R9
42360 MOV      R2,R1
42370 MOV      R3,#&10
42380
42390 SWI      "XMessageTrans_Lookup"
42400  BVS      NonSeriousError ;nomessages
42410 MOV      R7,#13
42420 STRB      R7,[R2,R3]
42430 CMP      R9,#&C0
42440  ADDNE    R9,R9,#&10
42450  BNE      IMloop1
42460
42470 MOV      R0,#2                       ;This section claims space for the
42480 FNLongAdr("",1,heap)                 ;iconbar menu structure.
42490 MOV      R3,#72
42500 SWI      "XOS_Heap"
42510  BLVS     noroom
42520 LDMVSFD   R13!,{R0-R12,PC}^
42530 FNLongAdr("",8,menulist)
42540 STR      R2,[R8,#0]
42550
42560 FNLongAdr("",0,messages)             ;This section creates the iconbar menu
42570 FNLongAdr("",1,ibmenu%)              ;structure.
42580 MOV      R3,#72
42590 SWI      "XMessageTrans_MakeMenus"
42600  BVS      nomessages
42610
42620 MOV      R0,#2                       ;This section claims space for the Main
42630 FNLongAdr("",1,heap)                 ;menu structure.
42640 MOV      R3,#148
42650 SWI      "XOS_Heap"
42660  BLVS     noroom
42670  LDMVSFD  R13!,{R0-R12,PC}^
42680 STR      R2,[R8,#4]
42690
42700 FNLongAdr("",0,messages)             ;This section creates the Main menu
42710 FNLongAdr("",1,mainmenu%)            ;structure.
42720 MOV      R3,#148
42730 SWI      "XMessageTrans_MakeMenus"
42740  BVS      nomessages
42750
42760 MOV      R0,#2                      ;This section claims space for the Topic
42770 FNLongAdr("",1,heap)                ;menu structure.
42780 MOV      R3,#820
42790 SWI      "XOS_Heap"
42800  BLVS     noroom
42810  LDMVSFD  R13!,{R0-R12,PC}^
42820 STR      R2,[R8,#8]
42830
42840 ADD      R1,R2,R3                   ;This section fills in the details of the
42850 SUB      R1,R1,#12                  ;last item on the topic menu which is a
42860 FNLongAdr("",7,writeabletext)       ;writeable menu option.
42870 MOV      R6,#0
42880 MOV      R5,#256
42890 STR      R7,[R1],#4
42900 STR      R6,[R1],#4
42910 STR      R5,[R1]
42920
42930 FNLongAdr("",0,messages)            ;This section creates the Topic menu
42940 FNLongAdr("",1,topicmenu%)          ;structure.
42950 MOV      R3,#820
42960 SWI      "XMessageTrans_MakeMenus"
42970  BVS      nomessages
42980
42990 LDR      R1,[R12,#info%]            ;This section puts the Info window
43000 LDR      R0,[R8,#0]                 ;handle in the Main menu structure as a
43010 STR      R1,[R0,#32]                ;a pointer to a sub-menu.
43020 LDR      R0,[R8,#4]
43030 STR      R1,[R0,#32]
43040
43050 LDR      R1,[R12,#search%]          ;This section puts the Search and Save
43060 STR      R1,[R0,#56]                ;window handles into the Main menu
43070 LDR      R1,[R12,#save%]            ;structure as pointers to sub-menus.
43080 STR      R1,[R0,#104]
43090
43100LDMFD    R13!,{R0-R12,PC}^
43110
43120;-----------------------------------------------------------------------------
43130; This section contains the pathname of the Meassages file.
43140
43150.messagefilename
43160EQUS     "<AUIndex$Resource>.Messages"
43170EQUB     0
43180ALIGN
43190
43200;-----------------------------------------------------------------------------
43210; This section contains a Message file descriptor which is used to information
43220; about the Messages file.
43230
43240.messages
43250EQUD     0
43260EQUD     0
43270EQUD     0
43280EQUD     0
43290EQUD     0
43300ALIGN
43310
43320;-----------------------------------------------------------------------------
43330;                          *** CountRecords ***
43340; This section counts the number of records in the file specified in R0.
43350
43360.CountRecords
43370
43380;On Entry
43390;R0=filehandle
43400;
43410;On Exit
43420;R0=No. records in file
43430
43440STMFD    R13!,{R1-R12,R14}
43450
43460 MOV      R1,R0                      ;This section finds the length of the
43470 MOV      R0,#2                      ;file.
43480 SWI      "XOS_Args"
43490  BVS      norecords
43500
43510 MOV      R0,R2                      ;This section divides the length of the
43520 MOV      R1,#88                     ;file by the length of a record, 88 bytes
43530 BL       Divide                     ;to find the number of records.
43540 MOV      R0,R2
43550
43560LDMFD    R13!,{R1-R12,PC}^
43570
43580;-----------------------------------------------------------------------------
43590;                          *** GetRecords ***
43600; This subroutine reads in a number of records in the direction specified by
43610; R1. The routine only reads in 1 record but skips the specified number of
43620; records inbetween.
43630
43640.GetRecords
43650
43660;On Entry
43670;R0=No. Of Records to read
43680;R1=Direction  0-next
43690;              1-last
43700;              2-Read specified record
43710
43720STMFD    R13!,{R0-R12,R14}
43730
43740 MOV      R5,R0                      ;This section copies the parameters into
43750 MOV      R4,R1                      ;high numbered registers for later use.
43760 LDR      R8,[R10,#record%]
43770 LDR      R7,[R10,#max%]
43780
43790 CMP      R4,#1                      ;This section checks which direction to
43800  BEQ      backwards                 ;read in.
43810 CMP      R4,#2
43820  MOVEQ    R8,R0
43830  BEQ      readrecord
43840
43850  CMP      R8,R7                     ;This section counts forward the
43860   MOVEQ    R8,#0                    ;specified number of records.
43870  ADD      R8,R8,R5
43880  CMP      R8,R7
43890   MOVGT    R8,R7
43900
43910  B        readrecord                ;Forward branch
43920
43930  .backwards
43940  CMP      R8,#1                     ;This section counts backwards the
43950   MOVEQ    R8,R7                    ;specofied number of records.
43960   ADDEQ    R8,R8,#1
43970  SUB      R8,R8,R5
43980  CMP      R8,#1
43990   MOVLT    R8,#1
44000
44010 .readrecord
44020 SUB      R8,R8,#1                   ;This section multiplies the target
44030 MOV      R2,   R8, LSL #3           ;record number by 88 to find the position
44040 ADD      R2,R2,R8, LSL #4           ;in the file where it starts.
44050 ADD      R2,R2,R8, LSL #6
44060
44070 MOV      R0,#1                      ;This section moves the filepointer to
44080 LDR      R1,[R10,#filehandle%]      ;the correct position in the file.
44090 SWI      "OS_Args"
44100  BVS      norecords
44110
44120 ADD      R0,R10,#record             ;This section reads in the record up to
44130 LDR      R1,[R10,#filehandle%]      ;the end of the last field.
44140 MOV      R2,#256
44150 MOV      R3,#13
44160 MOV      R4,#0
44170 SWI      "String_Get$#"
44180  BVS      norecords
44190
44200 ADD      R8,R8,#1                   ;This section updates the current record
44210 STR      R8,[R10,#record%]          ;number.
44220
44230LDMFD    R13!,{R0-R12,PC}^
44240
44250;-----------------------------------------------------------------------------
44260;                             *** Update ***
44270; This subroutine takes the record stored in the Record buffer and isolates
44280; each field in turn to update each of the icons in the Display window.
44290.Update
44300
44310STMFD    R13!,{R0-R12,R14}
44320
44330 LDR      R8,[R12,#display%]
44340 ADD      R7,R10,#record
44350 LDR      R6,[R10,#record%]
44360 LDR      R5,[R10,#max%]
44370
44380 MOV      R0,R6                      ;Record Number
44390 MOV      R1,R9
44400 MOV      R2,#256
44410 SWI      "OS_ConvertInteger4"
44420 MOV      R2,#13
44430 STRB     R2,[R1,#1]
44440 MOV      R0,R8
44450 MOV      R1,#28
44460 MOV      R2,R9
44470 BL       WriteIcon
44480
44490 MOV      R0,R5                      ;Maximum Record Number
44500 MOV      R1,R9
44510 MOV      R2,#256
44520 SWI      "OS_ConvertInteger4"
44530 MOV      R2,#13
44540 STRB     R2,[R1,#1]
44550 MOV      R0,R8
44560 MOV      R1,#29
44570 MOV      R2,R9
44580 BL       WriteIcon
44590                                     ;Month of Issue
44600 MOV      R0,R7
44610 ADD      R1,R10,#backslash
44620 MOV      R2,#13
44630 MOV      R3,#0
44640 SWI      "String_Instr"
44650 MOV      R0,R7
44660 MOV      R1,R9
44670 MOV      R2,#13
44680 MOV      R4,#0
44690 SWI      "String_Mid$"
44700 MOV      R0,R1
44710 MOV      R1,#13
44720 SWI      "String_Val"
44730 STR      R1,[R10,#displaymonth%]
44740 MOV      R2,#months%-&10
44750 ADD      R2,R2,R1,LSL #4
44760 ADD      R2,R10,R2
44770 MOV      R1,#32
44780 MOV      R0,R8
44790 BL       WriteIcon
44800
44810
44820 ADD      R4,R3,#1                   ;Year Of Issue
44830 MOV      R0,R7
44840 ADD      R1,R10,#backslash
44850 MOV      R2,#13
44860 ADD      R3,R3,#1
44870 SWI      "String_Instr"
44880 MOV      R5,R3
44890 MOV      R1,R9
44900 MOV      R0,R7
44910 MOV      R2,#13
44920 SUB      R3,R3,R4
44930 SWI      "String_Mid$"
44940 MOV      R0,R8
44950 MOV      R1,#33
44960 MOV      R2,R9
44970 BL       WriteIcon
44980
44990                                     ;Issue Number
45000 MOV      R3,R5
45010 ADD      R4,R3,#1
45020 MOV      R0,R7
45030 ADD      R1,R10,#backslash
45040 MOV      R2,#13
45050 ADD      R3,R3,#1
45060 SWI      "String_Instr"
45070 MOV      R5,R3
45080 MOV      R0,R7
45090 MOV      R1,R9
45100 MOV      R2,#13
45110 SUB      R3,R3,R4
45120 SWI      "String_Mid$"
45130 MOV      R0,R8
45140 MOV      R1,#34
45150 MOV      R2,R9
45160 BL       WriteIcon
45170
45180                                     ;Page Number
45190 MOV      R3,R5
45200 ADD      R4,R3,#1
45210 MOV      R0,R7
45220 ADD      R1,R10,#backslash
45230 MOV      R2,#13
45240 ADD      R3,R3,#1
45250 SWI      "String_Instr"
45260 MOV      R5,R3
45270 MOV      R0,R7
45280 MOV      R1,R9
45290 MOV      R2,#13
45300 SUB      R3,R3,R4
45310 SWI      "String_Mid$"
45320 MOV      R0,R8
45330 MOV      R1,#35
45340 MOV      R2,R9
45350 BL       WriteIcon
45360
45370 MOV      R3,R5                      ;Topic Of Article
45380 ADD      R4,R3,#1
45390 MOV      R0,R7
45400 ADD      R1,R10,#backslash
45410 MOV      R2,#13
45420 ADD      R3,R3,#1
45430 SWI      "String_Instr"
45440 MOV      R5,R3
45450 MOV      R0,R7
45460 MOV      R1,R9
45470 MOV      R2,#13
45480 SUB      R3,R3,R4
45490 SWI      "String_Mid$"
45500 MOV      R0,R8
45510 MOV      R1,#30
45520 MOV      R2,R9
45530 BL       WriteIcon
45540
45550 MOV      R0,R7                      ;Description Of Article.
45560 MOV      R1,#13
45570 SWI      "String_Len"
45580 MOV      R0,R5
45590 SUB      R3,R1,R0
45600 SUB      R3,R3,#1
45610 MOV      R0,R7
45620 MOV      R1,R9
45630 MOV      R2,#13
45640 SWI      "String_Right$"
45650 MOV      R0,R8
45660 MOV      R1,#31
45670 MOV      R2,R9
45680 BL       WriteIcon
45690
45700LDMFD    R13!,{R0-R12,PC}^
45710
45720;-----------------------------------------------------------------------------
45730;                            *** Divide ***
45740; This subroutine performs an integer division using R0 and R1. This routine
45750; has been adapted from an algorithm by Peter Cockerell.
45760
45770.Divide
45780; Performs R2=R0 DIV R1
45790; and      R3=R0 MOD R1
45800
45810STMFD    R13!,{R0-R1,R4-R12,R14}
45820
45830 CMP      R1,#0                      ;Trap Division by Zero errors.
45840  BEQ      divbyzero
45850
45860 MOV      R2,#0                      ;Initialise registers.
45870 MOV      R3,#0
45880 MOV      R4,#32                     ;Initialise counter.
45890
45900 .divloop1
45910  SUBS     R4,R4,#1                  ;Shift R0 until first set bit is in bit
45920   LDMEQFD  R13!,{R0-R1,R4-R12,PC}^  ;31. If the couter reaches 0 first then
45930  MOVS     R0,R0,ASL #1              ;R0 was zero to start with.
45940   BPL      divloop1
45950
45960 .divloop2
45970  MOVS     R0,R0,ASL #1              ;Shift top bit of R0 into R3
45980  ADC      R3,R3,R3                  ;This value is then subtracted from R1 if
45990  CMP      R3,R1                     ;it does not produce a negative result.
46000   SUBCS    R3,R3,R1
46010
46020  ADC      R2,R2,R2                  ;Repeat for each significant bit of R0.
46030  SUBS     R4,R4,#1
46040   BNE      divloop2
46050
46060LDMFD    R13!,{R0-R1,R4-R12,PC}^
46070
46080;-----------------------------------------------------------------------------
46090;                      *** Error Handling Routines ***
46100;-----------------------------------------------------------------------------
46110;This subroutine deals with Division By Zero errors.
46120
46130 .divbyzero
46140
46150LDMFD    R13!,{R0-R1,R4-R12,R14}     ;This section simply reports the error
46160 ADR      R0,divbyzeroerror          ;to the user.
46170 MOV      R1,#3
46180 MOV      R2,#0
46190 SWI      "Wimp_ReportError"
46200MOV      PC,R14
46210
46220;-----------------------------------------------------------------------------
46230; This section contains the string used in the DivByZero error message.
46240
46250.divbyzeroerror
46260EQUD    0
46270EQUS    "Division By Zero"
46280EQUB    0
46290ALIGN
46300
46310;-----------------------------------------------------------------------------
46320;This section deals with not being able to access the Indexfile.
46330
46340.noindex
46350 ADR      R0,noindexerror
46360 FNLongAdr("",1,messages)
46370 MOV      R2,#0
46380 SWI      "XMessageTrans_ErrorLookup"
46390 B        SeriousError
46400
46410;-----------------------------------------------------------------------------
46420; This section contains the Message Token for the NoIndex error.
46430
46440.noindexerror
46450EQUD     0
46460EQUS     "NoIndex"
46470EQUB     0
46480ALIGN
46490
46500;-----------------------------------------------------------------------------
46510;This section deals with not being able to access the Indexfile for update.
46520
46530.cantupdate
46540 MOV      R0,#0
46550 STR      R0,[R10,#updating%]
46560 LDR      R0,[R12,#update%]
46570 STR      R0,[R12,#block%+0]
46580 ADD      R1,R12,#block%
46590 SWI      "Wimp_CloseWindow"
46600
46610 ADR      R0,cantupdateerror
46620 FNLongAdr("",1,messages)
46630 MOV      R2,#0
46640 SWI      "XMessageTrans_ErrorLookup"
46650 B        NonSeriousError
46660
46670;-----------------------------------------------------------------------------
46680; This section contains the Message Token for the cantupdate error.
46690
46700.cantupdateerror
46710EQUD     0
46720EQUS     "CantUpdate"
46730EQUB     0
46740ALIGN
46750;-----------------------------------------------------------------------------
46760; This section deals with not being able to access the Searchfile.
46770
46780.nosearch
46790 ADR      R0,nosearcherror
46800 FNLongAdr("",1,messages)
46810 MOV      R2,#0
46820 SWI      "XMessageTrans_ErrorLookup"
46830 B        SeriousError
46840
46850;-----------------------------------------------------------------------------
46860; This section contains the Message Token for the NoSearch error.
46870
46880.nosearcherror
46890EQUD     0
46900EQUS     "NoSearch"
46910EQUB     0
46920ALIGN
46930
46940;-----------------------------------------------------------------------------
46950; This section produces an error when the Indexfile contains no records.
46960
46970.norecords
46980 ADR      R0,norecordserror
46990 FNLongAdr("",1,messages)
47000 MOV      R2,#0
47010 SWI      "XMessageTrans_ErrorLookup"
47020 B        SeriousError
47030
47040;-----------------------------------------------------------------------------
47050; This section contains the Message Token for the NoRecords error.
47060
47070.norecordserror
47080EQUD     0
47090EQUS     "NoRecords"
47100EQUB     0
47110ALIGN
47120
47130;-----------------------------------------------------------------------------
47140; This section deals with not being able to access a file that is to be
47150; merged with the index.
47160
47170.noinput
47180STMFD    R13!,{R0-R12,R14}
47190
47200 ADR      R0,noinputerror
47210 FNLongAdr("",1,messages)
47220 MOV      R2,#0
47230 SWI      "XMessageTrans_ErrorLookup"
47240 B        NonSeriousError
47250
47260;-----------------------------------------------------------------------------
47270; This section contains the Message Token for the NoInput error.
47280
47290.noinputerror
47300EQUD     0
47310EQUS     "NoInput"
47320EQUB     0
47330ALIGN
47340
47350;-----------------------------------------------------------------------------
47360; This section deals with not being able to open a file that is to be used to
47370; save out records to.
47380
47390.nooutput
47400STMFD    R13!,{R0-R12,R14}
47410
47420 ADR      R0,nooutputerror
47430 FNLongAdr("",1,messages)
47440 MOV      R2,#0
47450 SWI      "XMessageTrans_ErrorLookup"
47460 B        NonSeriousError
47470
47480;-----------------------------------------------------------------------------
47490; This section contains the Message Token for the NoOutput error.
47500
47510.nooutputerror
47520EQUD     0
47530EQUS     "NoOutput"
47540EQUB     0
47550ALIGN
47560
47570;-----------------------------------------------------------------------------
47580; This section deals with not being able to open a Scrapfile.
47590
47600.noscrapfile
47610STMFD     R13!,{R0-R12,R14}
47620
47630 ADR      R0,noscrapfileerror
47640 FNLongAdr("",1,messages)
47650 MOV      R2,#0
47660 SWI      "XMessageTrans_ErrorLookup"
47670 B        NonSeriousError
47680
47690;-----------------------------------------------------------------------------
47700; This section contains the Message Token for the NoScrapFile error.
47710
47720.noscrapfileerror
47730EQUD     0
47740EQUS     "NoScrapFile"
47750EQUB     0
47760ALIGN
47770
47780;-----------------------------------------------------------------------------
47790; This section deals with not being able to access the Messages file.
47800
47810.nomessages
47820 ADR      R0,nomessageserror
47830 B        SeriousError
47840
47850;-----------------------------------------------------------------------------
47860; This section contains the NoMessages error message.
47870
47880.nomessageserror
47890EQUD     0
47900EQUS     "AUIndex is unable to"
47910EQUS     " access its Messages file"
47920EQUS     " and must exit immediately"
47930EQUB     0
47940ALIGN
47950
47960;-----------------------------------------------------------------------------
47970; This section deals with not being able to access our Heap.
47980
47990.noheap
48000 ADR      R0,noheaperror
48010 FNLongAdr("",1,messages)
48020 MOV      R2,#0
48030 SWI      "XMessageTrans_ErrorLookup"
48040 B        SeriousError
48050
48060;-----------------------------------------------------------------------------
48070; This section contains the Message Token for the NoHeap error.
48080
48090.noheaperror
48100EQUD     0
48110EQUS     "NoHeap"
48120EQUB     0
48130ALIGN
48140
48150;-----------------------------------------------------------------------------
48160; This section deals with not being able to claim a large enough Heap block.
48170
48180.noroom
48190 ADR      R0,noroomerror
48200 FNLongAdr("",1,messages)
48210 MOV      R2,#0
48220 SWI      "XMessageTrans_ErrorLookup"
48230 B        NonSeriousError
48240
48250;-----------------------------------------------------------------------------
48260; This section contains the Message Token for the NoRoom error.
48270
48280.noroomerror
48290EQUD     0
48300EQUS     "NoRoom"
48310EQUB     0
48320ALIGN
48330
48340;-----------------------------------------------------------------------------
48350; This section tidies up after a non serious error has occurred. It reports
48360; the error to the user and closes any open files.
48370
48380.NonSeriousError
48390
48400 MOV      R1,#%1
48410 ADD      R2,R12,#appname
48420 SWI      "Wimp_ReportError"
48430
48440 MOV      R0,#0
48450 LDR      R1,[R10,#indexhandle%]
48460 SWI      "XOS_Find"
48470 LDR      R1,[R10,#searchhandle%]
48480 SWI      "XOS_Find"
48490
48500LDMFD    R13!,{R0-R12,PC}^
48510
48520;-----------------------------------------------------------------------------
48530; This section closes down our task after an unrecoverable error has occured.
48540
48550.SeriousError
48560
48570 MOV      R1,#%1
48580 ADD      R2,R12,#appname
48590 SWI      "Wimp_ReportError"
48600 SWI      "OS_Exit"
48610
48620;-----------------------------------------------------------------------------
48630.heap
48640]
48650NEXT
48660OSCLI" BreakSet "+STR$~(breakpoint)
48670OSCLI  "SAVE ""<AUIndex$Dir>.!RunImage"" "+STR$~(code%)+" "+STR$~(P%)
48680OSCLI  "SetType <AUIndex$Dir>.!RunImage Absolute"
48690CALL code%
48700END
48710
48720;-----------------------------------------------------------------------------
48730;                         *** LongAdr ***
48740; This function is a macro which assembles code to emulate the ADR directive
48750; for addresses greater than 4096 bytes away from the PC.
48760; ADD and SUB instructions can only use immediate values with up to 8
48770; significant bits,so two instructions are used.
48780
48790DEFFNLongAdr(condition$,reg%,pointer%)
48800
48810 IF ABS(pointer%-P%)>65536 THEN
48820  ERROR 1,"LongAdr only works for addresses within �64 KBytes at &"+STR$(~P%)
48830 ENDIF
48840
48850 IF condition$="" THEN condition$="AL"
48860 cc%=INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",condition$)
48870
48880 IF cc%=0 THEN
48890  ERROR 1, "Bad Condition Code in LongAdr at &"+STR$(~P%)
48900 ENDIF
48910
48920 cc%=(cc%-1) DIV 2
48930
48940 diff%=pointer%-(P%+8)
48950
48960 op1%=(cc%<<28)
48970 op1%+=&024F0000
48980 op1%+=(reg%<<12)
48990 op1%+=ABS(diff%) AND &FF
49000
49010 op2%=(cc%<<28)
49020 op2%+=&02400C00
49030 op2%+=(reg%<<16)
49040 op2%+=(reg%<<12)
49050 op2%+=ABS(diff%)>>8 AND &FF
49060
49070 IF diff%>=0 THEN
49080  op1%+=4<<20
49090  op2%+=4<<20
49100 ENDIF
49110
49120 [OPT pass%
49130 EQUD      op1%                        ;Assemble the two instructions
49140 EQUD      op2%
49150 ]
49160
49170=0

&�     Name : AUIndex (Source Code)
5�  Purpose : Easy Location Of Acorn User Articles
-�   Author : (c) The Flying Twig, 1994-96
(�           AKA Paul Burns
2#�  Version : 1.00 (20 Dec 1995)
<
F� :� �$;" at line ";�:�
P
ZE� code%  1024*28                     :� reserve 28k for assembler
d
nP�---------------------------------------------------------------------------
x
�� pass%=0�2 �2
�P%=code%
�
[OPTpass%
�
�AB       getstack                        ;Set up Stack Pointer
�
�
.continue
�
�STMFD   R13!,{R0-R12}
�
�@ �LongAdr("",11,menu%)                 ;Pointer to Menu Data
�A ADR     R12,data%                      ;Pointer to Wimp Data
�D ADD     R10,R12,#&1E00                 ;Pointer to Program Data
J ADD     R9,R10,#&300                   ;Pointer to Misc String buffer
 B       Start

"R;-----------------------------------------------------------------------------
,8; This section reserves space for Data (&2300 bytes)
6
@
.data%
J]
T
^� i =0 � &2300 � 4
h [OPT pass%
r  EQUD    0
| ]
��
�
�P�---------------------------------------------------------------------------
�M� This section sets up variables as offsets within the workspace to allow
�� easy reference to data.
�
��  Wimp Data Labels
�
�version%=&00
�
task%=&04
�iconbar%=&08
�display%=&0C
�
info%=&10
search%=&14

edit%=&18

save%=&1C
&*quit%=&20               :data%!quit%=0
0currentmenu%=&24
:Ntemplates=&28           :$(data%+templates)="<AUIndex$Resource>.Templates"
D;spritename=&45          :$(data%+spritename)="!AUIndex"
Nappname=&46
X1edit=&50                :$(data%+edit)="edit"
b7display=&55             :$(data%+display)="display"
l1info=&5E                :$(data%+info)="info"
v5search=&63              :$(data%+search)="search"
�1save=&6A                :$(data%+save)="save"
�Bversion=&70             :$(data%+version)="1.00 (20 Dec 1995)"
�:block%=&84              :$(data%+block%+24)="!AUIndex"
�fonts%=&190
�5update=&290             :$(data%+update)="update"
�update%=&298
�icons%=&3A0
�templates%=&1200
�
�indexdata%=data%+&1E00
�
�,�  Data Labels for Program Specific Data
�
indexhandle%=&00
searchhandle%=&04
indexmax%=&08
 searchmax%=&0C
*
show%=&10
4filehandle%=&14
>indexrecord%=&18
Hsearchrecord%=&1C
Rrecord%=&20
\max%=&24
fRsearchfile=&28          :$(indexdata%+searchfile)="<Wimp$ScrapDir>.SearchFile"
pSindexfile=&46           :$(indexdata%+indexfile)="<AUIndex$Resource>.IndexFile"
z8backslash=&66           :$(indexdata%+backslash)="\"
�editmonth%=&68
�displaymonth%=&6C
�6multiple%=&70           :!(indexdata%+multiple%)=0
�editrecord%=&74
�scrapref%=&78
�)updating%=&7C           :!updating%=0
�months%=&130
�#$(indexdata%+months%+&00)="Jan"
�#$(indexdata%+months%+&10)="Feb"
�#$(indexdata%+months%+&20)="Mar"
�#$(indexdata%+months%+&30)="Apr"
�#$(indexdata%+months%+&40)="May"
�#$(indexdata%+months%+&50)="Jun"
#$(indexdata%+months%+&60)="Jul"
#$(indexdata%+months%+&70)="Aug"
#$(indexdata%+months%+&80)="Sep"
$#$(indexdata%+months%+&90)="Oct"
.#$(indexdata%+months%+&A0)="Nov"
8#$(indexdata%+months%+&B0)="Dec"
B$$(indexdata%+months%+&C0)="Xmas"
Lrecord=&200
V
`P�---------------------------------------------------------------------------
j=� This section reserves space for the stack (&100 bytes).
t
~� i= 0 � &100 �4
� [OPT pass%
�  EQUD    0
� ]
��
�
�P�---------------------------------------------------------------------------
�-�  Save Link and Stack Pointer onto stack
�
�[OPT pass%
�	ALIGN
�
�
.getstack
STR     R14,getstack-4

STR     R13,getstack-8
ADR     R13,getstack-8
B       continue
(
2R;-----------------------------------------------------------------------------
<; MenuData
F@; This section sets up Menu Templates which can be passed to
PJ; "MessageTrans_MakeMenu" to create a menu structure using the strings
Z$; supplied in the Messages file.
d
n
.menulist
xQEQUD    0                              ;This reserves three words for storing
�NEQUD    0                              ;the address of the Menu structures
�BEQUD    0                              ;when they are created.
�
�
.menu%
�.ibmenu%
�JEQUS    "IM0"+�0                    ;Message Token for the menu title.
�IEQUB    7                              ;Menu Title foreground colour.
�IEQUB    2                              ;Menu Title background colour.
�MEQUB    7                              ;Menu work area foreground colour.
�MEQUB    0                              ;Menu work area background colour.
�SEQUB    44                             ;Height of each menu item (in OS units).
�LEQUB    0                              ;Vertical gap between menu items.
�

JEQUS    "IM1"+�0                    ;Message Token for first menu item
	ALIGN
";EQUD    0                              ;Menu Item flags
,;EQUD    0                              ;Submenu pointer
66EQUD    &7000021                       ;Icon flags
@
JKEQUS    "IM2"+�0                    ;Message Token for second menu item
T	ALIGN
^KEQUD    &80                            ;Menu Item flags (&80=last item)
h;EQUD    0                              ;Submenu pointer
r6EQUD    &7000021                       ;Icon flags
|
�<EQUB    0                              ;terminating byte
�	ALIGN
�
�.mainmenu%
�JEQUS    "MM0"+�0                    ;Message Token for the menu title.
�IEQUB    7                              ;Menu Title foreground colour.
�IEQUB    2                              ;Menu Title background colour.
�MEQUB    7                              ;Menu work area foreground colour.
�MEQUB    0                              ;Menu work area background colour.
�SEQUB    44                             ;Height of each menu item (in OS units).
�LEQUB    0                              ;Vertical gap between menu items.
�
�JEQUS    "MM1"+�0                    ;Message Token for first menu item
	ALIGN
;EQUD    0                              ;Menu Item flags
;EQUD    0                              ;Submenu pointer
&6EQUD    &7000021                       ;Icon flags
0
:KEQUS    "MM2"+�0                    ;Message Token for second menu item
D	ALIGN
N;EQUD    0                              ;Menu Item flags
X;EQUD    0                              ;Submenu pointer
b6EQUD    &7000021                       ;Icon flags
l
v
�JEQUS    "MM3"+�0                    ;Message Token for third menu item
�	ALIGN
�;EQUD    0                              ;Menu Item flags
�;EQUD    0                              ;Submenu pointer
�6EQUD    &7000021                       ;Icon flags
�
�KEQUS    "MM4"+�0                    ;Message Token for fourth menu item
�	ALIGN
�;EQUD    0                              ;Menu Item flags
�;EQUD    0                              ;Submenu pointer
�6EQUD    &7000021                       ;Icon flags
�
�JEQUS    "MM5"+�0                    ;Message Token for fifth menu item
	ALIGN
KEQUD    &80                            ;Menu Item flags (&80=last item)
;EQUD    0                              ;Submenu pointer
 6EQUD    &7000021                       ;Icon flags
*
4<EQUB    0                              ;Terminating byte
>	ALIGN
H
R.topicmenu%
\JEQUS    "TM0"+�0                    ;Message Token for the menu title.
fIEQUB    7                              ;Menu Title foreground colour.
pIEQUB    2                              ;Menu Title background colour.
zMEQUB    7                              ;Menu work area foreground colour.
�MEQUB    0                              ;Menu work area background colour.
�SEQUB    44                             ;Height of each menu item (in OS units).
�LEQUB    0                              ;Vertical gap between menu items.
�
�]
�� i=1 � 32
�[OPT pass%
�
�EEQUS    "TM"+�(i)+�0             ;Message Token for ith menu item
�	ALIGN
�;EQUD    0                              ;Menu Item flags
�;EQUD    0                              ;Submenu pointer
�6EQUD    &7000121                       ;Icon flags
	
	]
	�
	$[OPT pass%
	.
	8IEQUS    "TM33"+�0                   ;Message Token for 33rd menu item
	B	ALIGN
	LTEQUD    &84                            ;Menu Item flags(&84=Writeable/last item)
	V;EQUD    0                              ;Submenu pointer
	`EQUD    &7000121
	j
	t<EQUB    0                              ;Terminating byte
	~	ALIGN
	�
	�
	�.writeabletext
	�]
	�� i=0�256 �4
	� [OPT pass%
	�R  EQUD    0                            ;256 byte array for text from writeable
	�6                                       ;menu item.
	� ]
	��
	�
	�P�---------------------------------------------------------------------------
� Program code starts here


[OPT pass%

(
.Start
2
<R;-----------------------------------------------------------------------------
F8;                            *** Initialise Wimp ***
PP; This section calls the Window Manager which will return its version number
Z!; and our unique Task handle.
d
nGMOV     R0,#200                        ;Minimum Version Number *100
x2MOV     R1,   #&4B000000               ;"TASK"
�ADD     R1,R1,#&00530000
�ADD     R1,R1,#&00004100
�ADD     R1,R1,#&00000054
�JADD     R2,R12,#appname                ;Name to appear on Task Display
�SWI     "XWimp_Initialise"
� BVS     SeriousError
�DSTR     R0,[R12,#version%]             ;Wimp Version number *100
�;STR     R1,[R12,#task%]                ;Our Task handle
�
�R;-----------------------------------------------------------------------------
�7; This subroutine sets up our icon on the icon bar.
�
�PMVN     R0,#0                          ;Window handle (-1 Left side of IBar)
STR     R0,[R12,#block%+0]
5MOV     R0,#0                          ;Minimum X
STR     R0,[R12,#block%+4]
"5MOV     R0,#0                          ;Minimum Y
,STR     R0,[R12,#block%+8]
65MOV     R0,#170                        ;Maximum X
@STR     R0,[R12,#block%+12]
J5MOV     R0,#68                         ;Maximum Y
TSTR     R0,[R12,#block%+16]
^6MOV     R0,   #&3000                   ;Icon flags
hADD     R0,R0,#&0002
rSTR     R0,[R12,#block%+20]
|ADD     R1,R12,#block%
�SWI     "XWimp_CreateIcon"
� BVS     SeriousError
�@STR     R0,[R12,#iconbar%]             ;Icon bar icon number
�
�R;-----------------------------------------------------------------------------
�K; This section loads the window template files and creates the windows.
�
�ADD     R1,R12,#templates
� SWI     "XWimp_OpenTemplate"
� BVS     SeriousError
�CADD     R1,R12,#templates%             ;Space for template data
�JADD     R2,R12,#icons%                 ;Space for indirected Icon data
�MADD     R3,R2,#templates%-icons%       ;Size of space for indirected data
EADD     R4,R12,#fonts%                 ;256 byte font count array

?ADD     R5,R12,#display                ;Main Display Window
&LMOV     R6,#0                          ;Template to start searching from
0 SWI     "XWimp_LoadTemplate"
: BVS     SeriousError
D SWI     "XWimp_CreateWindow"
N BVS     SeriousError
XASTR     R0,[R12,#display%]             ;Display window handle
b
l=ADD     R5,R12,#info                   ;Info Dialogue box
vMOV     R6,#0
� SWI     "XWimp_LoadTemplate"
� BVS     SeriousError
� SWI     "XWimp_CreateWindow"
� BVS     SeriousError
�>STR     R0,[R12,#info%]                ;Info window handle
�
�?ADD     R5,R12,#search                 ;Search Dialogue box
�MOV     R6,#0
� SWI     "XWimp_LoadTemplate"
� BVS     SeriousError
� SWI     "XWimp_CreateWindow"
� BVS     SeriousError
�@STR     R0,[R12,#search%]              ;Search window handle



7ADD     R5,R12,#edit                   ;Edit window

MOV     R6,#0

  SWI     "XWimp_LoadTemplate"

* BVS     SeriousError

4 SWI     "XWimp_CreateWindow"

> BVS     SeriousError

H>STR     R0,[R12,#edit%]                ;Edit window handle

R

\=ADD     R5,R12,#save                   ;Save Dialogue box

fMOV     R6,#0

p SWI     "XWimp_LoadTemplate"

z BVS     SeriousError

� SWI     "XWimp_CreateWindow"

� BVS     SeriousError

�>STR     R0,[R12,#save%]                ;Save window handle

�

�

�AADD     R5,R12,#update                   ;Update Dialogue box

�MOV     R6,#0

� SWI     "XWimp_LoadTemplate"

� BVS     SeriousError

� SWI     "XWimp_CreateWindow"

� BVS     SeriousError

�BSTR     R0,[R12,#update%]                ;Update window handle

�
!SWI     "XWimp_CloseTemplate"

R;-----------------------------------------------------------------------------
$H; This routine fills in the version number in the Info dialogue box.
.
8LDR     R0,[R12,#info%]
BMOV     R1,#7
LADD     R2,R12,#version
VBL      WriteIcon
`R;-----------------------------------------------------------------------------
j
t<BL      Init                           ;Initialise files
~
�R;-----------------------------------------------------------------------------
�4;                              *** Wimp_Poll ***
�J; This routine repeatedly polls the wimp to find out what is happening
�M; around the desktop. The wimp returns an Event Reason Code and fills the
�7; parameter block with data dependant on the Event.
�
� .mainloop
�
�"MOV     R0,   #%11100000000000
�JADD     R0,R0,#%00000000010000         ;Mask out unwanted reason codes
�
�ADD     R1,R12,#block%
SWI     "Wimp_Poll"


( CMP     R0,#0: BLEQ    ContUpdating
/ CMP     R0,#1: BLEQ    RedrawWindowRequest
(- CMP     R0,#2: BLEQ    OpenWindowRequest
2. CMP     R0,#3: SWIEQ   "Wimp_CloseWindow"
<B;CMP     R0,#4                         ;Pointer_Leaving_Window
FC CMP     R0,#5:                        ;Pointer_Entering_Window
P. CMP     R0,#6: BLEQ    MouseButtonClicked
Z( CMP     R0,#7: BLEQ    DragFinished
d& CMP     R0,#8: BLEQ    KeyPressed
n. CMP     R0,#9: BLEQ    MenuOptionSelected
x:;CMP     R0,#10                        ;Scroll_Request
�8;CMP     R0,#11                        ;Losing_Caret
�9;CMP     R0,#12                        ;Gaining_Caret
�@ CMP     R0,#17                        ;User_MessageReceived
�/ CMPNE   R0,#18:BLEQ    UserMessageReceived
�<;CMP     R0,#19                        ;User_Message_Ack
�
�
�O LDR     R0,[R12,#quit%]               ;Check if we have been asked to quit
� CMP     R0,#0
� BEQ     mainloop
�
�Q;----------------------------------------------------------------------------
�/; This routine safley closes down our task.

O LDR     R0,[R12,#task%]               ;This section tells the WIMP that we
M MOV     R1,   #&4B000000              ;are about to close down our task.
" ADD     R1,R1,#&00530000
, ADD     R1,R1,#&00004100
6 ADD     R1,R1,#&00000054
@ SWI     "XWimp_CloseDown"
J
T MOV     R0,#6
^ ADD     R1,R10,#searchfile
h SWI     "OS_File"
r
|P �LongAdr("",0,messages)              ;This closes the Message file if it is
�7 SWI     "XMessageTrans_CloseFile"     ;still open.
�
�F SWI     "XOS_Exit"                    ;This closes down our task.
�
�R;-----------------------------------------------------------------------------
�6;                    *** Redraw_Window_Request ***
�M; This routine is called when part of one of our windows needs redrawing.
�P; Since none of our windows contain any 'User' graphics we can pass the call
�O; straight back to the Wimp to redraw the icons itself. A loop is needed to
�;; get a list of all the Rectangles that need redrawing.
�
�.RedrawWindowRequest
�
STMFD   R13!,{R0-R12,R14}
 ADD     R1,R12,#block%
  SWI     "Wimp_RedrawWindow"
& .redrawloop
0 CMP     R0,#0
: LDMEQFD R13!,{R0-R12,PC}^
D  SWI     "Wimp_GetRectangle"
NB       redrawloop
X
bR;-----------------------------------------------------------------------------
l6;                      *** Open_Window_Request ***
vN; This routine is called when one of our windows needs opening or has been
�M; scrolled and needs redrawing with new scroll offsets. No special action
�F; needs to be performed so we simply open the window as requested.
�
�.OpenWindowRequest
�
�STMFD   R13!,{R0-R12,R14}
�
� SWI     "Wimp_OpenWindow"
�
�LDMFD   R13!,{R0-R12,PC}^
�
�R;-----------------------------------------------------------------------------
�6;                       *** Mouse_Button_Click ***
J; This routine is called when the mouse buttons change state while the
S; pointer is over one of our windows - Dependant on the button type of the icon
; it is over, if any.
 
*.MouseButtonClicked
4
>STMFD   R13!,{R0-R12,R14}
H8 LDR     R2,[R12,#block%+0]            ;X coordinate
R8 LDR     R3,[R12,#block%+4]            ;Y coordinate
\> LDR     R4,[R12,#block%+8]            ;Mouse Button State
f9 LDR     R5,[R12,#block%+12]           ;Window handle
p7 LDR     R6,[R12,#block%+16]           ;Icon number
z LDR     R7,[R12,#display%]
� LDR     R8,[R12,#search%]
�
�O CMP     R5,R7                         ;This section will display the topic
�P  CMP     R6,#43                       ;selection menu if the menu button is
�O   �LongAdr("EQ",1,menuinfo)          ;pressed over the pop-up menu icon in
�<   �Q   R0,#0                       ;the Display window.
�   STREQ   R0,[R1,#4]
�    �LongAdr("EQ",8,menulist)
�   LDREQ   R1,[R8,#8]
�%   STREQ   R1,[R12,#currentmenu%]
�   SUBEQ   R2,R2,#64
�   STREQ   R2,[R9,#0]
�   STREQ   R3,[R9,#4]
    SWIEQ   "Wimp_CreateMenu"
    LDMEQFD R13!,{R0-R12,PC}^

$N CMP     R5,R7                         ;This section will display the main
.N  CMPEQ   R4,#2                        ;Menu if the Menu button is pressed
8O   BLEQ    UpdateStartEnd              ;anywhere else in the Display window
BR   BLEQ    UpdateLeafName              ;after first updating the Save dialogue
LL   �LongAdr("EQ",8,menulist)          ;box with the current issue number
V   LDREQ   R1,[R8,#4]
`%   STREQ   R1,[R12,#currentmenu%]
j   SUBEQ   R2,R2,#64
t   STREQ   R2,[R9,#0]
~   STREQ   R3,[R9,#4]
�    SWIEQ   "Wimp_CreateMenu"
�    LDMEQFD R13!,{R0-R12,PC}^
�
�N CMN     R5,#2                         ;This section displays the Icon Bar
�N  CMPEQ   R4,#2                        ;Menu if the menu button is pressed
�B   �LongAdr("EQ",8,menulist)          ;over our icon bar icon.
�   LDREQ   R1,[R8,#0]
�%   STREQ   R1,[R12,#currentmenu%]
�   �Q   R3,#96
�C   ADDEQ   R3,R3,#88                   ; 44 units per menu item
�   SUBEQ   R2,R2,#64
�   STREQ   R2,[R9,#0]
   STREQ   R3,[R9,#4]

    SWIEQ   "Wimp_CreateMenu"
    LDMEQFD R13!,{R0-R12,PC}^

(R CMN     R5,#2                         ;This section will open the main window
2O  STREQ   R7,[R12,#block%+0]           ;if Select or adjust is pressed over
<=  ADDEQ   R1,R12,#block%               ;our icon bar icon
F#  SWIEQ   "Wimp_GetWindowState"
P  BLEQ    OpenWindowRequest
Z
dO CMP     R5,R7                         ;This section will call a subroutine
nN  TSTEQ   R4,#(� 4) � 7            ;to deal with Select being pressed over
x?   BLEQ    SelectInDisplay             ;the Display window.
�    LDMEQFD R13!,{R0-R12,PC}^
�
�O CMP     R5,R7                         ;This section will call a subroutine
�N  TSTEQ   R4,#(� 1) � 7            ;to deal with adjust being pressed over
�>   BLEQ    AdjustInDisplay             ;the Display window
�    LDMEQFD R13!,{R0-R12,PC}^
�
�O CMP     R5,R8                         ;This section will start a search if
�M  CMPEQ   R6,#2                        ;the OK icon clicked in the Search
�O    BLEQ   StartSearch                 ;Dialogue box. If Select was used it
�J    TSTEQ  R4,#(� 4) � 7           ;will also close the Menu structure
�    MVNEQ  R1,#0
�     SWIEQ  "Wimp_CreateMenu"
!    LDMEQFD R13!,{R0-R12,PC}^

 LDR     R8,[R12,#edit%]
"K CMP     R5,R8                         ;This section displays the topic
,O  CMPEQ   R6,#25                       ;selection menu when Menu is pressed
6K   �LongAdr("EQ",1,menuinfo)          ;over the pop-up menu icon in the
@8   MVNEQ   R0,#0                       ;Edit window.
J   STREQ   R0,[R1,#4]
T    �LongAdr("EQ",1,menulist)
^   LDR     R1,[R1,#8]
h%   STREQ   R1,[R12,#currentmenu%]
r   SUBEQ   R2,R2,#64
|   STREQ   R2,[R9,#0]
�   STREQ   R3,[R9,#4]
�    SWIEQ   "Wimp_CreateMenu"
�    LDMEQFD R13!,{R0-R12,PC}^
�
�N CMP     R5,R8                         ;This section calls a subroutine to
�K  TSTEQ   R4,#(� 4) � 7            ;deal with Select being pressed over
�<   BLEQ    SelectInEdit                ;the Edit window.
�    LDMEQFD R13!,{R0-R12,PC}^
�
�N CMP     R5,R8                         ;This section calls a subroutine to
�K  TSTEQ   R4,#(� 1) � 7            ;deal with Adjust being pressed over
�;   BLEQ    AdjustInEdit                ;the Edit window
�    LDMEQFD R13!,{R0-R12,PC}^

 LDR     R8,[R12,#save%]
O CMP     R5,R8                         ;This section will call a subroutine
&I  TSTEQ   R4,#(� 4) � 7            ;to deal with Select being pressed
0E   BLEQ    SelectInSave                ;in the save dialogue box.
:    LDMEQFD R13!,{R0-R12,PC}^
D
NO CMP     R5,R8                         ;This section will call a subroutine
XI  TSTEQ   R4,#(� 1) � 7            ;to deal with Adjust being pressed
bD   BLEQ    AdjustInSave                ;in the save dialogue box
l    LDMEQFD R13!,{R0-R12,PC}^
v
� LDR     R8,[R12,#update%]
� CMP     R5,R8
�  CMP     R6,#5
�   �Q   R0,#1
�"   STREQ   R0,[R10,#updating%]
�
� CMP     R5,R8
�  CMP     R6,#6
�   �Q   R0,#0
�"   STREQ   R0,[R10,#updating%]
�!   STREQ   R8,[R12,#block%+0]
�   ADDEQ   R1,R12,#block%
�!   SWIEQ   "Wimp_CloseWindow"

LDMFD   R13!,{R0-R12,PC}^

 R;-----------------------------------------------------------------------------
*2;                      *** SelectInDisplay ***
4N; This subroutine deals with Select being clicked over the Display window.
>
H.SelectInDisplay
R
\STMFD   R13!,{R0-R12,R14}
f
pM LDR     R0,[R10,#show%]               ;This section open the appropriate
zN CMP     R0,#1                         ;file for the current display mode,
�J  MOV     R0,#&4F                      ;either Indexfile or Searchfile
�    ADDEQ   R1,R10,#indexfile
�!   ADDNE   R1,R10,#searchfile
�  SWI    "XOS_Find"
�   BVS     norecords
�#  STR     R0,[R10,#filehandle%]
�%   STREQ   R0,[R10,#indexhandle%]
�&   STRNE   R0,[R10,#searchhandle%]
�
�N CMP     R6,#20                        ;This section displays the previous
�P SWIEQ   "Hourglass_On"                ;record when the single left arrow is
�@  �Q   R0,#1                        ;clicked on with Select.
�  �Q   R1,#1
  BLEQ    GetRecords
  BLEQ    Update
  SWIEQ   "Hourglass_Off"
$  BEQ     selectclosefile
.
8N CMP     R6,#21                        ;This section reads back 10 records
BQ  SWIEQ   "Hourglass_On"               ;when the double left arrow is clicked
L8  �Q   R0,#10                       ;on with Select.
V  �Q   R1,#1
`  BLEQ    GetRecords
j  BLEQ    Update
t  SWIEQ   "Hourglass_Off"
~  BEQ     selectclosefile
�
�O CMP     R6,#22                        ;This section reads back 100 records
�Q  SWIEQ   "Hourglass_On"               ;when the triple left arrow is clicked
�7  �Q   R0,#100                      ;on with Select
�  �Q   R1,#1
�  BLEQ    GetRecords
�  BLEQ    Update
�  SWIEQ   "Hourglass_Off"
�  BEQ     selectclosefile
�
�N CMP     R6,#23                        ;This section reads the next record
�R  SWIEQ   "Hourglass_On"               ;when the single right arrow is clicked
8  �Q   R0,#1                        ;on with select.

  �Q   R1,#0
  BLEQ    GetRecords
  BLEQ    Update
(  SWIEQ   "Hourglass_Off"
2  BEQ     selectclosefile
<
FQ CMP     R6,#24                        ;This section reads forward 10 records
PR  SWIEQ   "Hourglass_On"               ;when the double right arrow is clicked
Z8  �Q  R0,#10                        ;on with Select.
d  �Q  R1,#0
n  BLEQ   GetRecords
x  BLEQ    Update
�  SWIEQ   "Hourglass_Off"
�  BEQ     selectclosefile
�
�R CMP     R6,#25                        ;This section reads forward 100 records
�R  SWIEQ   "Hourglass_On"               ;when the triple right arrow is clicked
�8  �Q   R0,#100                      ;on with Select.
�  �Q   R1,#0
�  BLEQ    GetRecords
�  BLEQ    Update
�  SWIEQ   "Hourglass_Off"
�  BEQ     selectclosefile
�
�Q CMP     R6,#26                        ;This section calls a subroutine which
O  BLEQ    ShowIndex                    ;switches mode to display the Entire
N  �Q   R0,#0                        ;Index when Select is clicked over the
>  LDREQ   R1,[R10,#filehandle%]        ;Entire Index icon.
"O  SWIEQ   "XOS_Find"                   ;It then closes the currently active
,L  �Q   R0,#&4F                      ;file and opens the Indexfile as the
6B  ADDEQ   R1,R10,#indexfile            ;currently active file.
@  SWIEQ   "XOS_Find"
J   BVS     noindex
T#  STREQ   R0,[R10,#filehandle%]
^  LDREQ   R0,[R10,#record%]
h  �Q   R1,#2
r  BLEQ    GetRecords
|  BLEQ    Update
�  BEQ     selectclosefile
�
�Q CMP     R6,#27                        ;This section calls a subroutine which
�I  BLEQ    ShowSearch                   ;swithces modes to display the
�K  �Q   R0,#0                        ;Last Search when Select is clicked
�F  LDREQ   R1,[R10,#filehandle%]        ;over the Last Search icon.
�O  SWIEQ   "XOS_Find"                   ;It then closes the currently active
�M  �Q   R0,#&4F                      ;file and opens the Searchfile as the
�B  ADDEQ   R1,R10,#searchfile           ;currently active file.
�  SWIEQ   "XOS_Find"
�   BVS     nosearch
�#  STREQ   R0,[R10,#filehandle%]
�  LDREQ   R0,[R10,#record%]
  �Q   R1,#2
  BLEQ    GetRecords
  BLEQ    Update
&  BEQ     selectclosefile
0
:N CMP     R6,#37                        ;This section calls a subroutine to
DR  BLEQ    editrecord                   ;to edit the current record when Select
NQ  BEQ     selectclosefile              ;is clicked over the Edit Record icon.
X
bN CMP     R6,#39                        ;This section calls a subroutine to
lL  BLEQ    lastmonth                    ;read back 1 issue when Select is
vM  BEQ     selectclosefile              ;clicked over the Month Down icon.
�
�N CMP     R6,#40                        ;This section calls a subroutine to
�O  BLEQ    nextmonth                    ;read forward 1 issue when Select is
�K  BEQ     selectclosefile              ;clicked over the Month Up icon.
�
�N CMP     R6,#41                        ;This section calls a subroutine to
�N  BLEQ    lastyear                     ;read back 12 issues when Select is
�L  BEQ     selectclosefile              ;clicked over the Year Down icon.
�
�N CMP     R6,#42                        ;This section calls a subroutine to
�Q  BLEQ    nextyear                     ;read forward 12 issues when Select is
�J  BEQ     selectclosefile              ;clicked over the Year Up icon.
�
R .selectclosefile                      ;This section closes both the currently
Q MOV    R0,#0                          ;active file prior to returning to the
; LDR    R1,[R10,#filehandle%]          ;Wimp_Poll loop.
  SWI    "XOS_Find"
*
4LDMFD   R13!,{R0-R12,PC}^
>
HR;-----------------------------------------------------------------------------
R4;                        *** AdjustInDisplay ***
\M; This subroutine is is called to deal with Adjust being clicked over the
f; Display window.
pL; NB; When Adjust is clicked over adjuster icons the RISC OS Style Guide
zQ; requires the adjustment to be made in the opposite direction to the arrows.
�
�.AdjustInDisplay
�
�STMFD   R13!,{R0-R12,R14}
�
�N LDR     R0,[R10,#show%]               ;This section opens the appropriate
�M CMP     R0,#1                         ;file for the current display mode
�K  MOV     R0,#&4F                      ;either Indexfile or Searchfile.
�    ADDEQ   R1,R10,#indexfile
�!   ADDNE   R1,R10,#searchfile
�  SWI    "XOS_Find"
�   BVS     norecords
�#  STR     R0,[R10,#filehandle%]
%   STREQ   R0,[R10,#indexhandle%]
&   STRNE   R0,[R10,#searchhandle%]

$N CMP     R6,#20                        ;This section reads the next record
.Q  SWIEQ   "Hourglass_On"               ;when the single left arrow is clicked
88  �Q   R0,#1                        ;on with Adjust.
B  �Q   R1,#0
L  BLEQ    GetRecords
V  BLEQ    Update
`  SWIEQ   "Hourglass_Off"
j  BEQ     adjustclosefile
t
~Q CMP     R6,#21                        ;This section reads forward 10 records
�Q  SWIEQ   "Hourglass_On"               ;when the double left arrow is clicked
�8  �Q   R0,#10                       ;on with Adjust.
�  �Q   R1,#0
�  BLEQ    GetRecords
�  BLEQ    Update
�  SWIEQ   "Hourglass_Off"
�  BEQ     adjustclosefile
�
�R CMP     R6,#22                        ;This section reads forward 100 records
�Q  SWIEQ   "Hourglass_On"               ;when the triple left arrow is clicked
�8  �Q   R0,#100                      ;on with Adjust.
�  �Q   R1,#0
  BLEQ    GetRecords

  BLEQ    Update
  SWIEQ   "Hourglass_Off"
  BEQ     adjustclosefile
(
2L CMP     R6,#23                        ;This section reads Back 1 record
<R  SWIEQ   "Hourglass_On"               ;when the single right arrow is clicked
F8  �Q   R0,#1                        ;on with Adjust.
P  �Q   R1,#1
Z  BLEQ    GetRecords
d  BLEQ    Update
n  SWIEQ   "Hourglass_Off"
x  BEQ     adjustclosefile
�
�N CMP     R6,#24                        ;This section reads back 10 records
�R  SWIEQ   "Hourglass_On"               ;when the double right arrow is clicked
�8  �Q   R0,#10                       ;on with Adjust.
�  �Q   R1,#1
�  BLEQ    GetRecords
�  BLEQ    Update
�  SWIEQ   "Hourglass_Off"
�  BEQ     adjustclosefile
�
�O CMP     R6,#25                        ;This section reads back 100 records
�R  SWIEQ   "Hourglass_On"               ;when the triple right arrow is clicked
�8  �Q   R0,#100                      ;on with Adjust.
  �Q   R1,#1
  BLEQ    GetRecords
  BLEQ    Update
"  SWIEQ   "Hourglass_Off"
,  BEQ     adjustclosefile
6
@Q CMP     R6,#26                        ;This section calls a subroutine which
JP  BLEQ    ShowIndex                    ;switches modes to display the Entire
TN  �Q   R0,#0                        ;Index when Adjust is clicked over the
^>  LDREQ   R1,[R10,#filehandle%]        ;Entire Index icon.
hO  SWIEQ   "XOS_Find"                   ;It then closes the currently active
rL  �Q   R0,#&4F                      ;file and opens the IndexFile as the
|B  ADDEQ   R1,R10,#indexfile            ;currently active file.
�  SWIEQ   "XOS_Find"
�   BVS     noindex
�#  STREQ   R0,[R10,#filehandle%]
�  LDREQ   R0,[R10,#record%]
�  �Q   R1,#2
�  BLEQ    GetRecords
�  BLEQ    Update
�  BEQ     adjustclosefile
�
�Q CMP     R6,#27                        ;This section calls a subroutine which
�N  BLEQ    ShowSearch                   ;switches modes to display the Last
�O  �Q   R0,#0                        ;Search when Adjust is clicked over the
�=  LDREQ   R1,[R10,#filehandle%]        ;Last Search icon.
   SWIEQ   "XOS_Find"
   �Q   R0,#&4F
    ADDEQ   R1,R10,#searchfile
 &  SWIEQ   "XOS_Find"
 0   BVS     nosearch
 :#  STREQ   R0,[R10,#filehandle%]
 D  LDREQ   R0,[R10,#record%]
 N  �Q   R1,#2
 X  BLEQ    GetRecords
 b  BLEQ    Update
 l  BEQ     adjustclosefile
 v
 �N CMP     R6,#37                        ;This section calls a subroutine to
 �K  BLEQ    editrecord                   ;to edit the current record when
 �Q  BEQ     adjustclosefile              ;Adjust is clicked over the Edit icon.
 �
 �Q CMP     R6,#39                        ;This section calls a subroutine which
 �P  BLEQ    nextmonth                    ;reads forward 1 Issue when Adjust is
 �M  BEQ     adjustclosefile              ;clicked over the Month Down icon.
 �
 �Q CMP     R6,#40                        ;This section calls a subroutine which
 �M  BLEQ    lastmonth                    ;reads back 1 Issue when Adjust is
 �K  BEQ     adjustclosefile              ;clicked over the Month Up icon.
 �
 �Q CMP     R6,#41                        ;This section calls a subroutine which
!R  BLEQ    nextyear                     ;reads forward 12 Issues when Adjust is
!L  BEQ     adjustclosefile              ;clicked over the Year Down icon.
!
! Q CMP     R6,#42                        ;This section calls a subroutine which
!*O  BLEQ    lastyear                     ;reads back 12 Issues when Adjust is
!4J  BEQ     adjustclosefile              ;clicked over the Year Up icon.
!>
!HM .adjustclosefile                      ;This section closes the currently
!RM MOV    R0,#0                          ;active file prior to returning to
!\? LDR    R1,[R10,#filehandle%]          ;the Wimp_Poll loop.
!f SWI    "XOS_Find"
!p
!zLDMFD   R13!,{R0-R12,PC}^
!�
!�R;-----------------------------------------------------------------------------
!�3;                             *** ShowIndex ***
!�Q; This subroutine is called when the 'Entire Index' icon is clicked on in the
!�M; Display window. It changes the values of the Current Record and Maximum
!�9; Record number etc. for displaying the Entire Index.
!�
!�.ShowIndex
!�
!�STMFD   R13!,{R0,R14}
!�
!�L LDR     R0,[R10,#show%]               ;This section ensures that we are
!�M CMP     R0,#1                         ;initially showing the Last Search
"E  LDMEQFD R13!,{R0,PC}^                ;otherwise we just Return.
"
"P LDR     R0,[R10,#indexmax%]           ;Set up Current Maximum Record as the
"$P STR     R0,[R10,#max%]                ;Maximum Record for the Entire Index.
".
"8R LDR     R0,[R10,#record%]             ;Store Current Record as Current Search
"B3 STR     R0,[R10,#searchrecord%]       ;Record.
"L
"VQ LDR     R0,[R10,#indexrecord%]        ;Store Current Index Record as Current
"`3 STR     R0,[R10,#record%]             ;Record.
"j
"tM MOV     R0,#1                         ;Set current mode to 1 to indicate
"~O STR     R0,[R10,#show%]               ; we are showing the 'Entire Index'.
"�
"� LDR     R0,[R12,#display%]
"� STR     R0,[R12,#block%+0]
"�
"�K MOV     R0,#37                        ;This section unshades the 'Edit
"�9 STR     R0,[R12,#block%+4]            ;record' icon.
"� MOV     R0,#0
"� STR     R0,[R12,#block%+8]
"� MOV     R0,#%1<<22
"�  STR     R0,[R12,#block%+12]
"� ADD     R1,R12,#block%
"�  SWI     "Wimp_SetIconState"
#
#
Q MOV     R0,#26                        ;This section makes the 'Entire Index'
#: STR     R0,[R12,#block%+4]            ;icon Selected.
# MOV     R0,#%1<<21
#( STR     R0,[R12,#block%+8]
#2 MOV     R0,#%1<<21
#<  STR     R0,[R12,#block%+12]
#F ADD     R1,R12,#block%
#P  SWI     "Wimp_SetIconState"
#Z
#dP MOV     R0,#27                        ;This section makes the 'Last Search'
#n< STR     R0,[R12,#block%+4]            ;icon Deselected.
#x MOV     R0,#0
#� STR     R0,[R12,#block%+8]
#� MOV     R0,#%1<<21
#�  STR     R0,[R12,#block%+12]
#� ADD     R1,R12,#block%
#�  SWI     "Wimp_SetIconState"
#�
#�LDMFD   R13!,{R0,PC}^
#�
#�R;-----------------------------------------------------------------------------
#�0;                         *** ShowSearch ***
#�P; This subroutine is called when the 'Last Search' icon is clicked on in the
#�Q; Display window. It changes the values of the Current Record and the Current
#�9; Maximum Record etc. for displaying the Last Search.
$
$.ShowSearch
$
$"STMFD   R13!,{R0-R1,R14}
$,
$6L LDR     R0,[R10,#show%]               ;This section ensures that we are
$@P CMP     R0,#0                         ;initially showing the 'Entire Index'
$JE  LDMEQFD R13!,{R0-R1,PC}^             ;otherwise we just return.
$T
$^Q LDR     R0,[R10,#searchmax%]          ;Set up Current Maximum as the Current
$h; STR     R0,[R10,#max%]                ;Search Maximum.
$r
$|N LDR     R0,[R10,#record%]             ;Store the Current Record number as
$�L STR     R0,[R10,#indexrecord%]        ;the Current Index Record number.
$�
$�O LDR     R0,[R10,#searchrecord%]       ;Set up the Current Record number as
$�M STR     R0,[R10,#record%]             ;the Current Search Record number.
$�
$�Q MOV     R0,#0                         ;Set the current mode to 0 to indicate
$�M STR     R0,[R10,#show%]               ;we are showing the 'Last Search'.
$�
$� LDR     R0,[R12,#display%]
$� STR     R0,[R12,#block%+0]
$�
$�Q MOV     R0,#37                        ;This section Shades the 'Edit Record'
$�1 STR     R0,[R12,#block%+4]            ;icon.
% MOV     R0,#1<<22
% STR     R0,[R12,#block%+8]
%  STR     R0,[R12,#block%+12]
%& ADD     R1,R12,#block%
%0  SWI     "Wimp_SetIconState"
%:
%DP MOV     R0,#27                        ;This section makes the 'Last Search'
%N: STR     R0,[R12,#block%+4]            ;icon selected.
%X MOV     R0,#%1<<21
%b STR     R0,[R12,#block%+8]
%l MOV     R0,#%1<<21
%v  STR     R0,[R12,#block%+12]
%� ADD     R1,R12,#block%
%�  SWI     "Wimp_SetIconState"
%�
%�Q MOV     R0,#26                        ;This section makes the 'Entire Index'
%�: STR     R0,[R12,#block%+4]            ;icon selected.
%� MOV     R0,#0
%� STR     R0,[R12,#block%+8]
%� MOV     R0,#%1<<21
%�  STR     R0,[R12,#block%+12]
%� ADD     R1,R12,#block%
%�  SWI     "Wimp_SetIconState"
%�LDMFD   R13!,{R0-R1,PC}^
%�
&R;-----------------------------------------------------------------------------
&:;                          *** Edit Current Record ***
&P; This subroutine is called when the 'Edit Record' icon is clicked on in the
& M; Display window. It opens the Edit window and positions the Caret in the
&*
; window.
&4
&>.editrecord
&H
&RSTMFD   R13!,{R0-R12,R14}
&\
&fQ BL      geteditdetails                ;Fill in details of the current record
&p
&zJ LDR     R0,[R10,#record%]             ;Store Current Record Number as
&�L STR     R0,[R10,#editrecord%]         ; the Current Edit Record Number.
&�
&�O LDR     R3,[R12,#edit%]               ;This section opens the Edit window.
&� STR     R3,[R12,#block%]
&� ADD     R1,R12,#block%
&�" SWI     "Wimp_GetWindowState"
&� SWI     "Wimp_OpenWindow"
&�
&�N MOV     R0,R3                         ;This section reads the string from
&�N MOV     R1,#20                        ;the Page Number icon and finds its
&�3 MOV     R2,R9                         ;length.
&� BL      ReadIcon
&� MOV     R0,R9
' MOV     R1,#13
' SWI     "String_Len"
' MOV     R5,R1
'$
'.O MOV     R0,R3                         ;This section positions the caret at
'8L MOV     R1,#20                        ;the end of the Page Number icon.
'B MVN     R4,#0
'L$ SWI     "Wimp_SetCaretPosition"
'V
'`LDMFD   R13!,{R0-R12,PC}^
'j
'tR;-----------------------------------------------------------------------------
'~5;                          *** GetEditDetails ***
'�O; This subroutine copies the details of the current record from the Display
'�.; window into the Edit window for editing.
'�
'�.geteditdetails
'�
'�STMFD   R13!,{R0-R12,R14}
'�
'� MOV     R2,R9
'� LDR     R8,[R12,#display%]
'� LDR     R7,[R12,#edit%]
'�
'�$ LDR     R0,[R10,#displaymonth%]
(! STR     R0,[R10,#editmonth%]
(

( MOV     R0,R8
(R MOV     R1,#32                        ;The following sections read the string
((P BL      ReadIcon                      ;from icons in the Display window and
(2Q MOV     R0,R7                         ;writes them into the equiveleant icon
(<P MOV     R1,#17                        ;in the Edit window, to allow them to
(F3 BL      WriteIcon                     ;edited.
(P
(Z MOV     R0,R8
(d MOV     R1,#33
(n BL      ReadIcon
(x MOV     R0,R7
(� MOV     R1,#18
(� BL      WriteIcon
(�
(� MOV     R0,R8
(� MOV     R1,#34
(� BL      ReadIcon
(� MOV     R0,R7
(� MOV     R1,#19
(� BL      WriteIcon
(�
(� MOV     R0,R8
(� MOV     R1,#35
(� BL      ReadIcon
) MOV     R0,R7
) MOV     R1,#20
) BL      WriteIcon
)"
), MOV     R0,R8
)6 MOV     R1,#30
)@ BL      ReadIcon
)J MOV     R0,R7
)T MOV     R1,#21
)^ BL      WriteIcon
)h
)r MOV     R0,R8
)| MOV     R1,#31
)� BL      ReadIcon
)� MOV     R0,R7
)� MOV     R1,#22
)� BL      WriteIcon
)�
)�N STR      R0,[R12,#block%+0]           ;This section displays the 'Delete'
)�O MOV      R0,#26                       ;icon in the Edit window by clearing
)�< STR      R0,[R12,#block%+4]           ;its Deleted bit.
)� MOV      R0,#0
)�  STR      R0,[R12,#block%+8]
)� MOV      R0,#%1<<23
)�! STR      R0,[R12,#block%+12]
)�
* ADD      R1,R12,#block%
*! SWI      "Wimp_SetIconState"
*
*&LDMFD   R13!,{R0-R12,PC}^
*0
*:R;-----------------------------------------------------------------------------
*D5;                            *** SelectInEdit ***
*NK; This subroutine deals with Select being pressed over the Edit Window.
*X
*b.SelectInEdit
*l
*vSTMFD    R13!,{R0-R12,R14}
*�
*� MOV      R0,R8
*�
*�R CMP      R6,#9                        ;This section decreases the Month icon.
*�  BLEQ     monthdown
*�
*�R CMP      R6,#10                       ;This section increases the Month icon.
*�  BLEQ     monthup
*�
*�Q CMP      R6,#11                       ;This section decreases the Year icon.
*�  �Q    R1,#18
*�  BLEQ     down
*�
+Q CMP      R6,#12                       ;This section increases the Year icon.
+  �Q    R1,#18
+  BLEQ     up
+ 
+*R CMP      R6,#13                       ;This section decreases the Issue icon.
+4  �Q    R1,#19
+>  BLEQ     down
+H
+RR CMP      R6,#14                       ;This section increases the Issue icon.
+\  �Q    R1,#19
+f  BLEQ     up
+p
+zQ CMP      R6,#15                       ;This section decreases the Page icon.
+�  �Q    R1,#20
+�  BLEQ     down
+�
+�Q CMP      R6,#16                       ;This section increases the Page icon.
+�  �Q    R1,#20
+�  BLEQ     up
+�
+�N CMP      R6,#23                       ;This section calls a subroutine to
+�I  BLEQ     storerecord                 ;add and/or delete the record.
+�  �Q    R0,#13
+�  STREQB   R0,[R9]
+�  LDREQ    R0,[R12,#edit%]
+�  �Q    R2,R9
,  �Q    R1,#22
,  BLEQ     WriteIcon
,
,$N CMP      R6,#24                       ;This section calls a subroutine to
,.E  BLEQ     canceledit                  ;to close the edit window.
,8
,BN CMP      R6,#26                       ;This section calls a subroutine to
,L>  BLEQ     storerecord                 ;delete the record.
,V
,`LDMFD    R13!,{R0-R12,PC}^
,j
,tR;-----------------------------------------------------------------------------
,~5;                            *** AdjustInEdit ***
,�K; This subroutine deals with Adjust being clicked over the Edit window.
,�Q; NB; When Adjust is clicked over the adjuster icons, the Risc OS Style Guide
,�P; requires the adjustment to be made in the opposite direction to the arrow.
,�
,�.AdjustInEdit
,�
,�STMFD    R13!,{R0-R12,R14}
,�
,� MOV      R0,R8
,�
,�R CMP      R6,#9                        ;This section increases the Month icon.
,�  BLEQ     monthup
-
-
R CMP      R6,#10                       ;This section decreases the Month Icon.
-  BLEQ     monthdown
-
-(Q CMP      R6,#11                       ;This section increases the Year icon.
-2  �Q    R1,#18
-<  BLEQ     up
-F
-PQ CMP      R6,#12                       ;This section decreases the Year icon.
-Z  �Q    R1,#18
-d  BLEQ     down
-n
-xR CMP      R6,#13                       ;This section increases the Issue icon.
-�  �Q    R1,#19
-�  BLEQ     up
-�
-�R CMP      R6,#14                       ;This section decreases the Issue icon.
-�  �Q    R1,#19
-�  BLEQ     down
-�
-�Q CMP      R6,#15                       ;This section increases the Page icon.
-�  �Q    R1,#20
-�  BLEQ     up
-�
-�Q CMP      R6,#16                       ;This section decreases the Page icon.
-�  �Q    R1,#20
.  BLEQ     down
.
.N CMP      R6,#23                       ;This section calls a subroutine to
."I  BLEQ     storerecord                 ;Add and/or Delete the record.
.,  �Q    R0,#13
.6  STREQB   R0,[R9]
.@  LDREQ    R0,[R12,#edit%]
.J  �Q    R2,R9
.T  �Q    R1,#22
.^  BLEQ     WriteIcon
.h
.rN CMP      R6,#24                       ;This section calls a subroutine to
.|A  BLEQ     canceledit                  ;close the Edit window
.�
.�N CMP      R6,#26                       ;This section calls a subroutine to
.�>  BLEQ     storerecord                 ;delete the record.
.�
.�LDMFD    R13!,{R0-R12,PC}^
.�
.�R;-----------------------------------------------------------------------------
.�4;                             *** CancelEdit ***
.�-; This subroutine closes the Edit Window.
.�
.�.canceledit
.�
.�STMFD    R13!,{R0-R12,R14}
/
/ LDR      R0,[R12,#edit%]
/  STR      R0,[R12,#block%+0]
/& ADD      R1,R12,#block%
/0  SWI      "Wimp_CloseWindow"
/:
/DLDMFD    R13!,{R0-R12,PC}^
/N
/XR;-----------------------------------------------------------------------------
/b1;                           *** MonthDown ***
/l<; This subroutine decreases the value in the Month icon.
/v
/�.monthdown
/�
/�STMFD    R13!,{R0-R12,R14}
/�
/�L LDR      R0,[R10,#editmonth%]      ;This section decreases the value of
/�N CMP      R0,#1                        ;the Current Month. It is set to 13
/�@  �Q    R0,#13                      ;if it was originally 1.
/�  SUBNE    R0,R0,#1
/�" STR      R0,[R10,#editmonth%]
/�
/�M MOV      R2,#months%-&10              ;This section gets the name of the
/�O ADD      R2,R2,R0,LSL #4              ;of the Current Month from a look-up
/�N ADD      R2,R10,R2                    ;table and writes it into the Month
01 MOV      R1,#17                       ;icon.
0 LDR      R0,[R12,#edit%]
0 BL       WriteIcon
0 
0*LDMFD    R13!,{R0-R12,PC}^
04
0>R;-----------------------------------------------------------------------------
0H/;                           *** MonthUp ***
0R<; This subroutine increases the value of the Month icon.
0\
0f.monthup
0p
0zSTMFD    R13!,{R0-R12,R14}
0�
0�L LDR      R0,[R10,#editmonth%]      ;This section increases the value of
0�P CMP      R0,#13                       ;the Current Month. It is set to 1 if
0�A  �Q    R0,#1                       ;if it was originally 13.
0�  ADDNE    R0,R0,#1
0�" STR      R0,[R10,#editmonth%]
0�
0�M MOV      R2,#months%-&10              ;This section gets the name of the
0�L ADD      R2,R2,R0,LSL #4              ;the current month from a look-up
0�N ADD      R2,R10,R2                    ;table and writes it into the month
0�1 MOV      R1,#17                       ;icon.
0� LDR      R0,[R12,#edit%]
0� BL       WriteIcon
1
1LDMFD    R13!,{R0-R12,PC}^
1
1$R;-----------------------------------------------------------------------------
1.-;                              *** Up ***
18M; This subroutine increases the value of the icon specified by the Window
1B,; Handle in R0 and an Icon Handle in R1.
1L
1V.up
1`
1jSTMFD    R13!,{R0-R12,R14}
1t
1~N MOV      R2,R9                        ;This section reads the string from
1�R BL       ReadIcon                     ;the icon specified and find its value.
1� MOV      R8,R0
1� MOV      R7,R1
1� MOV      R0,R2
1� MOV      R1,#13
1� SWI      "String_Val"
1�
1�O MOV      R0,   #&2700                 ;This section checks if the value is
1�Q ADD      R0,R0,#&000F                 ;9999 (&270F) and if so sets the value
1�N CMP      R1,R0                        ;to zero otherwise it incements it.
1�  �Q    R1,#0
1�  ADDNE    R1,R1,#1
2
2
O MOV      R0,R1                        ;This section converts the new value
2O MOV      R1,R9                        ;to its string equivelent and writes
2J MOV      R6,#&100                     ;it back into appropriate icon.
2(" SWI      "OS_ConvertInteger2"
22 MOV      R0,#13
2< STRB     R0,[R1]
2F MOV      R0,R8
2P MOV      R1,R7
2Z MOV      R2,R9
2d BL       WriteIcon
2n
2xLDMFD    R13!,{R0-R12,PC}^
2�
2�R;-----------------------------------------------------------------------------
2�-;                            *** Down ***
2�M; This subroutine decreases the value of the icon specified by the Window
2�-; handle in R0 and the Icon handle in R1.
2�
2�	.down
2�
2�STMFD    R13!,{R0-R12,R14}
2�
2�R MOV      R2,R9                        ;This section reads the string from the
2�N BL       ReadIcon                     ;icon specified and fins its value.
2� MOV      R8,R0
3 MOV      R7,R1
3 MOV      R0,R2
3 MOV      R1,#13
3" SWI      "String_Val"
3,
36Q CMP      R1,#0                        ;This section checks if the value is 0
3@J  �Q    R1,   #&2700                ;and if so sets it to 9999 (&2704)
3JG  ADDEQ    R1,R1,#&000F                ;otherwise it decrements it.
3T  SUBNE    R1,R1,#1
3^
3hO MOV      R0,R1                        ;This section converts the new value
3rO MOV      R1,R9                        ;to its string equivelent and writes
3|N MOV      R6,#&100                     ;it back into the appropriate icon.
3�" SWI      "OS_ConvertInteger2"
3� MOV      R0,#13
3� STRB     R0,[R1]
3� MOV      R0,R8
3� MOV      R1,R7
3� MOV      R2,R9
3� BL       WriteIcon
3�
3�LDMFD    R13!,{R0-R12,PC}^
3�
3�R;-----------------------------------------------------------------------------
3�2;                           *** Next Month ***
3�O; This procedure reads in records until the issue number is increased by at
4; least one.
4
4.nextmonth
4&
40STMFD    R13!,{R0-R12,R14}
4:
4D SWI     "Hourglass_On"
4N
4XO LDR     R0,[R12,#display%]            ;This section reads the Issue Number
4bI MOV     R1,#34                        ;icon from the Display window.
4l MOV     R2,R9
4v BL      ReadIcon
4�
4�N MOV     R0,R9                         ;This section gets the value of the
4�9 MOV     R1,#13                        ;Issue Number.
4� SWI     "String_Val"
4� MOV     R8,R1
4�
4�H .nextmonthloop                        ;This is the start of a loop.
4�R LDR     R0,[R10,#record%]             ;This section exits the loop if we have
4�Q LDR     R1,[R10,#max%]                ;reached the last record in the Index.
4� CMP     R0,R1
4� BEQ     nextmonthloopend
4�
4�R MOV     R0,#1                         ;This section reads in the next record.
5 MOV     R1,#0
5 BL      GetRecords
5
5 O ADD     R0,R10,#record                ;This section finds the start of the
5*G ADD     R1,R10,#backslash             ;third field (Issue number).
54 MOV     R2,#13
5> MOV     R3,#0
5H SWI     "String_Instr"
5R ADD     R3,R3,#1
5\ SWI     "String_Instr"
5f
5pN ADD     R0,R0,R3                      ;This section gets the value of the
5z? ADD     R0,R0,#1                      ;Issue Number field.
5� MOV     R1,#�("\")
5� SWI     "String_Val"
5�
5�R CMP     R1,R8                         ;This section compares the issue number
5�Q BLE     nextmonthloop                 ;that we're looking for with the issue
5�F .nextmonthloopend                     ;number that we have found.
5�
5� BL      Update
5�
5� SWI     "Hourglass_Off"
5�
5�LDMFD    R13!,{R0-R12,PC}^
5�
6R;-----------------------------------------------------------------------------
64;                              *** LastMonth ***
6O; This subroutine reads back records until the Issue Number is decreased by
6$; at least one.
6.
68.lastmonth
6B
6LSTMFD    R13!,{R0-R12,R14}
6V
6` SWI     "Hourglass_On"
6j
6tO LDR     R0,[R12,#display%]            ;This section reads the Issue Number
6~D MOV     R1,#34                        ;from the Display window.
6� MOV     R2,R9
6� BL      ReadIcon
6�
6�N MOV     R0,R9                         ;This section gets the value of the
6�9 MOV     R1,#13                        ;Issue Number.
6� SWI     "String_Val"
6� SUB     R8,R1,#1
6�
6�P MOV     R0,#1                         ;This section reads back to the start
6�B MOV     R1,#1                         ;of the current record.
6� BL      GetRecords
6�
7H .lastmonthloop                        ;This is the start of a loop.
7
R LDR     R0,[R10,#record%]             ;This section exits the loop if we have
7Q MOV     R1,#1                         ;reached the first record in the file.
7 CMP     R0,R1
7( BEQ     lastmonthloopend
72
7<M MOV     R0,#1                         ;This section reads back a record.
7F MOV     R1,#1
7P BL      GetRecords
7Z
7dO ADD     R0,R10,#record                ;This section finds the start of the
7nG ADD     R1,R10,#backslash             ;third field (Issue Number).
7x MOV     R2,#13
7� MOV     R3,#0
7� SWI     "String_Instr"
7� ADD     R3,R3,#1
7� SWI     "String_Instr"
7�
7�N ADD     R0,R0,R3                      ;This section gets the value of the
7�? ADD     R0,R0,#1                      ;Issue Number field.
7� MOV     R1,#�("\")
7� SWI     "String_Val"
7�
7�R CMP     R1,R8                         ;This section compares the Issue number
7�Q BGE     lastmonthloop                 ;that we're looking for with the Issue
7�D                                       ;number that we've found.
8 .lastmonthloopend
8
8 MOV     R0,#1
8" MOV     R1,#0
8, BL      GetRecords
86
8@ BL      Update
8J SWI     "Hourglass_Off"
8T
8^LDMFD    R13!,{R0-R12,PC}^
8h
8rR;-----------------------------------------------------------------------------
8|3;                              *** NextYear ***
8�P; This subroutine reads in records until the Issue Number is increased by at
8�; least 12.
8�
8�
.nextyear
8�
8�STMFD    R13!,{R0-R12,R14}
8�
8� SWI     "Hourglass_On"
8�
8�O LDR     R0,[R12,#display%]            ;This section reads the Issue number
8�D MOV     R1,#34                        ;from the Display window.
8� MOV     R2,R9
8� BL      ReadIcon
9
9N MOV     R0,R9                         ;This section gets the value of the
99 MOV     R1,#13                        ;Issue Number.
9& SWI     "String_Val"
90 ADD     R8,R1,#11
9:
9DH .nextyearloop                         ;This is the start of a loop.
9NR LDR     R0,[R10,#record%]             ;This section exits the loop if we have
9XQ LDR     R1,[R10,#max%]                ;reached the last record in the Index.
9b CMP     R0,R1
9l BEQ     nextyearloopend
9v
9�R MOV     R0,#1                         ;This section reads in the next record.
9� MOV     R1,#0
9� BL      GetRecords
9�
9�O ADD     R0,R10,#record                ;This section finds the start of the
9�G ADD     R1,R10,#backslash             ;third field (Issue Number).
9� MOV     R2,#13
9� MOV     R3,#0
9� SWI     "String_Instr"
9� ADD     R3,R3,#1
9� SWI     "String_Instr"
9�
9�N ADD     R0,R0,R3                      ;This section gets the value of the
:9 ADD     R0,R0,#1                      ;Issue Number.
: MOV     R1,#�("\")
: SWI     "String_Val"
: 
:*R CMP     R1,R8                         ;This section compares the Issue Number
:4Q BLE     nextyearloop                  ;that we're looking for with the Issue
:>D                                       ;Number that we've found.
:H .nextyearloopend
:R
:\ BL      Update
:f SWI     "Hourglass_Off"
:p
:zLDMFD    R13!,{R0-R12,PC}^
:�
:�R;-----------------------------------------------------------------------------
:�0;                           *** LastYear ***
:�O; This subroutine reads back records until the Issue number is decreased by
:�; at least 12.
:�
:�
.lastyear
:�
:�STMFD    R13!,{R0-R12,R14}
:�
:� SWI     "Hourglass_On"
:�
:�O LDR     R0,[R12,#display%]            ;This section reads the Issue Number
;D MOV     R1,#34                        ;from the Display window.
; MOV     R2,R9
; BL      ReadIcon
;$
;.N MOV     R0,R9                         ;This section gets the value of the
;89 MOV     R1,#13                        ;Issue Number.
;B SWI     "String_Val"
;L SUB     R8,R1,#12
;V
;`P MOV     R0,#1                         ;This section reads back to the start
;jB MOV     R1,#1                         ;of the current record.
;t BL      GetRecords
;~
;�H .lastyearloop                         ;This is the start of a loop.
;�R LDR     R0,[R10,#record%]             ;This section exits the loop if we have
;�E MOV     R1,#1                         ;reached the first record.
;� CMP     R0,R1
;� BEQ     lastyearloopend
;�
;�M MOV     R0,#1                         ;This section reads back 1 record.
;� MOV     R1,#1
;� BL      GetRecords
;�
;�O ADD     R0,R10,#record                ;This section finds the start of the
;�G ADD     R1,R10,#backslash             ;third field (Issue Number).
< MOV     R2,#13
<
 MOV     R3,#0
< SWI     "String_Instr"
< ADD     R3,R3,#1
<( SWI     "String_Instr"
<2
<<N ADD     R0,R0,R3                      ;This section gets the value of the
<F8 ADD     R0,R0,#1                      ;Issue Number
<P MOV     R1,#�("\")
<Z SWI     "String_Val"
<d
<nR CMP     R1,R8                         ;This section compares the Issue number
<xQ BGE     lastyearloop                  ;that we're looking for with the Issue
<�D                                       ;Number that we've found.
<� .lastyearloopend
<�
<� BL      Update
<� SWI     "Hourglass_Off"
<�
<�LDMFD    R13!,{R0-R12,PC}^
<�
<�R;-----------------------------------------------------------------------------
<�4;                           *** SelectInSave ***
<�P;This subroutine deals with Select being clicked over the Save Dialogue Box.
<�
<�.SelectInSave
=
=STMFD    R13!,{R0-R12,R14}
=
=" MOV      R0,R8
=,
=6Q CMP      R6,#4                        ;This section changes the state of the
=@O  LDREQ    R0,[R10,#multiple%]         ;Multiple Issue icon and updates the
=JM  �EQ    R0,R0,#1                    ;Leafname as appropriate when Select
=TN  STREQ    R0,[R10,#multiple%]         ;is clicked over the Multiple icon.
=^  BLEQ     UpdateLeafName
=h
=rN CMP      R6,#1                        ;This calls a subroutine to start a
=|R  BLEQ     StartDrag                   ;Drag when the user drags the File Icon
=�
=�P CMP      R6,#3                        ;This section reads the Filename from
=�M  �Q    R1,#2                       ;the icon when Select is clicked over
=�I  �Q    R2,R9                       ;the 'OK' icon. It then saves the
=�N  BLEQ     ReadIcon                    ;records to the file and closes the
=�;  BLEQ     SaveIssue                   ;Menu Structure.
=�  MVNEQ    R1,#0
=�   SWIEQ    "Wimp_CreateMenu"
=�
=�K MOV      R1,#7                        ;This is Start Issue icon number
=�
=�P CMP      R6,#8                        ;This decreses the value of the Start
=�O  BLEQ     down                        ;Issue Icon and updates the Leafname
>Q  LDREQ    R1,[R10,#multiple%]         ;if neccessary, when Select is clicked
>P  CMPEQ    R1,#0                       ;over the Start Down icon in the Save
>6   �Q    R1,#7                      ;Dialogue box.
>&   �Q    R2,R9
>0   BLEQ     ReadIcon
>:   �Q    R1,#10
>D   BLEQ     WriteIcon
>N   BLEQ     UpdateLeafName
>X
>bQ CMP      R6,#9                        ;This increases the value of the Start
>lO  BLEQ     up                          ;Issue Icon and updates the Leafname
>vQ  LDREQ    R1,[R10,#multiple%]         ;if neccessary, when Select is clicked
>�N  CMPEQ    R1,#0                       ;over the Start Up icon in the Save
>�6   �Q    R1,#7                      ;Dialogue box.
>�   �Q    R2,R9
>�   BLEQ     ReadIcon
>�   �Q    R1,#10
>�   BLEQ     WriteIcon
>�   BLEQ     UpdateLeafName
>�
>�N MOV      R1,#10                       ;This is the End Issue Icon number.
>�
>�P CMP      R6,#11                       ;This section decreases the End Issue
>�H  BLEQ     down                        ;icon when Select is clicked.
>�
?P CMP      R6,#12                       ;This section increases the End Issue
?H  BLEQ     up                          ;icon when Select is clicked.
?
? LDMFD    R13!,{R0-R12,PC}^
?*
?4R;-----------------------------------------------------------------------------
?>5;                            *** AdjustInSave ***
?HQ; This subroutine deals with Adjust being clicked over the Save dialogue box.
?RR; NB ; When Adjust is clicked over the adjuster icons, the Risc OS Style Guide
?\P; requires the adjustment to be made in the opposite direction to the arrow.
?f
?p.AdjustInSave
?z
?�STMFD    R13!,{R0-R12,R14}
?�
?�? MOV      R0,R8                        ;Save window handle.
?�
?�M CMP      R6,#4                        ;This section updates the multiple
?�Q  LDREQ    R0,[R10,#multiple%]         ;flag and calls a subroutine to update
?�L  �EQ    R0,R0,#1                    ;the leafname in the filename icon.
?�"  STREQ    R0,[R10,#multiple%]
?�  BLEQ     UpdateLeafName
?�
?�N CMP      R6,#1                        ;This calls a subroutine to start a
?�R  BLEQ     StartDrag                   ;Drag when the user drags the fileicon.
?�
@P CMP      R6,#3                        ;This section reads the filename from
@Q  �Q    R1,#2                       ;the filename icon and calls a subroutine
@E  �Q    R2,R9                       ;to save the selected issues.
@$  BLEQ     ReadIcon
@.  BLEQ     SaveIssue
@8
@B@ MOV      R1,#7                        ;'Start' icon number.
@L
@VO CMP      R6,#8                        ;This section increases the value in
@`P  BLEQ     up                          ;Start icon and calls a subroutine to
@jO    LDREQ    R1,[R10,#multiple%]       ;change the leafname in the filename
@t1    CMPEQ    R1,#0                     ;icon.
@~     �Q    R1,#7
@�     �Q    R2,R9
@�     BLEQ     ReadIcon
@�     �Q    R1,#10
@�     BLEQ     WriteIcon
@�      BLEQ     UpdateLeafName
@�
@�O CMP      R6,#9                        ;This section decreases the value of
@�P  BLEQ     down                        ;Start icon and calls a subroutine to
@�O    LDREQ    R1,[R10,#multiple%]       ;change the leafname in the filename
@�1    CMPEQ    R1,#0                     ;icon.
@�     �Q    R1,#7
@�     �Q    R2,R9
A     BLEQ     ReadIcon
A
     �Q    R1,#10
A     BLEQ     WriteIcon
A      BLEQ     UpdateLeafName
A(
A2> MOV      R1,#10                       ;'End' icon number.
A<
AFO CMP      R6,#11                       ;This section increases the value of
AP9  BLEQ     up                          ;the End icon.
AZ
AdO CMP      R6,#12                       ;This section decreases the value of
An9  BLEQ     down                        ;the End icon.
Ax
A�LDMFD    R13!,{R0-R12,PC}^
A�
A�R;-----------------------------------------------------------------------------
A�3;                             *** StartDrag ***
A�R; This subroutine initiates a drag operation when the user drags our file icon
A�R; from the Save dialogue box. Depending on how the host computer is configured
A�Q; either a dashed outline or a solid sprite will follow the mouse pointer for
A�Q; the duration of the drag. A 'Drag_Finished' reason code will be returned to
A�C; us by Wimp_Poll when the user releases all the mouse buttons.
A�
A�.StartDrag
A�
A�STMFD    R13!,{R0-R12,R14}
B
BO LDR      R0,[R12,#save%]              ;This section stores the Save window
BR STR      R0,[R12,#block%+0]           ;handle in the Wimp Parameter Block and
B"@ STR      R0,[R9,#0]                   ;the Misc. workspace.
B,
B6R MOV      R0,#1                        ;This section stores the icon handle of
B@L STR      R0,[R12,#block%+4]           ;the File icon in the Wimp Block.
BJ
BTO ADD      R1,R12,#block%               ;This section gets information about
B^J SWI      "Wimp_GetIconState"          ;the position of the File icon.
Bh
BrO MOV      R1,R9                        ;This section gets information about
B|R SWI      "Wimp_GetWindowState"        ;the position of the Save Dialogue box.
B�
B�M LDR      R1,[R9,#4]                   ;Visible area minimum x coordinate
B�S LDR      R2,[R9,#20]                  ;Scroll x offset relative to work origin
B�Q SUB      R1,R1,R2                     ;calculate x offset of icon in window.
B�
B�N LDR      R2,[R9,#16]                  ;Visible area maximum y coordinate.
B�S LDR      R3,[R9,#24]                  ;Scroll y offset relative to work origin
B�Q SUB      R2,R2,R3                     ;calculate y offset of icon in window.
B�
B�R LDR      R0,[R12,#block%+8]           ;This section calculates the actual max
B�N ADD      R0,R0,R1                     ;y coordinate of the icon in screen
B�8 STR      R0,[R12,#block%+8]           ;coordinates.
B�
CR LDR      R0,[R12,#block%+12]          ;This section calculates the actual max
CN ADD      R0,R0,R2                     ;x coordinate of the icon in screen
C8 STR      R0,[R12,#block%+12]          ;coordinates.
C&
C0R LDR      R0,[R12,#block%+16]          ;This section calculates the actual min
C:N ADD      R0,R0,R1                     ;y coordinate of the icon in screen
CD8 STR      R0,[R12,#block%+16]          ;coordinates.
CN
CXR LDR      R0,[R12,#block%+20]          ;This section calculates the actual min
CbN ADD      R0,R0,R2                     ;x coordinate of the icon in screen
Cl8 STR      R0,[R12,#block%+20]          ;coordinates.
Cv
C�M MOV      R0,#5                        ;Drag type 5 - Drag fixed sixe box
C�  STR      R0,[R12,#block%+4]
C�
C�S MOV      R0,#0                        ;This section sets the parent box, which
C�R STR      R0,[R12,#block%+24]          ;the icon can be dragged around inside,
C�< STR      R0,[R12,#block%+28]          ;to maximum size.
C� MVN      R0,#0
C�! STR      R0,[R12,#block%+32]
C�! STR      R0,[R12,#block%+36]
C�
C�Q ADD      R1,R12,#block%               ;This section starts a drag operation.
C� SWI      "Wimp_DragBox"
C�
DLDMFD    R13!,{R0-R12,PC}^
D
DS;------------------------------------------------------------------------------
D 2;                           *** KeyPressed ***
D*Q; This section deals with keypresses in any of our writeable icons. Printable
D4Q; characters which are allowed by the icons validation string will be written
D>M; automatically into the writable icon. Only non printable characters are
DHD; returned to us via a 'Key_Pressed' reason code from Wimp_Poll.
DR
D\.KeyPressed
Df
DpSTMFD    R13!,{R0-R12,R14}
Dz
D�: LDR      R2,[R12,#block%+0]           ;Window handle.
D�8 LDR      R3,[R12,#block%+4]           ;Icon handle.
D�< LDR      R4,[R12,#block%+24]          ;Keycode pressed.
D�A LDR      R5,[R12,#search%]            ;Search window handle.
D�? LDR      R6,[R12,#edit%]              ;Edit window handle.
D�
D�R CMP      R2,R5                        ;This section starts a search if Return
D�O  CMPEQ    R3,#1                       ;is pressed in the writeable icon in
D�N   CMPEQ    R4,#13                     ;Search Window. It also removes the
D�A     BLEQ    StartSearch               ;Menu from the screen.
D�     MVNEQ   R1,#0
D�"     SWIEQ   "Wimp_CreateMenu"
D�"     LDMEQFD R13!,{R0-R12,PC}^
EN                                       ;This section calls a subroutine to
EM CMP      R6,R2                        ;move the caret down into the next
EQ  CMPEQ    R4,#13                      ;writeable icon when Return is pressed
E$?   BLEQ     movecaretdown              ;in the Edit window.
E.!   LDMEQFD  R13!,{R0-R12,PC}^
E8
EBN CMP      R6,R2                        ;This section calls a subroutine to
ELJ  �Q    R8,   #&100                 ;move the caret down into the next
EVQ  ADDEQ    R8,R8,#&08E                 ;writeable icon when the Down arrow is
E`K  CMPEQ    R4,R8                       ;pressed within the Edit window.
Ej   BLEQ     movecaretdown
Et!   LDMEQFD  R13!,{R0-R12,PC}^
E~
E�N CMP      R6,R2                        ;This section calls a subroutine to
E�H  �Q    R8,   #&100                 ;move the caret up into the next
E�O  ADDEQ    R8,R8,#&08F                 ;writeable icon when the Up arrow is
E�K  CMPEQ    R4,R8                       ;pressed within the Edit window.
E�   BLEQ     movecaretup
E�!   LDMEQFD  R13!,{R0-R12,PC}^
E�
E�N LDR      R8,[R12,#save%]              ;This section calls a subroutine to
E�L CMP      R2,R8                        ;save or export article data when
E�Q  CMPEQ    R4,#13                      ;Return is pressed within the Filename
E�M   CMPEQ    R3,#2                      ;icon in the Save dialogue box. It
E�>    �Q    R0,R8                     ;also closes the menu.
F    �Q    R1,#2
F
    �Q    R2,R9
F    BLEQ     ReadIcon
F    BLEQ     SaveIssue
F(    MVNEQ    R1,#0
F2"    SWIEQ    "Wimp_CreateMenu"
F<"    LDMEQFD  R13!,{R0-R12,PC}^
FF
FPL CMP      R2,R8                        ;This section updates the default
FZN  CMPEQ    R4,#13                      ;Filename when Return is pressed in
Fd=   CMPEQ    R3,#7                      ;Start issue icon.
Fn$    LDREQ    R0,[R10,#multiple%]
Fx    CMPEQ    R0,#0
F�     �Q    R0,R8
F�     �Q    R1,#7
F�     �Q    R2,R9
F�     BLEQ     ReadIcon
F�     �Q    R1,#10
F�     BLEQ     WriteIcon
F�      BLEQ     UpdateLeafName
F�#     LDMEQFD  R13!,{R0-R12,PC}^
F�
F�Q LDR      R0,[R12,#block%+24]          ;This section passes any keypresses we
F�N SWI      "Wimp_ProcessKey"            ;don't understand back to the WIMP.
F�
F�LDMFD    R13!,{R0-R12,PC}^
G
GS;------------------------------------------------------------------------------
G1;                         *** MoveCaretUp ***
G"M; This section moves the caret into the previous icon in the Edit window.
G,
G6.movecaretup
G@
GJSTMFD    R13!,{R0-R12,R14}
GT
G^Q CMP      R3,#18                       ;This section checks that the caret is
GhL  LDMLSFD  R13!,{R0-R12,PC}^           ;not in the first writeable icon.
Gr
G|N SUB      R7,R3,#1                     ;This section reads the contents of
G�P MOV      R0,R2                        ;previous icon into the misc. buffer.
G� MOV      R1,R7
G� MOV      R2,R9
G� BL       ReadIcon
G�
G�P MOV      R0,R9                        ;This section finds the length of the
G�R MOV      R1,#13                       ;string in the previous writeable icon.
G� SWI      "String_Len"
G�Q                                       ;This section moves the caret to after
G�N MOV      R5,R1                        ;the last character in the previous
G�; MOV      R0,R6                        ;writeable icon.
G� MOV      R1,R7
G� MVN      R4,#0
H% SWI      "Wimp_SetCaretPosition"
H
HLDMFD    R13!,{R0-R12,PC}^
H&
H0S;------------------------------------------------------------------------------
H:1;                       *** MoveCaretDown ***
HDK; This section moves the caret into the next writeable icon in the Edit
HN
; window.
HX
Hb.movecaretdown
Hl
HvSTMFD    R13!,{R0-R12,R14}
H�
H�Q CMP      R3,#22                       ;This section checks that the caret is
H�Q  ADDLT    R7,R3,#1                    ;not in the last icon already and then
H�O  MOVLT    R0,R2                       ;reads the string into misc. buffer.
H�  MOVLT    R1,R7
H�  MOVLT    R2,R9
H�  BLLT     ReadIcon
H�
H�P  MOVLT    R0,R9                       ;This section finds the length of the
H�3  MOVLT    R1,#13                      ;string.
H�  SWILT    "String_Len"
H�
H�R  MOVLT    R5,R1                       ;This section positions the caret after
IP  MOVLT    R0,R6                       ;the last character in the next icon.
I  MOVLT    R1,R7
I  MVNLT    R4,#0
I &  SWILT    "Wimp_SetCaretPosition"
I*   LDMLTFD  R13!,{R0-R12,PC}^
I4
I>Q CMP      R4,#13                       ;This section checks if the Return key
IHP  LDMNEFD  R13!,{R0-R12,PC}^           ;was pressed else ends the subroutine
IR
I\N BL       storerecord                  ;This section calls a subroutine to
IfP MOV      R0,#13                       ;update the IndexFile with the edited
IpP STRB     R0,[R9]                      ;record. The description icon is then
Iz4 LDR      R0,[R12,#edit%]              ;cleared.
I� MOV      R2,R9
I� MOV      R1,#22
I� BL       WriteIcon
I�
I�Q LDR      R6,[R10,#editrecord%]        ;This section checks to see if we have
I�N CMP      R6,#0                        ;been adding new records. If so the
I�N  �Q    R1,#20                      ;caret is positioned at the end of the
I�J  �Q    R2,R9                       ;Page No. icon, ready for the next
I�?  BLEQ     ReadIcon                    ;record to be input.
I�  �Q    R0,R9
I�  �Q    R1,#13
I�  SWIEQ    "String_Len"
I�  �Q    R5,R1
J  LDREQ    R0,[R12,#edit%]
J  �Q    R1,#20
J  MVNEQ    R4,#0
J$&  SWIEQ    "Wimp_SetCaretPosition"
J.
J8LDMFD    R13!,{R0-R12,PC}^
JB
JLS;------------------------------------------------------------------------------
JV4;                            *** StoreRecord ***
J`P; This subroutine updates the IndexFile by removing and adding the record as
JjP; appropriate. If the record is a new one it is simply added. If it is being
JtO; edited the older version of the record is removed first. If the record is
J~'; to be deleted it is just removed.
J�
J�.storerecord
J�
J�STMFD    R13!,{R0-R12,R14}
J�
J� SWI      "Hourglass_On"
J�
J� LDR      R8,[R12,#edit%]
J�M                                       ;The first part of this subroutine
J�Q                                       ;creates a record from the contents of
J�M                                       ;all the icons in the Edit window.
J�
KM LDR      R0,[R10,#editmonth%]      ;This is section converts the numeric
K
L ADD      R1,R10,#record               ;month number into a string which
KB MOV      R2,#&100                     ;represents the number.
K" SWI      "OS_ConvertInteger1"
K( MOV      R2,R1
K2 MOV      R0,#�("\")
K< STRB     R0,[R2],#1
KF
KPG MOV      R0,R8                        ;This section adds the year.
KZ MOV      R1,#18
Kd BL       ReadIcon
Kn MOV      R0,R2
Kx MOV      R1,#13
K� SWI      "String_Len"
K� CMP      R1,#0
K�  �Q    R1,#1
K�  �Q    R0,#�("0")
K�  STREQB   R0,[R2]
K� ADD      R2,R2,R1
K� MOV      R0,#�("\")
K� STRB     R0,[R2],#1
K�
K�K MOV      R0,R8                        ;This section adds the Issue No.
K� MOV      R1,#19
K� BL       ReadIcon
K� MOV      R0,R2
L MOV      R1,#13
L SWI      "String_Len"
L CMP      R1,#0
L"  �Q    R1,#1
L,  �Q    R0,#�("0")
L6  STREQB   R0,[R2]
L@ ADD      R2,R2,R1
LJ MOV      R0,#�("\")
LT STRB     R0,[R2],#1
L^J                                       ;This section adds the Page No.
Lh MOV      R0,R8
Lr MOV      R1,#20
L| BL       ReadIcon
L� MOV      R0,R2
L� MOV      R1,#13
L� SWI      "String_Len"
L� CMP      R1,#0
L�  �Q    R1,#1
L�  �Q    R0,#�("0")
L�  STREQB   R0,[R2]
L� ADD      R2,R2,R1
L� MOV      R0,#�("\")
L� STRB     R0,[R2],#1
L�
L�H MOV      R0,R8                        ;This section adds the Topic.
L� MOV      R1,#21
M BL       ReadIcon
M MOV      R0,R2
M MOV      R1,#13
M& SWI      "String_Len"
M0 ADD      R2,R2,R1
M: MOV      R0,#�("\")
MD STRB     R0,[R2],#1
MN
MXN MOV      R0,R8                        ;This section adds the Description.
Mb MOV      R1,#22
Ml BL       ReadIcon
Mv MOV      R0,R2
M� MOV      R1,#13
M� SWI      "String_Len"
M� CMP      R1,#1
M�  SWILE   "Hourglass_Off"
M�  LDMLEFD R13!,{R0-R12,PC}^
M� ADD      R2,R2,R1
M� MOV      R0,#13
M� STRB     R0,[R2],#1
M�
M�P MOV      R0,#&CF                      ;This section opens the IndexFile for
M�5 ADD      R1,R10,#indexfile            ;updating.
M� SWI      "XOS_Find"
M�  BVS      noindex
N$ STR      R0,[R10,#indexhandle%]
N# STR      R0,[R10,#filehandle%]
N
N O LDR      R0,[R10,#editrecord%]        ;This section removes the old record
N*L CMP      R0,#0                        ;if neccesary and closes the edit
N4>  BLNE     remove                      ;window afterwards.
N>  LDRNE    R0,[R12,#edit%]
NH!  STRNE    R0,[R12,#block%+0]
NR  ADDNE    R1,R12,#block%
N\!  SWINE    "Wimp_CloseWindow"
Nf
NpO CMP     R6,#26                        ;This section adds the record to the
Nz  MOVNE    R8,#0
N�  BLNE     findplace
N�>  BLNE     insert                      ;index if necessay.
N�
N�O LDR      R0,[R10,#show%]              ;This section updates a count of the
N�Q CMP      R0,#1                        ;number of records in the current file
N�9  LDREQ    R1,[R10,#indexmax%]         ;if necessary.
N�  STREQ    R1,[R10,#max%]
N�
N�Q LDR      R0,[R10,#record%]            ;This section checks if the new record
N�Q LDR      R1,[R10,#max%]               ;is greater than the maximum and if so
N�@ CMP      R0,R1                        ;updates the maximum.
N�   STRGT    R1,[R10,#record%]
N�  MOVGT    R0,R1
O
OQ MOV      R1,#2                        ;This section reads the current record
OB BL       GetRecords                   ;into the record buffer
O$
O.N MOV      R0,#0                        ;This section closes the index file
O8$ LDR      R1,[R10,#indexhandle%]
OB SWI      "XOS_Find"
OL
OV BL       Update
O` SWI      "Hourglass_Off"
Oj
OtLDMFD    R13!,{R0-R12,PC}^
O~
O�S;------------------------------------------------------------------------------
O�-;                          *** Remove ***
O�P; This section removes the original copy of the record which is being edited
O�; from the index file.
O�
O�
;On Entry
O�0;        R0 = Number of record to be deleted
O�
O�.remove
O�
O�STMFD    R13!,{R0-R12,R14}
O�
PQ LDR      R7,[R10,#indexmax%]          ;This section multiplies the number of
P
O SUB      R7,R7,R0                     ;records 'til the end of the file by
PN MOV      R8,   R7, LSL #3             ;by 88 - the length of each record.
P ADD      R8,R8,R7, LSL #4
P( ADD      R8,R8,R7, LSL #6
P2 MOV      R5,R0
P<
PFN CMP      R8,#0                        ;This section moves the file extent
PPG  �Q    R0,#2                       ;back by 88 bytes - one record.
PZ%  LDREQ    R1,[R10,#indexhandle%]
Pd  SWIEQ    "OS_Args"
Pn  �Q    R0,#3
Px  SUBEQ    R2,R2,#88
P�  SWIEQ    "OS_Args"
P�"  LDREQ    R0,[R10,#indexmax%]
P�  SUBEQ    R0,R0,#1
P�"  STREQ    R0,[R10,#indexmax%]
P�   LDMEQFD  R13!,{R0-R12,PC}^
P�
P�O MOV      R0,#2                        ;This section grabs enough memory to
P�P �LongAdr("",1,heap)                  ;store the records after the record to
P�7 MOV      R3,R8                        ;be deleted.
P� SWI      "XOS_Heap"
P�   BLVS    noroom
P�    LDMVSFD R13!,{R0-R12,PC}^
P� MOV      R6,R2
Q
Q MOV      R7,   R5, LSL #3
Q ADD      R7,R7,R5, LSL #4
Q" ADD      R7,R7,R5, LSL #6
Q,
Q6Q MOV      R0,#3                        ;This section loads in all the records
Q@J LDR      R1,[R10,#indexhandle%]       ;after the record to be deleted
QJ MOV      R3,R8
QT MOV      R4,R7
Q^ SWI      "XOS_GBPB"
Qh  BVS      noindex
Qr
Q|O ADD      R2,R7,R8                     ;This section moves the file pointer
Q�E SUB      R2,R2,#88                    ;back 1 record - 88 bytes.
Q� SWI      "XOS_Args"
Q�  BVS      noindex
Q�
Q�N MOV      R0,#1                        ;This section saves out the records
Q�N MOV      R2,R6                        ;Thus deleting the required record.
Q� MOV      R3,R8
Q� SUB      R4,R7,#88
Q� SWI      "XOS_GBPB"
Q�  BCS      cantupdate
Q�
Q�L MOV      R0,#3                        ;This section releases the memory
Q�3 �LongAdr("",1,heap)                  ;claimed.
R MOV      R2,R6
R SWI      "XOS_Heap"
R  BVS      noheap
R&
R0Q LDR      R0,[R10,#indexmax%]          ;This section decrements the number of
R:4 SUB      R0,R0,#1                     ;records.
RD! STR      R0,[R10,#indexmax%]
RN
RXLDMFD    R13!,{R0-R12,PC}^
Rb
RlS;------------------------------------------------------------------------------
Rv1;                           *** FindPlace ***
R�Q; This subroutine locates the position in the file where the new record needs
R�B; to inserted. It checks the Issue Number and the Page number.
R�
R�;On Exit
R�M;        R8 = Position in file where the record should be inserted after.
R�
R�.findplace
R�
R�$STMFD    R13!,{R0-R7,R9-R12,R14}
R�
R�N ADD      R0,R10,#record               ;Get Issue Number to Search For and
R�: ADD      R1,R10,#backslash            ;holds it in R6
R� MOV      R2,#13
S MOV      R3,#0
S SWI      "String_Instr"
S ADD      R3,R3,#1
S  SWI      "String_Instr"
S* ADD      R3,R3,#1
S4 ADD      R0,R0,R3
S> MOV      R1,#�("\")
SH SWI      "String_Val"
SR MOV      R6,R1
S\
Sf
SpO .issueloop                            ;This loop steps through the records
SzM                                       ;until the correct issue is found.
S�
S�I MOV      R0,#2                        ;This section finds the length
S�K LDR      R1,[R10,#indexhandle%]       ;of the file and checks that the
S�E SWI      "XOS_Args"                   ;end has not been reached.
S�  BVS      noindex
S� CMP      R8,R2
S�(  LDMGEFD    R13!,{R0-R7,R9-R12,PC}^
S�
S�K MOV      R0,#1                        ;This section positions the file
S�3 MOV      R2,R8                        ;pointer
S� SWI      "XOS_Args"
S�  BVS      noindex
S�
TQ MOV      R0,R9                        ;This section reads each record into a
T2 MOV      R2,#256                      ;buffer
T MOV      R3,#13
T$ MOV      R4,#0
T. SWI      "XString_Get$#"
T8  BVS      noindex
TB
TLR MOV      R0,R9                        ;This section isolates the Issue number
TVJ ADD      R1,R10,#backslash            ;and and gets its value into R1
T` MOV      R2,#13
Tj MOV      R3,#0
Tt SWI      "String_Instr"
T~ ADD      R3,R3,#1
T� SWI      "String_Instr"
T� ADD      R3,R3,#1
T� ADD      R0,R0,R3
T� MOV      R1,#�("\")
T� SWI      "String_Val"
T�
T�R CMP      R1,R6                        ;This section compares the issue number
T�P  ADDLT    R8,R8,#88                   ;of the current record with the issue
T�Q  BLT      issueloop                   ;number we are looking for and repeats
T�C                                       ;the loop if it is less.
T�
T�
UP ADD      R0,R10,#record               ;This section gets the page number to
U
Q ADD      R1,R10,#backslash            ;search for and holds the result in R6
U MOV      R2,#13
U MOV      R3,#0
U( SWI      "String_Instr"
U2 ADD      R3,R3,#1
U< SWI      "String_Instr"
UF ADD      R3,R3,#1
UP SWI      "String_Instr"
UZ ADD      R3,R3,#1
Ud ADD      R0,R0,R3
Un MOV      R1,#�("\")
Ux SWI      "String_Val"
U� MOV      R6,R1
U�
U� MOV      R5,#0
U�
U�O .pageloop                             ;This loop steps through the records
U�L                                       ;until the correct page is found.
U�
U�P MOV      R0,#2                        ;This section finds the length of the
U�O LDR      R1,[R10,#indexhandle%]       ;file and checks we have not reached
U�; SWI      "XOS_Args"                   ;the end already
U�  BVS      noindex
U� CMP      R2,R8
U�(  LDMLEFD    R13!,{R0-R7,R9-R12,PC}^
V
VO MOV      R0,#1                        ;This section reads each record into
V5 MOV      R2,R8                        ;a buffer.
V" SWI      "XOS_Args"
V,  BVS      noindex
V6 MOV      R0,R9
V@ MOV      R2,#256
VJ MOV      R3,#13
VT MOV      R4,#0
V^ SWI      "XString_Get$#"
Vh  BVS      noindex
Vr
V|Q MOV      R0,R9                        ;This section isolates the Page number
V�= ADD      R1,R10,#backslash            ;from each record.
V� MOV      R2,#13
V� MOV      R3,#0
V� SWI      "String_Instr"
V� ADD      R3,R3,#1
V� SWI      "String_Instr"
V� ADD      R3,R3,#1
V� SWI      "String_Instr"
V� ADD      R3,R3,#1
V� ADD      R0,R0,R3
V� MOV      R1,#�("\")
V� SWI      "String_Val"
V�
WN CMP      R1,R5                        ;This section compares the two page
WO  MOVLT    R2,R8                       ;numbers and exits the subroutine if
W6  LDMLTFD  R13!,{R0-R7,R9-R12,PC}^     ;necessary.
W&
W0 MOV      R5,R1
W:
WDL CMP    R1,R6                          ;This section repeats the loop if
WNK  ADDLE    R8,R8,#88                   ;the page numbers are not equal.
WX  BLE      pageloop
Wb
Wl MOV      R2,R8
Wv
W�$LDMFD    R13!,{R0-R7,R9-R12,PC}^
W�
W�R;-----------------------------------------------------------------------------
W�-;                          *** Insert ***
W�R; This subroutine inserts the new record into the file at the place pointed to
W�; by 'findplace'.
W�
W�.insert
W�
W�STMFD    R13!,{R0-R12,R14}
W�
W� MOV      R8,#0
W� BL       findplace
X
XQ LDR      R0,[R10,#indexmax%]          ;This section calculates the length of
XL MOV      R7,   R0, LSL #3             ;the indexfile by multiplying the
X O ADD      R7,R7,R0, LSL #4             ;number of records by 88. The number
X*Q ADD      R7,R7,R0, LSL #6             ;of bytes after the insertion point is
X4? SUB      R7,R7,R8                     ;calculated from R8.
X>
XHR CMP      R7,#0                        ;The next section is skipped if the new
XRR  BLE      saverecord                  ;record is to go at the end of the file
X\
XfR MOV      R0,#2                        ;This section claims enough free memory
XpK �LongAdr("",1,heap)                  ;to load in the records after the
Xz< MOV      R3,R7                        ;insertion point.
X� SWI      "XOS_Heap"
X�   BLVS    noroom
X�    LDMVSFD R13!,{R0-R12,PC}^
X� MOV      R6,R2
X�
X�Q MOV      R0,#3                        ;This section loads in all the records
X�F LDR      R1,[R10,#indexhandle%]       ;after the insertion point.
X� MOV      R3,R7
X� MOV      R4,R8
X� SWI      "XOS_GBPB"
X�  BVS      cantupdate
X�
X� .saverecord
YQ ADD      R0,R10,#record               ;This section calculates the number of
YQ MOV      R1,#13                       ;of bytes needed to pad the new record
Y< SWI      "String_Len"                 ;out to 88 bytes.
Y$ MOV      R2,#13
Y. STRB     R2,[R0,R1]
Y8 ADD      R0,R0,R1
YB RSB      R1,R1,#87
YL SUB      R1,R1,#1
YV
Y`O MOV      R2,#0                        ;This section fills the remainder of
YjG.insertloop                            ;the record with zero bytes.
Yt STRB     R2,[R0,R1]
Y~ SUBS     R1,R1,#1
Y�  BNE      insertloop
Y�
Y�R MOV      R0,#1                        ;This section saves the new record into
Y�; LDR      R1,[R10,#indexhandle%]       ;the index file.
Y� ADD      R2,R10,#record
Y� MOV      R3,#88
Y� MOV      R4,R8
Y� SWI      "XOS_GBPB"
Y�  BVS      cantupdate
Y�
Y�O LDR      R0,[R10,#indexmax%]          ;This section increments the maximum
Y�: ADD      R0,R0,#1                     ;record number.
Z! STR      R0,[R10,#indexmax%]
Z

ZO CMP      R7,#0                        ;This section ends the subroutine if
ZO  LDMEQFD  R13!,{R0-R12,PC}^           ;the record was inserted at the end.
Z(
Z2P MOV      R0,#1                        ;This section writes the remainder of
Z<K MOV      R2,R6                        ;the records back into the file.
ZF MOV      R3,R7
ZP SWI      "XOS_GBPB"
ZZ  BVS      cantupdate
Zd
ZnL MOV     R0,#3                         ;This section releases the memory
Zx3 �LongAdr("",1,heap)                  ;claimed.
Z� MOV     R2,R6
Z� SWI     "XOS_Heap"
Z�  BVS     noheap
Z�
Z�LDMFD    R13!,{R0-R12,PC}^
Z�
Z�S;------------------------------------------------------------------------------
Z�4;                           *** DragFinished ***
Z�R; This subroutine is called when the user releases all the mouse buttons after
Z�M; performing a drag operation. i.e. dragging our save icon to a directory
Z�; display.
Z�
Z�.DragFinished
[
[STMFD    R13!,{R0-R12,R14}
[
["N LDR      R0,[R12,#save%]              ;This section reads the string from
[,N MOV      R1,#2                        ;the filename icon (#2) in the save
[65 MOV      R2,R9                        ;dialogue.
[@ BL       ReadIcon
[J
[TP MOV      R0,R9                        ;This section finds the length of the
[^5 MOV      R1,#13                       ;filename.
[h SWI      "String_Len"
[r MOV      R8,R1
[|
[�P SUB      R1,R1,#1                     ;This section locates the last '.' in
[�O .dragfinishedloop                     ;filename. Note; Sub-directory names
[�P  LDRB     R0,[R9,R1]                  ;are seperated by a full stop, so the
[�O  CMP      R0,#�(".")                ;name after the final full stop is the
[�5   ADDEQ    R1,R1,#1                   ;leafname.
[�   CMPNE    R1,#0
[�    SUBNE    R1,R1,#1
[� BNE      dragfinishedloop
[�
[� SUB      R8,R8,R1
[�
[�O MOV      R0,R9                        ;This section isolates the leafname.
[� MOV      R1,R9
\ MOV      R2,#13
\ MOV      R3,R8
\ SWI      "String_Right$"
\&
\0R ADD      R1,R12,#block%               ;This section gets details of the mouse
\:O SWI      "Wimp_GetPointerInfo"        ;pointer and uses the information to
\DP                                       ;create a message block. This message
\NM                                       ;is then sent to the Task Manager.
\X
\b> LDR      R0,[R12,#block%+0]           ;Mouse X coordinate
\l! STR      R0,[R12,#block%+28]
\v
\�> LDR      R0,[R12,#block%+4]           ;Mouse Y coordinate
\�! STR      R0,[R12,#block%+32]
\�
\�9 LDR      R0,[R12,#block%+12]          ;Window Handle
\�! STR      R0,[R12,#block%+20]
\�
\�7 LDR      R3,[R12,#block%+16]          ;Icon Handle
\�! STR      R3,[R12,#block%+24]
\�
\�Q MOV      R0,#0                        ;Our Reference - 0 for initial message
\�! STR      R0,[R12,#block%+12]
\�
\�G MOV      R0,#1                        ;Message number - 1 DataSave
]! STR      R0,[R12,#block%+16]
]
]B MOV      R0,#88                       ;Estimated size of file
] O STR      R0,[R12,#block%+36]          ;The file will always be at least 88
]*
]44 MOV      R0,#&0AC                     ;Filetype
]>! STR      R0,[R12,#block%+40]
]H
]R= MOV      R0,R9                        ;Proposed Leafname
]\ ADD      R1,R12,#block%+44
]f MOV      R2,#13
]p SWI      "String_Move$"
]z
]�P MOV      R0,#0                        ;This section adds a terminating zero
]�A ADD      R2,R12,#block%+44            ;byte to the leafname.
]� ADD      R1,R2,R8
]� STRB     R0,[R1],#1
]�
]�P ADD      R2,R8,#44+3                  ;This section finds the length of the
]�Q BIC      R2,R2,#%11                   ;entire message block and rounds it up
]�@ STR      R2,[R12,#block%+0]           ;to the nearest word.
]�
]�O MOV      R0,#18                       ;This section calls the Wimp to pass
]�Q ADD      R1,R12,#block%               ;our message block to the Task Manager
]�! LDR      R2,[R12,#block%+20]
]�  SWI      "Wimp_SendMessage"
^
^LDMFD    R13!,{R0-R12,PC}^
^
^$S;------------------------------------------------------------------------------
^./;                       *** DataSaveAck ***
^8Q; This subroutine is called when the target task acknolwlegdes that we can go
^BP; ahead and save our data. The 'target task' will be either the Filer if the
^LR; user wants to save the file to disc or another application if the user wants
^V; to export our data.
^`
^j.DataSaveAck
^t
^~STMFD    R13!,{R0-R12,R14}
^�
^�Q ADD      R0,R12,#block%+44            ;This section copies the filename from
^�M MOV      R1,R9                        ;the message block into workspace.
^� MOV      R2,#0
^� SWI      "String_Move$"
^�
^�
^�O LDR      R0,[R12,#block%+0]           ;This section copies the contents of
^�P LDR      R8,[R12,#block%+4]           ;the message block into R0-R8 so that
^�O LDR      R1,[R12,#block%+8]           ;the message block can be rebuilt as
^�L LDR      R2,[R12,#block%+20]          ;soon as we have finished saving.
^�! LDR      R3,[R12,#block%+24]
_! LDR      R4,[R12,#block%+28]
_
! LDR      R5,[R12,#block%+32]
_! LDR      R6,[R12,#block%+36]
_! LDR      R7,[R12,#block%+40]
_(
_2 BL       SaveIssue
_<
_FQ STR      R0,[R12,#block%+0]           ;The section rebuilds the wimp message
_P2 STR      R1,[R12,#block%+12]          ;block.
_Z! STR      R2,[R12,#block%+20]
_d! STR      R3,[R12,#block%+24]
_n! STR      R4,[R12,#block%+28]
_x! STR      R5,[R12,#block%+32]
_�! STR      R6,[R12,#block%+36]
_�! STR      R7,[R12,#block%+40]
_� MOV      R0,#3
_�! STR      R0,[R12,#block%+16]
_�
_�L MOV      R0,#18                       ;This section sends a 'Data_Load'
_�R ADD      R1,R12,#block%               ;message to the target task, to confirm
_�K MOV      R2,R8                        ;that we have sent all our data.
_�  SWI      "Wimp_SendMessage"
_�
_�N MVN      R1,#0                        ;This section ensures that the menu
_�G SWI      "Wimp_CreateMenu"            ;is removed from the screen.
_�
`LDMFD    R13!,{R0-R12,PC}^
`
`
`"S;------------------------------------------------------------------------------
`,0;                          *** SaveIssue ***
`6P; This subroutine performs the actual save operation after the Wimp protocol
`@; has been performed.
`J
`T.SaveIssue
`^
`hSTMFD    R13!,{R0-R12,R14}
`r
`|Q MOV      R0,#11                       ;This section creates an empty file of
`�B MOV      R1,R9                        ;type &0AC (IndexFile).
`� MOV      R2,#&0AC
`� MOV      R4,#0
`� MOV      R5,#0
`� SWI      "XOS_File"
`�  BVS      NonSeriousError
`�
`�O MOV      R0,#&CF                      ;This section opens the new file for
`�> MOV      R1,R9                        ;read/write access.
`� SWI      "XOS_Find"
`�  BVS      NonSeriousError
`�% STR      R0,[R10,#searchhandle%]
`�
aQ MOV      R0,#&4F                      ;This section opens the Index for read
a3 ADD      R1,R10,#indexfile            ;access.
a SWI      "XOS_Find"
a&  BVS      noindex
a0# STR      R0,[R10,#filehandle%]
a:
aDL LDR      R0,[R10,#record%]            ;This section updates the current
aNQ LDR      R1,[R10,#show%]              ;record number for the current display
aX1 CMP      R1,#1                        ;mode.
ab%  STREQ    R0,[R10,#indexrecord%]
al&  STRNE    R0,[R10,#searchrecord%]
av
a�O LDR      R0,[R12,#save%]              ;This section finds the value of the
a�8 MOV      R1,#7                        ;start issue.
a� MOV      R2,R9
a� BL       ReadIcon
a� MOV      R0,R9
a� MOV      R1,#13
a� SWI      "String_Val"
a� MOV      R7,R1
a�
a�O LDR      R0,[R12,#save%]              ;This section finds the value of the
a�O MOV      R1,#10                       ;end issue. All records belonging to
a�G MOV      R2,R9                        ;these issues will be saved.
a� BL       ReadIcon
b MOV      R0,R9
b MOV      R1,#13
b SWI      "String_Val"
b  MOV      R6,R1
b* CMP      R6,R7
b4  MOVLT    R6,R7
b> ADD      R6,R6,#1
bH
bR MOV      R5,#1
b\
bfQ .startloop                            ;This section checks if the end of the
bpB  LDR    R0,[R10,#indexmax%]           ;file has been reached.
bz  CMP    R5,R0
b�   LDRGT  R7,[R10,#record%]
b�   BGT    startloopend
b�J                                       ;This section reads in a record
b�  MOV    R0,R5
b�  MOV    R1,#2
b�  BL     GetRecords
b�
b�Q  ADD     R0,R10,#record               ;This section extract the issue number
b�C  ADD     R1,R10,#backslash            ;from the record string.
b�  MOV     R2,#13
b�  MOV     R3,#0
b�  SWI     "String_Instr"
b�  ADD     R3,R3,#1
c  SWI     "String_Instr"
c
c  ADD     R0,R0,R3
c$  ADD     R0,R0,#1
c.  MOV     R1,#�("\")
c8  SWI     "String_Val"
cB
cLQ  CMP     R1,R7                        ;This section compares the Start issue
cVI   ADDLT   R5,R5,#1                    ;with the issue of the record.
c`   BLT     startloop
cj   LDR    R7,[R10,#record%]
ct   SUBGT   R7,R7,#1
c~ .startloopend
c�
c�
 .endloop
c�Q  LDR    R0,[R10,#indexmax%]           ;This section checks if the end of the
c�B  CMP    R5,R0                         ;file has been reached.
c�   BGT    endloopend
c�
c�K  MOV    R0,R5                         ;This section reads in a record.
c�  MOV    R1,#2
c�  BL     GetRecords
c�
c�R  ADD     R0,R10,#record               ;This section extracts the issue number
c�C  ADD     R1,R10,#backslash            ;from the record string.
d  MOV     R2,#13
d
  MOV     R3,#0
d  SWI     "String_Instr"
d  ADD     R3,R3,#1
d(  SWI     "String_Instr"
d2
d<  ADD     R0,R0,R3
dF  ADD     R0,R0,#1
dP  MOV     R1,#�("\")
dZ  SWI     "String_Val"
dd
dnO  CMP     R1,R6                        ;This section compares the end issue
dxO   ADDLT   R5,R5,#1                    ;number with the issue number of the
d�3   BLT     endloop                     ;record.
d�
d� .endloopend
d�  LDR     R6,[R10,#record%]
d�
d�R MOV      R0,   R7, LSL #3             ;This section multiplies the record no.
d�P ADD      R0,R0,R7, LSL #4             ;of the Start record by 88 to get its
d�A ADD      R0,R0,R7, LSL #6             ;position in the file.
d� MOV      R7,R0
d�
d�R MOV      R0,   R6, LSL #3             ;This section multiplies the record no.
d�N ADD      R0,R0,R6, LSL #4             ;of the End record by 88 to get its
d�A ADD      R0,R0,R6, LSL #6             ;position in the file.
e MOV      R6,R0
eP                                       ;This section claims enough memory to
eL MOV      R0,#2                        ;load in the records to be saved.
e" �LongAdr("",1,heap)
e, SUBS    R3,R6,R7
e6  �Q    R3,#1
e@ SWI      "XOS_Heap"
eJ  BVS      noroom
eT MOV      R5,R2
e^
ehM MOV      R0,#3                        ;This section loads in the records
erB LDR      R1,[R10,#filehandle%]        ;which are to be saved.
e| SUB      R3,R6,R7
e� MOV      R4,R7
e� SWI      "XOS_GBPB"
e�  BVS      noindex
e�
e�O MOV      R0,#0                        ;This section closes the index file.
e� SWI      "XOS_Find"
e�
e�R MOV      R0,#1                        ;This section saves the recordfs to the
e�; LDR      R1,[R10,#searchhandle%]      ;specified file.
e� MOV      R2,R5
e� SUB      R3,R6,R7
e� MOV      R4,#0
e� SWI      "XOS_GBPB"
f  BVS      NonSeriousError
f
fM MOV      R0,#0                        ;This section closes the new file.
f& SWI      "XOS_Find"
f0
f:LDMFD    R13!,{R0-R12,PC}^
fD
fNS;------------------------------------------------------------------------------
fX<;                            *** UserMessageRecieved ***
fbP; This subroutine deals with all User Messages which are sent by other tasks
fl; to us.
fv
f�.breakpoint
f�MOV PC,R14
f�
f�.UserMessageReceived
f�
f�STMFD    R13!,{R0-R12,R14}
f�
f�N LDR      R0,[R12,#block%+16]          ;This gets the message Reason code.
f�
f�O CMP      R0,#0                        ;This message tells us to close down
f�9  �Q    R0,#1                       ;our application.
f�  STREQ    R0,[R12,#quit%]
f�
gQ CMP      R0,#1                        ;Another application is trying to save
gK  BLEQ     DataSave                    ;data and wants us to import it.
g
g R CMP      R0,#2                        ;Another task is giving us the go ahead
g*=  BLEQ    DataSaveAck                  ;to save our data.
g4
g>N CMP      R0,#3                        ;The filer wants us to load a file.
gH  BLEQ     DataLoad
gR;  BLEQ     breakpoint
g\
gfQ MOV      R1,   #&500                  ;A task is requesting interactive help
gp4 ADD      R1,R1,#&002                  ;from us.
gz CMP      R0,R1
g�  BLEQ     sendhelp
g�
g�N MOV      R1,   #&40000                ;Our application updates files from
g�N ADD      R1,R1,#&000C2                ;within our resources directory. If
g�M CMP      R0,R1                        ;two copies of our application are
g�R  ADDEQ    R0,R12,#block%+28           ;running then this could cause one copy
g�R  ADDEQ    R1,R12,#appname             ;to crash when the first copy updated a
g�G  �Q    R2,#13                      ;a file that was expected to be
g�3  �Q    R3,#0                       ;unchanged.
g�P  SWIEQ    "String_Instr"              ;This message is broadcast every time
g�P  CMPEQ    R3,#0                       ;a new application is registered with
g�O   �Q    R0,#1                      ;the Wimp. We examine the new task name
g�R   STREQ    R0,[R12,#quit%]            ;and if it is identical to our own then
h>   LDREQ    R0,[R12,#task%]            ;we must terminate.
h"   LDREQ    R1,[R12,#block%+4]
h   CMPEQ    R0,R1
h$    �Q    R0,#0
h.     STREQ    R0,[R12,#quit%]
h8
hBLDMFD    R13!,{R0-R12,PC}^
hL
hVR;-----------------------------------------------------------------------------
h`2;                             *** SendHelp ***
hjQ; This subroutine is called when an Interactive Help application request help
ht(; information about our application.
h~
h�
.sendhelp
h�
h�STMFD    R13!,{R0-R12,R14}
h�
h�P LDR      R0,[R12,#block%+32]          ;This is handle of the window needing
h�0                                       ;help
h�
h�N LDR      R1,[R12,#display%]           ;This section deals with help about
h�? CMP      R0,R1                        ;the Display window.
h�  BLEQ     displayhelp
h�   LDMEQFD  R13!,{R0-R12,PC}^
h�
iN LDR      R1,[R12,#edit%]              ;This section deals with help about
i
< CMP      R0,R1                        ;the Edit window.
i  BLEQ     edithelp
i   LDMEQFD  R13!,{R0-R12,PC}^
i(
i2N LDR      R1,[R12,#search%]            ;This section deals with help about
i<> CMP      R0,R1                        ;the Search window.
iF  BLEQ     searchhelp
iP
iZLDMFD    R13!,{R0-R12,PC}^
id
inR;-----------------------------------------------------------------------------
ix4;                            *** DisplayHelp ***
i�O;This subroutine sends help messages about icons within the Display window.
i�
i�.displayhelp
i�
i�STMFD    R13!,{R0-R12,R14}
i�
i�! LDR      R0,[R12,#block%+36]
i� ADR      R1,dispnoicon
i�
i�O CMP      R0,#20                       ;This section checks the icon number
i�P  ADREQ   R1,disp20help                ;of the icon that the pointer is over
i�M CMP      R0,#21                       ;and sets R1 to point to a message
i�2  ADREQ   R1,disp21help                ;token.
j CMP      R0,#22
j  ADREQ   R1,disp22help
j CMP      R0,#23
j"  ADREQ   R1,disp23help
j, CMP      R0,#24
j6  ADREQ   R1,disp24help
j@ CMP      R0,#25
jJ  ADREQ   R1,disp25help
jT CMP      R0,#26
j^  ADREQ   R1,disp26help
jh CMP      R0,#27
jr  ADREQ   R1,disp27help
j| CMP      R0,#28
j�  ADREQ   R1,disp28help
j� CMP      R0,#29
j�  ADREQ   R1,disp29help
j� CMP      R0,#30
j�  ADREQ   R1,disp30help
j� CMP      R0,#31
j�  ADREQ   R1,disp31help
j� CMP      R0,#32
j�  ADREQ   R1,disp32help
j� CMP      R0,#33
j�  ADREQ   R1,disp33help
j� CMP      R0,#34
j�  ADREQ   R1,disp34help
k CMP      R0,#35
k  ADREQ   R1,disp35help
k CMP      R0,#37
k&  ADREQ   R1,disp37help
k0 CMP      R0,#38
k:  ADREQ   R1,disp38help
kD CMP      R0,#39
kN  ADREQ   R1,disp39help
kX CMP      R0,#40
kb  ADREQ   R1,disp40help
kl CMP      R0,#41
kv  ADREQ   R1,disp41help
k� CMP      R0,#42
k�  ADREQ   R1,disp42help
k� CMP      R0,#43
k�  ADREQ   R1,disp43help
k�
k� BL       sendhelpmessage
k�
k�LDMFD    R13!,{R0-R12,PC}^
k�
k�R;-----------------------------------------------------------------------------
k�Q; The following section contains message tokens which are to be looked up and
k�"; sent to the requesting task.
k�
l
l#.dispnoicon :EQUS "HDNoIcon"+�0
l".disp20help :EQUS "HDBack1"+�0
l #.disp21help :EQUS "HDBack10"+�0
l*$.disp22help :EQUS "HDBack100"+�0
l4%.disp23help :EQUS "HDForward1"+�0
l>&.disp24help :EQUS "HDForward10"+�0
lH'.disp25help :EQUS "HDForward100"+�0
lR".disp26help :EQUS "HDIndex"+�0
l\#.disp27help :EQUS "HDSearch"+�0
lf#.disp28help :EQUS "HDRecord"+�0
lp .disp29help :EQUS "HDMax"+�0
lz".disp30help :EQUS "HDTopic"+�0
l�$.disp31help :EQUS "HDDetails"+�0
l�".disp32help :EQUS "HDMonth"+�0
l�!.disp33help :EQUS "HDYear"+�0
l�".disp34help :EQUS "HDIssue"+�0
l�!.disp35help :EQUS "HDPage"+�0
l�!.disp37help :EQUS "HDEdit"+�0
l�%.disp38help :EQUS "HDNotFound"+�0
l�".disp39help :EQUS "HDBackM"+�0
l�%.disp40help :EQUS "HDForwardM"+�0
l�".disp41help :EQUS "HDBackY"+�0
l�%.disp42help :EQUS "HDForwardY"+�0
l�&.disp43help :EQUS "HDTopicMenu"+�0
l�
m	ALIGN
m
mR;-----------------------------------------------------------------------------
m$2;                             *** EditHelp ***
m.L;This subroutine sends help messages about icons within the Edit window.
m8
mB
.edithelp
mL
mVSTMFD    R13!,{R0-R12,R14}^
m`
mj! LDR      R0,[R12,#block%+36]
mt
m~R ADR      R1,editnoicon                ;This scetion checks the icon number of
m�Q CMP      R0,#9                        ;the icon the pointer is over and sets
m�K  ADREQ    R1,edit9help                ;R1 to point to a message token.
m� CMP      R0,#10
m�  ADREQ    R1,edit10help
m� CMP      R0,#11
m�  ADREQ    R1,edit11help
m� CMP      R0,#12
m�  ADREQ    R1,edit12help
m� CMP      R0,#13
m�  ADREQ    R1,edit13help
m� CMP      R0,#14
m�  ADREQ    R1,edit14help
n CMP      R0,#15
n
  ADREQ    R1,edit15help
n CMP      R0,#16
n  ADREQ    R1,edit16help
n( CMP      R0,#17
n2  ADREQ    R1,edit17help
n< CMP      R0,#18
nF  ADREQ    R1,edit18help
nP CMP      R0,#19
nZ  ADREQ    R1,edit19help
nd CMP      R0,#20
nn  ADREQ    R1,edit20help
nx CMP      R0,#21
n�  ADREQ    R1,edit21help
n� CMP      R0,#22
n�  ADREQ    R1,edit22help
n� CMP      R0,#23
n�  ADREQ    R1,edit23help
n� CMP      R0,#24
n�  ADREQ    R1,edit24help
n� CMP      R0,#25
n�  ADREQ    R1,edit25help
n� CMP      R0,#26
n�  ADREQ    R1,edit26help
n�
n� BL       sendhelpmessage
o
oLDMFD    R13!,{R0-R12,PC}^
o
o"S;------------------------------------------------------------------------------
o,O; This section contins message tokens which are to be looked up and sent to
o6; the requesting task.
o@
oJ%.editnoicon :EQUS "HENoIcon"+�(0)
oT$.edit9help  :EQUS "HEBackM"+�(0)
o^'.edit10help :EQUS "HEForwardM"+�(0)
oh$.edit11help :EQUS "HEBackY"+�(0)
or'.edit12help :EQUS "HEForwardY"+�(0)
o|$.edit13help :EQUS "HEBackI"+�(0)
o�'.edit14help :EQUS "HEForwardI"+�(0)
o�$.edit15help :EQUS "HEBackP"+�(0)
o�'.edit16help :EQUS "HEForwardP"+�(0)
o�$.edit17help :EQUS "HEMonth"+�(0)
o�#.edit18help :EQUS "HEYear"+�(0)
o�$.edit19help :EQUS "HEIssue"+�(0)
o�#.edit20help :EQUS "HEPage"+�(0)
o�$.edit21help :EQUS "HETopic"+�(0)
o�&.edit22help :EQUS "HEDetails"+�(0)
o�!.edit23help :EQUS "HEOK"+�(0)
o�%.edit24help :EQUS "HECancel"+�(0)
o�(.edit25help :EQUS "HETopicMenu"+�(0)
o�%.edit26help :EQUS "HEDelete"+�(0)
p	ALIGN
p
pS;------------------------------------------------------------------------------
p&6;                               *** SearchHelp ***
p0Q; This subroutine sends help messages about icons in the Search dialogue box.
p:
pD.searchhelp
pN
pXSTMFD    R13!,{R0-R12,R14}^
pb
pl! LDR      R0,[R12,#block%+36]
pv ADR      R1,searchnoicon
p� CMP      R0,#1
p�  ADREQ    R1,search1help
p� CMP      R0,#2
p�  ADREQ    R1,search2help
p� BL       sendhelpmessage
p�
p�LDMFD    R13!,{R0-R12,PC}^
p�
p�R;-----------------------------------------------------------------------------
p�P; This section contains message tokens which are to be looked up and sent to
p�; the requesting task.
p�
p�&.searchnoicon:EQUS "HSNoIcon"+�(0)
q).search1help :EQUS "HSWriteable"+�(0)
q".search2help :EQUS "HSOK"+�(0)
q	ALIGN
q 
q*R;-----------------------------------------------------------------------------
q47;                           *** SendHelpMessage ***
q>Q; This subroutine looks up the message token pointed to by R1 in the Messages
qHG; file and sends the Help Text back to the Task which requested it.
qR
q\.sendhelpmessage
qf
qpSTMFD    R13!,{R0-R12,R14}
qz
q�L LDR      R0,[R12,#block%+8]           ;This copies the Task handle from
q�R STR      R0,[R12,#block%+12]          ;Sender field to the Destination field.
q�
q�Q MOV      R0,   #&500                  ;&503 is the message number of a reply
q�> ADD      R0,R0,#&003                  ;to a help request.
q�! STR      R0,[R12,#block%+16]
q�
q�P �LongAdr("",0,messages)              ;This section looks up the actual text
q�A ADD      R2,R12,#block%+20            ;in our Messages file.
q� MOV      R3,#256-20
q�# SWI      "MessageTrans_Lookup"
q�
q�L ADD      R1,R3,#24                    ;This section sends the Help text
rR BIC      R1,R1,#%11                   ;message to the Task that requested it.
r  STR      R1,[R12,#block%+0]
r MOV      R0,#17
r$ ADD      R1,R12,#block%
r.  LDR      R2,[R12,#block%+4]
r8  SWI      "Wimp_SendMessage"
rB
rLLDMFD    R13!,{R0-R12,PC}^
rV
r`R;-----------------------------------------------------------------------------
rj0;                           *** DataLoad ***
rtP; This subroutine is called when a file icon is dragged to our iconbar icon.
r~M; If the file is of a filetype we understand then we must try to load it.
r�O; In our case a user will drag a file to our icon when they want to add its
r�; contents to the Index.
r�
r�
.DataLoad
r�
r�STMFD    R13!,{R0-R12,R14}
r�
r�
r�Q LDR      R0,[R12,#block%+40]          ;This section ensures that the file is
r�I MOV      R1,   #&0AC                  ;of Filetype &0AC (IndexFile).
r� CMP      R0,R1
r�   LDMNEFD  R13!,{R0-R12,PC}^
s
s
 SWI      "Hourglass_On"
s
sQ MOV      R0,#&4F                      ;This section opens the users file for
s(= ADD      R1,R12,#block%+44            ;read access only.
s2 SWI      "XOS_Find"
s<  BLVS     noinput
sF   LDMVSFD  R13!,{R0-R12,PC}^
sP MOV       R7,R0
sZR                                       ;This section loads the first record of
sd;  MOV      R0,#3                       ;the users file.
sn  MOV      R1,R7
sx  ADD      R2,R10,#record
s�  MOV      R3,#88
s�  MOV      R4,#0
s�  SWI      "XOS_GBPB"
s�   BLVS     noinput
s�!   LDMVSFD  R13!,{R0-R12,PC}^
s�
s�O MOV      R0,#0                        ;This section closes the users file.
s� MOV      R1,R7
s� SWI      "XOS_Find"
s�
s�Q MOV      R0,#&4F                      ;This section opens the index file for
s�= ADD      R1,R10,#indexfile            ;read access only.
s� SWI      "XOS_Find"
t  BLVS     noindex
t   LDMVSFD  R13!,{R0-R12,PC}^
t$ STR      R0,[R10,#indexhandle%]
t"
t, MOV     R8,#0
t6 BL      findplace
t@
tJO MOV      R0,#0                        ;This section closes the index file.
tT$ LDR      R1,[R10,#indexhandle%]
t^ SWI      "XOS_Find"
th  BVS      noindex
tr
t| SWI     "Hourglass_Off"
t�
t�  LDR     R0,[R10,#indexmax%]
t� MOV     R1,   R0,LSL #6
t� ADD     R1,R1,R0,LSL #4
t� ADD     R1,R1,R0,LSL #3
t� CMP     R8,R1
t�  �Q   R0,#1
t�  MOVNE   R0,#0
t� STR     R0,UpdateType
t�
t� LDR      R0,[R12,#update%]
t� MOV      R1,#2
t� ADD      R2,R12,#block%+44
u BL       WriteIcon
u
u LDR      R0,[R12,#update%]
u& MOV      R1,#3
u0 MOV      R2,#0
u: BL       WriteIconNo
uD
uN  STR      R0,[R12,#block%+0]
uX ADD      R1,R12,#block%
ub# SWI      "Wimp_GetWindowState"
ul BL       OpenWindowRequest
uv
u� MOV      R0,#0
u� STR      R0,UpdatePointer
u� STR      R0,currentplace
u�
u�LDMFD    R13!,{R0-R12,PC}^
u�
u�R;-----------------------------------------------------------------------------
u�
u�.ContUpdating
u�
u� LDR      R8,[R10,#updating%]
u�CMP      R8,#0
u� �QS   PC,R14
v
vSTMFD    R13!,{R0-R12,R14}
v
v  LDR      R0,UpdateType
v* CMP      R0,#0
v4  BLNE     AppendFile
v>   LDMNEFD  R13!,{R0-R12,PC}^
vH
vRP MOV      R0,#&CF                      ;This section opens our indexfile for
v\3 ADD      R1,R10,#indexfile            ;update.
vf SWI      "XOS_Find"
vp$ STR      R0,[R10,#indexhandle%]
vz MOV      R1,R0
v� MOV      R0,#254
v� SWI      "OS_Args"
v� TST      R0,#%1<<7
v�  BLEQ     cantupdate
v�
v�Q MOV      R0,#&4F                      ;This section opens the users file for
v�= ADD      R1,R12,#block%+44            ;read access only.
v� SWI      "XOS_Find"
v�  BLVS     noinput
v�   LDMVSFD  R13!,{R0-R12,PC}^
v� MOV      R7,R0
v�
v�Q                                       ;This section loads each record of the
wL  MOV      R0,#3                       ;users file and uses the 'insert'
wP  MOV      R1,R7                       ;to add it in the correct position in
w;  ADD      R2,R10,#record              ;the Index file.
w$  MOV      R3,#88
w.  LDR      R4,UpdatePointer
w8  SWI      "XOS_GBPB"
wB   BLVS     noinput
wL!   LDMVSFD  R13!,{R0-R12,PC}^
wV  LDRCC    R8,currentplace
w`  BLCC     findplace
wj  STRCC    R8,currentplace
wt  BLCC     insert
w~  BLCS     FinishUpdating
w�  STR      R4,UpdatePointer
w�
w� LDR      R0,[R12,#update%]
w� MOV      R1,#3
w� BL       ReadIconNo
w� ADD      R2,R2,#1
w� BL       WriteIconNo
w�
w�O MOV      R0,#0                        ;This section closes the Index file.
w�$ LDR      R1,[R10,#indexhandle%]
w� SWI      "XOS_Find"
w�
xO MOV      R0,#0                        ;This section closes the users file.
x
 MOV      R1,R7
x SWI      "XOS_Find"
x
x(LDMFD     R13!,{R0-R12,PC}^
x2
x<R;-----------------------------------------------------------------------------
xF.currentplace
xPEQUD     0
xZ.UpdateType
xdEQUD     0
xn
xx.FinishUpdating
x�
x�STMFD    R13!,{R0-R12,R14}
x�
x�
x� MOV      R0,#0
x�! STR      R0,[R10,#updating%]
x�
x� LDR      R0,[R12,#update%]
x�  STR      R0,[R12,#block%+0]
x� ADD      R1,R12,#block%
x�  SWI      "Wimp_CloseWindow"
x�
x�Q LDR      R0,[R10,#show%]              ;This section ensures that the program
yL CMP      R0,#1                        ;is in Entire Index mode when the
yO  LDREQ    R0,[R10,#indexhandle%]      ;subroutine ends. Otherwise problems
yN  STREQ    R0,[R10,#filehandle%]       ;occur if the user switches back to
y"N  LDREQ    R0,[R10,#indexmax%]         ;display the Entire Index later on.
y,  STREQ    R0,[R10,#max%]
y6   LDREQ    R0,[R10,#record%]
y@  �Q    R1,#2
yJ  BLEQ     GetRecords
yT
y^ BL       Update
yh
yrLDMFD    R13!,{R0-R12,PC}^
y|
y�
y�.UpdatePointer
y�
EQUD    0
y�
y�R;-----------------------------------------------------------------------------
y�
y�.AppendFile
y�
y�STMFD   R13!,{R0-R12,R14}
y�
y� SWI      "Hourglass_On"
y�
y� MOV      R0,#5
z ADD      R1,R12,#block%+44
z SWI      "XOS_File"
z  BLVS     noinput
z&
z0 MOV      R3,R4
z: MOV      R7,R4
zD MOV      R0,#6
zN SWI      "XOS_Module"
zX BVS      noroom
zb
zl MOV      R8,R2
zv MOV      R0,#&FF
z� ADD      R1,R12,#block%+44
z� MOV      R2,R8
z� MOV      R3,#0
z� SWI      "XOS_File"
z�  BLVS     noinput
z�
z� MOV      R0,#&CF
z� ADD      R1,R10,#indexfile
z� SWI      "XOS_Find"
z�  BLVS      cantupdate
z�$ STR      R0,[R10,#indexhandle%]
z�
z� MOV      R1,R0
{ MOV      R0,#2
{ SWI      "XOS_Args"
{  BVS      noindex
{ 
{* MOV      R4,R2
{4 MOV      R2,R8
{> MOV      R0,#1
{H MOV      R3,R7
{R SWI      "XOS_GBPB"
{\  BLVS     cantupdate
{f
{p! LDR      R1,[R10,#indexmax%]
{z$ LDR      R0,[R10,#indexhandle%]
{� BL       CountRecords
{�! STR      R0,[R10,#indexmax%]
{�
{� SUB      R2,R0,R1
{� LDR      R0,[R12,#update%]
{� MOV      R1,#3
{� BL       WriteIconNo
{�
{� SWI      "Hourglass_Off"
{� BL       FinishUpdating
{�
{� MOV      R0,#0
{�$ LDR      R1,[R10,#indexhandle%]
| SWI      "XOS_Find"
|
| MOV      R0,#7
|$ MOV      R2,R8
|. SWI      "XOS_Module"
|8
|B
|LLDMFD   R13!,{R0-R12,PC}^
|V
|`R;-----------------------------------------------------------------------------
|j0;                           *** DataSave ***
|tO; This subroutine is called when an external task wants to save data to our
|~L; application. This would be if the user dragged a file icon from a save
|�!; dialogue box onto our icon.
|�
|�
.DataSave
|�
|�STMFD    R13!,{R0-R12,R14}
|�
|�P LDR      R0,[R12,#block%+4]           ;This section ensures that we are not
|�O LDR      R1,[R12,#task%]              ;trying to load our own data. ie the
|�Q CMP      R0,R1                        ;message was sent by a task other than
|�6  LDMEQFD  R13!,{R0-R12,PC}^           ;ourselves.
|�
|�R ADR      R0,scrapfilename             ;This section ensures that <Wimp$Scrap>
}E MOV      R1,R9                        ;has been asigned a value.
}
 MVN      R2,#0
} MOV      R3,#0
} SWI      "XOS_ReadVarVal"
}( CMP      R2,#0
}2  BLEQ    noscrapfile
}<  LDMEQFD R13!,{R0-R12,PC}^
}F
}P; MOV      R1,#60                       ;Length Of Block
}Z  STR      R1,[R12,#block%+0]
}d
}nJ LDR      R1,[R12,#block%+8]           ;This is the senders reference.
}x! STR      R1,[R10,#scrapref%]
}�! STR      R1,[R12,#block%+12]
}�
}�J MOV      R1,#2                        ;Message number - 2 DataSaveAck
}�! STR      R1,[R12,#block%+16]
}�
}�J ADR      R0,scrapfile                 ;This section tags the filename
}�R ADD      R1,R12,#block%+44            ;<Wimp$Scrap> to the end of the message
}� MOV      R2,#0
}� SWI      "String_Move$"
}�
}�R MVN      R1,#0                        ;This tells the saving application that
}�S STR      R1,[R12,#block%+36]          ;the saved data is not 'safe' ie on disc
}�
~N MOV      R0,#17                       ;This section sends the DataSaveAck
~G ADD      R1,R12,#block%               ;message to the saving task.
~  LDR      R2,[R12,#block%+4]
~"  SWI      "Wimp_SendMessage"
~,
~6LDMFD    R13!,{R0-R12,PC}^
~@
~JR;-----------------------------------------------------------------------------
~TL; This section contains strings which are used by the above subroutines.
~^
~h.scrapfile
~r
~|EQUS     "<Wimp$Scrap>"
~�EQUB     0
~�	ALIGN
~�
~�.scrapfilename
~�
~�EQUS     "Wimp$Scrap"
~�EQUB     0
~�	ALIGN
~�
~�R;-----------------------------------------------------------------------------
~�G; This section contains two words of memory which are used to store
~�:; information about the currently open menu structure.
~�

.menuinfo
EQUD     0
EQUD     0
&	ALIGN
0
:R;-----------------------------------------------------------------------------
D9;                          *** MenuOptionSelected ***
NO; This subroutine is called when the user selects a menu option from one of
X; our menus.
b
l.MenuOptionSelected
v
�STMFD    R13!,{R0-R12,R14}
�
�N ADR      R7,menuinfo                  ;This section finds out which mouse
�Q MOV      R1,R9                        ;button was used to make the selection
�N SWI      "Wimp_GetPointerInfo"        ;If Adjust was used the menu should
�= LDR      R0,[R9,#8]                   ;remain on screen.
� STR      R0,[R7]
�
�N �LongAdr("",8,menulist)              ;This section loads the addresses of
�L LDR      R0,[R12,#currentmenu%]       ;each of the three possible menus
� LDR      R1,[R8,#0]
� LDR      R2,[R8,#4]
� LDR      R3,[R8,#8]
�
�
�P CMP      R0,R1                        ;This section deals with the Icon Bar
� 1  BLEQ     DecodeIBMenu                ;menu.
�*
�4Q CMP      R0,R2                        ;This section deals with the Main menu
�>D  BLEQ     DecodeMainMenu              ;over the Display window.
�H
�RR CMP      R0,R3                        ;This section deals with the Topic menu
�\G  BLEQ     DecodeTopicMenu             ;over the pop-up menu icons.
�f
�pR LDR      R1,[R7]                      ;This section checks which mouse button
�zK TST      R1,#(� 1) � 255          ;was used to select the menu option.
��O  LDREQ    R1,[R12,#currentmenu%]      ;If Adjust was used the menu is kept
��1  SWIEQ    "Wimp_CreateMenu"           ;open.
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��9;                              *** DecodeMainMenu ***
��A;This section deals with options selected from the Main menu.
��
��.DecodeMainMenu
��
��STMFD    R13!,{R0-R12,R14}
��
�O LDR      R1,[R12,#block%+0]           ;This section starts a search if the
�N CMP      R1,#1                        ;user selects Search from the menu.
�  BLEQ     StartSearch
�$
�.Q CMP      R1,#2                        ;This section opens the Edit window to
�8G  �Q    R0,#0                       ;allow the Index to be Updated.
�BN  STREQ    R0,[R10,#editrecord%]       ;It also positions the caret in the
�L=  BLEQ     getcurrentissue             ;page number icon.
�V  LDREQ    R0,[R12,#edit%]
�`  ADDEQ    R1,R12,#block%
�j  STREQ    R0,[R12,#block%]
�t$  SWIEQ    "Wimp_GetWindowState"
�~   SWIEQ    "Wimp_OpenWindow"
��  LDREQ    R0,[R12,#edit%]
��  �Q    R1,#20
��  MVNEQ    R4,#0
��  �Q    R5,#0
��&  SWIEQ    "Wimp_SetCaretPosition"
��
��O CMP      R1,#4                        ;This ssection sets our Quit flag to
��O  �Q    R1,#1                       ;1 to indicate that we should quit when
��L  STREQ    R1,[R12,#quit%]             ;we return to our Wimp_Poll loop.
��
��LDMFD    R13!,{R0-R12,PC}^
��
�R;-----------------------------------------------------------------------------
�
P; This section contains strings that are used to get the Month and Year from
�P; the UTC format that the internal system clock gives into a suitable format
�!; for use by our application.
�(
�2.monthstring
�<
�F>EQUS     "%MN"                         ;Month as a number.
�PEQUB     0
�Z
�d
�n.yearstring
�x
��KEQUS     "%CE%YR"                      ;Century number and year number.
��EQUB     0
��
��R;-----------------------------------------------------------------------------
��O; This section contains a five-byte data block which is filled with the UTC
��8; (Universal Time Coordinate) from the System clock.
��
��	.time
��
��EQUB     3
��EQUB     0
��EQUB     0
��EQUB     0
�EQUB     0
�	ALIGN
�
�"R;-----------------------------------------------------------------------------
�,6;                          *** GetCurrentIssue ***
�6P; This section reads the time from the system clock and uses it to calculate
�@P; values for the current Month, Year and Issue Number. This assists the user
�J:; when they come to update the index with a new issue.
�T
�^.getcurrentissue
�h
�rSTMFD    R13!,{R0-R12,R14}
�|
��; MOV      R0,#14                       ;Read CMOS Clock
�� ADR      R1,time
�� SWI      "OS_Word"
��
��P MOV      R0,R1                        ;This section converts the 5-byte UTC
��L MOV      R1,R9                        ;into a Month number as a string.
�� MOV      R2,#&100
�� ADR      R3,monthstring
��% SWI      "OS_ConvertDateAndTime"
��
��N MOV      R1,#0                        ;This gets the value of the current
��P SWI      "String_Val"                 ;month number and stores it for later
��Q ADD      R8,R1,#1                     ;reference to the month look-up table.
�" STR      R8,[R10,#editmonth%]
�
�R MOV      R2,#months%-&10              ;This section looks up the month number
�&Q ADD      R2,R2,R8,LSL #4              ;in the look-up table and fills in the
�0J ADD      R2,R10,R2                    ;Month icon in the Edit window.
�: MOV      R1,#17
�D LDR      R0,[R12,#edit%]
�N BL       WriteIcon
�X
�bP ADR      R0,time                      ;This section converts the 5-byte UTC
�lI MOV      R1,R9                        ;to a Year number as a string.
�v MOV      R2,#&100
�� ADR      R3,yearstring
��% SWI      "OS_ConvertDateAndTime"
��
��N MOV      R0,#13                       ;This section gets the value of the
��8 STRB     R0,[R1]                      ;Year number.
�� MOV      R0,R9
�� MOV      R1,#13
�� SWI      "String_Val"
�� MOV      R7,R1
��
��Q MOV      R1,#18                       ;This section writes the string of the
��Q LDR      R0,[R12,#edit%]              ;year number into the Year icon in the
��8 MOV      R2,R9                        ;Edit window.
� BL       WriteIcon
�
�
� M MOV      R0,   #&7C0      ; 1994      ;This section calculates the Issue
�*H ADD      R0,R0,#&00A                  ;number of the current issue.
�4 SUB      R7,R7,R0
�>$ MOV      R0,   R7, LSL #3 ; *13
�H ADD      R0,R0,R7, LSL #2
�R ADD      R0,R0,R7
�\ ADD      R0,R0,R8
�f ADD      R0,R0,#137
�p MOV      R1,R9
�z MOV      R2,#&100
��" SWI      "OS_ConvertInteger2"
�� MOV      R0,#13
�� STRB     R0,[R1]
��
��P MOV      R1,#19                       ;This section writes the Issue number
��F LDR      R0,[R12,#edit%]              ;into the appropriate icon.
�� MOV      R2,R9
�� BL       WriteIcon
��
��P MOV      R0,#13                       ;This section blanks the page number,
��H STR      R0,[R9]                      ;topic and description icons.
�� LDR      R0,[R12,#edit%]
�� MOV      R2,R9
� MOV      R1,#20
� BL       WriteIcon
� MOV      R1,#21
�$ BL       WriteIcon
�. MOV      R1,#22
�8 BL       WriteIcon
�B
�L8 STR      R0,[R12,#block%+0]           ;This section
�V MOV      R0,#26
�`  STR      R0,[R12,#block%+4]
�j MOV      R0,#%1<<23
�t  STR      R0,[R12,#block%+8]
�~! STR      R0,[R12,#block%+12]
�� ADD      R1,R12,#block%
��! SWI      "Wimp_SetIconState"
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��8;                             *** UpdateLeafName ***
��J; This section changes the default leafname, which is written into the
��Q; filename icon in the save window, when the user changes the Issue that they
��; wish to save.
��
��.UpdateLeafName
�
�
STMFD    R13!,{R0-R12,R14}
�
�L LDR       R0,[R10,#multiple%]         ;This section shades the multiple
�(O CMP       R0,#0                       ;issues section of the window if the
�2L  LDRNE    R0,[R12,#save%]             ;Multiple option is not selected.
�<Q  MOVNE    R1,#2                       ;If it is selected then a default name
�FB  ADRNE    R2,multiple                 ;of 'Multiple' is used.
�P  BLNE     WriteIcon
�Z  BLNE     UnshadeSave
�d  BLEQ     ShadeSave
�n   LDMNEFD  R13!,{R0-R12,PC}^
�x
��N LDR      R0,[R12,#save%]              ;This section reads the contents of
��L MOV      R1,#7                        ;start issue number and finds its
��2 MOV      R2,R9                        ;value.
�� BL       ReadIcon
�� MOV      R0,R9
�� MOV      R1,#13
�� SWI      "String_Val"
��
�� CMP      R1,#137
�� BGT      AfterDec93
��
��Q ADD      R0,R1,#6                     ;This section gets the first 3 letters
��B MOV      R1,#12                       ;of the Month of issue.
� BL       Divide
� MOV      R8,R2
� MOV      R0,#months%
�" ADD      R0,R0,R3,LSL #4
�, ADD      R0,R10,R0
�6 MOV      R1,R9
�@ MOV      R2,#13
�J MOV      R3,#3
�T SWI      "String_Left$"
�^
�h
�rO ADD      R0,R8,#82                    ;This section gets the string of the
�|L ADD      R1,R9,#3                     ;year of issue and adds it to the
��D MOV      R2,#253                      ;month name (eg 'Apr95').
��" SWI      "OS_ConvertInteger1"
�� MOV      R0,#13
�� STRB     R0,[R1]
�� LDR      R0,[R12,#save%]
�� MOV      R1,#2
�� MOV      R2,R9
�� BL       WriteIcon
��
��LDMFD    R13!,{R0-R12,PC}^
��
��
��.AfterDec93
� SUB      R0,R1,#138
� MOV      R1,#13
� BL       Divide
�& MOV      R8,R2
�0 MOV      R0,#months%
�: ADD      R0,R0,R3,LSL #4
�D ADD      R0,R10,R0
�N MOV      R1,R9
�X MOV      R2,#13
�b MOV      R3,#3
�l SWI      "String_Left$"
�v
��O ADD      R0,R8,#94                    ;This section gets the string of the
��L ADD      R1,R9,#3                     ;year of issue and adds it to the
��D MOV      R2,#253                      ;month name (eg 'Apr95').
��" SWI      "OS_ConvertInteger1"
�� MOV      R0,#13
�� STRB     R0,[R1]
�� LDR      R0,[R12,#save%]
�� MOV      R1,#2
�� MOV      R2,R9
�� BL       WriteIcon
��
��LDMFD    R13!,{R0-R12,PC}^
��
�
�R;-----------------------------------------------------------------------------
�8;                             *** UpdateStartEnd ***
� P; This section fills the Start and End icons in with the Issue number of the
�*; Record being displyed.
�4
�>.UpdateStartEnd
�H
�RSTMFD    R13!,{R0-R12,R14}
�\
�fO LDR      R0,[R12,#display%]           ;This section reads the Issue number
�pD MOV      R1,#34                       ;from the Display window.
�z MOV      R2,R9
�� BL       ReadIcon
��
��P LDR      R0,[R12,#save%]              ;This section writes the Issue number
��O MOV      R1,#7                        ;into the Start and End icons in the
��8 BL       WriteIcon                    ;Save window.
�� MOV      R1,#10
�� BL       WriteIcon
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��J; This section contains the string 'Multiple' which is copied into the
��R; filename icon as the default filename if more than one issue is to be saved.
�
�
.multiple
�
�$EQUS     "Multiple"
�.EQUB     0
�8	ALIGN
�B
�LR;-----------------------------------------------------------------------------
�V6;                             *** DecodeIBMenu ***
�`D;This section deals with options selected from the IconBar menu.
�j
�t.DecodeIBMenu
�~
��STMFD    R13!,{R0-R12,R14}
��
��N LDR      R1,[R12,#block%+0]           ;This section sets our Quit flag to
��P CMP      R1,#1                        ;to 1 to indicate that we should quit
��N  �Q    R1,#1                       ;when we return to our Wimp_Poll loop.
��  STREQ    R1,[R12,#quit%]
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��8;                            *** DecodeTopicMenu ***
��
�.DecodeTopicMenu
�

�STMFD    R13!,{R0-R12,R14}
�
�( SWI     "Hourglass_On"
�2
�<O �LongAdr("",1,menulist)              ;This section gets the address of the
�FQ LDR     R1,[R1,#8]                    ;menu structure and converts it to its
�P? ADD     R2,R12,#block%                ;textual equivilent.
�Z MOV     R3,R9
�d SWI     "Wimp_DecodeMenu"
�n
�xK �LongAdr("",0,menuinfo)              ;This section checks which window
��H LDR     R0,[R0,#4]                    ;was used to invoke the menu.
�� CMN     R0,#1
��
��R  LDREQ   R0,[R12,#edit%]              ;If the Edit menu was used this section
��N  �Q   R1,#21                       ;copies the menu option into the Topic
��A  �Q   R2,R9                        ;icon in the edit window.
��  BLEQ    WriteIcon
��  SWIEQ   "Hourglass_Off"
��  LDMEQFD R13!,{R0-R12,PC}^
��
��R MOV     R0,R9                         ;This section converts the Topic to all
��> MOV     R1,#13                        ;lowercase letters.
��! SWI     "String_ToLowerCase"
�
�Q LDR     R8,[R10,#record%]             ;This section notes the record to stop
�R SUBS    R8,R8,#1                      ;at if a matching topic is not located.
�" LDREQ   R8,[R10,#max%]
�,
�6L LDR     R0,[R10,#show%]               ;This section opens the currently
�@8 CMP     R0,#1                         ;active file.
�J MOV     R0,#&4F
�T ADDEQ   R1,R10,#indexfile
�^ ADDNE   R1,R10,#searchfile
�h SWI     "XOS_Find"
�r  BVS     norecords
�|" STR     R0,[R10,#filehandle%]
��
��O .topicmenuloop                        ;This section reads in records until
��Q                                       ;one is found which matches the chosen
��2                                       ;topic.
�� LDR     R0,[R10,#max%]
�� LDR     R1,[R10,#record%]
��
��O CMP     R1,R8                         ;This section checks if we have gone
��H  �Q   R0,#1                        ;through the entire file without
��9  �Q   R1,#0                        ;finding a match.
��  BLEQ    GetRecords
��  BLEQ    Update
��  SWIEQ   "Hourglass_Off"
�  BEQ     topicmenuloopend
�
�N MOV     R0,#1                         ;This section reads in a record and
�&J MOV     R1,#0                         ;copies it into another buffer.
�0 BL      GetRecords
�: ADD     R0,R10,#record
�D ADD     R1,R12,#block%
�N MOV     R2,#13
�X SWI     "String_Move$"
�b
�lN MOV     R0,R1                         ;This section changes the record to
�v> MOV     R1,R2                         ;lowercase letters.
��! SWI     "String_ToLowerCase"
��
��K ADD     R1,R10,#backslash             ;This section isolates the Topic
��2 MOV     R2,#13                        ;field.
�� MOV     R3,#0
�� SWI     "String_Instr"
�� ADD     R3,R3,#1
�� SWI     "String_Instr"
�� ADD     R3,R3,#1
�� SWI     "String_Instr"
�� ADD     R3,R3,#1
�� SWI     "String_Instr"
��
�P ADD     R5,R3,#1                      ;This section compares the two topics
� MOV     R1,R9
� SWI     "String_Instr"
� 
�*O CMP     R3,R5                         ;This section loops back if they are
�49  BNE     topicmenuloop                ;not the same.
�>
�H .topicmenuloopend
�RI MOV     R0,#0                         ;This section closes the file.
�\" LDR     R1,[R10,#filehandle%]
�f SWI     "XOS_Find"
�p
�z BL      Update
�� SWI     "Hourglass_Off"
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��2;                          *** StartSearch ***
��P; This subroutine performs a search on the index file using the string given
��; in the Search window.
��
��.StartSearch
��
��STMFD    R13!,{R0-R12,R14}
��
� SWI      "Hourglass_On"
�
�O LDR      R0,[R12,#search%]            ;This section reads in the string to
�$7 MOV      R1,#1                        ;search for.
�. MOV      R2,R9
�8 BL       ReadIcon
�B
�LR MOV      R0,R9                        ;This section converts it to lower case
�V MOV      R1,#13
�`" SWI      "String_ToLowerCase"
�j
�tR LDR      R1,[R10,#show%]              ;This section stores the current record
�~P CMP      R1,#1                        ;if the Indexfile is being displayed.
��   LDREQ    R0,[R10,#record%]
��%  STREQ    R0,[R10,#indexrecord%]
��
��N MOV      R0,#&8F                      ;This section opens the Search file
��= ADD      R1,R10,#searchfile           ;for write access.
�� SWI      "XOS_Find"
��  BVS      nosearch
��% STR      R0,[R10,#searchhandle%]
��
��P MOV      R0,#&4F                      ;This section opens the Indexfile for
��8 ADD      R1,R10,#indexfile            ;read access.
�� SWI      "XOS_Find"
�  BVS      noindex
�
$ STR      R0,[R10,#indexhandle%]
�# STR      R0,[R10,#filehandle%]
�
�( MOV      R8,#1
�2
�<.searchloop
�FL BL       percentage                   ;This shows percentage completion
�PE                                       ;underneath the Hourglass.
�ZK MOV      R0,R8                        ;This section reads in a record.
�d MOV      R1,#2
�n BL       GetRecords
�x
��N ADD      R0,R10,#record               ;This section copies the string and
��F ADD      R1,R9,#90                    ;converts it to lower case.
�� MOV      R2,#13
�� SWI      "String_Move$"
�� MOV      R1,#13
��" SWI      "String_ToLowerCase"
��
��O MOV      R1,R9                        ;This checks if the search string is
��D MOV      R2,#13                       ;contained in the record.
�� MOV      R3,#0
�� SWI      "String_Instr"
��
�� CMN      R3,#1
�  BEQ      searchloopend
�
�N MOV      R0,#0                        ;This section finds the position in
�"J LDR      R1,[R10,#searchhandle%]      ;in the search file of the file
�,4 SWI      "XOS_Args"                   ;pointer.
�6  BVS      nosearch
�@ MOV      R7,R2
�J
�TN ADD      R0,R9,#90                    ;This scetion saves the record into
�^; MOV      R2,#13                       ;the Searchfile.
�h SWI      "XString_Put$#"
�r  BVS       nosearch
�|
��O ADD      R2,R7,#88                    ;This section moves the file pointer
��H MOV      R0,#1                        ;on by 88 bytes (one record).
�� SWI      "XOS_Args"
��  BVS      nosearch
��
�� .searchloopend
��N LDR      R1,[R10,#indexmax%]          ;This section loops back if we have
��L CMP      R8,R1                        ;not reached the end of the file.
��  ADDNE    R8,R8,#1
��  BNE      searchloop
��
��R MOV      R0,#100                      ;This turns of the percentage indicator
��$ SWI      "Hourglass_Percentage"
�
�M LDR      R0,[R10,#searchhandle%]      ;This section counts the number of
�F BL       CountRecords                 ;records in the Searchfile.
�&" STR      R0,[R10,#searchmax%]
�0
�:P CMP      R0,#0                       ;If no matches wee found this sounds a
�DP  BLEQ     shadesearch                ;short bleep and ensures that the user
�NR  SWIEQ    &100+7 ; Bleep             ;cannot switch to display the Searchfile
�X  BLNE     unshadesearch
�b
�lP MOV      R0,#1                        ;This section sets the current record
�vF STR      R0,[R10,#searchrecord%]      ;in the Search file to no.1
��
��N LDR      R0,[R10,#show%]              ;This section loads back the record
��N CMP      R0,#1                        ;that was showing before the search
��8  LDREQ    R0,[R10,#indexrecord%]      ;was started.
��  �Q    R1,#2
��  BLEQ     GetRecords
��
��P  LDRNE    R0,[R10,#searchhandle%]     ;This section switches to showing the
��7  STRNE    R0,[R10,#filehandle%]       ;searchfile.
��#  LDRNE    R0,[R10,#searchmax%]
��  STRNE    R0,[R10,#max%]
��&  LDRNE    R0,[R10,#searchrecord%]
��  MOVNE    R1,#2
�  BLNE     GetRecords
�
�P  MOV     R0,#0                        ;This section closes the search file.
� %  LDR     R1,[R10,#searchhandle%]
�*  SWI     "XOS_Find"
�4
�>N  MOV     R0,#0                        ;This section closes the Indexfile.
�H$  LDR     R1,[R10,#indexhandle%]
�R  SWI     "XOS_Find"
�\
�f  BL       Update
�p SWI      "Hourglass_Off"
�z
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                            *** Percentage ***
��Q; This section shows a percentage indicator underneath the hourglass, showing
��-; the percentage of the search completed.
��
��.percentage
��
��STMFD    R13!,{R0-R12,R14}
��
��N MOV     R0,#0                         ;This finds the current position in
��6 LDR     R1,[R10,#indexhandle%]        ;Indexfile.
� SWI     "OS_Args"
�
�P MOV     R4,R2,LSL #3                  ;This section multiplies the position
�$2 ADD     R4,R4,R2,LSL #1               ;by 100
�. MOV     R3,R4,LSL #3
�8 ADD     R3,R3,R4,LSL #1
�B
�LO MOV     R0,#2                         ;This section finds the total extent
�V8 SWI     "OS_Args"                     ;of the file.
�` MOV     R1,R2
�j MOV     R0,R3
�t
�~Q BL      Divide                        ;This divides one by the other to find
��D                                       ;the percentage complete.
��
��P MOV     R0,R2                         ;This section displays the percentage
��@ SWI     "Hourglass_Percentage"        ;under the hourglass.
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                           *** ShadeSearch ***
��O; This subroutine greys out the 'Last Search' icon in the Display window so
��R; that it is unselectable when no matches could be found with the last search.
��
�.shadesearch
�

�STMFD    R13!,{R0-R1,R14}
�
�(  LDR      R0,[R12,#display%]
�2  STR      R0,[R12,#block%+0]
�< MOV      R0,#38
�F  STR      R0,[R12,#block%+4]
�P MOV      R0,#0
�Z  STR      R0,[R12,#block%+8]
�d MOV      R0,#%1<<23
�n! STR      R0,[R12,#block%+12]
�x
�� ADD      R1,R12,#block%
��! SWI      "Wimp_SetIconState"
��
�� BL       ShowIndex
��
��LDMFD    R13!,{R0-R1,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                         *** UnshadeSeacrh ***
��L; This section ensures that the 'Last Search' icon is selectable after a
��R; search has found some matching records. It also ensures that the 'Not Found'
��?; icon has its Deleted bit set so that it is not displayed.
��
�.unshadesearch
�
�STMFD    R13!,{R0-R1,R14}
�"
�,P LDR      R0,[R12,#display%]           ;This section deletes the 'Not Found'
�61 STR      R0,[R12,#block%+0]           ;icon.
�@ MOV      R0,#38
�J  STR      R0,[R12,#block%+4]
�T MOV      R0,#%1<<23
�^  STR      R0,[R12,#block%+8]
�h! STR      R0,[R12,#block%+12]
�r ADD      R1,R12,#block%
�|! SWI      "Wimp_SetIconState"
��
��Q MOV      R0,#27                       ;This section ensures that the 'greyed
��M STR      R0,[R12,#block%+4]           ;out' bit is not set for the 'Last
��9 MOV      R0,#0                        ;Search' icon.
��  STR      R0,[R12,#block%+8]
�� MOV      R0,#1<<22
��! STR      R0,[R12,#block%+12]
��
�� ADD      R1,R12,#block%
��! SWI      "Wimp_SetIconState"
��
�� BL       ShowSearch
��
�LDMFD    R13!,{R0-R1,PC}^
�
�R;-----------------------------------------------------------------------------
�&0;                          *** ShadeSave ***
�0L; This subroutine shades out the icons in the bottom section of the Save
�:<; dialogue box when the 'Multiple' icon is not selected.
�D
�N.ShadeSave
�X
�bSTMFD    R13!,{R0-R1,R14}
�l
�vQ LDR      R0,[R12,#save%]              ;This section sets up the details that
��C STR      R0,[R12,#block%+0]           ;apply to all the icons.
�� MOV      R0,#%1<<22
��  STR      R0,[R12,#block%+8]
��! STR      R0,[R12,#block%+12]
��
�� ADD      R1,R12,#block%
�� MOV      R2,#10
��
��R.shadesaveloop                         ;This loop greys out each icon in turn.
��  STR      R2,[R12,#block%+4]
��! SWI      "Wimp_SetIconState"
�� CMP      R2,#12
��  ADDNE    R2,R2,#1
�  BNE      shadesaveloop
�
�LDMFD    R13!,{R0-R1,PC}^
� 
�*R;-----------------------------------------------------------------------------
�43;                           *** UnshadeSave ***
�>K; This subroutine ensures that the icons in the bottom part of the Save
�HK; dialogue box are unshaded and selectable, when the 'Multiple' icon is
�R; selected.
�\
�f.UnshadeSave
�p
�zSTMFD    R13!,{R0-R1,R14}
��
��Q LDR      R0,[R12,#save%]              ;This section sets up the details that
��H STR      R0,[R12,#block%+0]           ;that apply to all the icons.
�� MOV      R0,#0
��  STR      R0,[R12,#block%+8]
�� MOV      R0,#%1<<22
��! STR      R0,[R12,#block%+12]
�� ADD      R1,R12,#block%
�� MOV      R2,#10
��
��N.unshadesaveloop                       ;This section unshades each icon in
��1 STR      R2,[R12,#block%+4]           ;turn.
��! SWI      "Wimp_SetIconState"
� CMP      R2,#12
�  ADDNE    R2,R2,#1
�  BNE      unshadesaveloop
�$
�.LDMFD    R13!,{R0-R1,PC}^
�8
�BR;-----------------------------------------------------------------------------
�L3;                             *** WriteIcon ***
�VK;This subroutine takes a string pointed to by R2 and copies it into the
�`7;indirection buffer of the icon specified by R0/R1.
�j
�t.WriteIcon
�~;R0=WindowHandle
��;R1=IconHandle
��;R2=PointerToText
��
��STMFD    R13!,{R0-R8,R14}
��
��N MOV      R7,R0                        ;This section copies the parameters
��R MOV      R6,R1                        ;into high numbered registers for later
��0 MOV      R5,R2                        ;use.
��
��P MOV      R0,R2                        ;This section finds the length of the
��8 MOV      R1,#13                       ;text string.
�� SWI      "String_Len"
� MOV      R8,R1
�

�O STR      R7,[R12,#block%+0]           ;This section gets the icons details
�L STR      R6,[R12,#block%+4]           ;which include the address of its
�(? ADD      R1,R12,#block%               ;indirection buffer.
�2! SWI      "Wimp_GetIconState"
�<
�FP LDR      R2,[R12,#block%+36]          ;This section ensures that the string
�PQ CMP      R8,R2                        ;supplied is not longer than the icons
�ZQ  MOVGT    R1,#13                      ;indirection buffer. If it is then the
�d@  STRGT    R1,[R5,R2]                  ;string is truncated.
�n  MOVGT    R8,R2
�x
��O MOV      R0,R5                        ;This section copies the string into
��I LDR      R1,[R12,#block%+28]          ;the icons indirection buffer.
�� MOV      R2,#13
�� SWI      "String_Move$"
��
��R ADD     R1,R12,#block%                ;This section checks if the caret is in
��Q SWI     "Wimp_GetCaretPosition"       ;the icon that has been updated. If so
��J LDR     R0,[R12,#block%+0]            ;the caret needs to be redrawn.
�� LDR     R1,[R12,#block%+4]
��  LDR     R2,[R12,#block%+20]
�� CMP     R0,R7
��  CMPEQ   R1,R6
��   BNE     wicontinue
� CMP     R2,R8
�  MOVGT   R5,R8
�  MOVLE   R5,R2
�" MVN     R4,#0
�,$ SWI     "Wimp_SetCaretPosition"
�6
�@Q .wicontinue                           ;This section ensures that the icon is
�JQ ADD      R1,R12,#block%               ;redrawn by the Wimp after it has been
�T4 STR      R7,[R12,#block%+0]           ;updated.
�^  STR      R6,[R12,#block%+4]
�h MOV      R3,#0
�r  STR      R3,[R12,#block%+8]
�|! STR      R3,[R12,#block%+12]
��! SWI      "Wimp_SetIconState"
��
��LDMFD    R13!,{R0-R8,PC}^
��
��R;-----------------------------------------------------------------------------
��5;                             *** WriteIconNo ***
��P;This subroutine takes a value R2 and copies it's string equivilent into the
��7;indirection buffer of the icon specified by R0/R1.
��
��.WriteIconNo
��;R0=Window Handle
��;R1=Icon Handle
��
;R2=Value
�
�STMFD  R13!,{R0-R12,R14}
�
�&MOV     R7,R0
�0MOV     R8,R1
�:
�DMOV     R0,R2
�NMOV     R1,R9
�XMOV     R2,#255
�b SWI     "OS_BinaryToDecimal"
�l
�vMOV     R0,#13
��STRB    R0,[R9,R2]
��
��MOV     R0,R7
��MOV     R1,R8
��MOV     R2,R9
��BL      WriteIcon
��
��LDMFD  R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��1;                            *** ReadIcon ***
��R; This subroutine copies the contents of an icon into the buffer pointed to by
��	; R2.
�
�
.ReadIcon
�;R0=Window Handle
� ;R1=IconHandle
�*;R2=Pointer to buffer
�4
�>STMFD    R13!,{R0-R2,R14}
�H
�RP STR      R0,[R12,#block%+0]           ;This section gets the details of the
�\O STR      R1,[R12,#block%+4]           ;icon, including the address of it's
�fQ ADD      R1,R12,#block%               ;indirection buffer which contains the
�p8 SWI      "XWimp_GetIconState"         ;text string.
�z
��O LDR      R0,[R12,#block%+28]          ;This section copies the string into
��A MOV      R1,R2                        ;the specified buffer.
�� MOV      R2,#13
�� SWI      "String_Move$"
��
��LDMFD    R13!,{R0-R2,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                            *** ReadIconNo ***
��R; This subroutine copies the contents of an icon into the buffer pointed to by
��/; R2, converting it into a decimal integer.
��
��.ReadIconNo
�;R0=Window Handle
�;R1=IconHandle
�
�$"STMFD  R13!,{R0-R1,R3-R12,R14}
�.
�8MOV     R2,R9
�BBL      ReadIcon
�L
�VMOV     R0,#10
�`MOV     R1,R9
�jSWI     "OS_ReadUnsigned"
�t
�~"LDMFD  R13!,{R0-R1,R3-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��+;                          *** Init ***
��
��	.Init
��
��STMFD    R13!,{R0-R12,R14}
��
�� BL       InitMessages
��
��N LDR      R0,[R12,#display%]           ;This section ensures that the 'Not
��Q STR      R0,[R12,#block%+0]           ;Found' icon has its 'Deleted' bit set
�R MOV      R0,#38                       ;so that it is initially not displayed.
�
  STR      R0,[R12,#block%+4]
� MOV      R0,#1<<23
�  STR      R0,[R12,#block%+8]
�(! STR      R0,[R12,#block%+12]
�2 ADD      R1,R12,#block%
�<" SWI      "XWimp_SetIconState"
�F
�P BL       ShadeSave
�Z
�dP MOV      R0,#&4F                      ;This section trys to open the Search
�nQ ADD      R1,R10,#searchfile           ;file. If it cannot be found a new one
�x7 SWI      "XOS_Find"                   ;is created.
��&  STRVC    R0,[R10,#searchhandle%]
��  BLVS     CreateSearchFile
��&  LDRVS    R0,[R10,#searchhandle%]
��
��O BL       CountRecords                 ;The number of records in the Search
��L STR      R0,[R10,#searchmax%]         ;file is counted. If there are no
��Q CMP      R0,#0                        ;then the 'Last Search' icon is greyed
��P  LDREQ    R0,[R12,#display%]          ;out so that it cannot be selected by
��5  STREQ    R0,[R12,#block%+0]          ;the user.
��  �Q    R0,#27
��!  STREQ    R0,[R12,#block%+4]
��  �Q    R0,#%1<<22
��!  STREQ    R0,[R12,#block%+8]
�"  STREQ    R0,[R12,#block%+12]
�  ADD      R1,R12,#block%
�"  SWI      "Wimp_SetIconState"
�"
�,M MOV      R0,#&4F                      ;This section opens the Indexfile.
�6 ADD      R1,R10,#indexfile
�@ SWI      "XOS_Find"
�J  BVS      noindex
�T$ STR      R0,[R10,#indexhandle%]
�^# STR      R0,[R10,#filehandle%]
�h
�rM BL       CountRecords                 ;This section counts the number of
�|E STR      R0,[R10,#indexmax%]          ;records in the Indexfile.
�� STR      R0,[R10,#max%]
�� STR      R0,[R10,#record%]
��$ STR      R0,[R10,#indexrecord%]
��
��R MOV      R0,#1                        ;This section initialises the variables
�� STR      R0,[R10,#show%]
��% STR      R0,[R10,#searchrecord%]
��
��Q MOV      R0,#2                        ;This section moves the Indexfile file
��K LDR      R1,[R10,#indexhandle%]       ;pointer to the end of the file.
�� SWI      "XOS_Args"
��  BVS      noindex
�� MOV      R0,#1
� SWI      "XOS_Args"
�  BVS      noindex
�
�&L LDR      R0,[R10,#record%]            ;This section reads in the latest
�0= MOV      R1,#2                        ;in the Indexfile.
�: BL       GetRecords
�D
�NN MOV      R0,#0                        ;This section closes the indexfile.
�XQ LDR      R1,[R10,#indexhandle%]       ;It is bad practice to leave file open
�bE SWI      "XOS_Find"                   ;ocross calls to Wimp_Poll
�l
�vN MOV      R0,#0                        ;This section closes the Searchfile
��% LDR      R1,[R10,#searchhandle%]
�� SWI      "XOS_Find"
��
��L BL       Update                       ;This updates the Display window.
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                      *** CreateSearchFile ***
��F; This subroutine is called when no Searchfile can be found during
��4; initialisation. It creates a blank Searchfile.
��
��.CreateSearchFile
�
�STMFD    R13!,{R0-R12,R14}
�
� N MOV      R0,#11                       ;This section creates an empty file
�*E ADD      R1,R10,#searchfile           ;of type &0AC (IndexFile).
�4 MOV      R2,#&0AC
�> MOV      R4,#0
�H MOV      R5,#0
�R SWI      "XOS_File"
�\  BVS      nosearch
�f
�pH MOV      R0,#&4F                      ;This section opens the file.
�z  ADD      R1,R10,#searchfile
�� SWI      "XOS_Find"
��  BVS      nosearch
��
��$ STR     R0,[R10,#searchhandle%]
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��3;                          *** InitMessages ***
��R; This section opens the applications Messages file and creates look-up tables
��,; and Menu structures from the messages.
��
��.InitMessages
�
�STMFD    R13!,{R0-R12,R14}
�
�$O MOV      R0,#0                        ;This section finds the upper memory
�.M MOV      R1,#0                        ;limit that can be accessed by our
�88 SWI      "XOS_ChangeEnvironment"      ;application.
�B  BVS      SeriousError
�L SUB      R0,R1,#1
�V BIC      R0,R0,#%11
�`
�jQ �LongAdr("",1,heap)                  ;This section asigns the memory between
�tQ SUB      R3,R0,R1                     ;the end of the program and the end of
�~Q MOV      R0,#0                        ;our application space to be used as a
��1 SWI      "XOS_Heap"                   ;Heap.
��  BVS      SeriousError
��
��N ADR      R1,messagefilename           ;This section finds out how big the
��N SWI      "XMessageTrans_FileInfo"     ;Messages file is and claims a heap
��C  BVS      nomessages                  ;block of the same size.
�� MOV      R0,#2
�� �LongAdr("",1,heap)
�� MOV      R3,R2
�� SWI      "XOS_Heap"
��  BLVS     noroom
��   LDMVSFD  R13!,{R0-R12,PC}^
�
�
O ADR      R0,messages                 ;This section opens the messages file
�L ADR      R1,messagefilename          ;and loads it into the heap block.
�& SWI      "XMessageTrans_OpenFile"
�(  BVS      nomessages
�2
�<L �LongAdr("",0,messages)             ;The following section reads in the
�FO ADD      R8,R10,#months%             ;Month names from the file and builds
�PG MOV      R9,#0                       ;up a look-up table of names.
�Z
�d
 .IMloop1
�n ADD      R1,R8,R9
�x MOV      R2,R1
�� MOV      R3,#&10
��
��$ SWI      "XMessageTrans_Lookup"
��*  BVS      NonSeriousError ;nomessages
�� MOV      R7,#13
�� STRB      R7,[R2,R3]
�� CMP      R9,#&C0
��  ADDNE    R9,R9,#&10
��  BNE      IMloop1
��
��L MOV      R0,#2                       ;This section claims space for the
��A �LongAdr("",1,heap)                 ;iconbar menu structure.
�� MOV      R3,#72
� SWI      "XOS_Heap"
�  BLVS     noroom
�  LDMVSFD   R13!,{R0-R12,PC}^
�" �LongAdr("",8,menulist)
�, STR      R2,[R8,#0]
�6
�@O �LongAdr("",0,messages)             ;This section creates the iconbar menu
�J4 �LongAdr("",1,ibmenu%)              ;structure.
�T MOV      R3,#72
�^' SWI      "XMessageTrans_MakeMenus"
�h  BVS      nomessages
�r
�|Q MOV      R0,#2                       ;This section claims space for the Main
��9 �LongAdr("",1,heap)                 ;menu structure.
�� MOV      R3,#148
�� SWI      "XOS_Heap"
��  BLVS     noroom
��   LDMVSFD  R13!,{R0-R12,PC}^
�� STR      R2,[R8,#4]
��
��L �LongAdr("",0,messages)             ;This section creates the Main menu
��4 �LongAdr("",1,mainmenu%)            ;structure.
�� MOV      R3,#148
��' SWI      "XMessageTrans_MakeMenus"
��  BVS      nomessages
��
�Q MOV      R0,#2                      ;This section claims space for the Topic
�8 �LongAdr("",1,heap)                ;menu structure.
� MOV      R3,#820
�& SWI      "XOS_Heap"
�0  BLVS     noroom
�:   LDMVSFD  R13!,{R0-R12,PC}^
�D STR      R2,[R8,#8]
�N
�XR ADD      R1,R2,R3                   ;This section fills in the details of the
�bP SUB      R1,R1,#12                  ;last item on the topic menu which is a
�l? �LongAdr("",7,writeabletext)       ;writeable menu option.
�v MOV      R6,#0
�� MOV      R5,#256
�� STR      R7,[R1],#4
�� STR      R6,[R1],#4
�� STR      R5,[R1]
��
��L �LongAdr("",0,messages)            ;This section creates the Topic menu
��3 �LongAdr("",1,topicmenu%)          ;structure.
�� MOV      R3,#820
��' SWI      "XMessageTrans_MakeMenus"
��  BVS      nomessages
��
��K LDR      R1,[R12,#info%]            ;This section puts the Info window
��P LDR      R0,[R8,#0]                 ;handle in the Main menu structure as a
�B STR      R1,[R0,#32]                ;a pointer to a sub-menu.
� LDR      R0,[R8,#4]
� STR      R1,[R0,#32]
� 
�*O LDR      R1,[R12,#search%]          ;This section puts the Search and Save
�4K STR      R1,[R0,#56]                ;window handles into the Main menu
�>M LDR      R1,[R12,#save%]            ;structure as pointers to sub-menus.
�H STR      R1,[R0,#104]
�R
�\LDMFD    R13!,{R0-R12,PC}^
�f
�pR;-----------------------------------------------------------------------------
�z?; This section contains the pathname of the Meassages file.
��
��.messagefilename
��*EQUS     "<AUIndex$Resource>.Messages"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��R; This section contains a Message file descriptor which is used to information
��; about the Messages file.
��
��
.messages
��EQUD     0
��EQUD     0
�EQUD     0
�EQUD     0
�EQUD     0
�$	ALIGN
�.
�8R;-----------------------------------------------------------------------------
�B3;                          *** CountRecords ***
�LL; This section counts the number of records in the file specified in R0.
�V
�`.CountRecords
�j
�t
;On Entry
�~;R0=filehandle
��;
��;On Exit
��;R0=No. records in file
��
��STMFD    R13!,{R1-R12,R14}
��
��N MOV      R1,R0                      ;This section finds the length of the
��/ MOV      R0,#2                      ;file.
�� SWI      "XOS_Args"
��  BVS      norecords
��
��P MOV      R0,R2                      ;This section divides the length of the
�R MOV      R1,#88                     ;file by the length of a record, 88 bytes
�
H BL       Divide                     ;to find the number of records.
� MOV      R0,R2
�
�(LDMFD    R13!,{R1-R12,PC}^
�2
�<R;-----------------------------------------------------------------------------
�F1;                          *** GetRecords ***
�PP; This subroutine reads in a number of records in the direction specified by
�ZN; R1. The routine only reads in 1 record but skips the specified number of
�d; records inbetween.
�n
�x.GetRecords
��
��
;On Entry
��;R0=No. Of Records to read
��;R1=Direction  0-next
��;              1-last
��*;              2-Read specified record
��
��STMFD    R13!,{R0-R12,R14}
��
��Q MOV      R5,R0                      ;This section copies the parameters into
��P MOV      R4,R1                      ;high numbered registers for later use.
�� LDR      R8,[R10,#record%]
�� LDR      R7,[R10,#max%]
�
�P CMP      R4,#1                      ;This section checks which direction to
�2  BEQ      backwards                 ;read in.
�" CMP      R4,#2
�,  �Q    R8,R0
�6  BEQ      readrecord
�@
�JI  CMP      R8,R7                     ;This section counts forward the
�TC   �Q    R8,#0                    ;specified number of records.
�^  ADD      R8,R8,R5
�h  CMP      R8,R7
�r   MOVGT    R8,R7
�|
��8  B        readrecord                ;Forward branch
��
��  .backwards
��K  CMP      R8,#1                     ;This section counts backwards the
��C   �Q    R8,R7                    ;specofied number of records.
��   ADDEQ    R8,R8,#1
��  SUB      R8,R8,R5
��  CMP      R8,#1
��   MOVLT    R8,#1
��
�� .readrecord
��L SUB      R8,R8,#1                   ;This section multiplies the target
��R MOV      R2,   R8, LSL #3           ;record number by 88 to find the position
�F ADD      R2,R2,R8, LSL #4           ;in the file where it starts.
� ADD      R2,R2,R8, LSL #6
�
�&O MOV      R0,#1                      ;This section moves the filepointer to
�0K LDR      R1,[R10,#filehandle%]      ;the correct position in the file.
�: SWI      "OS_Args"
�D  BVS      norecords
�N
�XP ADD      R0,R10,#record             ;This section reads in the record up to
�bD LDR      R1,[R10,#filehandle%]      ;the end of the last field.
�l MOV      R2,#256
�v MOV      R3,#13
�� MOV      R4,#0
�� SWI      "String_Get$#"
��  BVS      norecords
��
��Q ADD      R8,R8,#1                   ;This section updates the current record
��1 STR      R8,[R10,#record%]          ;number.
��
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��0;                             *** Update ***
��O; This subroutine takes the record stored in the Record buffer and isolates
��K; each field in turn to update each of the icons in the Display window.
�.Update
�
�STMFD    R13!,{R0-R12,R14}
� 
�*  LDR      R8,[R12,#display%]
�4 ADD      R7,R10,#record
�> LDR      R6,[R10,#record%]
�H LDR      R5,[R10,#max%]
�R
�\7 MOV      R0,R6                      ;Record Number
�f MOV      R1,R9
�p MOV      R2,#256
�z" SWI      "OS_ConvertInteger4"
�� MOV      R2,#13
�� STRB     R2,[R1,#1]
�� MOV      R0,R8
�� MOV      R1,#28
�� MOV      R2,R9
�� BL       WriteIcon
��
��? MOV      R0,R5                      ;Maximum Record Number
�� MOV      R1,R9
�� MOV      R2,#256
��" SWI      "OS_ConvertInteger4"
�� MOV      R2,#13
�� STRB     R2,[R1,#1]
� MOV      R0,R8
� MOV      R1,#29
� MOV      R2,R9
�$ BL       WriteIcon
�.8                                     ;Month of Issue
�8 MOV      R0,R7
�B ADD      R1,R10,#backslash
�L MOV      R2,#13
�V MOV      R3,#0
�` SWI      "String_Instr"
�j MOV      R0,R7
�t MOV      R1,R9
�~ MOV      R2,#13
�� MOV      R4,#0
�� SWI      "String_Mid$"
�� MOV      R0,R1
�� MOV      R1,#13
�� SWI      "String_Val"
��% STR      R1,[R10,#displaymonth%]
�� MOV      R2,#months%-&10
�� ADD      R2,R2,R1,LSL #4
�� ADD      R2,R10,R2
�� MOV      R1,#32
�� MOV      R0,R8
�� BL       WriteIcon
�
�

�7 ADD      R4,R3,#1                   ;Year Of Issue
� MOV      R0,R7
�( ADD      R1,R10,#backslash
�2 MOV      R2,#13
�< ADD      R3,R3,#1
�F SWI      "String_Instr"
�P MOV      R5,R3
�Z MOV      R1,R9
�d MOV      R0,R7
�n MOV      R2,#13
�x SUB      R3,R3,R4
�� SWI      "String_Mid$"
�� MOV      R0,R8
�� MOV      R1,#33
�� MOV      R2,R9
�� BL       WriteIcon
��
��6                                     ;Issue Number
�� MOV      R3,R5
�� ADD      R4,R3,#1
�� MOV      R0,R7
�� ADD      R1,R10,#backslash
�� MOV      R2,#13
�� ADD      R3,R3,#1
� SWI      "String_Instr"
� MOV      R5,R3
� MOV      R0,R7
�" MOV      R1,R9
�, MOV      R2,#13
�6 SUB      R3,R3,R4
�@ SWI      "String_Mid$"
�J MOV      R0,R8
�T MOV      R1,#34
�^ MOV      R2,R9
�h BL       WriteIcon
�r
�|5                                     ;Page Number
�� MOV      R3,R5
�� ADD      R4,R3,#1
�� MOV      R0,R7
�� ADD      R1,R10,#backslash
�� MOV      R2,#13
�� ADD      R3,R3,#1
�� SWI      "String_Instr"
�� MOV      R5,R3
�� MOV      R0,R7
�� MOV      R1,R9
�� MOV      R2,#13
�� SUB      R3,R3,R4
�� SWI      "String_Mid$"
� MOV      R0,R8
� MOV      R1,#35
� MOV      R2,R9
�& BL       WriteIcon
�0
�:: MOV      R3,R5                      ;Topic Of Article
�D ADD      R4,R3,#1
�N MOV      R0,R7
�X ADD      R1,R10,#backslash
�b MOV      R2,#13
�l ADD      R3,R3,#1
�v SWI      "String_Instr"
�� MOV      R5,R3
�� MOV      R0,R7
�� MOV      R1,R9
�� MOV      R2,#13
�� SUB      R3,R3,R4
�� SWI      "String_Mid$"
�� MOV      R0,R8
�� MOV      R1,#30
�� MOV      R2,R9
�� BL       WriteIcon
��
��A MOV      R0,R7                      ;Description Of Article.
�� MOV      R1,#13
� SWI      "String_Len"
� MOV      R0,R5
� SUB      R3,R1,R0
�  SUB      R3,R3,#1
�* MOV      R0,R7
�4 MOV      R1,R9
�> MOV      R2,#13
�H SWI      "String_Right$"
�R MOV      R0,R8
�\ MOV      R1,#31
�f MOV      R2,R9
�p BL       WriteIcon
�z
��LDMFD    R13!,{R0-R12,PC}^
��
��R;-----------------------------------------------------------------------------
��/;                            *** Divide ***
��P; This subroutine performs an integer division using R0 and R1. This routine
��<; has been adapted from an algorithm by Peter Cockerell.
��
��.Divide
��; Performs R2=R0 � R1
��; and      R3=R0 � R1
��
��$STMFD    R13!,{R0-R1,R4-R12,R14}
��
�G CMP      R1,#0                      ;Trap Division by Zero errors.
�  BEQ      divbyzero
�
�$? MOV      R2,#0                      ;Initialise registers.
�. MOV      R3,#0
�8= MOV      R4,#32                     ;Initialise counter.
�B
�L .divloop1
�VP  SUBS     R4,R4,#1                  ;Shift R0 until first set bit is in bit
�`P   LDMEQFD  R13!,{R0-R1,R4-R12,PC}^  ;31. If the couter reaches 0 first then
�jD  MOVS     R0,R0,ASL #1              ;R0 was zero to start with.
�t   BPL      divloop1
�~
�� .divloop2
��E  MOVS     R0,R0,ASL #1              ;Shift top bit of R0 into R3
��R  ADC      R3,R3,R3                  ;This value is then subtracted from R1 if
��P  CMP      R3,R1                     ;it does not produce a negative result.
��   SUBCS    R3,R3,R1
��
��P  ADC      R2,R2,R2                  ;Repeat for each significant bit of R0.
��  SUBS     R4,R4,#1
��   BNE      divloop2
��
��$LDMFD    R13!,{R0-R1,R4-R12,PC}^
��
�R;-----------------------------------------------------------------------------
�
:;                      *** Error Handling Routines ***
�R;-----------------------------------------------------------------------------
�8;This subroutine deals with Division By Zero errors.
�(
�2 .divbyzero
�<
�FOLDMFD    R13!,{R0-R1,R4-R12,R14}     ;This section simply reports the error
�P6 ADR      R0,divbyzeroerror          ;to the user.
�Z MOV      R1,#3
�d MOV      R2,#0
�n  SWI      "Wimp_ReportError"
�xMOV      PC,R14
��
��R;-----------------------------------------------------------------------------
��K; This section contains the string used in the DivByZero error message.
��
��.divbyzeroerror
��
EQUD    0
��EQUS    "Division By Zero"
��
EQUB    0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��D;This section deals with not being able to access the Indexfile.
��
�.noindex
� ADR      R0,noindexerror
� �LongAdr("",1,messages)
�" MOV      R2,#0
�,) SWI      "XMessageTrans_ErrorLookup"
�6 B        SeriousError
�@
�JR;-----------------------------------------------------------------------------
�TD; This section contains the Message Token for the NoIndex error.
�^
�h.noindexerror
�rEQUD     0
�|EQUS     "NoIndex"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��O;This section deals with not being able to access the Indexfile for update.
��
��.cantupdate
�� MOV      R0,#0
��! STR      R0,[R10,#updating%]
�� LDR      R0,[R12,#update%]
��  STR      R0,[R12,#block%+0]
�� ADD      R1,R12,#block%
��  SWI      "Wimp_CloseWindow"
�
�  ADR      R0,cantupdateerror
� �LongAdr("",1,messages)
�& MOV      R2,#0
�0) SWI      "XMessageTrans_ErrorLookup"
�: B        NonSeriousError
�D
�NR;-----------------------------------------------------------------------------
�XG; This section contains the Message Token for the cantupdate error.
�b
�l.cantupdateerror
�vEQUD     0
��EQUS     "CantUpdate"
��EQUB     0
��	ALIGN
��R;-----------------------------------------------------------------------------
��F; This section deals with not being able to access the Searchfile.
��
��
.nosearch
�� ADR      R0,nosearcherror
�� �LongAdr("",1,messages)
�� MOV      R2,#0
��) SWI      "XMessageTrans_ErrorLookup"
�� B        SeriousError
��
�R;-----------------------------------------------------------------------------
�E; This section contains the Message Token for the NoSearch error.
�
� .nosearcherror
�*EQUD     0
�4EQUS     "NoSearch"
�>EQUB     0
�H	ALIGN
�R
�\R;-----------------------------------------------------------------------------
�fL; This section produces an error when the Indexfile contains no records.
�p
�z.norecords
�� ADR      R0,norecordserror
�� �LongAdr("",1,messages)
�� MOV      R2,#0
��) SWI      "XMessageTrans_ErrorLookup"
�� B        SeriousError
��
��R;-----------------------------------------------------------------------------
��F; This section contains the Message Token for the NoRecords error.
��
��.norecordserror
��EQUD     0
��EQUS     "NoRecords"
��EQUB     0
�	ALIGN
�
�R;-----------------------------------------------------------------------------
�$K; This section deals with not being able to access a file that is to be
�.; merged with the index.
�8
�B.noinput
�LSTMFD    R13!,{R0-R12,R14}
�V
�` ADR      R0,noinputerror
�j �LongAdr("",1,messages)
�t MOV      R2,#0
�~) SWI      "XMessageTrans_ErrorLookup"
�� B        NonSeriousError
��
��R;-----------------------------------------------------------------------------
��D; This section contains the Message Token for the NoInput error.
��
��.noinputerror
��EQUD     0
��EQUS     "NoInput"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
�Q; This section deals with not being able to open a file that is to be used to
�
; save out records to.
�
�
.nooutput
�(STMFD    R13!,{R0-R12,R14}
�2
�< ADR      R0,nooutputerror
�F �LongAdr("",1,messages)
�P MOV      R2,#0
�Z) SWI      "XMessageTrans_ErrorLookup"
�d B        NonSeriousError
�n
�xR;-----------------------------------------------------------------------------
��E; This section contains the Message Token for the NoOutput error.
��
��.nooutputerror
��EQUD     0
��EQUS     "NoOutput"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��A; This section deals with not being able to open a Scrapfile.
��
��.noscrapfile
��STMFD     R13!,{R0-R12,R14}
�
�! ADR      R0,noscrapfileerror
� �LongAdr("",1,messages)
�" MOV      R2,#0
�,) SWI      "XMessageTrans_ErrorLookup"
�6 B        NonSeriousError
�@
�JR;-----------------------------------------------------------------------------
�TH; This section contains the Message Token for the NoScrapFile error.
�^
�h.noscrapfileerror
�rEQUD     0
�|EQUS     "NoScrapFile"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��I; This section deals with not being able to access the Messages file.
��
��.nomessages
��  ADR      R0,nomessageserror
�� B        SeriousError
��
��R;-----------------------------------------------------------------------------
��9; This section contains the NoMessages error message.
��
�.nomessageserror
�EQUD     0
�#EQUS     "AUIndex is unable to"
�&(EQUS     " access its Messages file"
�0)EQUS     " and must exit immediately"
�:EQUB     0
�D	ALIGN
�N
�XR;-----------------------------------------------------------------------------
�b@; This section deals with not being able to access our Heap.
�l
�v.noheap
�� ADR      R0,noheaperror
�� �LongAdr("",1,messages)
�� MOV      R2,#0
��) SWI      "XMessageTrans_ErrorLookup"
�� B        SeriousError
��
��R;-----------------------------------------------------------------------------
��C; This section contains the Message Token for the NoHeap error.
��
��.noheaperror
��EQUD     0
��EQUS     "NoHeap"
��EQUB     0
�	ALIGN
�
�R;-----------------------------------------------------------------------------
� P; This section deals with not being able to claim a large enough Heap block.
�*
�4.noroom
�> ADR      R0,noroomerror
�H �LongAdr("",1,messages)
�R MOV      R2,#0
�\) SWI      "XMessageTrans_ErrorLookup"
�f B        NonSeriousError
�p
�zR;-----------------------------------------------------------------------------
��C; This section contains the Message Token for the NoRoom error.
��
��.noroomerror
��EQUD     0
��EQUS     "NoRoom"
��EQUB     0
��	ALIGN
��
��R;-----------------------------------------------------------------------------
��O; This section tidies up after a non serious error has occurred. It reports
��6; the error to the user and closes any open files.
��
��.NonSeriousError
�
� MOV      R1,#%1
� ADD      R2,R12,#appname
�$  SWI      "Wimp_ReportError"
�.
�8 MOV      R0,#0
�B$ LDR      R1,[R10,#indexhandle%]
�L SWI      "XOS_Find"
�V% LDR      R1,[R10,#searchhandle%]
�` SWI      "XOS_Find"
�j
�tLDMFD    R13!,{R0-R12,PC}^
�~
��R;-----------------------------------------------------------------------------
��Q; This section closes down our task after an unrecoverable error has occured.
��
��.SeriousError
��
�� MOV      R1,#%1
�� ADD      R2,R12,#appname
��  SWI      "Wimp_ReportError"
�� SWI      "OS_Exit"
��
��R;-----------------------------------------------------------------------------
��	.heap
�]
�
�
� �" BreakSet "+�~(breakpoint)
�?�  "SAVE ""<AUIndex$Dir>.!RunImage"" "+�~(code%)+" "+�~(P%)
�(1�  "SetType <AUIndex$Dir>.!RunImage Absolute"
�2� code%
�<�
�F
�PR;-----------------------------------------------------------------------------
�Z-;                         *** LongAdr ***
�dP; This function is a macro which assembles code to emulate the ADR directive
�n=; for addresses greater than 4096 bytes away from the PC.
�xI; ADD and SUB instructions can only use immediate values with up to 8
��4; significant bits,so two instructions are used.
��
��'ݤLongAdr(condition$,reg%,pointer%)
��
�� � �(pointer%-P%)>65536 �
��J  � 1,"LongAdr only works for addresses within �64 KBytes at &"+�(~P%)
�� �
��
��& � condition$="" � condition$="AL"
��8 cc%=�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",condition$)
��
�� � cc%=0 �
��6  � 1, "Bad Condition Code in LongAdr at &"+�(~P%)
� �
�
� cc%=(cc%-1) � 2
�"
�, diff%=pointer%-(P%+8)
�6
�@ op1%=(cc%<<28)
�J op1%+=&024F0000
�T op1%+=(reg%<<12)
�^ op1%+=�(diff%) � &FF
�h
�r op2%=(cc%<<28)
�| op2%+=&02400C00
�� op2%+=(reg%<<16)
�� op2%+=(reg%<<12)
�� op2%+=�(diff%)>>8 � &FF
��
�� � diff%>=0 �
��  op1%+=4<<20
��  op2%+=4<<20
�� �
��
�� [OPT pass%
��I EQUD      op1%                        ;Assemble the two instructions
�� EQUD      op2%
�� ]
�
�=0
�
00000000  0d 00 0a 26 f4 20 20 20  20 20 4e 61 6d 65 20 3a  |...&.     Name :|
00000010  20 41 55 49 6e 64 65 78  20 28 53 6f 75 72 63 65  | AUIndex (Source|
00000020  20 43 6f 64 65 29 0d 00  14 35 f4 20 20 50 75 72  | Code)...5.  Pur|
00000030  70 6f 73 65 20 3a 20 45  61 73 79 20 4c 6f 63 61  |pose : Easy Loca|
00000040  74 69 6f 6e 20 4f 66 20  41 63 6f 72 6e 20 55 73  |tion Of Acorn Us|
00000050  65 72 20 41 72 74 69 63  6c 65 73 0d 00 1e 2d f4  |er Articles...-.|
00000060  20 20 20 41 75 74 68 6f  72 20 3a 20 28 63 29 20  |   Author : (c) |
00000070  54 68 65 20 46 6c 79 69  6e 67 20 54 77 69 67 2c  |The Flying Twig,|
00000080  20 31 39 39 34 2d 39 36  0d 00 28 1e f4 20 20 20  | 1994-96..(..   |
00000090  20 20 20 20 20 20 20 20  41 4b 41 20 50 61 75 6c  |        AKA Paul|
000000a0  20 42 75 72 6e 73 0d 00  32 23 f4 20 20 56 65 72  | Burns..2#.  Ver|
000000b0  73 69 6f 6e 20 3a 20 31  2e 30 30 20 28 32 30 20  |sion : 1.00 (20 |
000000c0  44 65 63 20 31 39 39 35  29 0d 00 3c 04 0d 00 46  |Dec 1995)..<...F|
000000d0  1f ee 85 20 ee 85 87 3a  f1 20 f6 24 3b 22 20 61  |... ...:. .$;" a|
000000e0  74 20 6c 69 6e 65 20 22  3b 9e 3a e0 0d 00 50 04  |t line ";.:...P.|
000000f0  0d 00 5a 45 de 20 63 6f  64 65 25 20 20 31 30 32  |..ZE. code%  102|
00000100  34 2a 32 38 20 20 20 20  20 20 20 20 20 20 20 20  |4*28            |
00000110  20 20 20 20 20 20 20 20  20 3a f4 20 72 65 73 65  |         :. rese|
00000120  72 76 65 20 32 38 6b 20  66 6f 72 20 61 73 73 65  |rve 28k for asse|
00000130  6d 62 6c 65 72 0d 00 64  04 0d 00 6e 50 f4 2d 2d  |mbler..d...nP.--|
00000140  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000180  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 00 78 04 0d 00 82  |---------..x....|
00000190  12 e3 20 70 61 73 73 25  3d 30 b8 32 20 88 32 0d  |.. pass%=0.2 .2.|
000001a0  00 8c 0c 50 25 3d 63 6f  64 65 25 0d 00 96 0d 5b  |...P%=code%....[|
000001b0  4f 50 54 70 61 73 73 25  0d 00 a0 04 0d 00 aa 41  |OPTpass%.......A|
000001c0  42 20 20 20 20 20 20 20  67 65 74 73 74 61 63 6b  |B       getstack|
000001d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000001e0  20 20 20 20 20 20 20 20  3b 53 65 74 20 75 70 20  |        ;Set up |
000001f0  53 74 61 63 6b 20 50 6f  69 6e 74 65 72 0d 00 b4  |Stack Pointer...|
00000200  04 0d 00 be 0d 2e 63 6f  6e 74 69 6e 75 65 0d 00  |......continue..|
00000210  c8 04 0d 00 d2 19 53 54  4d 46 44 20 20 20 52 31  |......STMFD   R1|
00000220  33 21 2c 7b 52 30 2d 52  31 32 7d 0d 00 dc 04 0d  |3!,{R0-R12}.....|
00000230  00 e6 40 20 a4 4c 6f 6e  67 41 64 72 28 22 22 2c  |..@ .LongAdr("",|
00000240  31 31 2c 6d 65 6e 75 25  29 20 20 20 20 20 20 20  |11,menu%)       |
00000250  20 20 20 20 20 20 20 20  20 20 3b 50 6f 69 6e 74  |          ;Point|
00000260  65 72 20 74 6f 20 4d 65  6e 75 20 44 61 74 61 0d  |er to Menu Data.|
00000270  00 f0 41 20 41 44 52 20  20 20 20 20 52 31 32 2c  |..A ADR     R12,|
00000280  64 61 74 61 25 20 20 20  20 20 20 20 20 20 20 20  |data%           |
00000290  20 20 20 20 20 20 20 20  20 20 20 3b 50 6f 69 6e  |           ;Poin|
000002a0  74 65 72 20 74 6f 20 57  69 6d 70 20 44 61 74 61  |ter to Wimp Data|
000002b0  0d 00 fa 44 20 41 44 44  20 20 20 20 20 52 31 30  |...D ADD     R10|
000002c0  2c 52 31 32 2c 23 26 31  45 30 30 20 20 20 20 20  |,R12,#&1E00     |
000002d0  20 20 20 20 20 20 20 20  20 20 20 20 3b 50 6f 69  |            ;Poi|
000002e0  6e 74 65 72 20 74 6f 20  50 72 6f 67 72 61 6d 20  |nter to Program |
000002f0  44 61 74 61 0d 01 04 4a  20 41 44 44 20 20 20 20  |Data...J ADD    |
00000300  20 52 39 2c 52 31 30 2c  23 26 33 30 30 20 20 20  | R9,R10,#&300   |
00000310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000320  3b 50 6f 69 6e 74 65 72  20 74 6f 20 4d 69 73 63  |;Pointer to Misc|
00000330  20 53 74 72 69 6e 67 20  62 75 66 66 65 72 0d 01  | String buffer..|
00000340  0e 12 20 42 20 20 20 20  20 20 20 53 74 61 72 74  |.. B       Start|
00000350  0d 01 18 04 0d 01 22 52  3b 2d 2d 2d 2d 2d 2d 2d  |......"R;-------|
00000360  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000003a0  2d 2d 2d 2d 2d 2d 0d 01  2c 38 3b 20 54 68 69 73  |------..,8; This|
000003b0  20 73 65 63 74 69 6f 6e  20 72 65 73 65 72 76 65  | section reserve|
000003c0  73 20 73 70 61 63 65 20  66 6f 72 20 44 61 74 61  |s space for Data|
000003d0  20 28 26 32 33 30 30 20  62 79 74 65 73 29 0d 01  | (&2300 bytes)..|
000003e0  36 04 0d 01 40 0a 2e 64  61 74 61 25 0d 01 4a 05  |6...@..data%..J.|
000003f0  5d 0d 01 54 04 0d 01 5e  16 e3 20 69 20 3d 30 20  |]..T...^.. i =0 |
00000400  b8 20 26 32 33 30 30 20  88 20 34 0d 01 68 0f 20  |. &2300 . 4..h. |
00000410  5b 4f 50 54 20 70 61 73  73 25 0d 01 72 0f 20 20  |[OPT pass%..r.  |
00000420  45 51 55 44 20 20 20 20  30 0d 01 7c 06 20 5d 0d  |EQUD    0..|. ].|
00000430  01 86 05 ed 0d 01 90 04  0d 01 9a 50 f4 2d 2d 2d  |...........P.---|
00000440  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000480  2d 2d 2d 2d 2d 2d 2d 2d  0d 01 a4 4d f4 20 54 68  |--------...M. Th|
00000490  69 73 20 73 65 63 74 69  6f 6e 20 73 65 74 73 20  |is section sets |
000004a0  75 70 20 76 61 72 69 61  62 6c 65 73 20 61 73 20  |up variables as |
000004b0  6f 66 66 73 65 74 73 20  77 69 74 68 69 6e 20 74  |offsets within t|
000004c0  68 65 20 77 6f 72 6b 73  70 61 63 65 20 74 6f 20  |he workspace to |
000004d0  61 6c 6c 6f 77 0d 01 ae  1d f4 20 65 61 73 79 20  |allow..... easy |
000004e0  72 65 66 65 72 65 6e 63  65 20 74 6f 20 64 61 74  |reference to dat|
000004f0  61 2e 0d 01 b8 04 0d 01  c2 17 f4 20 20 57 69 6d  |a..........  Wim|
00000500  70 20 44 61 74 61 20 4c  61 62 65 6c 73 0d 01 cc  |p Data Labels...|
00000510  04 0d 01 d6 10 76 65 72  73 69 6f 6e 25 3d 26 30  |.....version%=&0|
00000520  30 0d 01 e0 0d 74 61 73  6b 25 3d 26 30 34 0d 01  |0....task%=&04..|
00000530  ea 10 69 63 6f 6e 62 61  72 25 3d 26 30 38 0d 01  |..iconbar%=&08..|
00000540  f4 10 64 69 73 70 6c 61  79 25 3d 26 30 43 0d 01  |..display%=&0C..|
00000550  fe 0d 69 6e 66 6f 25 3d  26 31 30 0d 02 08 0f 73  |..info%=&10....s|
00000560  65 61 72 63 68 25 3d 26  31 34 0d 02 12 0d 65 64  |earch%=&14....ed|
00000570  69 74 25 3d 26 31 38 0d  02 1c 0d 73 61 76 65 25  |it%=&18....save%|
00000580  3d 26 31 43 0d 02 26 2a  71 75 69 74 25 3d 26 32  |=&1C..&*quit%=&2|
00000590  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000005a0  3a 64 61 74 61 25 21 71  75 69 74 25 3d 30 0d 02  |:data%!quit%=0..|
000005b0  30 14 63 75 72 72 65 6e  74 6d 65 6e 75 25 3d 26  |0.currentmenu%=&|
000005c0  32 34 0d 02 3a 4e 74 65  6d 70 6c 61 74 65 73 3d  |24..:Ntemplates=|
000005d0  26 32 38 20 20 20 20 20  20 20 20 20 20 20 3a 24  |&28           :$|
000005e0  28 64 61 74 61 25 2b 74  65 6d 70 6c 61 74 65 73  |(data%+templates|
000005f0  29 3d 22 3c 41 55 49 6e  64 65 78 24 52 65 73 6f  |)="<AUIndex$Reso|
00000600  75 72 63 65 3e 2e 54 65  6d 70 6c 61 74 65 73 22  |urce>.Templates"|
00000610  0d 02 44 3b 73 70 72 69  74 65 6e 61 6d 65 3d 26  |..D;spritename=&|
00000620  34 35 20 20 20 20 20 20  20 20 20 20 3a 24 28 64  |45          :$(d|
00000630  61 74 61 25 2b 73 70 72  69 74 65 6e 61 6d 65 29  |ata%+spritename)|
00000640  3d 22 21 41 55 49 6e 64  65 78 22 0d 02 4e 0f 61  |="!AUIndex"..N.a|
00000650  70 70 6e 61 6d 65 3d 26  34 36 0d 02 58 31 65 64  |ppname=&46..X1ed|
00000660  69 74 3d 26 35 30 20 20  20 20 20 20 20 20 20 20  |it=&50          |
00000670  20 20 20 20 20 20 3a 24  28 64 61 74 61 25 2b 65  |      :$(data%+e|
00000680  64 69 74 29 3d 22 65 64  69 74 22 0d 02 62 37 64  |dit)="edit"..b7d|
00000690  69 73 70 6c 61 79 3d 26  35 35 20 20 20 20 20 20  |isplay=&55      |
000006a0  20 20 20 20 20 20 20 3a  24 28 64 61 74 61 25 2b  |       :$(data%+|
000006b0  64 69 73 70 6c 61 79 29  3d 22 64 69 73 70 6c 61  |display)="displa|
000006c0  79 22 0d 02 6c 31 69 6e  66 6f 3d 26 35 45 20 20  |y"..l1info=&5E  |
000006d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a 24  |              :$|
000006e0  28 64 61 74 61 25 2b 69  6e 66 6f 29 3d 22 69 6e  |(data%+info)="in|
000006f0  66 6f 22 0d 02 76 35 73  65 61 72 63 68 3d 26 36  |fo"..v5search=&6|
00000700  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |3              :|
00000710  24 28 64 61 74 61 25 2b  73 65 61 72 63 68 29 3d  |$(data%+search)=|
00000720  22 73 65 61 72 63 68 22  0d 02 80 31 73 61 76 65  |"search"...1save|
00000730  3d 26 36 41 20 20 20 20  20 20 20 20 20 20 20 20  |=&6A            |
00000740  20 20 20 20 3a 24 28 64  61 74 61 25 2b 73 61 76  |    :$(data%+sav|
00000750  65 29 3d 22 73 61 76 65  22 0d 02 8a 42 76 65 72  |e)="save"...Bver|
00000760  73 69 6f 6e 3d 26 37 30  20 20 20 20 20 20 20 20  |sion=&70        |
00000770  20 20 20 20 20 3a 24 28  64 61 74 61 25 2b 76 65  |     :$(data%+ve|
00000780  72 73 69 6f 6e 29 3d 22  31 2e 30 30 20 28 32 30  |rsion)="1.00 (20|
00000790  20 44 65 63 20 31 39 39  35 29 22 0d 02 94 3a 62  | Dec 1995)"...:b|
000007a0  6c 6f 63 6b 25 3d 26 38  34 20 20 20 20 20 20 20  |lock%=&84       |
000007b0  20 20 20 20 20 20 20 3a  24 28 64 61 74 61 25 2b  |       :$(data%+|
000007c0  62 6c 6f 63 6b 25 2b 32  34 29 3d 22 21 41 55 49  |block%+24)="!AUI|
000007d0  6e 64 65 78 22 0d 02 9e  0f 66 6f 6e 74 73 25 3d  |ndex"....fonts%=|
000007e0  26 31 39 30 0d 02 a8 35  75 70 64 61 74 65 3d 26  |&190...5update=&|
000007f0  32 39 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |290             |
00000800  3a 24 28 64 61 74 61 25  2b 75 70 64 61 74 65 29  |:$(data%+update)|
00000810  3d 22 75 70 64 61 74 65  22 0d 02 b2 10 75 70 64  |="update"....upd|
00000820  61 74 65 25 3d 26 32 39  38 0d 02 bc 0f 69 63 6f  |ate%=&298....ico|
00000830  6e 73 25 3d 26 33 41 30  0d 02 c6 14 74 65 6d 70  |ns%=&3A0....temp|
00000840  6c 61 74 65 73 25 3d 26  31 32 30 30 0d 02 d0 04  |lates%=&1200....|
00000850  0d 02 da 1a 69 6e 64 65  78 64 61 74 61 25 3d 64  |....indexdata%=d|
00000860  61 74 61 25 2b 26 31 45  30 30 0d 02 e4 04 0d 02  |ata%+&1E00......|
00000870  ee 2c f4 20 20 44 61 74  61 20 4c 61 62 65 6c 73  |.,.  Data Labels|
00000880  20 66 6f 72 20 50 72 6f  67 72 61 6d 20 53 70 65  | for Program Spe|
00000890  63 69 66 69 63 20 44 61  74 61 0d 02 f8 04 0d 03  |cific Data......|
000008a0  02 14 69 6e 64 65 78 68  61 6e 64 6c 65 25 3d 26  |..indexhandle%=&|
000008b0  30 30 0d 03 0c 15 73 65  61 72 63 68 68 61 6e 64  |00....searchhand|
000008c0  6c 65 25 3d 26 30 34 0d  03 16 11 69 6e 64 65 78  |le%=&04....index|
000008d0  6d 61 78 25 3d 26 30 38  0d 03 20 12 73 65 61 72  |max%=&08.. .sear|
000008e0  63 68 6d 61 78 25 3d 26  30 43 0d 03 2a 0d 73 68  |chmax%=&0C..*.sh|
000008f0  6f 77 25 3d 26 31 30 0d  03 34 13 66 69 6c 65 68  |ow%=&10..4.fileh|
00000900  61 6e 64 6c 65 25 3d 26  31 34 0d 03 3e 14 69 6e  |andle%=&14..>.in|
00000910  64 65 78 72 65 63 6f 72  64 25 3d 26 31 38 0d 03  |dexrecord%=&18..|
00000920  48 15 73 65 61 72 63 68  72 65 63 6f 72 64 25 3d  |H.searchrecord%=|
00000930  26 31 43 0d 03 52 0f 72  65 63 6f 72 64 25 3d 26  |&1C..R.record%=&|
00000940  32 30 0d 03 5c 0c 6d 61  78 25 3d 26 32 34 0d 03  |20..\.max%=&24..|
00000950  66 52 73 65 61 72 63 68  66 69 6c 65 3d 26 32 38  |fRsearchfile=&28|
00000960  20 20 20 20 20 20 20 20  20 20 3a 24 28 69 6e 64  |          :$(ind|
00000970  65 78 64 61 74 61 25 2b  73 65 61 72 63 68 66 69  |exdata%+searchfi|
00000980  6c 65 29 3d 22 3c 57 69  6d 70 24 53 63 72 61 70  |le)="<Wimp$Scrap|
00000990  44 69 72 3e 2e 53 65 61  72 63 68 46 69 6c 65 22  |Dir>.SearchFile"|
000009a0  0d 03 70 53 69 6e 64 65  78 66 69 6c 65 3d 26 34  |..pSindexfile=&4|
000009b0  36 20 20 20 20 20 20 20  20 20 20 20 3a 24 28 69  |6           :$(i|
000009c0  6e 64 65 78 64 61 74 61  25 2b 69 6e 64 65 78 66  |ndexdata%+indexf|
000009d0  69 6c 65 29 3d 22 3c 41  55 49 6e 64 65 78 24 52  |ile)="<AUIndex$R|
000009e0  65 73 6f 75 72 63 65 3e  2e 49 6e 64 65 78 46 69  |esource>.IndexFi|
000009f0  6c 65 22 0d 03 7a 38 62  61 63 6b 73 6c 61 73 68  |le"..z8backslash|
00000a00  3d 26 36 36 20 20 20 20  20 20 20 20 20 20 20 3a  |=&66           :|
00000a10  24 28 69 6e 64 65 78 64  61 74 61 25 2b 62 61 63  |$(indexdata%+bac|
00000a20  6b 73 6c 61 73 68 29 3d  22 5c 22 0d 03 84 12 65  |kslash)="\"....e|
00000a30  64 69 74 6d 6f 6e 74 68  25 3d 26 36 38 0d 03 8e  |ditmonth%=&68...|
00000a40  15 64 69 73 70 6c 61 79  6d 6f 6e 74 68 25 3d 26  |.displaymonth%=&|
00000a50  36 43 0d 03 98 36 6d 75  6c 74 69 70 6c 65 25 3d  |6C...6multiple%=|
00000a60  26 37 30 20 20 20 20 20  20 20 20 20 20 20 3a 21  |&70           :!|
00000a70  28 69 6e 64 65 78 64 61  74 61 25 2b 6d 75 6c 74  |(indexdata%+mult|
00000a80  69 70 6c 65 25 29 3d 30  0d 03 a2 13 65 64 69 74  |iple%)=0....edit|
00000a90  72 65 63 6f 72 64 25 3d  26 37 34 0d 03 ac 11 73  |record%=&74....s|
00000aa0  63 72 61 70 72 65 66 25  3d 26 37 38 0d 03 b6 29  |crapref%=&78...)|
00000ab0  75 70 64 61 74 69 6e 67  25 3d 26 37 43 20 20 20  |updating%=&7C   |
00000ac0  20 20 20 20 20 20 20 20  3a 21 75 70 64 61 74 69  |        :!updati|
00000ad0  6e 67 25 3d 30 0d 03 c0  10 6d 6f 6e 74 68 73 25  |ng%=0....months%|
00000ae0  3d 26 31 33 30 0d 03 ca  23 24 28 69 6e 64 65 78  |=&130...#$(index|
00000af0  64 61 74 61 25 2b 6d 6f  6e 74 68 73 25 2b 26 30  |data%+months%+&0|
00000b00  30 29 3d 22 4a 61 6e 22  0d 03 d4 23 24 28 69 6e  |0)="Jan"...#$(in|
00000b10  64 65 78 64 61 74 61 25  2b 6d 6f 6e 74 68 73 25  |dexdata%+months%|
00000b20  2b 26 31 30 29 3d 22 46  65 62 22 0d 03 de 23 24  |+&10)="Feb"...#$|
00000b30  28 69 6e 64 65 78 64 61  74 61 25 2b 6d 6f 6e 74  |(indexdata%+mont|
00000b40  68 73 25 2b 26 32 30 29  3d 22 4d 61 72 22 0d 03  |hs%+&20)="Mar"..|
00000b50  e8 23 24 28 69 6e 64 65  78 64 61 74 61 25 2b 6d  |.#$(indexdata%+m|
00000b60  6f 6e 74 68 73 25 2b 26  33 30 29 3d 22 41 70 72  |onths%+&30)="Apr|
00000b70  22 0d 03 f2 23 24 28 69  6e 64 65 78 64 61 74 61  |"...#$(indexdata|
00000b80  25 2b 6d 6f 6e 74 68 73  25 2b 26 34 30 29 3d 22  |%+months%+&40)="|
00000b90  4d 61 79 22 0d 03 fc 23  24 28 69 6e 64 65 78 64  |May"...#$(indexd|
00000ba0  61 74 61 25 2b 6d 6f 6e  74 68 73 25 2b 26 35 30  |ata%+months%+&50|
00000bb0  29 3d 22 4a 75 6e 22 0d  04 06 23 24 28 69 6e 64  |)="Jun"...#$(ind|
00000bc0  65 78 64 61 74 61 25 2b  6d 6f 6e 74 68 73 25 2b  |exdata%+months%+|
00000bd0  26 36 30 29 3d 22 4a 75  6c 22 0d 04 10 23 24 28  |&60)="Jul"...#$(|
00000be0  69 6e 64 65 78 64 61 74  61 25 2b 6d 6f 6e 74 68  |indexdata%+month|
00000bf0  73 25 2b 26 37 30 29 3d  22 41 75 67 22 0d 04 1a  |s%+&70)="Aug"...|
00000c00  23 24 28 69 6e 64 65 78  64 61 74 61 25 2b 6d 6f  |#$(indexdata%+mo|
00000c10  6e 74 68 73 25 2b 26 38  30 29 3d 22 53 65 70 22  |nths%+&80)="Sep"|
00000c20  0d 04 24 23 24 28 69 6e  64 65 78 64 61 74 61 25  |..$#$(indexdata%|
00000c30  2b 6d 6f 6e 74 68 73 25  2b 26 39 30 29 3d 22 4f  |+months%+&90)="O|
00000c40  63 74 22 0d 04 2e 23 24  28 69 6e 64 65 78 64 61  |ct"...#$(indexda|
00000c50  74 61 25 2b 6d 6f 6e 74  68 73 25 2b 26 41 30 29  |ta%+months%+&A0)|
00000c60  3d 22 4e 6f 76 22 0d 04  38 23 24 28 69 6e 64 65  |="Nov"..8#$(inde|
00000c70  78 64 61 74 61 25 2b 6d  6f 6e 74 68 73 25 2b 26  |xdata%+months%+&|
00000c80  42 30 29 3d 22 44 65 63  22 0d 04 42 24 24 28 69  |B0)="Dec"..B$$(i|
00000c90  6e 64 65 78 64 61 74 61  25 2b 6d 6f 6e 74 68 73  |ndexdata%+months|
00000ca0  25 2b 26 43 30 29 3d 22  58 6d 61 73 22 0d 04 4c  |%+&C0)="Xmas"..L|
00000cb0  0f 72 65 63 6f 72 64 3d  26 32 30 30 0d 04 56 04  |.record=&200..V.|
00000cc0  0d 04 60 50 f4 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..`P.-----------|
00000cd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000d10  0d 04 6a 3d f4 20 54 68  69 73 20 73 65 63 74 69  |..j=. This secti|
00000d20  6f 6e 20 72 65 73 65 72  76 65 73 20 73 70 61 63  |on reserves spac|
00000d30  65 20 66 6f 72 20 74 68  65 20 73 74 61 63 6b 20  |e for the stack |
00000d40  28 26 31 30 30 20 62 79  74 65 73 29 2e 0d 04 74  |(&100 bytes)...t|
00000d50  04 0d 04 7e 14 e3 20 69  3d 20 30 20 b8 20 26 31  |...~.. i= 0 . &1|
00000d60  30 30 20 88 34 0d 04 88  0f 20 5b 4f 50 54 20 70  |00 .4.... [OPT p|
00000d70  61 73 73 25 0d 04 92 0f  20 20 45 51 55 44 20 20  |ass%....  EQUD  |
00000d80  20 20 30 0d 04 9c 06 20  5d 0d 04 a6 05 ed 0d 04  |  0.... ].......|
00000d90  b0 04 0d 04 ba 50 f4 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.....P.---------|
00000da0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000de0  2d 2d 0d 04 c4 2d f4 20  20 53 61 76 65 20 4c 69  |--...-.  Save Li|
00000df0  6e 6b 20 61 6e 64 20 53  74 61 63 6b 20 50 6f 69  |nk and Stack Poi|
00000e00  6e 74 65 72 20 6f 6e 74  6f 20 73 74 61 63 6b 0d  |nter onto stack.|
00000e10  04 ce 04 0d 04 d8 0e 5b  4f 50 54 20 70 61 73 73  |.......[OPT pass|
00000e20  25 0d 04 e2 09 41 4c 49  47 4e 0d 04 ec 04 0d 04  |%....ALIGN......|
00000e30  f6 0d 2e 67 65 74 73 74  61 63 6b 0d 05 00 1a 53  |...getstack....S|
00000e40  54 52 20 20 20 20 20 52  31 34 2c 67 65 74 73 74  |TR     R14,getst|
00000e50  61 63 6b 2d 34 0d 05 0a  1a 53 54 52 20 20 20 20  |ack-4....STR    |
00000e60  20 52 31 33 2c 67 65 74  73 74 61 63 6b 2d 38 0d  | R13,getstack-8.|
00000e70  05 14 1a 41 44 52 20 20  20 20 20 52 31 33 2c 67  |...ADR     R13,g|
00000e80  65 74 73 74 61 63 6b 2d  38 0d 05 1e 14 42 20 20  |etstack-8....B  |
00000e90  20 20 20 20 20 63 6f 6e  74 69 6e 75 65 0d 05 28  |     continue..(|
00000ea0  04 0d 05 32 52 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...2R;----------|
00000eb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000ef0  2d 2d 2d 0d 05 3c 0e 3b  20 4d 65 6e 75 44 61 74  |---..<.; MenuDat|
00000f00  61 0d 05 46 40 3b 20 54  68 69 73 20 73 65 63 74  |a..F@; This sect|
00000f10  69 6f 6e 20 73 65 74 73  20 75 70 20 4d 65 6e 75  |ion sets up Menu|
00000f20  20 54 65 6d 70 6c 61 74  65 73 20 77 68 69 63 68  | Templates which|
00000f30  20 63 61 6e 20 62 65 20  70 61 73 73 65 64 20 74  | can be passed t|
00000f40  6f 0d 05 50 4a 3b 20 22  4d 65 73 73 61 67 65 54  |o..PJ; "MessageT|
00000f50  72 61 6e 73 5f 4d 61 6b  65 4d 65 6e 75 22 20 74  |rans_MakeMenu" t|
00000f60  6f 20 63 72 65 61 74 65  20 61 20 6d 65 6e 75 20  |o create a menu |
00000f70  73 74 72 75 63 74 75 72  65 20 75 73 69 6e 67 20  |structure using |
00000f80  74 68 65 20 73 74 72 69  6e 67 73 0d 05 5a 24 3b  |the strings..Z$;|
00000f90  20 73 75 70 70 6c 69 65  64 20 69 6e 20 74 68 65  | supplied in the|
00000fa0  20 4d 65 73 73 61 67 65  73 20 66 69 6c 65 2e 0d  | Messages file..|
00000fb0  05 64 04 0d 05 6e 0d 2e  6d 65 6e 75 6c 69 73 74  |.d...n..menulist|
00000fc0  0d 05 78 51 45 51 55 44  20 20 20 20 30 20 20 20  |..xQEQUD    0   |
00000fd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000fe0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00000ff0  20 72 65 73 65 72 76 65  73 20 74 68 72 65 65 20  | reserves three |
00001000  77 6f 72 64 73 20 66 6f  72 20 73 74 6f 72 69 6e  |words for storin|
00001010  67 0d 05 82 4e 45 51 55  44 20 20 20 20 30 20 20  |g...NEQUD    0  |
00001020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001030  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 68 65  |            ;the|
00001040  20 61 64 64 72 65 73 73  20 6f 66 20 74 68 65 20  | address of the |
00001050  4d 65 6e 75 20 73 74 72  75 63 74 75 72 65 73 0d  |Menu structures.|
00001060  05 8c 42 45 51 55 44 20  20 20 20 30 20 20 20 20  |..BEQUD    0    |
00001070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001080  20 20 20 20 20 20 20 20  20 20 3b 77 68 65 6e 20  |          ;when |
00001090  74 68 65 79 20 61 72 65  20 63 72 65 61 74 65 64  |they are created|
000010a0  2e 0d 05 96 04 0d 05 a0  0a 2e 6d 65 6e 75 25 0d  |..........menu%.|
000010b0  05 aa 0c 2e 69 62 6d 65  6e 75 25 0d 05 b4 4a 45  |....ibmenu%...JE|
000010c0  51 55 53 20 20 20 20 22  49 4d 30 22 2b bd 30 20  |QUS    "IM0"+.0 |
000010d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000010e0  20 20 20 3b 4d 65 73 73  61 67 65 20 54 6f 6b 65  |   ;Message Toke|
000010f0  6e 20 66 6f 72 20 74 68  65 20 6d 65 6e 75 20 74  |n for the menu t|
00001100  69 74 6c 65 2e 0d 05 be  49 45 51 55 42 20 20 20  |itle....IEQUB   |
00001110  20 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 7              |
00001120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001130  3b 4d 65 6e 75 20 54 69  74 6c 65 20 66 6f 72 65  |;Menu Title fore|
00001140  67 72 6f 75 6e 64 20 63  6f 6c 6f 75 72 2e 0d 05  |ground colour...|
00001150  c8 49 45 51 55 42 20 20  20 20 32 20 20 20 20 20  |.IEQUB    2     |
00001160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001170  20 20 20 20 20 20 20 20  20 3b 4d 65 6e 75 20 54  |         ;Menu T|
00001180  69 74 6c 65 20 62 61 63  6b 67 72 6f 75 6e 64 20  |itle background |
00001190  63 6f 6c 6f 75 72 2e 0d  05 d2 4d 45 51 55 42 20  |colour....MEQUB |
000011a0  20 20 20 37 20 20 20 20  20 20 20 20 20 20 20 20  |   7            |
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000011c0  20 20 3b 4d 65 6e 75 20  77 6f 72 6b 20 61 72 65  |  ;Menu work are|
000011d0  61 20 66 6f 72 65 67 72  6f 75 6e 64 20 63 6f 6c  |a foreground col|
000011e0  6f 75 72 2e 0d 05 dc 4d  45 51 55 42 20 20 20 20  |our....MEQUB    |
000011f0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00001200  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001210  4d 65 6e 75 20 77 6f 72  6b 20 61 72 65 61 20 62  |Menu work area b|
00001220  61 63 6b 67 72 6f 75 6e  64 20 63 6f 6c 6f 75 72  |ackground colour|
00001230  2e 0d 05 e6 53 45 51 55  42 20 20 20 20 34 34 20  |....SEQUB    44 |
00001240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001250  20 20 20 20 20 20 20 20  20 20 20 20 3b 48 65 69  |            ;Hei|
00001260  67 68 74 20 6f 66 20 65  61 63 68 20 6d 65 6e 75  |ght of each menu|
00001270  20 69 74 65 6d 20 28 69  6e 20 4f 53 20 75 6e 69  | item (in OS uni|
00001280  74 73 29 2e 0d 05 f0 4c  45 51 55 42 20 20 20 20  |ts)....LEQUB    |
00001290  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000012a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000012b0  56 65 72 74 69 63 61 6c  20 67 61 70 20 62 65 74  |Vertical gap bet|
000012c0  77 65 65 6e 20 6d 65 6e  75 20 69 74 65 6d 73 2e  |ween menu items.|
000012d0  0d 05 fa 04 0d 06 04 04  0d 06 0e 4a 45 51 55 53  |...........JEQUS|
000012e0  20 20 20 20 22 49 4d 31  22 2b bd 30 20 20 20 20  |    "IM1"+.0    |
000012f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001300  3b 4d 65 73 73 61 67 65  20 54 6f 6b 65 6e 20 66  |;Message Token f|
00001310  6f 72 20 66 69 72 73 74  20 6d 65 6e 75 20 69 74  |or first menu it|
00001320  65 6d 0d 06 18 09 41 4c  49 47 4e 0d 06 22 3b 45  |em....ALIGN..";E|
00001330  51 55 44 20 20 20 20 30  20 20 20 20 20 20 20 20  |QUD    0        |
00001340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001350  20 20 20 20 20 20 3b 4d  65 6e 75 20 49 74 65 6d  |      ;Menu Item|
00001360  20 66 6c 61 67 73 0d 06  2c 3b 45 51 55 44 20 20  | flags..,;EQUD  |
00001370  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |  0             |
00001380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001390  20 3b 53 75 62 6d 65 6e  75 20 70 6f 69 6e 74 65  | ;Submenu pointe|
000013a0  72 0d 06 36 36 45 51 55  44 20 20 20 20 26 37 30  |r..66EQUD    &70|
000013b0  30 30 30 32 31 20 20 20  20 20 20 20 20 20 20 20  |00021           |
000013c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 49 63 6f  |            ;Ico|
000013d0  6e 20 66 6c 61 67 73 0d  06 40 04 0d 06 4a 4b 45  |n flags..@...JKE|
000013e0  51 55 53 20 20 20 20 22  49 4d 32 22 2b bd 30 20  |QUS    "IM2"+.0 |
000013f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001400  20 20 20 3b 4d 65 73 73  61 67 65 20 54 6f 6b 65  |   ;Message Toke|
00001410  6e 20 66 6f 72 20 73 65  63 6f 6e 64 20 6d 65 6e  |n for second men|
00001420  75 20 69 74 65 6d 0d 06  54 09 41 4c 49 47 4e 0d  |u item..T.ALIGN.|
00001430  06 5e 4b 45 51 55 44 20  20 20 20 26 38 30 20 20  |.^KEQUD    &80  |
00001440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001450  20 20 20 20 20 20 20 20  20 20 3b 4d 65 6e 75 20  |          ;Menu |
00001460  49 74 65 6d 20 66 6c 61  67 73 20 28 26 38 30 3d  |Item flags (&80=|
00001470  6c 61 73 74 20 69 74 65  6d 29 0d 06 68 3b 45 51  |last item)..h;EQ|
00001480  55 44 20 20 20 20 30 20  20 20 20 20 20 20 20 20  |UD    0         |
00001490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000014a0  20 20 20 20 20 3b 53 75  62 6d 65 6e 75 20 70 6f  |     ;Submenu po|
000014b0  69 6e 74 65 72 0d 06 72  36 45 51 55 44 20 20 20  |inter..r6EQUD   |
000014c0  20 26 37 30 30 30 30 32  31 20 20 20 20 20 20 20  | &7000021       |
000014d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000014e0  3b 49 63 6f 6e 20 66 6c  61 67 73 0d 06 7c 04 0d  |;Icon flags..|..|
000014f0  06 86 3c 45 51 55 42 20  20 20 20 30 20 20 20 20  |..<EQUB    0    |
00001500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001510  20 20 20 20 20 20 20 20  20 20 3b 74 65 72 6d 69  |          ;termi|
00001520  6e 61 74 69 6e 67 20 62  79 74 65 0d 06 90 09 41  |nating byte....A|
00001530  4c 49 47 4e 0d 06 9a 04  0d 06 a4 0e 2e 6d 61 69  |LIGN.........mai|
00001540  6e 6d 65 6e 75 25 0d 06  ae 4a 45 51 55 53 20 20  |nmenu%...JEQUS  |
00001550  20 20 22 4d 4d 30 22 2b  bd 30 20 20 20 20 20 20  |  "MM0"+.0      |
00001560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4d  |              ;M|
00001570  65 73 73 61 67 65 20 54  6f 6b 65 6e 20 66 6f 72  |essage Token for|
00001580  20 74 68 65 20 6d 65 6e  75 20 74 69 74 6c 65 2e  | the menu title.|
00001590  0d 06 b8 49 45 51 55 42  20 20 20 20 37 20 20 20  |...IEQUB    7   |
000015a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000015b0  20 20 20 20 20 20 20 20  20 20 20 3b 4d 65 6e 75  |           ;Menu|
000015c0  20 54 69 74 6c 65 20 66  6f 72 65 67 72 6f 75 6e  | Title foregroun|
000015d0  64 20 63 6f 6c 6f 75 72  2e 0d 06 c2 49 45 51 55  |d colour....IEQU|
000015e0  42 20 20 20 20 32 20 20  20 20 20 20 20 20 20 20  |B    2          |
000015f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001600  20 20 20 20 3b 4d 65 6e  75 20 54 69 74 6c 65 20  |    ;Menu Title |
00001610  62 61 63 6b 67 72 6f 75  6e 64 20 63 6f 6c 6f 75  |background colou|
00001620  72 2e 0d 06 cc 4d 45 51  55 42 20 20 20 20 37 20  |r....MEQUB    7 |
00001630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001640  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 4d 65  |             ;Me|
00001650  6e 75 20 77 6f 72 6b 20  61 72 65 61 20 66 6f 72  |nu work area for|
00001660  65 67 72 6f 75 6e 64 20  63 6f 6c 6f 75 72 2e 0d  |eground colour..|
00001670  06 d6 4d 45 51 55 42 20  20 20 20 30 20 20 20 20  |..MEQUB    0    |
00001680  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001690  20 20 20 20 20 20 20 20  20 20 3b 4d 65 6e 75 20  |          ;Menu |
000016a0  77 6f 72 6b 20 61 72 65  61 20 62 61 63 6b 67 72  |work area backgr|
000016b0  6f 75 6e 64 20 63 6f 6c  6f 75 72 2e 0d 06 e0 53  |ound colour....S|
000016c0  45 51 55 42 20 20 20 20  34 34 20 20 20 20 20 20  |EQUB    44      |
000016d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000016e0  20 20 20 20 20 20 20 3b  48 65 69 67 68 74 20 6f  |       ;Height o|
000016f0  66 20 65 61 63 68 20 6d  65 6e 75 20 69 74 65 6d  |f each menu item|
00001700  20 28 69 6e 20 4f 53 20  75 6e 69 74 73 29 2e 0d  | (in OS units)..|
00001710  06 ea 4c 45 51 55 42 20  20 20 20 30 20 20 20 20  |..LEQUB    0    |
00001720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001730  20 20 20 20 20 20 20 20  20 20 3b 56 65 72 74 69  |          ;Verti|
00001740  63 61 6c 20 67 61 70 20  62 65 74 77 65 65 6e 20  |cal gap between |
00001750  6d 65 6e 75 20 69 74 65  6d 73 2e 0d 06 f4 04 0d  |menu items......|
00001760  06 fe 4a 45 51 55 53 20  20 20 20 22 4d 4d 31 22  |..JEQUS    "MM1"|
00001770  2b bd 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |+.0             |
00001780  20 20 20 20 20 20 20 3b  4d 65 73 73 61 67 65 20  |       ;Message |
00001790  54 6f 6b 65 6e 20 66 6f  72 20 66 69 72 73 74 20  |Token for first |
000017a0  6d 65 6e 75 20 69 74 65  6d 0d 07 08 09 41 4c 49  |menu item....ALI|
000017b0  47 4e 0d 07 12 3b 45 51  55 44 20 20 20 20 30 20  |GN...;EQUD    0 |
000017c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000017d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 4d 65  |             ;Me|
000017e0  6e 75 20 49 74 65 6d 20  66 6c 61 67 73 0d 07 1c  |nu Item flags...|
000017f0  3b 45 51 55 44 20 20 20  20 30 20 20 20 20 20 20  |;EQUD    0      |
00001800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001810  20 20 20 20 20 20 20 20  3b 53 75 62 6d 65 6e 75  |        ;Submenu|
00001820  20 70 6f 69 6e 74 65 72  0d 07 26 36 45 51 55 44  | pointer..&6EQUD|
00001830  20 20 20 20 26 37 30 30  30 30 32 31 20 20 20 20  |    &7000021    |
00001840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001850  20 20 20 3b 49 63 6f 6e  20 66 6c 61 67 73 0d 07  |   ;Icon flags..|
00001860  30 04 0d 07 3a 4b 45 51  55 53 20 20 20 20 22 4d  |0...:KEQUS    "M|
00001870  4d 32 22 2b bd 30 20 20  20 20 20 20 20 20 20 20  |M2"+.0          |
00001880  20 20 20 20 20 20 20 20  20 20 3b 4d 65 73 73 61  |          ;Messa|
00001890  67 65 20 54 6f 6b 65 6e  20 66 6f 72 20 73 65 63  |ge Token for sec|
000018a0  6f 6e 64 20 6d 65 6e 75  20 69 74 65 6d 0d 07 44  |ond menu item..D|
000018b0  09 41 4c 49 47 4e 0d 07  4e 3b 45 51 55 44 20 20  |.ALIGN..N;EQUD  |
000018c0  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |  0             |
000018d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000018e0  20 3b 4d 65 6e 75 20 49  74 65 6d 20 66 6c 61 67  | ;Menu Item flag|
000018f0  73 0d 07 58 3b 45 51 55  44 20 20 20 20 30 20 20  |s..X;EQUD    0  |
00001900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001910  20 20 20 20 20 20 20 20  20 20 20 20 3b 53 75 62  |            ;Sub|
00001920  6d 65 6e 75 20 70 6f 69  6e 74 65 72 0d 07 62 36  |menu pointer..b6|
00001930  45 51 55 44 20 20 20 20  26 37 30 30 30 30 32 31  |EQUD    &7000021|
00001940  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001950  20 20 20 20 20 20 20 3b  49 63 6f 6e 20 66 6c 61  |       ;Icon fla|
00001960  67 73 0d 07 6c 04 0d 07  76 04 0d 07 80 4a 45 51  |gs..l...v....JEQ|
00001970  55 53 20 20 20 20 22 4d  4d 33 22 2b bd 30 20 20  |US    "MM3"+.0  |
00001980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001990  20 20 3b 4d 65 73 73 61  67 65 20 54 6f 6b 65 6e  |  ;Message Token|
000019a0  20 66 6f 72 20 74 68 69  72 64 20 6d 65 6e 75 20  | for third menu |
000019b0  69 74 65 6d 0d 07 8a 09  41 4c 49 47 4e 0d 07 94  |item....ALIGN...|
000019c0  3b 45 51 55 44 20 20 20  20 30 20 20 20 20 20 20  |;EQUD    0      |
000019d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000019e0  20 20 20 20 20 20 20 20  3b 4d 65 6e 75 20 49 74  |        ;Menu It|
000019f0  65 6d 20 66 6c 61 67 73  0d 07 9e 3b 45 51 55 44  |em flags...;EQUD|
00001a00  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
00001a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001a20  20 20 20 3b 53 75 62 6d  65 6e 75 20 70 6f 69 6e  |   ;Submenu poin|
00001a30  74 65 72 0d 07 a8 36 45  51 55 44 20 20 20 20 26  |ter...6EQUD    &|
00001a40  37 30 30 30 30 32 31 20  20 20 20 20 20 20 20 20  |7000021         |
00001a50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 49  |              ;I|
00001a60  63 6f 6e 20 66 6c 61 67  73 0d 07 b2 04 0d 07 bc  |con flags.......|
00001a70  4b 45 51 55 53 20 20 20  20 22 4d 4d 34 22 2b bd  |KEQUS    "MM4"+.|
00001a80  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00001a90  20 20 20 20 20 3b 4d 65  73 73 61 67 65 20 54 6f  |     ;Message To|
00001aa0  6b 65 6e 20 66 6f 72 20  66 6f 75 72 74 68 20 6d  |ken for fourth m|
00001ab0  65 6e 75 20 69 74 65 6d  0d 07 c6 09 41 4c 49 47  |enu item....ALIG|
00001ac0  4e 0d 07 d0 3b 45 51 55  44 20 20 20 20 30 20 20  |N...;EQUD    0  |
00001ad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ae0  20 20 20 20 20 20 20 20  20 20 20 20 3b 4d 65 6e  |            ;Men|
00001af0  75 20 49 74 65 6d 20 66  6c 61 67 73 0d 07 da 3b  |u Item flags...;|
00001b00  45 51 55 44 20 20 20 20  30 20 20 20 20 20 20 20  |EQUD    0       |
00001b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b20  20 20 20 20 20 20 20 3b  53 75 62 6d 65 6e 75 20  |       ;Submenu |
00001b30  70 6f 69 6e 74 65 72 0d  07 e4 36 45 51 55 44 20  |pointer...6EQUD |
00001b40  20 20 20 26 37 30 30 30  30 32 31 20 20 20 20 20  |   &7000021     |
00001b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b60  20 20 3b 49 63 6f 6e 20  66 6c 61 67 73 0d 07 ee  |  ;Icon flags...|
00001b70  04 0d 07 f8 4a 45 51 55  53 20 20 20 20 22 4d 4d  |....JEQUS    "MM|
00001b80  35 22 2b bd 30 20 20 20  20 20 20 20 20 20 20 20  |5"+.0           |
00001b90  20 20 20 20 20 20 20 20  20 3b 4d 65 73 73 61 67  |         ;Messag|
00001ba0  65 20 54 6f 6b 65 6e 20  66 6f 72 20 66 69 66 74  |e Token for fift|
00001bb0  68 20 6d 65 6e 75 20 69  74 65 6d 0d 08 02 09 41  |h menu item....A|
00001bc0  4c 49 47 4e 0d 08 0c 4b  45 51 55 44 20 20 20 20  |LIGN...KEQUD    |
00001bd0  26 38 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |&80             |
00001be0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001bf0  4d 65 6e 75 20 49 74 65  6d 20 66 6c 61 67 73 20  |Menu Item flags |
00001c00  28 26 38 30 3d 6c 61 73  74 20 69 74 65 6d 29 0d  |(&80=last item).|
00001c10  08 16 3b 45 51 55 44 20  20 20 20 30 20 20 20 20  |..;EQUD    0    |
00001c20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c30  20 20 20 20 20 20 20 20  20 20 3b 53 75 62 6d 65  |          ;Subme|
00001c40  6e 75 20 70 6f 69 6e 74  65 72 0d 08 20 36 45 51  |nu pointer.. 6EQ|
00001c50  55 44 20 20 20 20 26 37  30 30 30 30 32 31 20 20  |UD    &7000021  |
00001c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c70  20 20 20 20 20 3b 49 63  6f 6e 20 66 6c 61 67 73  |     ;Icon flags|
00001c80  0d 08 2a 04 0d 08 34 3c  45 51 55 42 20 20 20 20  |..*...4<EQUB    |
00001c90  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00001ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001cb0  54 65 72 6d 69 6e 61 74  69 6e 67 20 62 79 74 65  |Terminating byte|
00001cc0  0d 08 3e 09 41 4c 49 47  4e 0d 08 48 04 0d 08 52  |..>.ALIGN..H...R|
00001cd0  0f 2e 74 6f 70 69 63 6d  65 6e 75 25 0d 08 5c 4a  |..topicmenu%..\J|
00001ce0  45 51 55 53 20 20 20 20  22 54 4d 30 22 2b bd 30  |EQUS    "TM0"+.0|
00001cf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d00  20 20 20 20 3b 4d 65 73  73 61 67 65 20 54 6f 6b  |    ;Message Tok|
00001d10  65 6e 20 66 6f 72 20 74  68 65 20 6d 65 6e 75 20  |en for the menu |
00001d20  74 69 74 6c 65 2e 0d 08  66 49 45 51 55 42 20 20  |title...fIEQUB  |
00001d30  20 20 37 20 20 20 20 20  20 20 20 20 20 20 20 20  |  7             |
00001d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d50  20 3b 4d 65 6e 75 20 54  69 74 6c 65 20 66 6f 72  | ;Menu Title for|
00001d60  65 67 72 6f 75 6e 64 20  63 6f 6c 6f 75 72 2e 0d  |eground colour..|
00001d70  08 70 49 45 51 55 42 20  20 20 20 32 20 20 20 20  |.pIEQUB    2    |
00001d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d90  20 20 20 20 20 20 20 20  20 20 3b 4d 65 6e 75 20  |          ;Menu |
00001da0  54 69 74 6c 65 20 62 61  63 6b 67 72 6f 75 6e 64  |Title background|
00001db0  20 63 6f 6c 6f 75 72 2e  0d 08 7a 4d 45 51 55 42  | colour...zMEQUB|
00001dc0  20 20 20 20 37 20 20 20  20 20 20 20 20 20 20 20  |    7           |
00001dd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001de0  20 20 20 3b 4d 65 6e 75  20 77 6f 72 6b 20 61 72  |   ;Menu work ar|
00001df0  65 61 20 66 6f 72 65 67  72 6f 75 6e 64 20 63 6f  |ea foreground co|
00001e00  6c 6f 75 72 2e 0d 08 84  4d 45 51 55 42 20 20 20  |lour....MEQUB   |
00001e10  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
00001e20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e30  3b 4d 65 6e 75 20 77 6f  72 6b 20 61 72 65 61 20  |;Menu work area |
00001e40  62 61 63 6b 67 72 6f 75  6e 64 20 63 6f 6c 6f 75  |background colou|
00001e50  72 2e 0d 08 8e 53 45 51  55 42 20 20 20 20 34 34  |r....SEQUB    44|
00001e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e70  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 48 65  |             ;He|
00001e80  69 67 68 74 20 6f 66 20  65 61 63 68 20 6d 65 6e  |ight of each men|
00001e90  75 20 69 74 65 6d 20 28  69 6e 20 4f 53 20 75 6e  |u item (in OS un|
00001ea0  69 74 73 29 2e 0d 08 98  4c 45 51 55 42 20 20 20  |its)....LEQUB   |
00001eb0  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
00001ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ed0  3b 56 65 72 74 69 63 61  6c 20 67 61 70 20 62 65  |;Vertical gap be|
00001ee0  74 77 65 65 6e 20 6d 65  6e 75 20 69 74 65 6d 73  |tween menu items|
00001ef0  2e 0d 08 a2 04 0d 08 ac  05 5d 0d 08 b6 0e e3 20  |.........]..... |
00001f00  69 3d 31 20 b8 20 33 32  0d 08 c0 0e 5b 4f 50 54  |i=1 . 32....[OPT|
00001f10  20 70 61 73 73 25 0d 08  ca 04 0d 08 d4 45 45 51  | pass%.......EEQ|
00001f20  55 53 20 20 20 20 22 54  4d 22 2b c3 28 69 29 2b  |US    "TM"+.(i)+|
00001f30  bd 30 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |.0             ;|
00001f40  4d 65 73 73 61 67 65 20  54 6f 6b 65 6e 20 66 6f  |Message Token fo|
00001f50  72 20 69 74 68 20 6d 65  6e 75 20 69 74 65 6d 0d  |r ith menu item.|
00001f60  08 de 09 41 4c 49 47 4e  0d 08 e8 3b 45 51 55 44  |...ALIGN...;EQUD|
00001f70  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
00001f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f90  20 20 20 3b 4d 65 6e 75  20 49 74 65 6d 20 66 6c  |   ;Menu Item fl|
00001fa0  61 67 73 0d 08 f2 3b 45  51 55 44 20 20 20 20 30  |ags...;EQUD    0|
00001fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001fc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 53  |              ;S|
00001fd0  75 62 6d 65 6e 75 20 70  6f 69 6e 74 65 72 0d 08  |ubmenu pointer..|
00001fe0  fc 36 45 51 55 44 20 20  20 20 26 37 30 30 30 31  |.6EQUD    &70001|
00001ff0  32 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |21              |
00002000  20 20 20 20 20 20 20 20  20 3b 49 63 6f 6e 20 66  |         ;Icon f|
00002010  6c 61 67 73 0d 09 06 04  0d 09 10 05 5d 0d 09 1a  |lags........]...|
00002020  05 ed 0d 09 24 0e 5b 4f  50 54 20 70 61 73 73 25  |....$.[OPT pass%|
00002030  0d 09 2e 04 0d 09 38 49  45 51 55 53 20 20 20 20  |......8IEQUS    |
00002040  22 54 4d 33 33 22 2b bd  30 20 20 20 20 20 20 20  |"TM33"+.0       |
00002050  20 20 20 20 20 20 20 20  20 20 20 20 3b 4d 65 73  |            ;Mes|
00002060  73 61 67 65 20 54 6f 6b  65 6e 20 66 6f 72 20 33  |sage Token for 3|
00002070  33 72 64 20 6d 65 6e 75  20 69 74 65 6d 0d 09 42  |3rd menu item..B|
00002080  09 41 4c 49 47 4e 0d 09  4c 54 45 51 55 44 20 20  |.ALIGN..LTEQUD  |
00002090  20 20 26 38 34 20 20 20  20 20 20 20 20 20 20 20  |  &84           |
000020a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000020b0  20 3b 4d 65 6e 75 20 49  74 65 6d 20 66 6c 61 67  | ;Menu Item flag|
000020c0  73 28 26 38 34 3d 57 72  69 74 65 61 62 6c 65 2f  |s(&84=Writeable/|
000020d0  6c 61 73 74 20 69 74 65  6d 29 0d 09 56 3b 45 51  |last item)..V;EQ|
000020e0  55 44 20 20 20 20 30 20  20 20 20 20 20 20 20 20  |UD    0         |
000020f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002100  20 20 20 20 20 3b 53 75  62 6d 65 6e 75 20 70 6f  |     ;Submenu po|
00002110  69 6e 74 65 72 0d 09 60  14 45 51 55 44 20 20 20  |inter..`.EQUD   |
00002120  20 26 37 30 30 30 31 32  31 0d 09 6a 04 0d 09 74  | &7000121..j...t|
00002130  3c 45 51 55 42 20 20 20  20 30 20 20 20 20 20 20  |<EQUB    0      |
00002140  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002150  20 20 20 20 20 20 20 20  3b 54 65 72 6d 69 6e 61  |        ;Termina|
00002160  74 69 6e 67 20 62 79 74  65 0d 09 7e 09 41 4c 49  |ting byte..~.ALI|
00002170  47 4e 0d 09 88 04 0d 09  92 04 0d 09 9c 12 2e 77  |GN.............w|
00002180  72 69 74 65 61 62 6c 65  74 65 78 74 0d 09 a6 05  |riteabletext....|
00002190  5d 0d 09 b0 10 e3 20 69  3d 30 b8 32 35 36 20 88  |]..... i=0.256 .|
000021a0  34 0d 09 ba 0f 20 5b 4f  50 54 20 70 61 73 73 25  |4.... [OPT pass%|
000021b0  0d 09 c4 52 20 20 45 51  55 44 20 20 20 20 30 20  |...R  EQUD    0 |
000021c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000021d0  20 20 20 20 20 20 20 20  20 20 20 3b 32 35 36 20  |           ;256 |
000021e0  62 79 74 65 20 61 72 72  61 79 20 66 6f 72 20 74  |byte array for t|
000021f0  65 78 74 20 66 72 6f 6d  20 77 72 69 74 65 61 62  |ext from writeab|
00002200  6c 65 0d 09 ce 36 20 20  20 20 20 20 20 20 20 20  |le...6          |
00002210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002220  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 6d 65  |             ;me|
00002230  6e 75 20 69 74 65 6d 2e  0d 09 d8 06 20 5d 0d 09  |nu item..... ]..|
00002240  e2 05 ed 0d 09 ec 04 0d  09 f6 50 f4 2d 2d 2d 2d  |..........P.----|
00002250  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002290  2d 2d 2d 2d 2d 2d 2d 0d  0a 00 1e f4 20 50 72 6f  |-------..... Pro|
000022a0  67 72 61 6d 20 63 6f 64  65 20 73 74 61 72 74 73  |gram code starts|
000022b0  20 68 65 72 65 0d 0a 0a  04 0d 0a 14 0e 5b 4f 50  | here........[OP|
000022c0  54 20 70 61 73 73 25 0d  0a 1e 04 0d 0a 28 0a 2e  |T pass%......(..|
000022d0  53 74 61 72 74 0d 0a 32  04 0d 0a 3c 52 3b 2d 2d  |Start..2...<R;--|
000022e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002320  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 0a 46 38 3b  |-----------..F8;|
00002330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002340  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
00002350  49 6e 69 74 69 61 6c 69  73 65 20 57 69 6d 70 20  |Initialise Wimp |
00002360  2a 2a 2a 0d 0a 50 50 3b  20 54 68 69 73 20 73 65  |***..PP; This se|
00002370  63 74 69 6f 6e 20 63 61  6c 6c 73 20 74 68 65 20  |ction calls the |
00002380  57 69 6e 64 6f 77 20 4d  61 6e 61 67 65 72 20 77  |Window Manager w|
00002390  68 69 63 68 20 77 69 6c  6c 20 72 65 74 75 72 6e  |hich will return|
000023a0  20 69 74 73 20 76 65 72  73 69 6f 6e 20 6e 75 6d  | its version num|
000023b0  62 65 72 0d 0a 5a 21 3b  20 61 6e 64 20 6f 75 72  |ber..Z!; and our|
000023c0  20 75 6e 69 71 75 65 20  54 61 73 6b 20 68 61 6e  | unique Task han|
000023d0  64 6c 65 2e 0d 0a 64 04  0d 0a 6e 47 4d 4f 56 20  |dle...d...nGMOV |
000023e0  20 20 20 20 52 30 2c 23  32 30 30 20 20 20 20 20  |    R0,#200     |
000023f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002400  20 20 20 3b 4d 69 6e 69  6d 75 6d 20 56 65 72 73  |   ;Minimum Vers|
00002410  69 6f 6e 20 4e 75 6d 62  65 72 20 2a 31 30 30 0d  |ion Number *100.|
00002420  0a 78 32 4d 4f 56 20 20  20 20 20 52 31 2c 20 20  |.x2MOV     R1,  |
00002430  20 23 26 34 42 30 30 30  30 30 30 20 20 20 20 20  | #&4B000000     |
00002440  20 20 20 20 20 20 20 20  20 20 3b 22 54 41 53 4b  |          ;"TASK|
00002450  22 0d 0a 82 1c 41 44 44  20 20 20 20 20 52 31 2c  |"....ADD     R1,|
00002460  52 31 2c 23 26 30 30 35  33 30 30 30 30 0d 0a 8c  |R1,#&00530000...|
00002470  1c 41 44 44 20 20 20 20  20 52 31 2c 52 31 2c 23  |.ADD     R1,R1,#|
00002480  26 30 30 30 30 34 31 30  30 0d 0a 96 1c 41 44 44  |&00004100....ADD|
00002490  20 20 20 20 20 52 31 2c  52 31 2c 23 26 30 30 30  |     R1,R1,#&000|
000024a0  30 30 30 35 34 0d 0a a0  4a 41 44 44 20 20 20 20  |00054...JADD    |
000024b0  20 52 32 2c 52 31 32 2c  23 61 70 70 6e 61 6d 65  | R2,R12,#appname|
000024c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000024d0  3b 4e 61 6d 65 20 74 6f  20 61 70 70 65 61 72 20  |;Name to appear |
000024e0  6f 6e 20 54 61 73 6b 20  44 69 73 70 6c 61 79 0d  |on Task Display.|
000024f0  0a aa 1e 53 57 49 20 20  20 20 20 22 58 57 69 6d  |...SWI     "XWim|
00002500  70 5f 49 6e 69 74 69 61  6c 69 73 65 22 0d 0a b4  |p_Initialise"...|
00002510  19 20 42 56 53 20 20 20  20 20 53 65 72 69 6f 75  |. BVS     Seriou|
00002520  73 45 72 72 6f 72 0d 0a  be 44 53 54 52 20 20 20  |sError...DSTR   |
00002530  20 20 52 30 2c 5b 52 31  32 2c 23 76 65 72 73 69  |  R0,[R12,#versi|
00002540  6f 6e 25 5d 20 20 20 20  20 20 20 20 20 20 20 20  |on%]            |
00002550  20 3b 57 69 6d 70 20 56  65 72 73 69 6f 6e 20 6e  | ;Wimp Version n|
00002560  75 6d 62 65 72 20 2a 31  30 30 0d 0a c8 3b 53 54  |umber *100...;ST|
00002570  52 20 20 20 20 20 52 31  2c 5b 52 31 32 2c 23 74  |R     R1,[R12,#t|
00002580  61 73 6b 25 5d 20 20 20  20 20 20 20 20 20 20 20  |ask%]           |
00002590  20 20 20 20 20 3b 4f 75  72 20 54 61 73 6b 20 68  |     ;Our Task h|
000025a0  61 6e 64 6c 65 0d 0a d2  04 0d 0a dc 52 3b 2d 2d  |andle.......R;--|
000025b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000025f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 0a e6 37 3b  |-----------...7;|
00002600  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
00002610  20 73 65 74 73 20 75 70  20 6f 75 72 20 69 63 6f  | sets up our ico|
00002620  6e 20 6f 6e 20 74 68 65  20 69 63 6f 6e 20 62 61  |n on the icon ba|
00002630  72 2e 0d 0a f0 04 0d 0a  fa 50 4d 56 4e 20 20 20  |r........PMVN   |
00002640  20 20 52 30 2c 23 30 20  20 20 20 20 20 20 20 20  |  R0,#0         |
00002650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002660  20 3b 57 69 6e 64 6f 77  20 68 61 6e 64 6c 65 20  | ;Window handle |
00002670  28 2d 31 20 4c 65 66 74  20 73 69 64 65 20 6f 66  |(-1 Left side of|
00002680  20 49 42 61 72 29 0d 0b  04 1e 53 54 52 20 20 20  | IBar)....STR   |
00002690  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
000026a0  25 2b 30 5d 0d 0b 0e 35  4d 4f 56 20 20 20 20 20  |%+0]...5MOV     |
000026b0  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
000026c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000026d0  4d 69 6e 69 6d 75 6d 20  58 0d 0b 18 1e 53 54 52  |Minimum X....STR|
000026e0  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
000026f0  6f 63 6b 25 2b 34 5d 0d  0b 22 35 4d 4f 56 20 20  |ock%+4].."5MOV  |
00002700  20 20 20 52 30 2c 23 30  20 20 20 20 20 20 20 20  |   R0,#0        |
00002710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002720  20 20 3b 4d 69 6e 69 6d  75 6d 20 59 0d 0b 2c 1e  |  ;Minimum Y..,.|
00002730  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |STR     R0,[R12,|
00002740  23 62 6c 6f 63 6b 25 2b  38 5d 0d 0b 36 35 4d 4f  |#block%+8]..65MO|
00002750  56 20 20 20 20 20 52 30  2c 23 31 37 30 20 20 20  |V     R0,#170   |
00002760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002770  20 20 20 20 20 3b 4d 61  78 69 6d 75 6d 20 58 0d  |     ;Maximum X.|
00002780  0b 40 1f 53 54 52 20 20  20 20 20 52 30 2c 5b 52  |.@.STR     R0,[R|
00002790  31 32 2c 23 62 6c 6f 63  6b 25 2b 31 32 5d 0d 0b  |12,#block%+12]..|
000027a0  4a 35 4d 4f 56 20 20 20  20 20 52 30 2c 23 36 38  |J5MOV     R0,#68|
000027b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000027c0  20 20 20 20 20 20 20 20  20 3b 4d 61 78 69 6d 75  |         ;Maximu|
000027d0  6d 20 59 0d 0b 54 1f 53  54 52 20 20 20 20 20 52  |m Y..T.STR     R|
000027e0  30 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 31  |0,[R12,#block%+1|
000027f0  36 5d 0d 0b 5e 36 4d 4f  56 20 20 20 20 20 52 30  |6]..^6MOV     R0|
00002800  2c 20 20 20 23 26 33 30  30 30 20 20 20 20 20 20  |,   #&3000      |
00002810  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 63  |             ;Ic|
00002820  6f 6e 20 66 6c 61 67 73  0d 0b 68 18 41 44 44 20  |on flags..h.ADD |
00002830  20 20 20 20 52 30 2c 52  30 2c 23 26 30 30 30 32  |    R0,R0,#&0002|
00002840  0d 0b 72 1f 53 54 52 20  20 20 20 20 52 30 2c 5b  |..r.STR     R0,[|
00002850  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 32 30 5d 0d  |R12,#block%+20].|
00002860  0b 7c 1a 41 44 44 20 20  20 20 20 52 31 2c 52 31  |.|.ADD     R1,R1|
00002870  32 2c 23 62 6c 6f 63 6b  25 0d 0b 86 1e 53 57 49  |2,#block%....SWI|
00002880  20 20 20 20 20 22 58 57  69 6d 70 5f 43 72 65 61  |     "XWimp_Crea|
00002890  74 65 49 63 6f 6e 22 0d  0b 90 19 20 42 56 53 20  |teIcon".... BVS |
000028a0  20 20 20 20 53 65 72 69  6f 75 73 45 72 72 6f 72  |    SeriousError|
000028b0  0d 0b 9a 40 53 54 52 20  20 20 20 20 52 30 2c 5b  |...@STR     R0,[|
000028c0  52 31 32 2c 23 69 63 6f  6e 62 61 72 25 5d 20 20  |R12,#iconbar%]  |
000028d0  20 20 20 20 20 20 20 20  20 20 20 3b 49 63 6f 6e  |           ;Icon|
000028e0  20 62 61 72 20 69 63 6f  6e 20 6e 75 6d 62 65 72  | bar icon number|
000028f0  0d 0b a4 04 0d 0b ae 52  3b 2d 2d 2d 2d 2d 2d 2d  |.......R;-------|
00002900  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002940  2d 2d 2d 2d 2d 2d 0d 0b  b8 4b 3b 20 54 68 69 73  |------...K; This|
00002950  20 73 65 63 74 69 6f 6e  20 6c 6f 61 64 73 20 74  | section loads t|
00002960  68 65 20 77 69 6e 64 6f  77 20 74 65 6d 70 6c 61  |he window templa|
00002970  74 65 20 66 69 6c 65 73  20 61 6e 64 20 63 72 65  |te files and cre|
00002980  61 74 65 73 20 74 68 65  20 77 69 6e 64 6f 77 73  |ates the windows|
00002990  2e 0d 0b c2 04 0d 0b cc  1d 41 44 44 20 20 20 20  |.........ADD    |
000029a0  20 52 31 2c 52 31 32 2c  23 74 65 6d 70 6c 61 74  | R1,R12,#templat|
000029b0  65 73 0d 0b d6 20 53 57  49 20 20 20 20 20 22 58  |es... SWI     "X|
000029c0  57 69 6d 70 5f 4f 70 65  6e 54 65 6d 70 6c 61 74  |Wimp_OpenTemplat|
000029d0  65 22 0d 0b e0 19 20 42  56 53 20 20 20 20 20 53  |e".... BVS     S|
000029e0  65 72 69 6f 75 73 45 72  72 6f 72 0d 0b ea 43 41  |eriousError...CA|
000029f0  44 44 20 20 20 20 20 52  31 2c 52 31 32 2c 23 74  |DD     R1,R12,#t|
00002a00  65 6d 70 6c 61 74 65 73  25 20 20 20 20 20 20 20  |emplates%       |
00002a10  20 20 20 20 20 20 3b 53  70 61 63 65 20 66 6f 72  |      ;Space for|
00002a20  20 74 65 6d 70 6c 61 74  65 20 64 61 74 61 0d 0b  | template data..|
00002a30  f4 4a 41 44 44 20 20 20  20 20 52 32 2c 52 31 32  |.JADD     R2,R12|
00002a40  2c 23 69 63 6f 6e 73 25  20 20 20 20 20 20 20 20  |,#icons%        |
00002a50  20 20 20 20 20 20 20 20  20 3b 53 70 61 63 65 20  |         ;Space |
00002a60  66 6f 72 20 69 6e 64 69  72 65 63 74 65 64 20 49  |for indirected I|
00002a70  63 6f 6e 20 64 61 74 61  0d 0b fe 4d 41 44 44 20  |con data...MADD |
00002a80  20 20 20 20 52 33 2c 52  32 2c 23 74 65 6d 70 6c  |    R3,R2,#templ|
00002a90  61 74 65 73 25 2d 69 63  6f 6e 73 25 20 20 20 20  |ates%-icons%    |
00002aa0  20 20 20 3b 53 69 7a 65  20 6f 66 20 73 70 61 63  |   ;Size of spac|
00002ab0  65 20 66 6f 72 20 69 6e  64 69 72 65 63 74 65 64  |e for indirected|
00002ac0  20 64 61 74 61 0d 0c 08  45 41 44 44 20 20 20 20  | data...EADD    |
00002ad0  20 52 34 2c 52 31 32 2c  23 66 6f 6e 74 73 25 20  | R4,R12,#fonts% |
00002ae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002af0  3b 32 35 36 20 62 79 74  65 20 66 6f 6e 74 20 63  |;256 byte font c|
00002b00  6f 75 6e 74 20 61 72 72  61 79 0d 0c 12 04 0d 0c  |ount array......|
00002b10  1c 3f 41 44 44 20 20 20  20 20 52 35 2c 52 31 32  |.?ADD     R5,R12|
00002b20  2c 23 64 69 73 70 6c 61  79 20 20 20 20 20 20 20  |,#display       |
00002b30  20 20 20 20 20 20 20 20  20 3b 4d 61 69 6e 20 44  |         ;Main D|
00002b40  69 73 70 6c 61 79 20 57  69 6e 64 6f 77 0d 0c 26  |isplay Window..&|
00002b50  4c 4d 4f 56 20 20 20 20  20 52 36 2c 23 30 20 20  |LMOV     R6,#0  |
00002b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002b70  20 20 20 20 20 20 20 20  3b 54 65 6d 70 6c 61 74  |        ;Templat|
00002b80  65 20 74 6f 20 73 74 61  72 74 20 73 65 61 72 63  |e to start searc|
00002b90  68 69 6e 67 20 66 72 6f  6d 0d 0c 30 20 53 57 49  |hing from..0 SWI|
00002ba0  20 20 20 20 20 22 58 57  69 6d 70 5f 4c 6f 61 64  |     "XWimp_Load|
00002bb0  54 65 6d 70 6c 61 74 65  22 0d 0c 3a 19 20 42 56  |Template"..:. BV|
00002bc0  53 20 20 20 20 20 53 65  72 69 6f 75 73 45 72 72  |S     SeriousErr|
00002bd0  6f 72 0d 0c 44 20 53 57  49 20 20 20 20 20 22 58  |or..D SWI     "X|
00002be0  57 69 6d 70 5f 43 72 65  61 74 65 57 69 6e 64 6f  |Wimp_CreateWindo|
00002bf0  77 22 0d 0c 4e 19 20 42  56 53 20 20 20 20 20 53  |w"..N. BVS     S|
00002c00  65 72 69 6f 75 73 45 72  72 6f 72 0d 0c 58 41 53  |eriousError..XAS|
00002c10  54 52 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |TR     R0,[R12,#|
00002c20  64 69 73 70 6c 61 79 25  5d 20 20 20 20 20 20 20  |display%]       |
00002c30  20 20 20 20 20 20 3b 44  69 73 70 6c 61 79 20 77  |      ;Display w|
00002c40  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 0c 62 04  |indow handle..b.|
00002c50  0d 0c 6c 3d 41 44 44 20  20 20 20 20 52 35 2c 52  |..l=ADD     R5,R|
00002c60  31 32 2c 23 69 6e 66 6f  20 20 20 20 20 20 20 20  |12,#info        |
00002c70  20 20 20 20 20 20 20 20  20 20 20 3b 49 6e 66 6f  |           ;Info|
00002c80  20 44 69 61 6c 6f 67 75  65 20 62 6f 78 0d 0c 76  | Dialogue box..v|
00002c90  11 4d 4f 56 20 20 20 20  20 52 36 2c 23 30 0d 0c  |.MOV     R6,#0..|
00002ca0  80 20 53 57 49 20 20 20  20 20 22 58 57 69 6d 70  |. SWI     "XWimp|
00002cb0  5f 4c 6f 61 64 54 65 6d  70 6c 61 74 65 22 0d 0c  |_LoadTemplate"..|
00002cc0  8a 19 20 42 56 53 20 20  20 20 20 53 65 72 69 6f  |.. BVS     Serio|
00002cd0  75 73 45 72 72 6f 72 0d  0c 94 20 53 57 49 20 20  |usError... SWI  |
00002ce0  20 20 20 22 58 57 69 6d  70 5f 43 72 65 61 74 65  |   "XWimp_Create|
00002cf0  57 69 6e 64 6f 77 22 0d  0c 9e 19 20 42 56 53 20  |Window".... BVS |
00002d00  20 20 20 20 53 65 72 69  6f 75 73 45 72 72 6f 72  |    SeriousError|
00002d10  0d 0c a8 3e 53 54 52 20  20 20 20 20 52 30 2c 5b  |...>STR     R0,[|
00002d20  52 31 32 2c 23 69 6e 66  6f 25 5d 20 20 20 20 20  |R12,#info%]     |
00002d30  20 20 20 20 20 20 20 20  20 20 20 3b 49 6e 66 6f  |           ;Info|
00002d40  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 0d 0c  | window handle..|
00002d50  b2 04 0d 0c bc 3f 41 44  44 20 20 20 20 20 52 35  |.....?ADD     R5|
00002d60  2c 52 31 32 2c 23 73 65  61 72 63 68 20 20 20 20  |,R12,#search    |
00002d70  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 53 65  |             ;Se|
00002d80  61 72 63 68 20 44 69 61  6c 6f 67 75 65 20 62 6f  |arch Dialogue bo|
00002d90  78 0d 0c c6 11 4d 4f 56  20 20 20 20 20 52 36 2c  |x....MOV     R6,|
00002da0  23 30 0d 0c d0 20 53 57  49 20 20 20 20 20 22 58  |#0... SWI     "X|
00002db0  57 69 6d 70 5f 4c 6f 61  64 54 65 6d 70 6c 61 74  |Wimp_LoadTemplat|
00002dc0  65 22 0d 0c da 19 20 42  56 53 20 20 20 20 20 53  |e".... BVS     S|
00002dd0  65 72 69 6f 75 73 45 72  72 6f 72 0d 0c e4 20 53  |eriousError... S|
00002de0  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 43 72  |WI     "XWimp_Cr|
00002df0  65 61 74 65 57 69 6e 64  6f 77 22 0d 0c ee 19 20  |eateWindow".... |
00002e00  42 56 53 20 20 20 20 20  53 65 72 69 6f 75 73 45  |BVS     SeriousE|
00002e10  72 72 6f 72 0d 0c f8 40  53 54 52 20 20 20 20 20  |rror...@STR     |
00002e20  52 30 2c 5b 52 31 32 2c  23 73 65 61 72 63 68 25  |R0,[R12,#search%|
00002e30  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |]              ;|
00002e40  53 65 61 72 63 68 20 77  69 6e 64 6f 77 20 68 61  |Search window ha|
00002e50  6e 64 6c 65 0d 0d 02 04  0d 0d 0c 37 41 44 44 20  |ndle.......7ADD |
00002e60  20 20 20 20 52 35 2c 52  31 32 2c 23 65 64 69 74  |    R5,R12,#edit|
00002e70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e80  20 20 20 3b 45 64 69 74  20 77 69 6e 64 6f 77 0d  |   ;Edit window.|
00002e90  0d 16 11 4d 4f 56 20 20  20 20 20 52 36 2c 23 30  |...MOV     R6,#0|
00002ea0  0d 0d 20 20 53 57 49 20  20 20 20 20 22 58 57 69  |..  SWI     "XWi|
00002eb0  6d 70 5f 4c 6f 61 64 54  65 6d 70 6c 61 74 65 22  |mp_LoadTemplate"|
00002ec0  0d 0d 2a 19 20 42 56 53  20 20 20 20 20 53 65 72  |..*. BVS     Ser|
00002ed0  69 6f 75 73 45 72 72 6f  72 0d 0d 34 20 53 57 49  |iousError..4 SWI|
00002ee0  20 20 20 20 20 22 58 57  69 6d 70 5f 43 72 65 61  |     "XWimp_Crea|
00002ef0  74 65 57 69 6e 64 6f 77  22 0d 0d 3e 19 20 42 56  |teWindow"..>. BV|
00002f00  53 20 20 20 20 20 53 65  72 69 6f 75 73 45 72 72  |S     SeriousErr|
00002f10  6f 72 0d 0d 48 3e 53 54  52 20 20 20 20 20 52 30  |or..H>STR     R0|
00002f20  2c 5b 52 31 32 2c 23 65  64 69 74 25 5d 20 20 20  |,[R12,#edit%]   |
00002f30  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 45 64  |             ;Ed|
00002f40  69 74 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |it window handle|
00002f50  0d 0d 52 04 0d 0d 5c 3d  41 44 44 20 20 20 20 20  |..R...\=ADD     |
00002f60  52 35 2c 52 31 32 2c 23  73 61 76 65 20 20 20 20  |R5,R12,#save    |
00002f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00002f80  53 61 76 65 20 44 69 61  6c 6f 67 75 65 20 62 6f  |Save Dialogue bo|
00002f90  78 0d 0d 66 11 4d 4f 56  20 20 20 20 20 52 36 2c  |x..f.MOV     R6,|
00002fa0  23 30 0d 0d 70 20 53 57  49 20 20 20 20 20 22 58  |#0..p SWI     "X|
00002fb0  57 69 6d 70 5f 4c 6f 61  64 54 65 6d 70 6c 61 74  |Wimp_LoadTemplat|
00002fc0  65 22 0d 0d 7a 19 20 42  56 53 20 20 20 20 20 53  |e"..z. BVS     S|
00002fd0  65 72 69 6f 75 73 45 72  72 6f 72 0d 0d 84 20 53  |eriousError... S|
00002fe0  57 49 20 20 20 20 20 22  58 57 69 6d 70 5f 43 72  |WI     "XWimp_Cr|
00002ff0  65 61 74 65 57 69 6e 64  6f 77 22 0d 0d 8e 19 20  |eateWindow".... |
00003000  42 56 53 20 20 20 20 20  53 65 72 69 6f 75 73 45  |BVS     SeriousE|
00003010  72 72 6f 72 0d 0d 98 3e  53 54 52 20 20 20 20 20  |rror...>STR     |
00003020  52 30 2c 5b 52 31 32 2c  23 73 61 76 65 25 5d 20  |R0,[R12,#save%] |
00003030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00003040  53 61 76 65 20 77 69 6e  64 6f 77 20 68 61 6e 64  |Save window hand|
00003050  6c 65 0d 0d a2 04 0d 0d  ac 04 0d 0d b6 41 41 44  |le...........AAD|
00003060  44 20 20 20 20 20 52 35  2c 52 31 32 2c 23 75 70  |D     R5,R12,#up|
00003070  64 61 74 65 20 20 20 20  20 20 20 20 20 20 20 20  |date            |
00003080  20 20 20 20 20 20 20 3b  55 70 64 61 74 65 20 44  |       ;Update D|
00003090  69 61 6c 6f 67 75 65 20  62 6f 78 0d 0d c0 11 4d  |ialogue box....M|
000030a0  4f 56 20 20 20 20 20 52  36 2c 23 30 0d 0d ca 20  |OV     R6,#0... |
000030b0  53 57 49 20 20 20 20 20  22 58 57 69 6d 70 5f 4c  |SWI     "XWimp_L|
000030c0  6f 61 64 54 65 6d 70 6c  61 74 65 22 0d 0d d4 19  |oadTemplate"....|
000030d0  20 42 56 53 20 20 20 20  20 53 65 72 69 6f 75 73  | BVS     Serious|
000030e0  45 72 72 6f 72 0d 0d de  20 53 57 49 20 20 20 20  |Error... SWI    |
000030f0  20 22 58 57 69 6d 70 5f  43 72 65 61 74 65 57 69  | "XWimp_CreateWi|
00003100  6e 64 6f 77 22 0d 0d e8  19 20 42 56 53 20 20 20  |ndow".... BVS   |
00003110  20 20 53 65 72 69 6f 75  73 45 72 72 6f 72 0d 0d  |  SeriousError..|
00003120  f2 42 53 54 52 20 20 20  20 20 52 30 2c 5b 52 31  |.BSTR     R0,[R1|
00003130  32 2c 23 75 70 64 61 74  65 25 5d 20 20 20 20 20  |2,#update%]     |
00003140  20 20 20 20 20 20 20 20  20 20 20 3b 55 70 64 61  |           ;Upda|
00003150  74 65 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |te window handle|
00003160  0d 0d fc 04 0d 0e 06 21  53 57 49 20 20 20 20 20  |.......!SWI     |
00003170  22 58 57 69 6d 70 5f 43  6c 6f 73 65 54 65 6d 70  |"XWimp_CloseTemp|
00003180  6c 61 74 65 22 0d 0e 10  04 0d 0e 1a 52 3b 2d 2d  |late".......R;--|
00003190  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000031d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 0e 24 48 3b  |-----------..$H;|
000031e0  20 54 68 69 73 20 72 6f  75 74 69 6e 65 20 66 69  | This routine fi|
000031f0  6c 6c 73 20 69 6e 20 74  68 65 20 76 65 72 73 69  |lls in the versi|
00003200  6f 6e 20 6e 75 6d 62 65  72 20 69 6e 20 74 68 65  |on number in the|
00003210  20 49 6e 66 6f 20 64 69  61 6c 6f 67 75 65 20 62  | Info dialogue b|
00003220  6f 78 2e 0d 0e 2e 04 0d  0e 38 1b 4c 44 52 20 20  |ox.......8.LDR  |
00003230  20 20 20 52 30 2c 5b 52  31 32 2c 23 69 6e 66 6f  |   R0,[R12,#info|
00003240  25 5d 0d 0e 42 11 4d 4f  56 20 20 20 20 20 52 31  |%]..B.MOV     R1|
00003250  2c 23 37 0d 0e 4c 1b 41  44 44 20 20 20 20 20 52  |,#7..L.ADD     R|
00003260  32 2c 52 31 32 2c 23 76  65 72 73 69 6f 6e 0d 0e  |2,R12,#version..|
00003270  56 15 42 4c 20 20 20 20  20 20 57 72 69 74 65 49  |V.BL      WriteI|
00003280  63 6f 6e 0d 0e 60 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |con..`R;--------|
00003290  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000032d0  2d 2d 2d 2d 2d 0d 0e 6a  04 0d 0e 74 3c 42 4c 20  |-----..j...t<BL |
000032e0  20 20 20 20 20 49 6e 69  74 20 20 20 20 20 20 20  |     Init       |
000032f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003300  20 20 20 20 3b 49 6e 69  74 69 61 6c 69 73 65 20  |    ;Initialise |
00003310  66 69 6c 65 73 0d 0e 7e  04 0d 0e 88 52 3b 2d 2d  |files..~....R;--|
00003320  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003360  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 0e 92 34 3b  |-----------...4;|
00003370  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 2a  |              **|
00003390  2a 20 57 69 6d 70 5f 50  6f 6c 6c 20 2a 2a 2a 0d  |* Wimp_Poll ***.|
000033a0  0e 9c 4a 3b 20 54 68 69  73 20 72 6f 75 74 69 6e  |..J; This routin|
000033b0  65 20 72 65 70 65 61 74  65 64 6c 79 20 70 6f 6c  |e repeatedly pol|
000033c0  6c 73 20 74 68 65 20 77  69 6d 70 20 74 6f 20 66  |ls the wimp to f|
000033d0  69 6e 64 20 6f 75 74 20  77 68 61 74 20 69 73 20  |ind out what is |
000033e0  68 61 70 70 65 6e 69 6e  67 0d 0e a6 4d 3b 20 61  |happening...M; a|
000033f0  72 6f 75 6e 64 20 74 68  65 20 64 65 73 6b 74 6f  |round the deskto|
00003400  70 2e 20 54 68 65 20 77  69 6d 70 20 72 65 74 75  |p. The wimp retu|
00003410  72 6e 73 20 61 6e 20 45  76 65 6e 74 20 52 65 61  |rns an Event Rea|
00003420  73 6f 6e 20 43 6f 64 65  20 61 6e 64 20 66 69 6c  |son Code and fil|
00003430  6c 73 20 74 68 65 0d 0e  b0 37 3b 20 70 61 72 61  |ls the...7; para|
00003440  6d 65 74 65 72 20 62 6c  6f 63 6b 20 77 69 74 68  |meter block with|
00003450  20 64 61 74 61 20 64 65  70 65 6e 64 61 6e 74 20  | data dependant |
00003460  6f 6e 20 74 68 65 20 45  76 65 6e 74 2e 0d 0e ba  |on the Event....|
00003470  04 0d 0e c4 0e 20 2e 6d  61 69 6e 6c 6f 6f 70 0d  |..... .mainloop.|
00003480  0e ce 04 0d 0e d8 22 4d  4f 56 20 20 20 20 20 52  |......"MOV     R|
00003490  30 2c 20 20 20 23 25 31  31 31 30 30 30 30 30 30  |0,   #%111000000|
000034a0  30 30 30 30 30 0d 0e e2  4a 41 44 44 20 20 20 20  |00000...JADD    |
000034b0  20 52 30 2c 52 30 2c 23  25 30 30 30 30 30 30 30  | R0,R0,#%0000000|
000034c0  30 30 31 30 30 30 30 20  20 20 20 20 20 20 20 20  |0010000         |
000034d0  3b 4d 61 73 6b 20 6f 75  74 20 75 6e 77 61 6e 74  |;Mask out unwant|
000034e0  65 64 20 72 65 61 73 6f  6e 20 63 6f 64 65 73 0d  |ed reason codes.|
000034f0  0e ec 04 0d 0e f6 1a 41  44 44 20 20 20 20 20 52  |.......ADD     R|
00003500  31 2c 52 31 32 2c 23 62  6c 6f 63 6b 25 0d 0f 00  |1,R12,#block%...|
00003510  17 53 57 49 20 20 20 20  20 22 57 69 6d 70 5f 50  |.SWI     "Wimp_P|
00003520  6f 6c 6c 22 0d 0f 0a 04  0d 0f 14 28 20 43 4d 50  |oll".......( CMP|
00003530  20 20 20 20 20 52 30 2c  23 30 3a 20 42 4c 45 51  |     R0,#0: BLEQ|
00003540  20 20 20 20 43 6f 6e 74  55 70 64 61 74 69 6e 67  |    ContUpdating|
00003550  0d 0f 1e 2f 20 43 4d 50  20 20 20 20 20 52 30 2c  |.../ CMP     R0,|
00003560  23 31 3a 20 42 4c 45 51  20 20 20 20 52 65 64 72  |#1: BLEQ    Redr|
00003570  61 77 57 69 6e 64 6f 77  52 65 71 75 65 73 74 0d  |awWindowRequest.|
00003580  0f 28 2d 20 43 4d 50 20  20 20 20 20 52 30 2c 23  |.(- CMP     R0,#|
00003590  32 3a 20 42 4c 45 51 20  20 20 20 4f 70 65 6e 57  |2: BLEQ    OpenW|
000035a0  69 6e 64 6f 77 52 65 71  75 65 73 74 0d 0f 32 2e  |indowRequest..2.|
000035b0  20 43 4d 50 20 20 20 20  20 52 30 2c 23 33 3a 20  | CMP     R0,#3: |
000035c0  53 57 49 45 51 20 20 20  22 57 69 6d 70 5f 43 6c  |SWIEQ   "Wimp_Cl|
000035d0  6f 73 65 57 69 6e 64 6f  77 22 0d 0f 3c 42 3b 43  |oseWindow"..<B;C|
000035e0  4d 50 20 20 20 20 20 52  30 2c 23 34 20 20 20 20  |MP     R0,#4    |
000035f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003600  20 20 20 20 20 3b 50 6f  69 6e 74 65 72 5f 4c 65  |     ;Pointer_Le|
00003610  61 76 69 6e 67 5f 57 69  6e 64 6f 77 0d 0f 46 43  |aving_Window..FC|
00003620  20 43 4d 50 20 20 20 20  20 52 30 2c 23 35 3a 20  | CMP     R0,#5: |
00003630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003640  20 20 20 20 20 20 20 3b  50 6f 69 6e 74 65 72 5f  |       ;Pointer_|
00003650  45 6e 74 65 72 69 6e 67  5f 57 69 6e 64 6f 77 0d  |Entering_Window.|
00003660  0f 50 2e 20 43 4d 50 20  20 20 20 20 52 30 2c 23  |.P. CMP     R0,#|
00003670  36 3a 20 42 4c 45 51 20  20 20 20 4d 6f 75 73 65  |6: BLEQ    Mouse|
00003680  42 75 74 74 6f 6e 43 6c  69 63 6b 65 64 0d 0f 5a  |ButtonClicked..Z|
00003690  28 20 43 4d 50 20 20 20  20 20 52 30 2c 23 37 3a  |( CMP     R0,#7:|
000036a0  20 42 4c 45 51 20 20 20  20 44 72 61 67 46 69 6e  | BLEQ    DragFin|
000036b0  69 73 68 65 64 0d 0f 64  26 20 43 4d 50 20 20 20  |ished..d& CMP   |
000036c0  20 20 52 30 2c 23 38 3a  20 42 4c 45 51 20 20 20  |  R0,#8: BLEQ   |
000036d0  20 4b 65 79 50 72 65 73  73 65 64 0d 0f 6e 2e 20  | KeyPressed..n. |
000036e0  43 4d 50 20 20 20 20 20  52 30 2c 23 39 3a 20 42  |CMP     R0,#9: B|
000036f0  4c 45 51 20 20 20 20 4d  65 6e 75 4f 70 74 69 6f  |LEQ    MenuOptio|
00003700  6e 53 65 6c 65 63 74 65  64 0d 0f 78 3a 3b 43 4d  |nSelected..x:;CM|
00003710  50 20 20 20 20 20 52 30  2c 23 31 30 20 20 20 20  |P     R0,#10    |
00003720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003730  20 20 20 20 3b 53 63 72  6f 6c 6c 5f 52 65 71 75  |    ;Scroll_Requ|
00003740  65 73 74 0d 0f 82 38 3b  43 4d 50 20 20 20 20 20  |est...8;CMP     |
00003750  52 30 2c 23 31 31 20 20  20 20 20 20 20 20 20 20  |R0,#11          |
00003760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4c  |              ;L|
00003770  6f 73 69 6e 67 5f 43 61  72 65 74 0d 0f 8c 39 3b  |osing_Caret...9;|
00003780  43 4d 50 20 20 20 20 20  52 30 2c 23 31 32 20 20  |CMP     R0,#12  |
00003790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000037a0  20 20 20 20 20 20 3b 47  61 69 6e 69 6e 67 5f 43  |      ;Gaining_C|
000037b0  61 72 65 74 0d 0f 96 40  20 43 4d 50 20 20 20 20  |aret...@ CMP    |
000037c0  20 52 30 2c 23 31 37 20  20 20 20 20 20 20 20 20  | R0,#17         |
000037d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000037e0  55 73 65 72 5f 4d 65 73  73 61 67 65 52 65 63 65  |User_MessageRece|
000037f0  69 76 65 64 0d 0f a0 2f  20 43 4d 50 4e 45 20 20  |ived.../ CMPNE  |
00003800  20 52 30 2c 23 31 38 3a  42 4c 45 51 20 20 20 20  | R0,#18:BLEQ    |
00003810  55 73 65 72 4d 65 73 73  61 67 65 52 65 63 65 69  |UserMessageRecei|
00003820  76 65 64 0d 0f aa 3c 3b  43 4d 50 20 20 20 20 20  |ved...<;CMP     |
00003830  52 30 2c 23 31 39 20 20  20 20 20 20 20 20 20 20  |R0,#19          |
00003840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 55  |              ;U|
00003850  73 65 72 5f 4d 65 73 73  61 67 65 5f 41 63 6b 0d  |ser_Message_Ack.|
00003860  0f b4 04 0d 0f be 04 0d  0f c8 4f 20 4c 44 52 20  |..........O LDR |
00003870  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 71 75 69  |    R0,[R12,#qui|
00003880  74 25 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |t%]             |
00003890  20 20 3b 43 68 65 63 6b  20 69 66 20 77 65 20 68  |  ;Check if we h|
000038a0  61 76 65 20 62 65 65 6e  20 61 73 6b 65 64 20 74  |ave been asked t|
000038b0  6f 20 71 75 69 74 0d 0f  d2 12 20 43 4d 50 20 20  |o quit.... CMP  |
000038c0  20 20 20 52 30 2c 23 30  0d 0f dc 15 20 42 45 51  |   R0,#0.... BEQ|
000038d0  20 20 20 20 20 6d 61 69  6e 6c 6f 6f 70 0d 0f e6  |     mainloop...|
000038e0  04 0d 0f f0 51 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....Q;----------|
000038f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003930  2d 2d 0d 0f fa 2f 3b 20  54 68 69 73 20 72 6f 75  |--.../; This rou|
00003940  74 69 6e 65 20 73 61 66  6c 65 79 20 63 6c 6f 73  |tine safley clos|
00003950  65 73 20 64 6f 77 6e 20  6f 75 72 20 74 61 73 6b  |es down our task|
00003960  2e 0d 10 04 04 0d 10 0e  4f 20 4c 44 52 20 20 20  |........O LDR   |
00003970  20 20 52 30 2c 5b 52 31  32 2c 23 74 61 73 6b 25  |  R0,[R12,#task%|
00003980  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |]               |
00003990  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 74 65  |;This section te|
000039a0  6c 6c 73 20 74 68 65 20  57 49 4d 50 20 74 68 61  |lls the WIMP tha|
000039b0  74 20 77 65 0d 10 18 4d  20 4d 4f 56 20 20 20 20  |t we...M MOV    |
000039c0  20 52 31 2c 20 20 20 23  26 34 42 30 30 30 30 30  | R1,   #&4B00000|
000039d0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |0              ;|
000039e0  61 72 65 20 61 62 6f 75  74 20 74 6f 20 63 6c 6f  |are about to clo|
000039f0  73 65 20 64 6f 77 6e 20  6f 75 72 20 74 61 73 6b  |se down our task|
00003a00  2e 0d 10 22 1d 20 41 44  44 20 20 20 20 20 52 31  |...". ADD     R1|
00003a10  2c 52 31 2c 23 26 30 30  35 33 30 30 30 30 0d 10  |,R1,#&00530000..|
00003a20  2c 1d 20 41 44 44 20 20  20 20 20 52 31 2c 52 31  |,. ADD     R1,R1|
00003a30  2c 23 26 30 30 30 30 34  31 30 30 0d 10 36 1d 20  |,#&00004100..6. |
00003a40  41 44 44 20 20 20 20 20  52 31 2c 52 31 2c 23 26  |ADD     R1,R1,#&|
00003a50  30 30 30 30 30 30 35 34  0d 10 40 1e 20 53 57 49  |00000054..@. SWI|
00003a60  20 20 20 20 20 22 58 57  69 6d 70 5f 43 6c 6f 73  |     "XWimp_Clos|
00003a70  65 44 6f 77 6e 22 0d 10  4a 04 0d 10 54 12 20 4d  |eDown"..J...T. M|
00003a80  4f 56 20 20 20 20 20 52  30 2c 23 36 0d 10 5e 1f  |OV     R0,#6..^.|
00003a90  20 41 44 44 20 20 20 20  20 52 31 2c 52 31 30 2c  | ADD     R1,R10,|
00003aa0  23 73 65 61 72 63 68 66  69 6c 65 0d 10 68 16 20  |#searchfile..h. |
00003ab0  53 57 49 20 20 20 20 20  22 4f 53 5f 46 69 6c 65  |SWI     "OS_File|
00003ac0  22 0d 10 72 04 0d 10 7c  50 20 a4 4c 6f 6e 67 41  |"..r...|P .LongA|
00003ad0  64 72 28 22 22 2c 30 2c  6d 65 73 73 61 67 65 73  |dr("",0,messages|
00003ae0  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |)              ;|
00003af0  54 68 69 73 20 63 6c 6f  73 65 73 20 74 68 65 20  |This closes the |
00003b00  4d 65 73 73 61 67 65 20  66 69 6c 65 20 69 66 20  |Message file if |
00003b10  69 74 20 69 73 0d 10 86  37 20 53 57 49 20 20 20  |it is...7 SWI   |
00003b20  20 20 22 58 4d 65 73 73  61 67 65 54 72 61 6e 73  |  "XMessageTrans|
00003b30  5f 43 6c 6f 73 65 46 69  6c 65 22 20 20 20 20 20  |_CloseFile"     |
00003b40  3b 73 74 69 6c 6c 20 6f  70 65 6e 2e 0d 10 90 04  |;still open.....|
00003b50  0d 10 9a 46 20 53 57 49  20 20 20 20 20 22 58 4f  |...F SWI     "XO|
00003b60  53 5f 45 78 69 74 22 20  20 20 20 20 20 20 20 20  |S_Exit"         |
00003b70  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00003b80  20 63 6c 6f 73 65 73 20  64 6f 77 6e 20 6f 75 72  | closes down our|
00003b90  20 74 61 73 6b 2e 0d 10  a4 04 0d 10 ae 52 3b 2d  | task........R;-|
00003ba0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003be0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 10 b8 36  |------------...6|
00003bf0  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00003c00  20 20 20 20 20 2a 2a 2a  20 52 65 64 72 61 77 5f  |     *** Redraw_|
00003c10  57 69 6e 64 6f 77 5f 52  65 71 75 65 73 74 20 2a  |Window_Request *|
00003c20  2a 2a 0d 10 c2 4d 3b 20  54 68 69 73 20 72 6f 75  |**...M; This rou|
00003c30  74 69 6e 65 20 69 73 20  63 61 6c 6c 65 64 20 77  |tine is called w|
00003c40  68 65 6e 20 70 61 72 74  20 6f 66 20 6f 6e 65 20  |hen part of one |
00003c50  6f 66 20 6f 75 72 20 77  69 6e 64 6f 77 73 20 6e  |of our windows n|
00003c60  65 65 64 73 20 72 65 64  72 61 77 69 6e 67 2e 0d  |eeds redrawing..|
00003c70  10 cc 50 3b 20 53 69 6e  63 65 20 6e 6f 6e 65 20  |..P; Since none |
00003c80  6f 66 20 6f 75 72 20 77  69 6e 64 6f 77 73 20 63  |of our windows c|
00003c90  6f 6e 74 61 69 6e 20 61  6e 79 20 27 55 73 65 72  |ontain any 'User|
00003ca0  27 20 67 72 61 70 68 69  63 73 20 77 65 20 63 61  |' graphics we ca|
00003cb0  6e 20 70 61 73 73 20 74  68 65 20 63 61 6c 6c 0d  |n pass the call.|
00003cc0  10 d6 4f 3b 20 73 74 72  61 69 67 68 74 20 62 61  |..O; straight ba|
00003cd0  63 6b 20 74 6f 20 74 68  65 20 57 69 6d 70 20 74  |ck to the Wimp t|
00003ce0  6f 20 72 65 64 72 61 77  20 74 68 65 20 69 63 6f  |o redraw the ico|
00003cf0  6e 73 20 69 74 73 65 6c  66 2e 20 41 20 6c 6f 6f  |ns itself. A loo|
00003d00  70 20 69 73 20 6e 65 65  64 65 64 20 74 6f 0d 10  |p is needed to..|
00003d10  e0 3b 3b 20 67 65 74 20  61 20 6c 69 73 74 20 6f  |.;; get a list o|
00003d20  66 20 61 6c 6c 20 74 68  65 20 52 65 63 74 61 6e  |f all the Rectan|
00003d30  67 6c 65 73 20 74 68 61  74 20 6e 65 65 64 20 72  |gles that need r|
00003d40  65 64 72 61 77 69 6e 67  2e 0d 10 ea 04 0d 10 f4  |edrawing........|
00003d50  18 2e 52 65 64 72 61 77  57 69 6e 64 6f 77 52 65  |..RedrawWindowRe|
00003d60  71 75 65 73 74 0d 10 fe  04 0d 11 08 1d 53 54 4d  |quest........STM|
00003d70  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |FD   R13!,{R0-R1|
00003d80  32 2c 52 31 34 7d 0d 11  12 1b 20 41 44 44 20 20  |2,R14}.... ADD  |
00003d90  20 20 20 52 31 2c 52 31  32 2c 23 62 6c 6f 63 6b  |   R1,R12,#block|
00003da0  25 0d 11 1c 20 20 53 57  49 20 20 20 20 20 22 57  |%...  SWI     "W|
00003db0  69 6d 70 5f 52 65 64 72  61 77 57 69 6e 64 6f 77  |imp_RedrawWindow|
00003dc0  22 0d 11 26 10 20 2e 72  65 64 72 61 77 6c 6f 6f  |"..&. .redrawloo|
00003dd0  70 0d 11 30 12 20 43 4d  50 20 20 20 20 20 52 30  |p..0. CMP     R0|
00003de0  2c 23 30 0d 11 3a 1e 20  4c 44 4d 45 51 46 44 20  |,#0..:. LDMEQFD |
00003df0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
00003e00  5e 0d 11 44 20 20 53 57  49 20 20 20 20 20 22 57  |^..D  SWI     "W|
00003e10  69 6d 70 5f 47 65 74 52  65 63 74 61 6e 67 6c 65  |imp_GetRectangle|
00003e20  22 0d 11 4e 16 42 20 20  20 20 20 20 20 72 65 64  |"..N.B       red|
00003e30  72 61 77 6c 6f 6f 70 0d  11 58 04 0d 11 62 52 3b  |rawloop..X...bR;|
00003e40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003e80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 11 6c  |-------------..l|
00003e90  36 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6;              |
00003ea0  20 20 20 20 20 20 20 20  2a 2a 2a 20 4f 70 65 6e  |        *** Open|
00003eb0  5f 57 69 6e 64 6f 77 5f  52 65 71 75 65 73 74 20  |_Window_Request |
00003ec0  2a 2a 2a 0d 11 76 4e 3b  20 54 68 69 73 20 72 6f  |***..vN; This ro|
00003ed0  75 74 69 6e 65 20 69 73  20 63 61 6c 6c 65 64 20  |utine is called |
00003ee0  77 68 65 6e 20 6f 6e 65  20 6f 66 20 6f 75 72 20  |when one of our |
00003ef0  77 69 6e 64 6f 77 73 20  6e 65 65 64 73 20 6f 70  |windows needs op|
00003f00  65 6e 69 6e 67 20 6f 72  20 68 61 73 20 62 65 65  |ening or has bee|
00003f10  6e 0d 11 80 4d 3b 20 73  63 72 6f 6c 6c 65 64 20  |n...M; scrolled |
00003f20  61 6e 64 20 6e 65 65 64  73 20 72 65 64 72 61 77  |and needs redraw|
00003f30  69 6e 67 20 77 69 74 68  20 6e 65 77 20 73 63 72  |ing with new scr|
00003f40  6f 6c 6c 20 6f 66 66 73  65 74 73 2e 20 4e 6f 20  |oll offsets. No |
00003f50  73 70 65 63 69 61 6c 20  61 63 74 69 6f 6e 0d 11  |special action..|
00003f60  8a 46 3b 20 6e 65 65 64  73 20 74 6f 20 62 65 20  |.F; needs to be |
00003f70  70 65 72 66 6f 72 6d 65  64 20 73 6f 20 77 65 20  |performed so we |
00003f80  73 69 6d 70 6c 79 20 6f  70 65 6e 20 74 68 65 20  |simply open the |
00003f90  77 69 6e 64 6f 77 20 61  73 20 72 65 71 75 65 73  |window as reques|
00003fa0  74 65 64 2e 0d 11 94 04  0d 11 9e 16 2e 4f 70 65  |ted..........Ope|
00003fb0  6e 57 69 6e 64 6f 77 52  65 71 75 65 73 74 0d 11  |nWindowRequest..|
00003fc0  a8 04 0d 11 b2 1d 53 54  4d 46 44 20 20 20 52 31  |......STMFD   R1|
00003fd0  33 21 2c 7b 52 30 2d 52  31 32 2c 52 31 34 7d 0d  |3!,{R0-R12,R14}.|
00003fe0  11 bc 04 0d 11 c6 1e 20  53 57 49 20 20 20 20 20  |....... SWI     |
00003ff0  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
00004000  22 0d 11 d0 04 0d 11 da  1d 4c 44 4d 46 44 20 20  |"........LDMFD  |
00004010  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
00004020  7d 5e 0d 11 e4 04 0d 11  ee 52 3b 2d 2d 2d 2d 2d  |}^.......R;-----|
00004030  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004070  2d 2d 2d 2d 2d 2d 2d 2d  0d 11 f8 36 3b 20 20 20  |--------...6;   |
00004080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004090  20 20 20 20 2a 2a 2a 20  4d 6f 75 73 65 5f 42 75  |    *** Mouse_Bu|
000040a0  74 74 6f 6e 5f 43 6c 69  63 6b 20 2a 2a 2a 0d 12  |tton_Click ***..|
000040b0  02 4a 3b 20 54 68 69 73  20 72 6f 75 74 69 6e 65  |.J; This routine|
000040c0  20 69 73 20 63 61 6c 6c  65 64 20 77 68 65 6e 20  | is called when |
000040d0  74 68 65 20 6d 6f 75 73  65 20 62 75 74 74 6f 6e  |the mouse button|
000040e0  73 20 63 68 61 6e 67 65  20 73 74 61 74 65 20 77  |s change state w|
000040f0  68 69 6c 65 20 74 68 65  0d 12 0c 53 3b 20 70 6f  |hile the...S; po|
00004100  69 6e 74 65 72 20 69 73  20 6f 76 65 72 20 6f 6e  |inter is over on|
00004110  65 20 6f 66 20 6f 75 72  20 77 69 6e 64 6f 77 73  |e of our windows|
00004120  20 2d 20 44 65 70 65 6e  64 61 6e 74 20 6f 6e 20  | - Dependant on |
00004130  74 68 65 20 62 75 74 74  6f 6e 20 74 79 70 65 20  |the button type |
00004140  6f 66 20 74 68 65 20 69  63 6f 6e 0d 12 16 19 3b  |of the icon....;|
00004150  20 69 74 20 69 73 20 6f  76 65 72 2c 20 69 66 20  | it is over, if |
00004160  61 6e 79 2e 0d 12 20 04  0d 12 2a 17 2e 4d 6f 75  |any... ...*..Mou|
00004170  73 65 42 75 74 74 6f 6e  43 6c 69 63 6b 65 64 0d  |seButtonClicked.|
00004180  12 34 04 0d 12 3e 1d 53  54 4d 46 44 20 20 20 52  |.4...>.STMFD   R|
00004190  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
000041a0  0d 12 48 38 20 4c 44 52  20 20 20 20 20 52 32 2c  |..H8 LDR     R2,|
000041b0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 30 5d 20  |[R12,#block%+0] |
000041c0  20 20 20 20 20 20 20 20  20 20 20 3b 58 20 63 6f  |           ;X co|
000041d0  6f 72 64 69 6e 61 74 65  0d 12 52 38 20 4c 44 52  |ordinate..R8 LDR|
000041e0  20 20 20 20 20 52 33 2c  5b 52 31 32 2c 23 62 6c  |     R3,[R12,#bl|
000041f0  6f 63 6b 25 2b 34 5d 20  20 20 20 20 20 20 20 20  |ock%+4]         |
00004200  20 20 20 3b 59 20 63 6f  6f 72 64 69 6e 61 74 65  |   ;Y coordinate|
00004210  0d 12 5c 3e 20 4c 44 52  20 20 20 20 20 52 34 2c  |..\> LDR     R4,|
00004220  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 38 5d 20  |[R12,#block%+8] |
00004230  20 20 20 20 20 20 20 20  20 20 20 3b 4d 6f 75 73  |           ;Mous|
00004240  65 20 42 75 74 74 6f 6e  20 53 74 61 74 65 0d 12  |e Button State..|
00004250  66 39 20 4c 44 52 20 20  20 20 20 52 35 2c 5b 52  |f9 LDR     R5,[R|
00004260  31 32 2c 23 62 6c 6f 63  6b 25 2b 31 32 5d 20 20  |12,#block%+12]  |
00004270  20 20 20 20 20 20 20 20  20 3b 57 69 6e 64 6f 77  |         ;Window|
00004280  20 68 61 6e 64 6c 65 0d  12 70 37 20 4c 44 52 20  | handle..p7 LDR |
00004290  20 20 20 20 52 36 2c 5b  52 31 32 2c 23 62 6c 6f  |    R6,[R12,#blo|
000042a0  63 6b 25 2b 31 36 5d 20  20 20 20 20 20 20 20 20  |ck%+16]         |
000042b0  20 20 3b 49 63 6f 6e 20  6e 75 6d 62 65 72 0d 12  |  ;Icon number..|
000042c0  7a 1f 20 4c 44 52 20 20  20 20 20 52 37 2c 5b 52  |z. LDR     R7,[R|
000042d0  31 32 2c 23 64 69 73 70  6c 61 79 25 5d 0d 12 84  |12,#display%]...|
000042e0  1e 20 4c 44 52 20 20 20  20 20 52 38 2c 5b 52 31  |. LDR     R8,[R1|
000042f0  32 2c 23 73 65 61 72 63  68 25 5d 0d 12 8e 04 0d  |2,#search%].....|
00004300  12 98 4f 20 43 4d 50 20  20 20 20 20 52 35 2c 52  |..O CMP     R5,R|
00004310  37 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |7               |
00004320  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00004330  73 65 63 74 69 6f 6e 20  77 69 6c 6c 20 64 69 73  |section will dis|
00004340  70 6c 61 79 20 74 68 65  20 74 6f 70 69 63 0d 12  |play the topic..|
00004350  a2 50 20 20 43 4d 50 20  20 20 20 20 52 36 2c 23  |.P  CMP     R6,#|
00004360  34 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |43              |
00004370  20 20 20 20 20 20 20 20  20 3b 73 65 6c 65 63 74  |         ;select|
00004380  69 6f 6e 20 6d 65 6e 75  20 69 66 20 74 68 65 20  |ion menu if the |
00004390  6d 65 6e 75 20 62 75 74  74 6f 6e 20 69 73 0d 12  |menu button is..|
000043a0  ac 4f 20 20 20 a4 4c 6f  6e 67 41 64 72 28 22 45  |.O   .LongAdr("E|
000043b0  51 22 2c 31 2c 6d 65 6e  75 69 6e 66 6f 29 20 20  |Q",1,menuinfo)  |
000043c0  20 20 20 20 20 20 20 20  3b 70 72 65 73 73 65 64  |        ;pressed|
000043d0  20 6f 76 65 72 20 74 68  65 20 70 6f 70 2d 75 70  | over the pop-up|
000043e0  20 6d 65 6e 75 20 69 63  6f 6e 20 69 6e 0d 12 b6  | menu icon in...|
000043f0  3c 20 20 20 ec 51 20 20  20 52 30 2c 23 30 20 20  |<   .Q   R0,#0  |
00004400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004410  20 20 20 20 20 3b 74 68  65 20 44 69 73 70 6c 61  |     ;the Displa|
00004420  79 20 77 69 6e 64 6f 77  2e 0d 12 c0 19 20 20 20  |y window.....   |
00004430  53 54 52 45 51 20 20 20  52 30 2c 5b 52 31 2c 23  |STREQ   R0,[R1,#|
00004440  34 5d 0d 12 ca 20 20 20  20 a4 4c 6f 6e 67 41 64  |4]...    .LongAd|
00004450  72 28 22 45 51 22 2c 38  2c 6d 65 6e 75 6c 69 73  |r("EQ",8,menulis|
00004460  74 29 0d 12 d4 19 20 20  20 4c 44 52 45 51 20 20  |t)....   LDREQ  |
00004470  20 52 31 2c 5b 52 38 2c  23 38 5d 0d 12 de 25 20  | R1,[R8,#8]...% |
00004480  20 20 53 54 52 45 51 20  20 20 52 31 2c 5b 52 31  |  STREQ   R1,[R1|
00004490  32 2c 23 63 75 72 72 65  6e 74 6d 65 6e 75 25 5d  |2,#currentmenu%]|
000044a0  0d 12 e8 18 20 20 20 53  55 42 45 51 20 20 20 52  |....   SUBEQ   R|
000044b0  32 2c 52 32 2c 23 36 34  0d 12 f2 19 20 20 20 53  |2,R2,#64....   S|
000044c0  54 52 45 51 20 20 20 52  32 2c 5b 52 39 2c 23 30  |TREQ   R2,[R9,#0|
000044d0  5d 0d 12 fc 19 20 20 20  53 54 52 45 51 20 20 20  |]....   STREQ   |
000044e0  52 33 2c 5b 52 39 2c 23  34 5d 0d 13 06 20 20 20  |R3,[R9,#4]...   |
000044f0  20 53 57 49 45 51 20 20  20 22 57 69 6d 70 5f 43  | SWIEQ   "Wimp_C|
00004500  72 65 61 74 65 4d 65 6e  75 22 0d 13 10 20 20 20  |reateMenu"...   |
00004510  20 4c 44 4d 45 51 46 44  20 52 31 33 21 2c 7b 52  | LDMEQFD R13!,{R|
00004520  30 2d 52 31 32 2c 50 43  7d 5e 0d 13 1a 04 0d 13  |0-R12,PC}^......|
00004530  24 4e 20 43 4d 50 20 20  20 20 20 52 35 2c 52 37  |$N CMP     R5,R7|
00004540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004550  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00004560  65 63 74 69 6f 6e 20 77  69 6c 6c 20 64 69 73 70  |ection will disp|
00004570  6c 61 79 20 74 68 65 20  6d 61 69 6e 0d 13 2e 4e  |lay the main...N|
00004580  20 20 43 4d 50 45 51 20  20 20 52 34 2c 23 32 20  |  CMPEQ   R4,#2 |
00004590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000045a0  20 20 20 20 20 20 20 3b  4d 65 6e 75 20 69 66 20  |       ;Menu if |
000045b0  74 68 65 20 4d 65 6e 75  20 62 75 74 74 6f 6e 20  |the Menu button |
000045c0  69 73 20 70 72 65 73 73  65 64 0d 13 38 4f 20 20  |is pressed..8O  |
000045d0  20 42 4c 45 51 20 20 20  20 55 70 64 61 74 65 53  | BLEQ    UpdateS|
000045e0  74 61 72 74 45 6e 64 20  20 20 20 20 20 20 20 20  |tartEnd         |
000045f0  20 20 20 20 20 3b 61 6e  79 77 68 65 72 65 20 65  |     ;anywhere e|
00004600  6c 73 65 20 69 6e 20 74  68 65 20 44 69 73 70 6c  |lse in the Displ|
00004610  61 79 20 77 69 6e 64 6f  77 0d 13 42 52 20 20 20  |ay window..BR   |
00004620  42 4c 45 51 20 20 20 20  55 70 64 61 74 65 4c 65  |BLEQ    UpdateLe|
00004630  61 66 4e 61 6d 65 20 20  20 20 20 20 20 20 20 20  |afName          |
00004640  20 20 20 20 3b 61 66 74  65 72 20 66 69 72 73 74  |    ;after first|
00004650  20 75 70 64 61 74 69 6e  67 20 74 68 65 20 53 61  | updating the Sa|
00004660  76 65 20 64 69 61 6c 6f  67 75 65 0d 13 4c 4c 20  |ve dialogue..LL |
00004670  20 20 a4 4c 6f 6e 67 41  64 72 28 22 45 51 22 2c  |  .LongAdr("EQ",|
00004680  38 2c 6d 65 6e 75 6c 69  73 74 29 20 20 20 20 20  |8,menulist)     |
00004690  20 20 20 20 20 3b 62 6f  78 20 77 69 74 68 20 74  |     ;box with t|
000046a0  68 65 20 63 75 72 72 65  6e 74 20 69 73 73 75 65  |he current issue|
000046b0  20 6e 75 6d 62 65 72 0d  13 56 19 20 20 20 4c 44  | number..V.   LD|
000046c0  52 45 51 20 20 20 52 31  2c 5b 52 38 2c 23 34 5d  |REQ   R1,[R8,#4]|
000046d0  0d 13 60 25 20 20 20 53  54 52 45 51 20 20 20 52  |..`%   STREQ   R|
000046e0  31 2c 5b 52 31 32 2c 23  63 75 72 72 65 6e 74 6d  |1,[R12,#currentm|
000046f0  65 6e 75 25 5d 0d 13 6a  18 20 20 20 53 55 42 45  |enu%]..j.   SUBE|
00004700  51 20 20 20 52 32 2c 52  32 2c 23 36 34 0d 13 74  |Q   R2,R2,#64..t|
00004710  19 20 20 20 53 54 52 45  51 20 20 20 52 32 2c 5b  |.   STREQ   R2,[|
00004720  52 39 2c 23 30 5d 0d 13  7e 19 20 20 20 53 54 52  |R9,#0]..~.   STR|
00004730  45 51 20 20 20 52 33 2c  5b 52 39 2c 23 34 5d 0d  |EQ   R3,[R9,#4].|
00004740  13 88 20 20 20 20 53 57  49 45 51 20 20 20 22 57  |..    SWIEQ   "W|
00004750  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 0d  |imp_CreateMenu".|
00004760  13 92 20 20 20 20 4c 44  4d 45 51 46 44 20 52 31  |..    LDMEQFD R1|
00004770  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
00004780  13 9c 04 0d 13 a6 4e 20  43 4d 4e 20 20 20 20 20  |......N CMN     |
00004790  52 35 2c 23 32 20 20 20  20 20 20 20 20 20 20 20  |R5,#2           |
000047a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
000047b0  68 69 73 20 73 65 63 74  69 6f 6e 20 64 69 73 70  |his section disp|
000047c0  6c 61 79 73 20 74 68 65  20 49 63 6f 6e 20 42 61  |lays the Icon Ba|
000047d0  72 0d 13 b0 4e 20 20 43  4d 50 45 51 20 20 20 52  |r...N  CMPEQ   R|
000047e0  34 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |4,#2            |
000047f0  20 20 20 20 20 20 20 20  20 20 20 20 3b 4d 65 6e  |            ;Men|
00004800  75 20 69 66 20 74 68 65  20 6d 65 6e 75 20 62 75  |u if the menu bu|
00004810  74 74 6f 6e 20 69 73 20  70 72 65 73 73 65 64 0d  |tton is pressed.|
00004820  13 ba 42 20 20 20 a4 4c  6f 6e 67 41 64 72 28 22  |..B   .LongAdr("|
00004830  45 51 22 2c 38 2c 6d 65  6e 75 6c 69 73 74 29 20  |EQ",8,menulist) |
00004840  20 20 20 20 20 20 20 20  20 3b 6f 76 65 72 20 6f  |         ;over o|
00004850  75 72 20 69 63 6f 6e 20  62 61 72 20 69 63 6f 6e  |ur icon bar icon|
00004860  2e 0d 13 c4 19 20 20 20  4c 44 52 45 51 20 20 20  |.....   LDREQ   |
00004870  52 31 2c 5b 52 38 2c 23  30 5d 0d 13 ce 25 20 20  |R1,[R8,#0]...%  |
00004880  20 53 54 52 45 51 20 20  20 52 31 2c 5b 52 31 32  | STREQ   R1,[R12|
00004890  2c 23 63 75 72 72 65 6e  74 6d 65 6e 75 25 5d 0d  |,#currentmenu%].|
000048a0  13 d8 12 20 20 20 ec 51  20 20 20 52 33 2c 23 39  |...   .Q   R3,#9|
000048b0  36 0d 13 e2 43 20 20 20  41 44 44 45 51 20 20 20  |6...C   ADDEQ   |
000048c0  52 33 2c 52 33 2c 23 38  38 20 20 20 20 20 20 20  |R3,R3,#88       |
000048d0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 34 34  |            ; 44|
000048e0  20 75 6e 69 74 73 20 70  65 72 20 6d 65 6e 75 20  | units per menu |
000048f0  69 74 65 6d 0d 13 ec 18  20 20 20 53 55 42 45 51  |item....   SUBEQ|
00004900  20 20 20 52 32 2c 52 32  2c 23 36 34 0d 13 f6 19  |   R2,R2,#64....|
00004910  20 20 20 53 54 52 45 51  20 20 20 52 32 2c 5b 52  |   STREQ   R2,[R|
00004920  39 2c 23 30 5d 0d 14 00  19 20 20 20 53 54 52 45  |9,#0]....   STRE|
00004930  51 20 20 20 52 33 2c 5b  52 39 2c 23 34 5d 0d 14  |Q   R3,[R9,#4]..|
00004940  0a 20 20 20 20 53 57 49  45 51 20 20 20 22 57 69  |.    SWIEQ   "Wi|
00004950  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 0d 14  |mp_CreateMenu"..|
00004960  14 20 20 20 20 4c 44 4d  45 51 46 44 20 52 31 33  |.    LDMEQFD R13|
00004970  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 14  |!,{R0-R12,PC}^..|
00004980  1e 04 0d 14 28 52 20 43  4d 4e 20 20 20 20 20 52  |....(R CMN     R|
00004990  35 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |5,#2            |
000049a0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
000049b0  69 73 20 73 65 63 74 69  6f 6e 20 77 69 6c 6c 20  |is section will |
000049c0  6f 70 65 6e 20 74 68 65  20 6d 61 69 6e 20 77 69  |open the main wi|
000049d0  6e 64 6f 77 0d 14 32 4f  20 20 53 54 52 45 51 20  |ndow..2O  STREQ |
000049e0  20 20 52 37 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R7,[R12,#block|
000049f0  25 2b 30 5d 20 20 20 20  20 20 20 20 20 20 20 3b  |%+0]           ;|
00004a00  69 66 20 53 65 6c 65 63  74 20 6f 72 20 61 64 6a  |if Select or adj|
00004a10  75 73 74 20 69 73 20 70  72 65 73 73 65 64 20 6f  |ust is pressed o|
00004a20  76 65 72 0d 14 3c 3d 20  20 41 44 44 45 51 20 20  |ver..<=  ADDEQ  |
00004a30  20 52 31 2c 52 31 32 2c  23 62 6c 6f 63 6b 25 20  | R1,R12,#block% |
00004a40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 6f  |              ;o|
00004a50  75 72 20 69 63 6f 6e 20  62 61 72 20 69 63 6f 6e  |ur icon bar icon|
00004a60  0d 14 46 23 20 20 53 57  49 45 51 20 20 20 22 57  |..F#  SWIEQ   "W|
00004a70  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00004a80  74 65 22 0d 14 50 1f 20  20 42 4c 45 51 20 20 20  |te"..P.  BLEQ   |
00004a90  20 4f 70 65 6e 57 69 6e  64 6f 77 52 65 71 75 65  | OpenWindowReque|
00004aa0  73 74 0d 14 5a 04 0d 14  64 4f 20 43 4d 50 20 20  |st..Z...dO CMP  |
00004ab0  20 20 20 52 35 2c 52 37  20 20 20 20 20 20 20 20  |   R5,R7        |
00004ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004ad0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 77  | ;This section w|
00004ae0  69 6c 6c 20 63 61 6c 6c  20 61 20 73 75 62 72 6f  |ill call a subro|
00004af0  75 74 69 6e 65 0d 14 6e  4e 20 20 54 53 54 45 51  |utine..nN  TSTEQ|
00004b00  20 20 20 52 34 2c 23 28  ac 20 34 29 20 80 20 37  |   R4,#(. 4) . 7|
00004b10  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 6f 20  |            ;to |
00004b20  64 65 61 6c 20 77 69 74  68 20 53 65 6c 65 63 74  |deal with Select|
00004b30  20 62 65 69 6e 67 20 70  72 65 73 73 65 64 20 6f  | being pressed o|
00004b40  76 65 72 0d 14 78 3f 20  20 20 42 4c 45 51 20 20  |ver..x?   BLEQ  |
00004b50  20 20 53 65 6c 65 63 74  49 6e 44 69 73 70 6c 61  |  SelectInDispla|
00004b60  79 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |y             ;t|
00004b70  68 65 20 44 69 73 70 6c  61 79 20 77 69 6e 64 6f  |he Display windo|
00004b80  77 2e 0d 14 82 20 20 20  20 4c 44 4d 45 51 46 44  |w....    LDMEQFD|
00004b90  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
00004ba0  7d 5e 0d 14 8c 04 0d 14  96 4f 20 43 4d 50 20 20  |}^.......O CMP  |
00004bb0  20 20 20 52 35 2c 52 37  20 20 20 20 20 20 20 20  |   R5,R7        |
00004bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004bd0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 77  | ;This section w|
00004be0  69 6c 6c 20 63 61 6c 6c  20 61 20 73 75 62 72 6f  |ill call a subro|
00004bf0  75 74 69 6e 65 0d 14 a0  4e 20 20 54 53 54 45 51  |utine...N  TSTEQ|
00004c00  20 20 20 52 34 2c 23 28  ac 20 31 29 20 80 20 37  |   R4,#(. 1) . 7|
00004c10  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 6f 20  |            ;to |
00004c20  64 65 61 6c 20 77 69 74  68 20 61 64 6a 75 73 74  |deal with adjust|
00004c30  20 62 65 69 6e 67 20 70  72 65 73 73 65 64 20 6f  | being pressed o|
00004c40  76 65 72 0d 14 aa 3e 20  20 20 42 4c 45 51 20 20  |ver...>   BLEQ  |
00004c50  20 20 41 64 6a 75 73 74  49 6e 44 69 73 70 6c 61  |  AdjustInDispla|
00004c60  79 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |y             ;t|
00004c70  68 65 20 44 69 73 70 6c  61 79 20 77 69 6e 64 6f  |he Display windo|
00004c80  77 0d 14 b4 20 20 20 20  4c 44 4d 45 51 46 44 20  |w...    LDMEQFD |
00004c90  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
00004ca0  5e 0d 14 be 04 0d 14 c8  4f 20 43 4d 50 20 20 20  |^.......O CMP   |
00004cb0  20 20 52 35 2c 52 38 20  20 20 20 20 20 20 20 20  |  R5,R8         |
00004cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004cd0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 77 69  |;This section wi|
00004ce0  6c 6c 20 73 74 61 72 74  20 61 20 73 65 61 72 63  |ll start a searc|
00004cf0  68 20 69 66 0d 14 d2 4d  20 20 43 4d 50 45 51 20  |h if...M  CMPEQ |
00004d00  20 20 52 36 2c 23 32 20  20 20 20 20 20 20 20 20  |  R6,#2         |
00004d10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00004d20  74 68 65 20 4f 4b 20 69  63 6f 6e 20 63 6c 69 63  |the OK icon clic|
00004d30  6b 65 64 20 69 6e 20 74  68 65 20 53 65 61 72 63  |ked in the Searc|
00004d40  68 0d 14 dc 4f 20 20 20  20 42 4c 45 51 20 20 20  |h...O    BLEQ   |
00004d50  53 74 61 72 74 53 65 61  72 63 68 20 20 20 20 20  |StartSearch     |
00004d60  20 20 20 20 20 20 20 20  20 20 20 20 3b 44 69 61  |            ;Dia|
00004d70  6c 6f 67 75 65 20 62 6f  78 2e 20 49 66 20 53 65  |logue box. If Se|
00004d80  6c 65 63 74 20 77 61 73  20 75 73 65 64 20 69 74  |lect was used it|
00004d90  0d 14 e6 4a 20 20 20 20  54 53 54 45 51 20 20 52  |...J    TSTEQ  R|
00004da0  34 2c 23 28 ac 20 34 29  20 80 20 37 20 20 20 20  |4,#(. 4) . 7    |
00004db0  20 20 20 20 20 20 20 3b  77 69 6c 6c 20 61 6c 73  |       ;will als|
00004dc0  6f 20 63 6c 6f 73 65 20  74 68 65 20 4d 65 6e 75  |o close the Menu|
00004dd0  20 73 74 72 75 63 74 75  72 65 0d 14 f0 14 20 20  | structure....  |
00004de0  20 20 4d 56 4e 45 51 20  20 52 31 2c 23 30 0d 14  |  MVNEQ  R1,#0..|
00004df0  fa 20 20 20 20 20 53 57  49 45 51 20 20 22 57 69  |.     SWIEQ  "Wi|
00004e00  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 0d 15  |mp_CreateMenu"..|
00004e10  04 21 20 20 20 20 4c 44  4d 45 51 46 44 20 52 31  |.!    LDMEQFD R1|
00004e20  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
00004e30  15 0e 04 0d 15 18 1c 20  4c 44 52 20 20 20 20 20  |....... LDR     |
00004e40  52 38 2c 5b 52 31 32 2c  23 65 64 69 74 25 5d 0d  |R8,[R12,#edit%].|
00004e50  15 22 4b 20 43 4d 50 20  20 20 20 20 52 35 2c 52  |."K CMP     R5,R|
00004e60  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
00004e70  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00004e80  73 65 63 74 69 6f 6e 20  64 69 73 70 6c 61 79 73  |section displays|
00004e90  20 74 68 65 20 74 6f 70  69 63 0d 15 2c 4f 20 20  | the topic..,O  |
00004ea0  43 4d 50 45 51 20 20 20  52 36 2c 23 32 35 20 20  |CMPEQ   R6,#25  |
00004eb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004ec0  20 20 20 20 20 3b 73 65  6c 65 63 74 69 6f 6e 20  |     ;selection |
00004ed0  6d 65 6e 75 20 77 68 65  6e 20 4d 65 6e 75 20 69  |menu when Menu i|
00004ee0  73 20 70 72 65 73 73 65  64 0d 15 36 4b 20 20 20  |s pressed..6K   |
00004ef0  a4 4c 6f 6e 67 41 64 72  28 22 45 51 22 2c 31 2c  |.LongAdr("EQ",1,|
00004f00  6d 65 6e 75 69 6e 66 6f  29 20 20 20 20 20 20 20  |menuinfo)       |
00004f10  20 20 20 3b 6f 76 65 72  20 74 68 65 20 70 6f 70  |   ;over the pop|
00004f20  2d 75 70 20 6d 65 6e 75  20 69 63 6f 6e 20 69 6e  |-up menu icon in|
00004f30  20 74 68 65 0d 15 40 38  20 20 20 4d 56 4e 45 51  | the..@8   MVNEQ|
00004f40  20 20 20 52 30 2c 23 30  20 20 20 20 20 20 20 20  |   R0,#0        |
00004f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00004f60  45 64 69 74 20 77 69 6e  64 6f 77 2e 0d 15 4a 19  |Edit window...J.|
00004f70  20 20 20 53 54 52 45 51  20 20 20 52 30 2c 5b 52  |   STREQ   R0,[R|
00004f80  31 2c 23 34 5d 0d 15 54  20 20 20 20 a4 4c 6f 6e  |1,#4]..T    .Lon|
00004f90  67 41 64 72 28 22 45 51  22 2c 31 2c 6d 65 6e 75  |gAdr("EQ",1,menu|
00004fa0  6c 69 73 74 29 0d 15 5e  19 20 20 20 4c 44 52 20  |list)..^.   LDR |
00004fb0  20 20 20 20 52 31 2c 5b  52 31 2c 23 38 5d 0d 15  |    R1,[R1,#8]..|
00004fc0  68 25 20 20 20 53 54 52  45 51 20 20 20 52 31 2c  |h%   STREQ   R1,|
00004fd0  5b 52 31 32 2c 23 63 75  72 72 65 6e 74 6d 65 6e  |[R12,#currentmen|
00004fe0  75 25 5d 0d 15 72 18 20  20 20 53 55 42 45 51 20  |u%]..r.   SUBEQ |
00004ff0  20 20 52 32 2c 52 32 2c  23 36 34 0d 15 7c 19 20  |  R2,R2,#64..|. |
00005000  20 20 53 54 52 45 51 20  20 20 52 32 2c 5b 52 39  |  STREQ   R2,[R9|
00005010  2c 23 30 5d 0d 15 86 19  20 20 20 53 54 52 45 51  |,#0]....   STREQ|
00005020  20 20 20 52 33 2c 5b 52  39 2c 23 34 5d 0d 15 90  |   R3,[R9,#4]...|
00005030  20 20 20 20 53 57 49 45  51 20 20 20 22 57 69 6d  |    SWIEQ   "Wim|
00005040  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 0d 15 9a  |p_CreateMenu"...|
00005050  20 20 20 20 4c 44 4d 45  51 46 44 20 52 31 33 21  |    LDMEQFD R13!|
00005060  2c 7b 52 30 2d 52 31 32  2c 50 43 7d 5e 0d 15 a4  |,{R0-R12,PC}^...|
00005070  04 0d 15 ae 4e 20 43 4d  50 20 20 20 20 20 52 35  |....N CMP     R5|
00005080  2c 52 38 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R8             |
00005090  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
000050a0  73 20 73 65 63 74 69 6f  6e 20 63 61 6c 6c 73 20  |s section calls |
000050b0  61 20 73 75 62 72 6f 75  74 69 6e 65 20 74 6f 0d  |a subroutine to.|
000050c0  15 b8 4b 20 20 54 53 54  45 51 20 20 20 52 34 2c  |..K  TSTEQ   R4,|
000050d0  23 28 ac 20 34 29 20 80  20 37 20 20 20 20 20 20  |#(. 4) . 7      |
000050e0  20 20 20 20 20 20 3b 64  65 61 6c 20 77 69 74 68  |      ;deal with|
000050f0  20 53 65 6c 65 63 74 20  62 65 69 6e 67 20 70 72  | Select being pr|
00005100  65 73 73 65 64 20 6f 76  65 72 0d 15 c2 3c 20 20  |essed over...<  |
00005110  20 42 4c 45 51 20 20 20  20 53 65 6c 65 63 74 49  | BLEQ    SelectI|
00005120  6e 45 64 69 74 20 20 20  20 20 20 20 20 20 20 20  |nEdit           |
00005130  20 20 20 20 20 3b 74 68  65 20 45 64 69 74 20 77  |     ;the Edit w|
00005140  69 6e 64 6f 77 2e 0d 15  cc 20 20 20 20 4c 44 4d  |indow....    LDM|
00005150  45 51 46 44 20 52 31 33  21 2c 7b 52 30 2d 52 31  |EQFD R13!,{R0-R1|
00005160  32 2c 50 43 7d 5e 0d 15  d6 04 0d 15 e0 4e 20 43  |2,PC}^.......N C|
00005170  4d 50 20 20 20 20 20 52  35 2c 52 38 20 20 20 20  |MP     R5,R8    |
00005180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005190  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
000051a0  6f 6e 20 63 61 6c 6c 73  20 61 20 73 75 62 72 6f  |on calls a subro|
000051b0  75 74 69 6e 65 20 74 6f  0d 15 ea 4b 20 20 54 53  |utine to...K  TS|
000051c0  54 45 51 20 20 20 52 34  2c 23 28 ac 20 31 29 20  |TEQ   R4,#(. 1) |
000051d0  80 20 37 20 20 20 20 20  20 20 20 20 20 20 20 3b  |. 7            ;|
000051e0  64 65 61 6c 20 77 69 74  68 20 41 64 6a 75 73 74  |deal with Adjust|
000051f0  20 62 65 69 6e 67 20 70  72 65 73 73 65 64 20 6f  | being pressed o|
00005200  76 65 72 0d 15 f4 3b 20  20 20 42 4c 45 51 20 20  |ver...;   BLEQ  |
00005210  20 20 41 64 6a 75 73 74  49 6e 45 64 69 74 20 20  |  AdjustInEdit  |
00005220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
00005230  68 65 20 45 64 69 74 20  77 69 6e 64 6f 77 0d 15  |he Edit window..|
00005240  fe 20 20 20 20 4c 44 4d  45 51 46 44 20 52 31 33  |.    LDMEQFD R13|
00005250  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 16  |!,{R0-R12,PC}^..|
00005260  08 04 0d 16 12 1c 20 4c  44 52 20 20 20 20 20 52  |...... LDR     R|
00005270  38 2c 5b 52 31 32 2c 23  73 61 76 65 25 5d 0d 16  |8,[R12,#save%]..|
00005280  1c 4f 20 43 4d 50 20 20  20 20 20 52 35 2c 52 38  |.O CMP     R5,R8|
00005290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000052a0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
000052b0  65 63 74 69 6f 6e 20 77  69 6c 6c 20 63 61 6c 6c  |ection will call|
000052c0  20 61 20 73 75 62 72 6f  75 74 69 6e 65 0d 16 26  | a subroutine..&|
000052d0  49 20 20 54 53 54 45 51  20 20 20 52 34 2c 23 28  |I  TSTEQ   R4,#(|
000052e0  ac 20 34 29 20 80 20 37  20 20 20 20 20 20 20 20  |. 4) . 7        |
000052f0  20 20 20 20 3b 74 6f 20  64 65 61 6c 20 77 69 74  |    ;to deal wit|
00005300  68 20 53 65 6c 65 63 74  20 62 65 69 6e 67 20 70  |h Select being p|
00005310  72 65 73 73 65 64 0d 16  30 45 20 20 20 42 4c 45  |ressed..0E   BLE|
00005320  51 20 20 20 20 53 65 6c  65 63 74 49 6e 53 61 76  |Q    SelectInSav|
00005330  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e               |
00005340  20 3b 69 6e 20 74 68 65  20 73 61 76 65 20 64 69  | ;in the save di|
00005350  61 6c 6f 67 75 65 20 62  6f 78 2e 0d 16 3a 20 20  |alogue box...:  |
00005360  20 20 4c 44 4d 45 51 46  44 20 52 31 33 21 2c 7b  |  LDMEQFD R13!,{|
00005370  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 16 44 04 0d  |R0-R12,PC}^..D..|
00005380  16 4e 4f 20 43 4d 50 20  20 20 20 20 52 35 2c 52  |.NO CMP     R5,R|
00005390  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
000053a0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
000053b0  73 65 63 74 69 6f 6e 20  77 69 6c 6c 20 63 61 6c  |section will cal|
000053c0  6c 20 61 20 73 75 62 72  6f 75 74 69 6e 65 0d 16  |l a subroutine..|
000053d0  58 49 20 20 54 53 54 45  51 20 20 20 52 34 2c 23  |XI  TSTEQ   R4,#|
000053e0  28 ac 20 31 29 20 80 20  37 20 20 20 20 20 20 20  |(. 1) . 7       |
000053f0  20 20 20 20 20 3b 74 6f  20 64 65 61 6c 20 77 69  |     ;to deal wi|
00005400  74 68 20 41 64 6a 75 73  74 20 62 65 69 6e 67 20  |th Adjust being |
00005410  70 72 65 73 73 65 64 0d  16 62 44 20 20 20 42 4c  |pressed..bD   BL|
00005420  45 51 20 20 20 20 41 64  6a 75 73 74 49 6e 53 61  |EQ    AdjustInSa|
00005430  76 65 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ve              |
00005440  20 20 3b 69 6e 20 74 68  65 20 73 61 76 65 20 64  |  ;in the save d|
00005450  69 61 6c 6f 67 75 65 20  62 6f 78 0d 16 6c 20 20  |ialogue box..l  |
00005460  20 20 4c 44 4d 45 51 46  44 20 52 31 33 21 2c 7b  |  LDMEQFD R13!,{|
00005470  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 16 76 04 0d  |R0-R12,PC}^..v..|
00005480  16 80 1e 20 4c 44 52 20  20 20 20 20 52 38 2c 5b  |... LDR     R8,[|
00005490  52 31 32 2c 23 75 70 64  61 74 65 25 5d 0d 16 8a  |R12,#update%]...|
000054a0  12 20 43 4d 50 20 20 20  20 20 52 35 2c 52 38 0d  |. CMP     R5,R8.|
000054b0  16 94 13 20 20 43 4d 50  20 20 20 20 20 52 36 2c  |...  CMP     R6,|
000054c0  23 35 0d 16 9e 11 20 20  20 ec 51 20 20 20 52 30  |#5....   .Q   R0|
000054d0  2c 23 31 0d 16 a8 22 20  20 20 53 54 52 45 51 20  |,#1..."   STREQ |
000054e0  20 20 52 30 2c 5b 52 31  30 2c 23 75 70 64 61 74  |  R0,[R10,#updat|
000054f0  69 6e 67 25 5d 0d 16 b2  04 0d 16 bc 12 20 43 4d  |ing%]........ CM|
00005500  50 20 20 20 20 20 52 35  2c 52 38 0d 16 c6 13 20  |P     R5,R8.... |
00005510  20 43 4d 50 20 20 20 20  20 52 36 2c 23 36 0d 16  | CMP     R6,#6..|
00005520  d0 11 20 20 20 ec 51 20  20 20 52 30 2c 23 30 0d  |..   .Q   R0,#0.|
00005530  16 da 22 20 20 20 53 54  52 45 51 20 20 20 52 30  |.."   STREQ   R0|
00005540  2c 5b 52 31 30 2c 23 75  70 64 61 74 69 6e 67 25  |,[R10,#updating%|
00005550  5d 0d 16 e4 21 20 20 20  53 54 52 45 51 20 20 20  |]...!   STREQ   |
00005560  52 38 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R8,[R12,#block%+|
00005570  30 5d 0d 16 ee 1d 20 20  20 41 44 44 45 51 20 20  |0]....   ADDEQ  |
00005580  20 52 31 2c 52 31 32 2c  23 62 6c 6f 63 6b 25 0d  | R1,R12,#block%.|
00005590  16 f8 21 20 20 20 53 57  49 45 51 20 20 20 22 57  |..!   SWIEQ   "W|
000055a0  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
000055b0  0d 17 02 04 0d 17 0c 1d  4c 44 4d 46 44 20 20 20  |........LDMFD   |
000055c0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
000055d0  5e 0d 17 16 04 0d 17 20  52 3b 2d 2d 2d 2d 2d 2d  |^...... R;------|
000055e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005620  2d 2d 2d 2d 2d 2d 2d 0d  17 2a 32 3b 20 20 20 20  |-------..*2;    |
00005630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005640  20 20 2a 2a 2a 20 53 65  6c 65 63 74 49 6e 44 69  |  *** SelectInDi|
00005650  73 70 6c 61 79 20 2a 2a  2a 0d 17 34 4e 3b 20 54  |splay ***..4N; T|
00005660  68 69 73 20 73 75 62 72  6f 75 74 69 6e 65 20 64  |his subroutine d|
00005670  65 61 6c 73 20 77 69 74  68 20 53 65 6c 65 63 74  |eals with Select|
00005680  20 62 65 69 6e 67 20 63  6c 69 63 6b 65 64 20 6f  | being clicked o|
00005690  76 65 72 20 74 68 65 20  44 69 73 70 6c 61 79 20  |ver the Display |
000056a0  77 69 6e 64 6f 77 2e 0d  17 3e 04 0d 17 48 14 2e  |window...>...H..|
000056b0  53 65 6c 65 63 74 49 6e  44 69 73 70 6c 61 79 0d  |SelectInDisplay.|
000056c0  17 52 04 0d 17 5c 1d 53  54 4d 46 44 20 20 20 52  |.R...\.STMFD   R|
000056d0  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
000056e0  0d 17 66 04 0d 17 70 4d  20 4c 44 52 20 20 20 20  |..f...pM LDR    |
000056f0  20 52 30 2c 5b 52 31 30  2c 23 73 68 6f 77 25 5d  | R0,[R10,#show%]|
00005700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00005710  54 68 69 73 20 73 65 63  74 69 6f 6e 20 6f 70 65  |This section ope|
00005720  6e 20 74 68 65 20 61 70  70 72 6f 70 72 69 61 74  |n the appropriat|
00005730  65 0d 17 7a 4e 20 43 4d  50 20 20 20 20 20 52 30  |e..zN CMP     R0|
00005740  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
00005750  20 20 20 20 20 20 20 20  20 20 20 20 3b 66 69 6c  |            ;fil|
00005760  65 20 66 6f 72 20 74 68  65 20 63 75 72 72 65 6e  |e for the curren|
00005770  74 20 64 69 73 70 6c 61  79 20 6d 6f 64 65 2c 0d  |t display mode,.|
00005780  17 84 4a 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |..J  MOV     R0,|
00005790  23 26 34 46 20 20 20 20  20 20 20 20 20 20 20 20  |#&4F            |
000057a0  20 20 20 20 20 20 20 20  20 20 3b 65 69 74 68 65  |          ;eithe|
000057b0  72 20 49 6e 64 65 78 66  69 6c 65 20 6f 72 20 53  |r Indexfile or S|
000057c0  65 61 72 63 68 66 69 6c  65 0d 17 8e 20 20 20 20  |earchfile...    |
000057d0  41 44 44 45 51 20 20 20  52 31 2c 52 31 30 2c 23  |ADDEQ   R1,R10,#|
000057e0  69 6e 64 65 78 66 69 6c  65 0d 17 98 21 20 20 20  |indexfile...!   |
000057f0  41 44 44 4e 45 20 20 20  52 31 2c 52 31 30 2c 23  |ADDNE   R1,R10,#|
00005800  73 65 61 72 63 68 66 69  6c 65 0d 17 a2 17 20 20  |searchfile....  |
00005810  53 57 49 20 20 20 20 22  58 4f 53 5f 46 69 6e 64  |SWI    "XOS_Find|
00005820  22 0d 17 ac 18 20 20 20  42 56 53 20 20 20 20 20  |"....   BVS     |
00005830  6e 6f 72 65 63 6f 72 64  73 0d 17 b6 23 20 20 53  |norecords...#  S|
00005840  54 52 20 20 20 20 20 52  30 2c 5b 52 31 30 2c 23  |TR     R0,[R10,#|
00005850  66 69 6c 65 68 61 6e 64  6c 65 25 5d 0d 17 c0 25  |filehandle%]...%|
00005860  20 20 20 53 54 52 45 51  20 20 20 52 30 2c 5b 52  |   STREQ   R0,[R|
00005870  31 30 2c 23 69 6e 64 65  78 68 61 6e 64 6c 65 25  |10,#indexhandle%|
00005880  5d 0d 17 ca 26 20 20 20  53 54 52 4e 45 20 20 20  |]...&   STRNE   |
00005890  52 30 2c 5b 52 31 30 2c  23 73 65 61 72 63 68 68  |R0,[R10,#searchh|
000058a0  61 6e 64 6c 65 25 5d 0d  17 d4 04 0d 17 de 4e 20  |andle%].......N |
000058b0  43 4d 50 20 20 20 20 20  52 36 2c 23 32 30 20 20  |CMP     R6,#20  |
000058c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000058d0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
000058e0  69 6f 6e 20 64 69 73 70  6c 61 79 73 20 74 68 65  |ion displays the|
000058f0  20 70 72 65 76 69 6f 75  73 0d 17 e8 50 20 53 57  | previous...P SW|
00005900  49 45 51 20 20 20 22 48  6f 75 72 67 6c 61 73 73  |IEQ   "Hourglass|
00005910  5f 4f 6e 22 20 20 20 20  20 20 20 20 20 20 20 20  |_On"            |
00005920  20 20 20 20 3b 72 65 63  6f 72 64 20 77 68 65 6e  |    ;record when|
00005930  20 74 68 65 20 73 69 6e  67 6c 65 20 6c 65 66 74  | the single left|
00005940  20 61 72 72 6f 77 20 69  73 0d 17 f2 40 20 20 ec  | arrow is...@  .|
00005950  51 20 20 20 52 30 2c 23  31 20 20 20 20 20 20 20  |Q   R0,#1       |
00005960  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005970  20 3b 63 6c 69 63 6b 65  64 20 6f 6e 20 77 69 74  | ;clicked on wit|
00005980  68 20 53 65 6c 65 63 74  2e 0d 17 fc 10 20 20 ec  |h Select.....  .|
00005990  51 20 20 20 52 31 2c 23  31 0d 18 06 18 20 20 42  |Q   R1,#1....  B|
000059a0  4c 45 51 20 20 20 20 47  65 74 52 65 63 6f 72 64  |LEQ    GetRecord|
000059b0  73 0d 18 10 14 20 20 42  4c 45 51 20 20 20 20 55  |s....  BLEQ    U|
000059c0  70 64 61 74 65 0d 18 1a  1d 20 20 53 57 49 45 51  |pdate....  SWIEQ|
000059d0  20 20 20 22 48 6f 75 72  67 6c 61 73 73 5f 4f 66  |   "Hourglass_Of|
000059e0  66 22 0d 18 24 1d 20 20  42 45 51 20 20 20 20 20  |f"..$.  BEQ     |
000059f0  73 65 6c 65 63 74 63 6c  6f 73 65 66 69 6c 65 0d  |selectclosefile.|
00005a00  18 2e 04 0d 18 38 4e 20  43 4d 50 20 20 20 20 20  |.....8N CMP     |
00005a10  52 36 2c 23 32 31 20 20  20 20 20 20 20 20 20 20  |R6,#21          |
00005a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00005a30  68 69 73 20 73 65 63 74  69 6f 6e 20 72 65 61 64  |his section read|
00005a40  73 20 62 61 63 6b 20 31  30 20 72 65 63 6f 72 64  |s back 10 record|
00005a50  73 0d 18 42 51 20 20 53  57 49 45 51 20 20 20 22  |s..BQ  SWIEQ   "|
00005a60  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 20 20 20  |Hourglass_On"   |
00005a70  20 20 20 20 20 20 20 20  20 20 20 20 3b 77 68 65  |            ;whe|
00005a80  6e 20 74 68 65 20 64 6f  75 62 6c 65 20 6c 65 66  |n the double lef|
00005a90  74 20 61 72 72 6f 77 20  69 73 20 63 6c 69 63 6b  |t arrow is click|
00005aa0  65 64 0d 18 4c 38 20 20  ec 51 20 20 20 52 30 2c  |ed..L8  .Q   R0,|
00005ab0  23 31 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |#10             |
00005ac0  20 20 20 20 20 20 20 20  20 20 3b 6f 6e 20 77 69  |          ;on wi|
00005ad0  74 68 20 53 65 6c 65 63  74 2e 0d 18 56 10 20 20  |th Select...V.  |
00005ae0  ec 51 20 20 20 52 31 2c  23 31 0d 18 60 18 20 20  |.Q   R1,#1..`.  |
00005af0  42 4c 45 51 20 20 20 20  47 65 74 52 65 63 6f 72  |BLEQ    GetRecor|
00005b00  64 73 0d 18 6a 14 20 20  42 4c 45 51 20 20 20 20  |ds..j.  BLEQ    |
00005b10  55 70 64 61 74 65 0d 18  74 1d 20 20 53 57 49 45  |Update..t.  SWIE|
00005b20  51 20 20 20 22 48 6f 75  72 67 6c 61 73 73 5f 4f  |Q   "Hourglass_O|
00005b30  66 66 22 0d 18 7e 1d 20  20 42 45 51 20 20 20 20  |ff"..~.  BEQ    |
00005b40  20 73 65 6c 65 63 74 63  6c 6f 73 65 66 69 6c 65  | selectclosefile|
00005b50  0d 18 88 04 0d 18 92 4f  20 43 4d 50 20 20 20 20  |.......O CMP    |
00005b60  20 52 36 2c 23 32 32 20  20 20 20 20 20 20 20 20  | R6,#22         |
00005b70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00005b80  54 68 69 73 20 73 65 63  74 69 6f 6e 20 72 65 61  |This section rea|
00005b90  64 73 20 62 61 63 6b 20  31 30 30 20 72 65 63 6f  |ds back 100 reco|
00005ba0  72 64 73 0d 18 9c 51 20  20 53 57 49 45 51 20 20  |rds...Q  SWIEQ  |
00005bb0  20 22 48 6f 75 72 67 6c  61 73 73 5f 4f 6e 22 20  | "Hourglass_On" |
00005bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 77  |              ;w|
00005bd0  68 65 6e 20 74 68 65 20  74 72 69 70 6c 65 20 6c  |hen the triple l|
00005be0  65 66 74 20 61 72 72 6f  77 20 69 73 20 63 6c 69  |eft arrow is cli|
00005bf0  63 6b 65 64 0d 18 a6 37  20 20 ec 51 20 20 20 52  |cked...7  .Q   R|
00005c00  30 2c 23 31 30 30 20 20  20 20 20 20 20 20 20 20  |0,#100          |
00005c10  20 20 20 20 20 20 20 20  20 20 20 20 3b 6f 6e 20  |            ;on |
00005c20  77 69 74 68 20 53 65 6c  65 63 74 0d 18 b0 10 20  |with Select.... |
00005c30  20 ec 51 20 20 20 52 31  2c 23 31 0d 18 ba 18 20  | .Q   R1,#1.... |
00005c40  20 42 4c 45 51 20 20 20  20 47 65 74 52 65 63 6f  | BLEQ    GetReco|
00005c50  72 64 73 0d 18 c4 14 20  20 42 4c 45 51 20 20 20  |rds....  BLEQ   |
00005c60  20 55 70 64 61 74 65 0d  18 ce 1d 20 20 53 57 49  | Update....  SWI|
00005c70  45 51 20 20 20 22 48 6f  75 72 67 6c 61 73 73 5f  |EQ   "Hourglass_|
00005c80  4f 66 66 22 0d 18 d8 1d  20 20 42 45 51 20 20 20  |Off"....  BEQ   |
00005c90  20 20 73 65 6c 65 63 74  63 6c 6f 73 65 66 69 6c  |  selectclosefil|
00005ca0  65 0d 18 e2 04 0d 18 ec  4e 20 43 4d 50 20 20 20  |e.......N CMP   |
00005cb0  20 20 52 36 2c 23 32 33  20 20 20 20 20 20 20 20  |  R6,#23        |
00005cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005cd0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
00005ce0  61 64 73 20 74 68 65 20  6e 65 78 74 20 72 65 63  |ads the next rec|
00005cf0  6f 72 64 0d 18 f6 52 20  20 53 57 49 45 51 20 20  |ord...R  SWIEQ  |
00005d00  20 22 48 6f 75 72 67 6c  61 73 73 5f 4f 6e 22 20  | "Hourglass_On" |
00005d10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 77  |              ;w|
00005d20  68 65 6e 20 74 68 65 20  73 69 6e 67 6c 65 20 72  |hen the single r|
00005d30  69 67 68 74 20 61 72 72  6f 77 20 69 73 20 63 6c  |ight arrow is cl|
00005d40  69 63 6b 65 64 0d 19 00  38 20 20 ec 51 20 20 20  |icked...8  .Q   |
00005d50  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
00005d60  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 6f 6e  |             ;on|
00005d70  20 77 69 74 68 20 73 65  6c 65 63 74 2e 0d 19 0a  | with select....|
00005d80  10 20 20 ec 51 20 20 20  52 31 2c 23 30 0d 19 14  |.  .Q   R1,#0...|
00005d90  18 20 20 42 4c 45 51 20  20 20 20 47 65 74 52 65  |.  BLEQ    GetRe|
00005da0  63 6f 72 64 73 0d 19 1e  14 20 20 42 4c 45 51 20  |cords....  BLEQ |
00005db0  20 20 20 55 70 64 61 74  65 0d 19 28 1d 20 20 53  |   Update..(.  S|
00005dc0  57 49 45 51 20 20 20 22  48 6f 75 72 67 6c 61 73  |WIEQ   "Hourglas|
00005dd0  73 5f 4f 66 66 22 0d 19  32 1d 20 20 42 45 51 20  |s_Off"..2.  BEQ |
00005de0  20 20 20 20 73 65 6c 65  63 74 63 6c 6f 73 65 66  |    selectclosef|
00005df0  69 6c 65 0d 19 3c 04 0d  19 46 51 20 43 4d 50 20  |ile..<...FQ CMP |
00005e00  20 20 20 20 52 36 2c 23  32 34 20 20 20 20 20 20  |    R6,#24      |
00005e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005e20  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00005e30  72 65 61 64 73 20 66 6f  72 77 61 72 64 20 31 30  |reads forward 10|
00005e40  20 72 65 63 6f 72 64 73  0d 19 50 52 20 20 53 57  | records..PR  SW|
00005e50  49 45 51 20 20 20 22 48  6f 75 72 67 6c 61 73 73  |IEQ   "Hourglass|
00005e60  5f 4f 6e 22 20 20 20 20  20 20 20 20 20 20 20 20  |_On"            |
00005e70  20 20 20 3b 77 68 65 6e  20 74 68 65 20 64 6f 75  |   ;when the dou|
00005e80  62 6c 65 20 72 69 67 68  74 20 61 72 72 6f 77 20  |ble right arrow |
00005e90  69 73 20 63 6c 69 63 6b  65 64 0d 19 5a 38 20 20  |is clicked..Z8  |
00005ea0  ec 51 20 20 52 30 2c 23  31 30 20 20 20 20 20 20  |.Q  R0,#10      |
00005eb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005ec0  20 20 3b 6f 6e 20 77 69  74 68 20 53 65 6c 65 63  |  ;on with Selec|
00005ed0  74 2e 0d 19 64 0f 20 20  ec 51 20 20 52 31 2c 23  |t...d.  .Q  R1,#|
00005ee0  30 0d 19 6e 17 20 20 42  4c 45 51 20 20 20 47 65  |0..n.  BLEQ   Ge|
00005ef0  74 52 65 63 6f 72 64 73  0d 19 78 14 20 20 42 4c  |tRecords..x.  BL|
00005f00  45 51 20 20 20 20 55 70  64 61 74 65 0d 19 82 1d  |EQ    Update....|
00005f10  20 20 53 57 49 45 51 20  20 20 22 48 6f 75 72 67  |  SWIEQ   "Hourg|
00005f20  6c 61 73 73 5f 4f 66 66  22 0d 19 8c 1d 20 20 42  |lass_Off"....  B|
00005f30  45 51 20 20 20 20 20 73  65 6c 65 63 74 63 6c 6f  |EQ     selectclo|
00005f40  73 65 66 69 6c 65 0d 19  96 04 0d 19 a0 52 20 43  |sefile.......R C|
00005f50  4d 50 20 20 20 20 20 52  36 2c 23 32 35 20 20 20  |MP     R6,#25   |
00005f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005f70  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00005f80  6f 6e 20 72 65 61 64 73  20 66 6f 72 77 61 72 64  |on reads forward|
00005f90  20 31 30 30 20 72 65 63  6f 72 64 73 0d 19 aa 52  | 100 records...R|
00005fa0  20 20 53 57 49 45 51 20  20 20 22 48 6f 75 72 67  |  SWIEQ   "Hourg|
00005fb0  6c 61 73 73 5f 4f 6e 22  20 20 20 20 20 20 20 20  |lass_On"        |
00005fc0  20 20 20 20 20 20 20 3b  77 68 65 6e 20 74 68 65  |       ;when the|
00005fd0  20 74 72 69 70 6c 65 20  72 69 67 68 74 20 61 72  | triple right ar|
00005fe0  72 6f 77 20 69 73 20 63  6c 69 63 6b 65 64 0d 19  |row is clicked..|
00005ff0  b4 38 20 20 ec 51 20 20  20 52 30 2c 23 31 30 30  |.8  .Q   R0,#100|
00006000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006010  20 20 20 20 20 20 3b 6f  6e 20 77 69 74 68 20 53  |      ;on with S|
00006020  65 6c 65 63 74 2e 0d 19  be 10 20 20 ec 51 20 20  |elect.....  .Q  |
00006030  20 52 31 2c 23 30 0d 19  c8 18 20 20 42 4c 45 51  | R1,#0....  BLEQ|
00006040  20 20 20 20 47 65 74 52  65 63 6f 72 64 73 0d 19  |    GetRecords..|
00006050  d2 14 20 20 42 4c 45 51  20 20 20 20 55 70 64 61  |..  BLEQ    Upda|
00006060  74 65 0d 19 dc 1d 20 20  53 57 49 45 51 20 20 20  |te....  SWIEQ   |
00006070  22 48 6f 75 72 67 6c 61  73 73 5f 4f 66 66 22 0d  |"Hourglass_Off".|
00006080  19 e6 1d 20 20 42 45 51  20 20 20 20 20 73 65 6c  |...  BEQ     sel|
00006090  65 63 74 63 6c 6f 73 65  66 69 6c 65 0d 19 f0 04  |ectclosefile....|
000060a0  0d 19 fa 51 20 43 4d 50  20 20 20 20 20 52 36 2c  |...Q CMP     R6,|
000060b0  23 32 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |#26             |
000060c0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
000060d0  20 73 65 63 74 69 6f 6e  20 63 61 6c 6c 73 20 61  | section calls a|
000060e0  20 73 75 62 72 6f 75 74  69 6e 65 20 77 68 69 63  | subroutine whic|
000060f0  68 0d 1a 04 4f 20 20 42  4c 45 51 20 20 20 20 53  |h...O  BLEQ    S|
00006100  68 6f 77 49 6e 64 65 78  20 20 20 20 20 20 20 20  |howIndex        |
00006110  20 20 20 20 20 20 20 20  20 20 20 20 3b 73 77 69  |            ;swi|
00006120  74 63 68 65 73 20 6d 6f  64 65 20 74 6f 20 64 69  |tches mode to di|
00006130  73 70 6c 61 79 20 74 68  65 20 45 6e 74 69 72 65  |splay the Entire|
00006140  0d 1a 0e 4e 20 20 ec 51  20 20 20 52 30 2c 23 30  |...N  .Q   R0,#0|
00006150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006160  20 20 20 20 20 20 20 20  3b 49 6e 64 65 78 20 77  |        ;Index w|
00006170  68 65 6e 20 53 65 6c 65  63 74 20 69 73 20 63 6c  |hen Select is cl|
00006180  69 63 6b 65 64 20 6f 76  65 72 20 74 68 65 0d 1a  |icked over the..|
00006190  18 3e 20 20 4c 44 52 45  51 20 20 20 52 31 2c 5b  |.>  LDREQ   R1,[|
000061a0  52 31 30 2c 23 66 69 6c  65 68 61 6e 64 6c 65 25  |R10,#filehandle%|
000061b0  5d 20 20 20 20 20 20 20  20 3b 45 6e 74 69 72 65  |]        ;Entire|
000061c0  20 49 6e 64 65 78 20 69  63 6f 6e 2e 0d 1a 22 4f  | Index icon..."O|
000061d0  20 20 53 57 49 45 51 20  20 20 22 58 4f 53 5f 46  |  SWIEQ   "XOS_F|
000061e0  69 6e 64 22 20 20 20 20  20 20 20 20 20 20 20 20  |ind"            |
000061f0  20 20 20 20 20 20 20 3b  49 74 20 74 68 65 6e 20  |       ;It then |
00006200  63 6c 6f 73 65 73 20 74  68 65 20 63 75 72 72 65  |closes the curre|
00006210  6e 74 6c 79 20 61 63 74  69 76 65 0d 1a 2c 4c 20  |ntly active..,L |
00006220  20 ec 51 20 20 20 52 30  2c 23 26 34 46 20 20 20  | .Q   R0,#&4F   |
00006230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006240  20 20 20 3b 66 69 6c 65  20 61 6e 64 20 6f 70 65  |   ;file and ope|
00006250  6e 73 20 74 68 65 20 49  6e 64 65 78 66 69 6c 65  |ns the Indexfile|
00006260  20 61 73 20 74 68 65 0d  1a 36 42 20 20 41 44 44  | as the..6B  ADD|
00006270  45 51 20 20 20 52 31 2c  52 31 30 2c 23 69 6e 64  |EQ   R1,R10,#ind|
00006280  65 78 66 69 6c 65 20 20  20 20 20 20 20 20 20 20  |exfile          |
00006290  20 20 3b 63 75 72 72 65  6e 74 6c 79 20 61 63 74  |  ;currently act|
000062a0  69 76 65 20 66 69 6c 65  2e 0d 1a 40 18 20 20 53  |ive file...@.  S|
000062b0  57 49 45 51 20 20 20 22  58 4f 53 5f 46 69 6e 64  |WIEQ   "XOS_Find|
000062c0  22 0d 1a 4a 16 20 20 20  42 56 53 20 20 20 20 20  |"..J.   BVS     |
000062d0  6e 6f 69 6e 64 65 78 0d  1a 54 23 20 20 53 54 52  |noindex..T#  STR|
000062e0  45 51 20 20 20 52 30 2c  5b 52 31 30 2c 23 66 69  |EQ   R0,[R10,#fi|
000062f0  6c 65 68 61 6e 64 6c 65  25 5d 0d 1a 5e 1f 20 20  |lehandle%]..^.  |
00006300  4c 44 52 45 51 20 20 20  52 30 2c 5b 52 31 30 2c  |LDREQ   R0,[R10,|
00006310  23 72 65 63 6f 72 64 25  5d 0d 1a 68 10 20 20 ec  |#record%]..h.  .|
00006320  51 20 20 20 52 31 2c 23  32 0d 1a 72 18 20 20 42  |Q   R1,#2..r.  B|
00006330  4c 45 51 20 20 20 20 47  65 74 52 65 63 6f 72 64  |LEQ    GetRecord|
00006340  73 0d 1a 7c 14 20 20 42  4c 45 51 20 20 20 20 55  |s..|.  BLEQ    U|
00006350  70 64 61 74 65 0d 1a 86  1d 20 20 42 45 51 20 20  |pdate....  BEQ  |
00006360  20 20 20 73 65 6c 65 63  74 63 6c 6f 73 65 66 69  |   selectclosefi|
00006370  6c 65 0d 1a 90 04 0d 1a  9a 51 20 43 4d 50 20 20  |le.......Q CMP  |
00006380  20 20 20 52 36 2c 23 32  37 20 20 20 20 20 20 20  |   R6,#27       |
00006390  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000063a0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
000063b0  61 6c 6c 73 20 61 20 73  75 62 72 6f 75 74 69 6e  |alls a subroutin|
000063c0  65 20 77 68 69 63 68 0d  1a a4 49 20 20 42 4c 45  |e which...I  BLE|
000063d0  51 20 20 20 20 53 68 6f  77 53 65 61 72 63 68 20  |Q    ShowSearch |
000063e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000063f0  20 20 3b 73 77 69 74 68  63 65 73 20 6d 6f 64 65  |  ;swithces mode|
00006400  73 20 74 6f 20 64 69 73  70 6c 61 79 20 74 68 65  |s to display the|
00006410  0d 1a ae 4b 20 20 ec 51  20 20 20 52 30 2c 23 30  |...K  .Q   R0,#0|
00006420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006430  20 20 20 20 20 20 20 20  3b 4c 61 73 74 20 53 65  |        ;Last Se|
00006440  61 72 63 68 20 77 68 65  6e 20 53 65 6c 65 63 74  |arch when Select|
00006450  20 69 73 20 63 6c 69 63  6b 65 64 0d 1a b8 46 20  | is clicked...F |
00006460  20 4c 44 52 45 51 20 20  20 52 31 2c 5b 52 31 30  | LDREQ   R1,[R10|
00006470  2c 23 66 69 6c 65 68 61  6e 64 6c 65 25 5d 20 20  |,#filehandle%]  |
00006480  20 20 20 20 20 20 3b 6f  76 65 72 20 74 68 65 20  |      ;over the |
00006490  4c 61 73 74 20 53 65 61  72 63 68 20 69 63 6f 6e  |Last Search icon|
000064a0  2e 0d 1a c2 4f 20 20 53  57 49 45 51 20 20 20 22  |....O  SWIEQ   "|
000064b0  58 4f 53 5f 46 69 6e 64  22 20 20 20 20 20 20 20  |XOS_Find"       |
000064c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 49 74 20  |            ;It |
000064d0  74 68 65 6e 20 63 6c 6f  73 65 73 20 74 68 65 20  |then closes the |
000064e0  63 75 72 72 65 6e 74 6c  79 20 61 63 74 69 76 65  |currently active|
000064f0  0d 1a cc 4d 20 20 ec 51  20 20 20 52 30 2c 23 26  |...M  .Q   R0,#&|
00006500  34 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4F              |
00006510  20 20 20 20 20 20 20 20  3b 66 69 6c 65 20 61 6e  |        ;file an|
00006520  64 20 6f 70 65 6e 73 20  74 68 65 20 53 65 61 72  |d opens the Sear|
00006530  63 68 66 69 6c 65 20 61  73 20 74 68 65 0d 1a d6  |chfile as the...|
00006540  42 20 20 41 44 44 45 51  20 20 20 52 31 2c 52 31  |B  ADDEQ   R1,R1|
00006550  30 2c 23 73 65 61 72 63  68 66 69 6c 65 20 20 20  |0,#searchfile   |
00006560  20 20 20 20 20 20 20 20  3b 63 75 72 72 65 6e 74  |        ;current|
00006570  6c 79 20 61 63 74 69 76  65 20 66 69 6c 65 2e 0d  |ly active file..|
00006580  1a e0 18 20 20 53 57 49  45 51 20 20 20 22 58 4f  |...  SWIEQ   "XO|
00006590  53 5f 46 69 6e 64 22 0d  1a ea 17 20 20 20 42 56  |S_Find"....   BV|
000065a0  53 20 20 20 20 20 6e 6f  73 65 61 72 63 68 0d 1a  |S     nosearch..|
000065b0  f4 23 20 20 53 54 52 45  51 20 20 20 52 30 2c 5b  |.#  STREQ   R0,[|
000065c0  52 31 30 2c 23 66 69 6c  65 68 61 6e 64 6c 65 25  |R10,#filehandle%|
000065d0  5d 0d 1a fe 1f 20 20 4c  44 52 45 51 20 20 20 52  |]....  LDREQ   R|
000065e0  30 2c 5b 52 31 30 2c 23  72 65 63 6f 72 64 25 5d  |0,[R10,#record%]|
000065f0  0d 1b 08 10 20 20 ec 51  20 20 20 52 31 2c 23 32  |....  .Q   R1,#2|
00006600  0d 1b 12 18 20 20 42 4c  45 51 20 20 20 20 47 65  |....  BLEQ    Ge|
00006610  74 52 65 63 6f 72 64 73  0d 1b 1c 14 20 20 42 4c  |tRecords....  BL|
00006620  45 51 20 20 20 20 55 70  64 61 74 65 0d 1b 26 1d  |EQ    Update..&.|
00006630  20 20 42 45 51 20 20 20  20 20 73 65 6c 65 63 74  |  BEQ     select|
00006640  63 6c 6f 73 65 66 69 6c  65 0d 1b 30 04 0d 1b 3a  |closefile..0...:|
00006650  4e 20 43 4d 50 20 20 20  20 20 52 36 2c 23 33 37  |N CMP     R6,#37|
00006660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006670  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00006680  63 74 69 6f 6e 20 63 61  6c 6c 73 20 61 20 73 75  |ction calls a su|
00006690  62 72 6f 75 74 69 6e 65  20 74 6f 0d 1b 44 52 20  |broutine to..DR |
000066a0  20 42 4c 45 51 20 20 20  20 65 64 69 74 72 65 63  | BLEQ    editrec|
000066b0  6f 72 64 20 20 20 20 20  20 20 20 20 20 20 20 20  |ord             |
000066c0  20 20 20 20 20 20 3b 74  6f 20 65 64 69 74 20 74  |      ;to edit t|
000066d0  68 65 20 63 75 72 72 65  6e 74 20 72 65 63 6f 72  |he current recor|
000066e0  64 20 77 68 65 6e 20 53  65 6c 65 63 74 0d 1b 4e  |d when Select..N|
000066f0  51 20 20 42 45 51 20 20  20 20 20 73 65 6c 65 63  |Q  BEQ     selec|
00006700  74 63 6c 6f 73 65 66 69  6c 65 20 20 20 20 20 20  |tclosefile      |
00006710  20 20 20 20 20 20 20 20  3b 69 73 20 63 6c 69 63  |        ;is clic|
00006720  6b 65 64 20 6f 76 65 72  20 74 68 65 20 45 64 69  |ked over the Edi|
00006730  74 20 52 65 63 6f 72 64  20 69 63 6f 6e 2e 0d 1b  |t Record icon...|
00006740  58 04 0d 1b 62 4e 20 43  4d 50 20 20 20 20 20 52  |X...bN CMP     R|
00006750  36 2c 23 33 39 20 20 20  20 20 20 20 20 20 20 20  |6,#39           |
00006760  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00006770  69 73 20 73 65 63 74 69  6f 6e 20 63 61 6c 6c 73  |is section calls|
00006780  20 61 20 73 75 62 72 6f  75 74 69 6e 65 20 74 6f  | a subroutine to|
00006790  0d 1b 6c 4c 20 20 42 4c  45 51 20 20 20 20 6c 61  |..lL  BLEQ    la|
000067a0  73 74 6d 6f 6e 74 68 20  20 20 20 20 20 20 20 20  |stmonth         |
000067b0  20 20 20 20 20 20 20 20  20 20 20 3b 72 65 61 64  |           ;read|
000067c0  20 62 61 63 6b 20 31 20  69 73 73 75 65 20 77 68  | back 1 issue wh|
000067d0  65 6e 20 53 65 6c 65 63  74 20 69 73 0d 1b 76 4d  |en Select is..vM|
000067e0  20 20 42 45 51 20 20 20  20 20 73 65 6c 65 63 74  |  BEQ     select|
000067f0  63 6c 6f 73 65 66 69 6c  65 20 20 20 20 20 20 20  |closefile       |
00006800  20 20 20 20 20 20 20 3b  63 6c 69 63 6b 65 64 20  |       ;clicked |
00006810  6f 76 65 72 20 74 68 65  20 4d 6f 6e 74 68 20 44  |over the Month D|
00006820  6f 77 6e 20 69 63 6f 6e  2e 0d 1b 80 04 0d 1b 8a  |own icon........|
00006830  4e 20 43 4d 50 20 20 20  20 20 52 36 2c 23 34 30  |N CMP     R6,#40|
00006840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006850  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00006860  63 74 69 6f 6e 20 63 61  6c 6c 73 20 61 20 73 75  |ction calls a su|
00006870  62 72 6f 75 74 69 6e 65  20 74 6f 0d 1b 94 4f 20  |broutine to...O |
00006880  20 42 4c 45 51 20 20 20  20 6e 65 78 74 6d 6f 6e  | BLEQ    nextmon|
00006890  74 68 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |th              |
000068a0  20 20 20 20 20 20 3b 72  65 61 64 20 66 6f 72 77  |      ;read forw|
000068b0  61 72 64 20 31 20 69 73  73 75 65 20 77 68 65 6e  |ard 1 issue when|
000068c0  20 53 65 6c 65 63 74 20  69 73 0d 1b 9e 4b 20 20  | Select is...K  |
000068d0  42 45 51 20 20 20 20 20  73 65 6c 65 63 74 63 6c  |BEQ     selectcl|
000068e0  6f 73 65 66 69 6c 65 20  20 20 20 20 20 20 20 20  |osefile         |
000068f0  20 20 20 20 20 3b 63 6c  69 63 6b 65 64 20 6f 76  |     ;clicked ov|
00006900  65 72 20 74 68 65 20 4d  6f 6e 74 68 20 55 70 20  |er the Month Up |
00006910  69 63 6f 6e 2e 0d 1b a8  04 0d 1b b2 4e 20 43 4d  |icon........N CM|
00006920  50 20 20 20 20 20 52 36  2c 23 34 31 20 20 20 20  |P     R6,#41    |
00006930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006940  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00006950  6e 20 63 61 6c 6c 73 20  61 20 73 75 62 72 6f 75  |n calls a subrou|
00006960  74 69 6e 65 20 74 6f 0d  1b bc 4e 20 20 42 4c 45  |tine to...N  BLE|
00006970  51 20 20 20 20 6c 61 73  74 79 65 61 72 20 20 20  |Q    lastyear   |
00006980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006990  20 20 3b 72 65 61 64 20  62 61 63 6b 20 31 32 20  |  ;read back 12 |
000069a0  69 73 73 75 65 73 20 77  68 65 6e 20 53 65 6c 65  |issues when Sele|
000069b0  63 74 20 69 73 0d 1b c6  4c 20 20 42 45 51 20 20  |ct is...L  BEQ  |
000069c0  20 20 20 73 65 6c 65 63  74 63 6c 6f 73 65 66 69  |   selectclosefi|
000069d0  6c 65 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |le              |
000069e0  3b 63 6c 69 63 6b 65 64  20 6f 76 65 72 20 74 68  |;clicked over th|
000069f0  65 20 59 65 61 72 20 44  6f 77 6e 20 69 63 6f 6e  |e Year Down icon|
00006a00  2e 0d 1b d0 04 0d 1b da  4e 20 43 4d 50 20 20 20  |........N CMP   |
00006a10  20 20 52 36 2c 23 34 32  20 20 20 20 20 20 20 20  |  R6,#42        |
00006a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006a30  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 61  |;This section ca|
00006a40  6c 6c 73 20 61 20 73 75  62 72 6f 75 74 69 6e 65  |lls a subroutine|
00006a50  20 74 6f 0d 1b e4 51 20  20 42 4c 45 51 20 20 20  | to...Q  BLEQ   |
00006a60  20 6e 65 78 74 79 65 61  72 20 20 20 20 20 20 20  | nextyear       |
00006a70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 72  |              ;r|
00006a80  65 61 64 20 66 6f 72 77  61 72 64 20 31 32 20 69  |ead forward 12 i|
00006a90  73 73 75 65 73 20 77 68  65 6e 20 53 65 6c 65 63  |ssues when Selec|
00006aa0  74 20 69 73 0d 1b ee 4a  20 20 42 45 51 20 20 20  |t is...J  BEQ   |
00006ab0  20 20 73 65 6c 65 63 74  63 6c 6f 73 65 66 69 6c  |  selectclosefil|
00006ac0  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |e              ;|
00006ad0  63 6c 69 63 6b 65 64 20  6f 76 65 72 20 74 68 65  |clicked over the|
00006ae0  20 59 65 61 72 20 55 70  20 69 63 6f 6e 2e 0d 1b  | Year Up icon...|
00006af0  f8 04 0d 1c 02 52 20 2e  73 65 6c 65 63 74 63 6c  |.....R .selectcl|
00006b00  6f 73 65 66 69 6c 65 20  20 20 20 20 20 20 20 20  |osefile         |
00006b10  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00006b20  69 73 20 73 65 63 74 69  6f 6e 20 63 6c 6f 73 65  |is section close|
00006b30  73 20 62 6f 74 68 20 74  68 65 20 63 75 72 72 65  |s both the curre|
00006b40  6e 74 6c 79 0d 1c 0c 51  20 4d 4f 56 20 20 20 20  |ntly...Q MOV    |
00006b50  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
00006b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00006b70  61 63 74 69 76 65 20 66  69 6c 65 20 70 72 69 6f  |active file prio|
00006b80  72 20 74 6f 20 72 65 74  75 72 6e 69 6e 67 20 74  |r to returning t|
00006b90  6f 20 74 68 65 0d 1c 16  3b 20 4c 44 52 20 20 20  |o the...; LDR   |
00006ba0  20 52 31 2c 5b 52 31 30  2c 23 66 69 6c 65 68 61  | R1,[R10,#fileha|
00006bb0  6e 64 6c 65 25 5d 20 20  20 20 20 20 20 20 20 20  |ndle%]          |
00006bc0  3b 57 69 6d 70 5f 50 6f  6c 6c 20 6c 6f 6f 70 2e  |;Wimp_Poll loop.|
00006bd0  0d 1c 20 16 20 53 57 49  20 20 20 20 22 58 4f 53  |.. . SWI    "XOS|
00006be0  5f 46 69 6e 64 22 0d 1c  2a 04 0d 1c 34 1d 4c 44  |_Find"..*...4.LD|
00006bf0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
00006c00  31 32 2c 50 43 7d 5e 0d  1c 3e 04 0d 1c 48 52 3b  |12,PC}^..>...HR;|
00006c10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006c50  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 1c 52  |-------------..R|
00006c60  34 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4;              |
00006c70  20 20 20 20 20 20 20 20  20 20 2a 2a 2a 20 41 64  |          *** Ad|
00006c80  6a 75 73 74 49 6e 44 69  73 70 6c 61 79 20 2a 2a  |justInDisplay **|
00006c90  2a 0d 1c 5c 4d 3b 20 54  68 69 73 20 73 75 62 72  |*..\M; This subr|
00006ca0  6f 75 74 69 6e 65 20 69  73 20 69 73 20 63 61 6c  |outine is is cal|
00006cb0  6c 65 64 20 74 6f 20 64  65 61 6c 20 77 69 74 68  |led to deal with|
00006cc0  20 41 64 6a 75 73 74 20  62 65 69 6e 67 20 63 6c  | Adjust being cl|
00006cd0  69 63 6b 65 64 20 6f 76  65 72 20 74 68 65 0d 1c  |icked over the..|
00006ce0  66 15 3b 20 44 69 73 70  6c 61 79 20 77 69 6e 64  |f.; Display wind|
00006cf0  6f 77 2e 0d 1c 70 4c 3b  20 4e 42 3b 20 57 68 65  |ow...pL; NB; Whe|
00006d00  6e 20 41 64 6a 75 73 74  20 69 73 20 63 6c 69 63  |n Adjust is clic|
00006d10  6b 65 64 20 6f 76 65 72  20 61 64 6a 75 73 74 65  |ked over adjuste|
00006d20  72 20 69 63 6f 6e 73 20  74 68 65 20 52 49 53 43  |r icons the RISC|
00006d30  20 4f 53 20 53 74 79 6c  65 20 47 75 69 64 65 0d  | OS Style Guide.|
00006d40  1c 7a 51 3b 20 72 65 71  75 69 72 65 73 20 74 68  |.zQ; requires th|
00006d50  65 20 61 64 6a 75 73 74  6d 65 6e 74 20 74 6f 20  |e adjustment to |
00006d60  62 65 20 6d 61 64 65 20  69 6e 20 74 68 65 20 6f  |be made in the o|
00006d70  70 70 6f 73 69 74 65 20  64 69 72 65 63 74 69 6f  |pposite directio|
00006d80  6e 20 74 6f 20 74 68 65  20 61 72 72 6f 77 73 2e  |n to the arrows.|
00006d90  0d 1c 84 04 0d 1c 8e 14  2e 41 64 6a 75 73 74 49  |.........AdjustI|
00006da0  6e 44 69 73 70 6c 61 79  0d 1c 98 04 0d 1c a2 1d  |nDisplay........|
00006db0  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
00006dc0  2d 52 31 32 2c 52 31 34  7d 0d 1c ac 04 0d 1c b6  |-R12,R14}.......|
00006dd0  4e 20 4c 44 52 20 20 20  20 20 52 30 2c 5b 52 31  |N LDR     R0,[R1|
00006de0  30 2c 23 73 68 6f 77 25  5d 20 20 20 20 20 20 20  |0,#show%]       |
00006df0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00006e00  63 74 69 6f 6e 20 6f 70  65 6e 73 20 74 68 65 20  |ction opens the |
00006e10  61 70 70 72 6f 70 72 69  61 74 65 0d 1c c0 4d 20  |appropriate...M |
00006e20  43 4d 50 20 20 20 20 20  52 30 2c 23 31 20 20 20  |CMP     R0,#1   |
00006e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006e40  20 20 20 20 20 20 3b 66  69 6c 65 20 66 6f 72 20  |      ;file for |
00006e50  74 68 65 20 63 75 72 72  65 6e 74 20 64 69 73 70  |the current disp|
00006e60  6c 61 79 20 6d 6f 64 65  0d 1c ca 4b 20 20 4d 4f  |lay mode...K  MO|
00006e70  56 20 20 20 20 20 52 30  2c 23 26 34 46 20 20 20  |V     R0,#&4F   |
00006e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006e90  20 20 20 3b 65 69 74 68  65 72 20 49 6e 64 65 78  |   ;either Index|
00006ea0  66 69 6c 65 20 6f 72 20  53 65 61 72 63 68 66 69  |file or Searchfi|
00006eb0  6c 65 2e 0d 1c d4 20 20  20 20 41 44 44 45 51 20  |le....    ADDEQ |
00006ec0  20 20 52 31 2c 52 31 30  2c 23 69 6e 64 65 78 66  |  R1,R10,#indexf|
00006ed0  69 6c 65 0d 1c de 21 20  20 20 41 44 44 4e 45 20  |ile...!   ADDNE |
00006ee0  20 20 52 31 2c 52 31 30  2c 23 73 65 61 72 63 68  |  R1,R10,#search|
00006ef0  66 69 6c 65 0d 1c e8 17  20 20 53 57 49 20 20 20  |file....  SWI   |
00006f00  20 22 58 4f 53 5f 46 69  6e 64 22 0d 1c f2 18 20  | "XOS_Find".... |
00006f10  20 20 42 56 53 20 20 20  20 20 6e 6f 72 65 63 6f  |  BVS     noreco|
00006f20  72 64 73 0d 1c fc 23 20  20 53 54 52 20 20 20 20  |rds...#  STR    |
00006f30  20 52 30 2c 5b 52 31 30  2c 23 66 69 6c 65 68 61  | R0,[R10,#fileha|
00006f40  6e 64 6c 65 25 5d 0d 1d  06 25 20 20 20 53 54 52  |ndle%]...%   STR|
00006f50  45 51 20 20 20 52 30 2c  5b 52 31 30 2c 23 69 6e  |EQ   R0,[R10,#in|
00006f60  64 65 78 68 61 6e 64 6c  65 25 5d 0d 1d 10 26 20  |dexhandle%]...& |
00006f70  20 20 53 54 52 4e 45 20  20 20 52 30 2c 5b 52 31  |  STRNE   R0,[R1|
00006f80  30 2c 23 73 65 61 72 63  68 68 61 6e 64 6c 65 25  |0,#searchhandle%|
00006f90  5d 0d 1d 1a 04 0d 1d 24  4e 20 43 4d 50 20 20 20  |]......$N CMP   |
00006fa0  20 20 52 36 2c 23 32 30  20 20 20 20 20 20 20 20  |  R6,#20        |
00006fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006fc0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
00006fd0  61 64 73 20 74 68 65 20  6e 65 78 74 20 72 65 63  |ads the next rec|
00006fe0  6f 72 64 0d 1d 2e 51 20  20 53 57 49 45 51 20 20  |ord...Q  SWIEQ  |
00006ff0  20 22 48 6f 75 72 67 6c  61 73 73 5f 4f 6e 22 20  | "Hourglass_On" |
00007000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 77  |              ;w|
00007010  68 65 6e 20 74 68 65 20  73 69 6e 67 6c 65 20 6c  |hen the single l|
00007020  65 66 74 20 61 72 72 6f  77 20 69 73 20 63 6c 69  |eft arrow is cli|
00007030  63 6b 65 64 0d 1d 38 38  20 20 ec 51 20 20 20 52  |cked..88  .Q   R|
00007040  30 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |0,#1            |
00007050  20 20 20 20 20 20 20 20  20 20 20 20 3b 6f 6e 20  |            ;on |
00007060  77 69 74 68 20 41 64 6a  75 73 74 2e 0d 1d 42 10  |with Adjust...B.|
00007070  20 20 ec 51 20 20 20 52  31 2c 23 30 0d 1d 4c 18  |  .Q   R1,#0..L.|
00007080  20 20 42 4c 45 51 20 20  20 20 47 65 74 52 65 63  |  BLEQ    GetRec|
00007090  6f 72 64 73 0d 1d 56 14  20 20 42 4c 45 51 20 20  |ords..V.  BLEQ  |
000070a0  20 20 55 70 64 61 74 65  0d 1d 60 1d 20 20 53 57  |  Update..`.  SW|
000070b0  49 45 51 20 20 20 22 48  6f 75 72 67 6c 61 73 73  |IEQ   "Hourglass|
000070c0  5f 4f 66 66 22 0d 1d 6a  1d 20 20 42 45 51 20 20  |_Off"..j.  BEQ  |
000070d0  20 20 20 61 64 6a 75 73  74 63 6c 6f 73 65 66 69  |   adjustclosefi|
000070e0  6c 65 0d 1d 74 04 0d 1d  7e 51 20 43 4d 50 20 20  |le..t...~Q CMP  |
000070f0  20 20 20 52 36 2c 23 32  31 20 20 20 20 20 20 20  |   R6,#21       |
00007100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007110  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 72  | ;This section r|
00007120  65 61 64 73 20 66 6f 72  77 61 72 64 20 31 30 20  |eads forward 10 |
00007130  72 65 63 6f 72 64 73 0d  1d 88 51 20 20 53 57 49  |records...Q  SWI|
00007140  45 51 20 20 20 22 48 6f  75 72 67 6c 61 73 73 5f  |EQ   "Hourglass_|
00007150  4f 6e 22 20 20 20 20 20  20 20 20 20 20 20 20 20  |On"             |
00007160  20 20 3b 77 68 65 6e 20  74 68 65 20 64 6f 75 62  |  ;when the doub|
00007170  6c 65 20 6c 65 66 74 20  61 72 72 6f 77 20 69 73  |le left arrow is|
00007180  20 63 6c 69 63 6b 65 64  0d 1d 92 38 20 20 ec 51  | clicked...8  .Q|
00007190  20 20 20 52 30 2c 23 31  30 20 20 20 20 20 20 20  |   R0,#10       |
000071a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000071b0  3b 6f 6e 20 77 69 74 68  20 41 64 6a 75 73 74 2e  |;on with Adjust.|
000071c0  0d 1d 9c 10 20 20 ec 51  20 20 20 52 31 2c 23 30  |....  .Q   R1,#0|
000071d0  0d 1d a6 18 20 20 42 4c  45 51 20 20 20 20 47 65  |....  BLEQ    Ge|
000071e0  74 52 65 63 6f 72 64 73  0d 1d b0 14 20 20 42 4c  |tRecords....  BL|
000071f0  45 51 20 20 20 20 55 70  64 61 74 65 0d 1d ba 1d  |EQ    Update....|
00007200  20 20 53 57 49 45 51 20  20 20 22 48 6f 75 72 67  |  SWIEQ   "Hourg|
00007210  6c 61 73 73 5f 4f 66 66  22 0d 1d c4 1d 20 20 42  |lass_Off"....  B|
00007220  45 51 20 20 20 20 20 61  64 6a 75 73 74 63 6c 6f  |EQ     adjustclo|
00007230  73 65 66 69 6c 65 0d 1d  ce 04 0d 1d d8 52 20 43  |sefile.......R C|
00007240  4d 50 20 20 20 20 20 52  36 2c 23 32 32 20 20 20  |MP     R6,#22   |
00007250  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007260  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00007270  6f 6e 20 72 65 61 64 73  20 66 6f 72 77 61 72 64  |on reads forward|
00007280  20 31 30 30 20 72 65 63  6f 72 64 73 0d 1d e2 51  | 100 records...Q|
00007290  20 20 53 57 49 45 51 20  20 20 22 48 6f 75 72 67  |  SWIEQ   "Hourg|
000072a0  6c 61 73 73 5f 4f 6e 22  20 20 20 20 20 20 20 20  |lass_On"        |
000072b0  20 20 20 20 20 20 20 3b  77 68 65 6e 20 74 68 65  |       ;when the|
000072c0  20 74 72 69 70 6c 65 20  6c 65 66 74 20 61 72 72  | triple left arr|
000072d0  6f 77 20 69 73 20 63 6c  69 63 6b 65 64 0d 1d ec  |ow is clicked...|
000072e0  38 20 20 ec 51 20 20 20  52 30 2c 23 31 30 30 20  |8  .Q   R0,#100 |
000072f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007300  20 20 20 20 20 3b 6f 6e  20 77 69 74 68 20 41 64  |     ;on with Ad|
00007310  6a 75 73 74 2e 0d 1d f6  10 20 20 ec 51 20 20 20  |just.....  .Q   |
00007320  52 31 2c 23 30 0d 1e 00  18 20 20 42 4c 45 51 20  |R1,#0....  BLEQ |
00007330  20 20 20 47 65 74 52 65  63 6f 72 64 73 0d 1e 0a  |   GetRecords...|
00007340  14 20 20 42 4c 45 51 20  20 20 20 55 70 64 61 74  |.  BLEQ    Updat|
00007350  65 0d 1e 14 1d 20 20 53  57 49 45 51 20 20 20 22  |e....  SWIEQ   "|
00007360  48 6f 75 72 67 6c 61 73  73 5f 4f 66 66 22 0d 1e  |Hourglass_Off"..|
00007370  1e 1d 20 20 42 45 51 20  20 20 20 20 61 64 6a 75  |..  BEQ     adju|
00007380  73 74 63 6c 6f 73 65 66  69 6c 65 0d 1e 28 04 0d  |stclosefile..(..|
00007390  1e 32 4c 20 43 4d 50 20  20 20 20 20 52 36 2c 23  |.2L CMP     R6,#|
000073a0  32 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |23              |
000073b0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
000073c0  73 65 63 74 69 6f 6e 20  72 65 61 64 73 20 42 61  |section reads Ba|
000073d0  63 6b 20 31 20 72 65 63  6f 72 64 0d 1e 3c 52 20  |ck 1 record..<R |
000073e0  20 53 57 49 45 51 20 20  20 22 48 6f 75 72 67 6c  | SWIEQ   "Hourgl|
000073f0  61 73 73 5f 4f 6e 22 20  20 20 20 20 20 20 20 20  |ass_On"         |
00007400  20 20 20 20 20 20 3b 77  68 65 6e 20 74 68 65 20  |      ;when the |
00007410  73 69 6e 67 6c 65 20 72  69 67 68 74 20 61 72 72  |single right arr|
00007420  6f 77 20 69 73 20 63 6c  69 63 6b 65 64 0d 1e 46  |ow is clicked..F|
00007430  38 20 20 ec 51 20 20 20  52 30 2c 23 31 20 20 20  |8  .Q   R0,#1   |
00007440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007450  20 20 20 20 20 3b 6f 6e  20 77 69 74 68 20 41 64  |     ;on with Ad|
00007460  6a 75 73 74 2e 0d 1e 50  10 20 20 ec 51 20 20 20  |just...P.  .Q   |
00007470  52 31 2c 23 31 0d 1e 5a  18 20 20 42 4c 45 51 20  |R1,#1..Z.  BLEQ |
00007480  20 20 20 47 65 74 52 65  63 6f 72 64 73 0d 1e 64  |   GetRecords..d|
00007490  14 20 20 42 4c 45 51 20  20 20 20 55 70 64 61 74  |.  BLEQ    Updat|
000074a0  65 0d 1e 6e 1d 20 20 53  57 49 45 51 20 20 20 22  |e..n.  SWIEQ   "|
000074b0  48 6f 75 72 67 6c 61 73  73 5f 4f 66 66 22 0d 1e  |Hourglass_Off"..|
000074c0  78 1d 20 20 42 45 51 20  20 20 20 20 61 64 6a 75  |x.  BEQ     adju|
000074d0  73 74 63 6c 6f 73 65 66  69 6c 65 0d 1e 82 04 0d  |stclosefile.....|
000074e0  1e 8c 4e 20 43 4d 50 20  20 20 20 20 52 36 2c 23  |..N CMP     R6,#|
000074f0  32 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |24              |
00007500  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00007510  73 65 63 74 69 6f 6e 20  72 65 61 64 73 20 62 61  |section reads ba|
00007520  63 6b 20 31 30 20 72 65  63 6f 72 64 73 0d 1e 96  |ck 10 records...|
00007530  52 20 20 53 57 49 45 51  20 20 20 22 48 6f 75 72  |R  SWIEQ   "Hour|
00007540  67 6c 61 73 73 5f 4f 6e  22 20 20 20 20 20 20 20  |glass_On"       |
00007550  20 20 20 20 20 20 20 20  3b 77 68 65 6e 20 74 68  |        ;when th|
00007560  65 20 64 6f 75 62 6c 65  20 72 69 67 68 74 20 61  |e double right a|
00007570  72 72 6f 77 20 69 73 20  63 6c 69 63 6b 65 64 0d  |rrow is clicked.|
00007580  1e a0 38 20 20 ec 51 20  20 20 52 30 2c 23 31 30  |..8  .Q   R0,#10|
00007590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000075a0  20 20 20 20 20 20 20 3b  6f 6e 20 77 69 74 68 20  |       ;on with |
000075b0  41 64 6a 75 73 74 2e 0d  1e aa 10 20 20 ec 51 20  |Adjust.....  .Q |
000075c0  20 20 52 31 2c 23 31 0d  1e b4 18 20 20 42 4c 45  |  R1,#1....  BLE|
000075d0  51 20 20 20 20 47 65 74  52 65 63 6f 72 64 73 0d  |Q    GetRecords.|
000075e0  1e be 14 20 20 42 4c 45  51 20 20 20 20 55 70 64  |...  BLEQ    Upd|
000075f0  61 74 65 0d 1e c8 1d 20  20 53 57 49 45 51 20 20  |ate....  SWIEQ  |
00007600  20 22 48 6f 75 72 67 6c  61 73 73 5f 4f 66 66 22  | "Hourglass_Off"|
00007610  0d 1e d2 1d 20 20 42 45  51 20 20 20 20 20 61 64  |....  BEQ     ad|
00007620  6a 75 73 74 63 6c 6f 73  65 66 69 6c 65 0d 1e dc  |justclosefile...|
00007630  04 0d 1e e6 4f 20 43 4d  50 20 20 20 20 20 52 36  |....O CMP     R6|
00007640  2c 23 32 35 20 20 20 20  20 20 20 20 20 20 20 20  |,#25            |
00007650  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00007660  73 20 73 65 63 74 69 6f  6e 20 72 65 61 64 73 20  |s section reads |
00007670  62 61 63 6b 20 31 30 30  20 72 65 63 6f 72 64 73  |back 100 records|
00007680  0d 1e f0 52 20 20 53 57  49 45 51 20 20 20 22 48  |...R  SWIEQ   "H|
00007690  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 20 20 20 20  |ourglass_On"    |
000076a0  20 20 20 20 20 20 20 20  20 20 20 3b 77 68 65 6e  |           ;when|
000076b0  20 74 68 65 20 74 72 69  70 6c 65 20 72 69 67 68  | the triple righ|
000076c0  74 20 61 72 72 6f 77 20  69 73 20 63 6c 69 63 6b  |t arrow is click|
000076d0  65 64 0d 1e fa 38 20 20  ec 51 20 20 20 52 30 2c  |ed...8  .Q   R0,|
000076e0  23 31 30 30 20 20 20 20  20 20 20 20 20 20 20 20  |#100            |
000076f0  20 20 20 20 20 20 20 20  20 20 3b 6f 6e 20 77 69  |          ;on wi|
00007700  74 68 20 41 64 6a 75 73  74 2e 0d 1f 04 10 20 20  |th Adjust.....  |
00007710  ec 51 20 20 20 52 31 2c  23 31 0d 1f 0e 18 20 20  |.Q   R1,#1....  |
00007720  42 4c 45 51 20 20 20 20  47 65 74 52 65 63 6f 72  |BLEQ    GetRecor|
00007730  64 73 0d 1f 18 14 20 20  42 4c 45 51 20 20 20 20  |ds....  BLEQ    |
00007740  55 70 64 61 74 65 0d 1f  22 1d 20 20 53 57 49 45  |Update..".  SWIE|
00007750  51 20 20 20 22 48 6f 75  72 67 6c 61 73 73 5f 4f  |Q   "Hourglass_O|
00007760  66 66 22 0d 1f 2c 1d 20  20 42 45 51 20 20 20 20  |ff"..,.  BEQ    |
00007770  20 61 64 6a 75 73 74 63  6c 6f 73 65 66 69 6c 65  | adjustclosefile|
00007780  0d 1f 36 04 0d 1f 40 51  20 43 4d 50 20 20 20 20  |..6...@Q CMP    |
00007790  20 52 36 2c 23 32 36 20  20 20 20 20 20 20 20 20  | R6,#26         |
000077a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000077b0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 61 6c  |This section cal|
000077c0  6c 73 20 61 20 73 75 62  72 6f 75 74 69 6e 65 20  |ls a subroutine |
000077d0  77 68 69 63 68 0d 1f 4a  50 20 20 42 4c 45 51 20  |which..JP  BLEQ |
000077e0  20 20 20 53 68 6f 77 49  6e 64 65 78 20 20 20 20  |   ShowIndex    |
000077f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007800  3b 73 77 69 74 63 68 65  73 20 6d 6f 64 65 73 20  |;switches modes |
00007810  74 6f 20 64 69 73 70 6c  61 79 20 74 68 65 20 45  |to display the E|
00007820  6e 74 69 72 65 0d 1f 54  4e 20 20 ec 51 20 20 20  |ntire..TN  .Q   |
00007830  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
00007840  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 6e  |             ;In|
00007850  64 65 78 20 77 68 65 6e  20 41 64 6a 75 73 74 20  |dex when Adjust |
00007860  69 73 20 63 6c 69 63 6b  65 64 20 6f 76 65 72 20  |is clicked over |
00007870  74 68 65 0d 1f 5e 3e 20  20 4c 44 52 45 51 20 20  |the..^>  LDREQ  |
00007880  20 52 31 2c 5b 52 31 30  2c 23 66 69 6c 65 68 61  | R1,[R10,#fileha|
00007890  6e 64 6c 65 25 5d 20 20  20 20 20 20 20 20 3b 45  |ndle%]        ;E|
000078a0  6e 74 69 72 65 20 49 6e  64 65 78 20 69 63 6f 6e  |ntire Index icon|
000078b0  2e 0d 1f 68 4f 20 20 53  57 49 45 51 20 20 20 22  |...hO  SWIEQ   "|
000078c0  58 4f 53 5f 46 69 6e 64  22 20 20 20 20 20 20 20  |XOS_Find"       |
000078d0  20 20 20 20 20 20 20 20  20 20 20 20 3b 49 74 20  |            ;It |
000078e0  74 68 65 6e 20 63 6c 6f  73 65 73 20 74 68 65 20  |then closes the |
000078f0  63 75 72 72 65 6e 74 6c  79 20 61 63 74 69 76 65  |currently active|
00007900  0d 1f 72 4c 20 20 ec 51  20 20 20 52 30 2c 23 26  |..rL  .Q   R0,#&|
00007910  34 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4F              |
00007920  20 20 20 20 20 20 20 20  3b 66 69 6c 65 20 61 6e  |        ;file an|
00007930  64 20 6f 70 65 6e 73 20  74 68 65 20 49 6e 64 65  |d opens the Inde|
00007940  78 46 69 6c 65 20 61 73  20 74 68 65 0d 1f 7c 42  |xFile as the..|B|
00007950  20 20 41 44 44 45 51 20  20 20 52 31 2c 52 31 30  |  ADDEQ   R1,R10|
00007960  2c 23 69 6e 64 65 78 66  69 6c 65 20 20 20 20 20  |,#indexfile     |
00007970  20 20 20 20 20 20 20 3b  63 75 72 72 65 6e 74 6c  |       ;currentl|
00007980  79 20 61 63 74 69 76 65  20 66 69 6c 65 2e 0d 1f  |y active file...|
00007990  86 18 20 20 53 57 49 45  51 20 20 20 22 58 4f 53  |..  SWIEQ   "XOS|
000079a0  5f 46 69 6e 64 22 0d 1f  90 16 20 20 20 42 56 53  |_Find"....   BVS|
000079b0  20 20 20 20 20 6e 6f 69  6e 64 65 78 0d 1f 9a 23  |     noindex...#|
000079c0  20 20 53 54 52 45 51 20  20 20 52 30 2c 5b 52 31  |  STREQ   R0,[R1|
000079d0  30 2c 23 66 69 6c 65 68  61 6e 64 6c 65 25 5d 0d  |0,#filehandle%].|
000079e0  1f a4 1f 20 20 4c 44 52  45 51 20 20 20 52 30 2c  |...  LDREQ   R0,|
000079f0  5b 52 31 30 2c 23 72 65  63 6f 72 64 25 5d 0d 1f  |[R10,#record%]..|
00007a00  ae 10 20 20 ec 51 20 20  20 52 31 2c 23 32 0d 1f  |..  .Q   R1,#2..|
00007a10  b8 18 20 20 42 4c 45 51  20 20 20 20 47 65 74 52  |..  BLEQ    GetR|
00007a20  65 63 6f 72 64 73 0d 1f  c2 14 20 20 42 4c 45 51  |ecords....  BLEQ|
00007a30  20 20 20 20 55 70 64 61  74 65 0d 1f cc 1d 20 20  |    Update....  |
00007a40  42 45 51 20 20 20 20 20  61 64 6a 75 73 74 63 6c  |BEQ     adjustcl|
00007a50  6f 73 65 66 69 6c 65 0d  1f d6 04 0d 1f e0 51 20  |osefile.......Q |
00007a60  43 4d 50 20 20 20 20 20  52 36 2c 23 32 37 20 20  |CMP     R6,#27  |
00007a70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007a80  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00007a90  69 6f 6e 20 63 61 6c 6c  73 20 61 20 73 75 62 72  |ion calls a subr|
00007aa0  6f 75 74 69 6e 65 20 77  68 69 63 68 0d 1f ea 4e  |outine which...N|
00007ab0  20 20 42 4c 45 51 20 20  20 20 53 68 6f 77 53 65  |  BLEQ    ShowSe|
00007ac0  61 72 63 68 20 20 20 20  20 20 20 20 20 20 20 20  |arch            |
00007ad0  20 20 20 20 20 20 20 3b  73 77 69 74 63 68 65 73  |       ;switches|
00007ae0  20 6d 6f 64 65 73 20 74  6f 20 64 69 73 70 6c 61  | modes to displa|
00007af0  79 20 74 68 65 20 4c 61  73 74 0d 1f f4 4f 20 20  |y the Last...O  |
00007b00  ec 51 20 20 20 52 30 2c  23 30 20 20 20 20 20 20  |.Q   R0,#0      |
00007b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007b20  20 20 3b 53 65 61 72 63  68 20 77 68 65 6e 20 41  |  ;Search when A|
00007b30  64 6a 75 73 74 20 69 73  20 63 6c 69 63 6b 65 64  |djust is clicked|
00007b40  20 6f 76 65 72 20 74 68  65 0d 1f fe 3d 20 20 4c  | over the...=  L|
00007b50  44 52 45 51 20 20 20 52  31 2c 5b 52 31 30 2c 23  |DREQ   R1,[R10,#|
00007b60  66 69 6c 65 68 61 6e 64  6c 65 25 5d 20 20 20 20  |filehandle%]    |
00007b70  20 20 20 20 3b 4c 61 73  74 20 53 65 61 72 63 68  |    ;Last Search|
00007b80  20 69 63 6f 6e 2e 0d 20  08 18 20 20 53 57 49 45  | icon.. ..  SWIE|
00007b90  51 20 20 20 22 58 4f 53  5f 46 69 6e 64 22 0d 20  |Q   "XOS_Find". |
00007ba0  12 12 20 20 ec 51 20 20  20 52 30 2c 23 26 34 46  |..  .Q   R0,#&4F|
00007bb0  0d 20 1c 20 20 20 41 44  44 45 51 20 20 20 52 31  |. .   ADDEQ   R1|
00007bc0  2c 52 31 30 2c 23 73 65  61 72 63 68 66 69 6c 65  |,R10,#searchfile|
00007bd0  0d 20 26 18 20 20 53 57  49 45 51 20 20 20 22 58  |. &.  SWIEQ   "X|
00007be0  4f 53 5f 46 69 6e 64 22  0d 20 30 17 20 20 20 42  |OS_Find". 0.   B|
00007bf0  56 53 20 20 20 20 20 6e  6f 73 65 61 72 63 68 0d  |VS     nosearch.|
00007c00  20 3a 23 20 20 53 54 52  45 51 20 20 20 52 30 2c  | :#  STREQ   R0,|
00007c10  5b 52 31 30 2c 23 66 69  6c 65 68 61 6e 64 6c 65  |[R10,#filehandle|
00007c20  25 5d 0d 20 44 1f 20 20  4c 44 52 45 51 20 20 20  |%]. D.  LDREQ   |
00007c30  52 30 2c 5b 52 31 30 2c  23 72 65 63 6f 72 64 25  |R0,[R10,#record%|
00007c40  5d 0d 20 4e 10 20 20 ec  51 20 20 20 52 31 2c 23  |]. N.  .Q   R1,#|
00007c50  32 0d 20 58 18 20 20 42  4c 45 51 20 20 20 20 47  |2. X.  BLEQ    G|
00007c60  65 74 52 65 63 6f 72 64  73 0d 20 62 14 20 20 42  |etRecords. b.  B|
00007c70  4c 45 51 20 20 20 20 55  70 64 61 74 65 0d 20 6c  |LEQ    Update. l|
00007c80  1d 20 20 42 45 51 20 20  20 20 20 61 64 6a 75 73  |.  BEQ     adjus|
00007c90  74 63 6c 6f 73 65 66 69  6c 65 0d 20 76 04 0d 20  |tclosefile. v.. |
00007ca0  80 4e 20 43 4d 50 20 20  20 20 20 52 36 2c 23 33  |.N CMP     R6,#3|
00007cb0  37 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |7               |
00007cc0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00007cd0  65 63 74 69 6f 6e 20 63  61 6c 6c 73 20 61 20 73  |ection calls a s|
00007ce0  75 62 72 6f 75 74 69 6e  65 20 74 6f 0d 20 8a 4b  |ubroutine to. .K|
00007cf0  20 20 42 4c 45 51 20 20  20 20 65 64 69 74 72 65  |  BLEQ    editre|
00007d00  63 6f 72 64 20 20 20 20  20 20 20 20 20 20 20 20  |cord            |
00007d10  20 20 20 20 20 20 20 3b  74 6f 20 65 64 69 74 20  |       ;to edit |
00007d20  74 68 65 20 63 75 72 72  65 6e 74 20 72 65 63 6f  |the current reco|
00007d30  72 64 20 77 68 65 6e 0d  20 94 51 20 20 42 45 51  |rd when. .Q  BEQ|
00007d40  20 20 20 20 20 61 64 6a  75 73 74 63 6c 6f 73 65  |     adjustclose|
00007d50  66 69 6c 65 20 20 20 20  20 20 20 20 20 20 20 20  |file            |
00007d60  20 20 3b 41 64 6a 75 73  74 20 69 73 20 63 6c 69  |  ;Adjust is cli|
00007d70  63 6b 65 64 20 6f 76 65  72 20 74 68 65 20 45 64  |cked over the Ed|
00007d80  69 74 20 69 63 6f 6e 2e  0d 20 9e 04 0d 20 a8 51  |it icon.. ... .Q|
00007d90  20 43 4d 50 20 20 20 20  20 52 36 2c 23 33 39 20  | CMP     R6,#39 |
00007da0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007db0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00007dc0  74 69 6f 6e 20 63 61 6c  6c 73 20 61 20 73 75 62  |tion calls a sub|
00007dd0  72 6f 75 74 69 6e 65 20  77 68 69 63 68 0d 20 b2  |routine which. .|
00007de0  50 20 20 42 4c 45 51 20  20 20 20 6e 65 78 74 6d  |P  BLEQ    nextm|
00007df0  6f 6e 74 68 20 20 20 20  20 20 20 20 20 20 20 20  |onth            |
00007e00  20 20 20 20 20 20 20 20  3b 72 65 61 64 73 20 66  |        ;reads f|
00007e10  6f 72 77 61 72 64 20 31  20 49 73 73 75 65 20 77  |orward 1 Issue w|
00007e20  68 65 6e 20 41 64 6a 75  73 74 20 69 73 0d 20 bc  |hen Adjust is. .|
00007e30  4d 20 20 42 45 51 20 20  20 20 20 61 64 6a 75 73  |M  BEQ     adjus|
00007e40  74 63 6c 6f 73 65 66 69  6c 65 20 20 20 20 20 20  |tclosefile      |
00007e50  20 20 20 20 20 20 20 20  3b 63 6c 69 63 6b 65 64  |        ;clicked|
00007e60  20 6f 76 65 72 20 74 68  65 20 4d 6f 6e 74 68 20  | over the Month |
00007e70  44 6f 77 6e 20 69 63 6f  6e 2e 0d 20 c6 04 0d 20  |Down icon.. ... |
00007e80  d0 51 20 43 4d 50 20 20  20 20 20 52 36 2c 23 34  |.Q CMP     R6,#4|
00007e90  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00007ea0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00007eb0  65 63 74 69 6f 6e 20 63  61 6c 6c 73 20 61 20 73  |ection calls a s|
00007ec0  75 62 72 6f 75 74 69 6e  65 20 77 68 69 63 68 0d  |ubroutine which.|
00007ed0  20 da 4d 20 20 42 4c 45  51 20 20 20 20 6c 61 73  | .M  BLEQ    las|
00007ee0  74 6d 6f 6e 74 68 20 20  20 20 20 20 20 20 20 20  |tmonth          |
00007ef0  20 20 20 20 20 20 20 20  20 20 3b 72 65 61 64 73  |          ;reads|
00007f00  20 62 61 63 6b 20 31 20  49 73 73 75 65 20 77 68  | back 1 Issue wh|
00007f10  65 6e 20 41 64 6a 75 73  74 20 69 73 0d 20 e4 4b  |en Adjust is. .K|
00007f20  20 20 42 45 51 20 20 20  20 20 61 64 6a 75 73 74  |  BEQ     adjust|
00007f30  63 6c 6f 73 65 66 69 6c  65 20 20 20 20 20 20 20  |closefile       |
00007f40  20 20 20 20 20 20 20 3b  63 6c 69 63 6b 65 64 20  |       ;clicked |
00007f50  6f 76 65 72 20 74 68 65  20 4d 6f 6e 74 68 20 55  |over the Month U|
00007f60  70 20 69 63 6f 6e 2e 0d  20 ee 04 0d 20 f8 51 20  |p icon.. ... .Q |
00007f70  43 4d 50 20 20 20 20 20  52 36 2c 23 34 31 20 20  |CMP     R6,#41  |
00007f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007f90  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00007fa0  69 6f 6e 20 63 61 6c 6c  73 20 61 20 73 75 62 72  |ion calls a subr|
00007fb0  6f 75 74 69 6e 65 20 77  68 69 63 68 0d 21 02 52  |outine which.!.R|
00007fc0  20 20 42 4c 45 51 20 20  20 20 6e 65 78 74 79 65  |  BLEQ    nextye|
00007fd0  61 72 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ar              |
00007fe0  20 20 20 20 20 20 20 3b  72 65 61 64 73 20 66 6f  |       ;reads fo|
00007ff0  72 77 61 72 64 20 31 32  20 49 73 73 75 65 73 20  |rward 12 Issues |
00008000  77 68 65 6e 20 41 64 6a  75 73 74 20 69 73 0d 21  |when Adjust is.!|
00008010  0c 4c 20 20 42 45 51 20  20 20 20 20 61 64 6a 75  |.L  BEQ     adju|
00008020  73 74 63 6c 6f 73 65 66  69 6c 65 20 20 20 20 20  |stclosefile     |
00008030  20 20 20 20 20 20 20 20  20 3b 63 6c 69 63 6b 65  |         ;clicke|
00008040  64 20 6f 76 65 72 20 74  68 65 20 59 65 61 72 20  |d over the Year |
00008050  44 6f 77 6e 20 69 63 6f  6e 2e 0d 21 16 04 0d 21  |Down icon..!...!|
00008060  20 51 20 43 4d 50 20 20  20 20 20 52 36 2c 23 34  | Q CMP     R6,#4|
00008070  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
00008080  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00008090  65 63 74 69 6f 6e 20 63  61 6c 6c 73 20 61 20 73  |ection calls a s|
000080a0  75 62 72 6f 75 74 69 6e  65 20 77 68 69 63 68 0d  |ubroutine which.|
000080b0  21 2a 4f 20 20 42 4c 45  51 20 20 20 20 6c 61 73  |!*O  BLEQ    las|
000080c0  74 79 65 61 72 20 20 20  20 20 20 20 20 20 20 20  |tyear           |
000080d0  20 20 20 20 20 20 20 20  20 20 3b 72 65 61 64 73  |          ;reads|
000080e0  20 62 61 63 6b 20 31 32  20 49 73 73 75 65 73 20  | back 12 Issues |
000080f0  77 68 65 6e 20 41 64 6a  75 73 74 20 69 73 0d 21  |when Adjust is.!|
00008100  34 4a 20 20 42 45 51 20  20 20 20 20 61 64 6a 75  |4J  BEQ     adju|
00008110  73 74 63 6c 6f 73 65 66  69 6c 65 20 20 20 20 20  |stclosefile     |
00008120  20 20 20 20 20 20 20 20  20 3b 63 6c 69 63 6b 65  |         ;clicke|
00008130  64 20 6f 76 65 72 20 74  68 65 20 59 65 61 72 20  |d over the Year |
00008140  55 70 20 69 63 6f 6e 2e  0d 21 3e 04 0d 21 48 4d  |Up icon..!>..!HM|
00008150  20 2e 61 64 6a 75 73 74  63 6c 6f 73 65 66 69 6c  | .adjustclosefil|
00008160  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e               |
00008170  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00008180  74 69 6f 6e 20 63 6c 6f  73 65 73 20 74 68 65 20  |tion closes the |
00008190  63 75 72 72 65 6e 74 6c  79 0d 21 52 4d 20 4d 4f  |currently.!RM MO|
000081a0  56 20 20 20 20 52 30 2c  23 30 20 20 20 20 20 20  |V    R0,#0      |
000081b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000081c0  20 20 20 20 3b 61 63 74  69 76 65 20 66 69 6c 65  |    ;active file|
000081d0  20 70 72 69 6f 72 20 74  6f 20 72 65 74 75 72 6e  | prior to return|
000081e0  69 6e 67 20 74 6f 0d 21  5c 3f 20 4c 44 52 20 20  |ing to.!\? LDR  |
000081f0  20 20 52 31 2c 5b 52 31  30 2c 23 66 69 6c 65 68  |  R1,[R10,#fileh|
00008200  61 6e 64 6c 65 25 5d 20  20 20 20 20 20 20 20 20  |andle%]         |
00008210  20 3b 74 68 65 20 57 69  6d 70 5f 50 6f 6c 6c 20  | ;the Wimp_Poll |
00008220  6c 6f 6f 70 2e 0d 21 66  16 20 53 57 49 20 20 20  |loop..!f. SWI   |
00008230  20 22 58 4f 53 5f 46 69  6e 64 22 0d 21 70 04 0d  | "XOS_Find".!p..|
00008240  21 7a 1d 4c 44 4d 46 44  20 20 20 52 31 33 21 2c  |!z.LDMFD   R13!,|
00008250  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 21 84 04  |{R0-R12,PC}^.!..|
00008260  0d 21 8e 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.!.R;-----------|
00008270  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000082b0  2d 2d 0d 21 98 33 3b 20  20 20 20 20 20 20 20 20  |--.!.3;         |
000082c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000082d0  20 20 20 20 2a 2a 2a 20  53 68 6f 77 49 6e 64 65  |    *** ShowInde|
000082e0  78 20 2a 2a 2a 0d 21 a2  51 3b 20 54 68 69 73 20  |x ***.!.Q; This |
000082f0  73 75 62 72 6f 75 74 69  6e 65 20 69 73 20 63 61  |subroutine is ca|
00008300  6c 6c 65 64 20 77 68 65  6e 20 74 68 65 20 27 45  |lled when the 'E|
00008310  6e 74 69 72 65 20 49 6e  64 65 78 27 20 69 63 6f  |ntire Index' ico|
00008320  6e 20 69 73 20 63 6c 69  63 6b 65 64 20 6f 6e 20  |n is clicked on |
00008330  69 6e 20 74 68 65 0d 21  ac 4d 3b 20 44 69 73 70  |in the.!.M; Disp|
00008340  6c 61 79 20 77 69 6e 64  6f 77 2e 20 49 74 20 63  |lay window. It c|
00008350  68 61 6e 67 65 73 20 74  68 65 20 76 61 6c 75 65  |hanges the value|
00008360  73 20 6f 66 20 74 68 65  20 43 75 72 72 65 6e 74  |s of the Current|
00008370  20 52 65 63 6f 72 64 20  61 6e 64 20 4d 61 78 69  | Record and Maxi|
00008380  6d 75 6d 0d 21 b6 39 3b  20 52 65 63 6f 72 64 20  |mum.!.9; Record |
00008390  6e 75 6d 62 65 72 20 65  74 63 2e 20 66 6f 72 20  |number etc. for |
000083a0  64 69 73 70 6c 61 79 69  6e 67 20 74 68 65 20 45  |displaying the E|
000083b0  6e 74 69 72 65 20 49 6e  64 65 78 2e 0d 21 c0 04  |ntire Index..!..|
000083c0  0d 21 ca 0e 2e 53 68 6f  77 49 6e 64 65 78 0d 21  |.!...ShowIndex.!|
000083d0  d4 04 0d 21 de 19 53 54  4d 46 44 20 20 20 52 31  |...!..STMFD   R1|
000083e0  33 21 2c 7b 52 30 2c 52  31 34 7d 0d 21 e8 04 0d  |3!,{R0,R14}.!...|
000083f0  21 f2 4c 20 4c 44 52 20  20 20 20 20 52 30 2c 5b  |!.L LDR     R0,[|
00008400  52 31 30 2c 23 73 68 6f  77 25 5d 20 20 20 20 20  |R10,#show%]     |
00008410  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00008420  73 65 63 74 69 6f 6e 20  65 6e 73 75 72 65 73 20  |section ensures |
00008430  74 68 61 74 20 77 65 20  61 72 65 0d 21 fc 4d 20  |that we are.!.M |
00008440  43 4d 50 20 20 20 20 20  52 30 2c 23 31 20 20 20  |CMP     R0,#1   |
00008450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008460  20 20 20 20 20 20 3b 69  6e 69 74 69 61 6c 6c 79  |      ;initially|
00008470  20 73 68 6f 77 69 6e 67  20 74 68 65 20 4c 61 73  | showing the Las|
00008480  74 20 53 65 61 72 63 68  0d 22 06 45 20 20 4c 44  |t Search.".E  LD|
00008490  4d 45 51 46 44 20 52 31  33 21 2c 7b 52 30 2c 50  |MEQFD R13!,{R0,P|
000084a0  43 7d 5e 20 20 20 20 20  20 20 20 20 20 20 20 20  |C}^             |
000084b0  20 20 20 3b 6f 74 68 65  72 77 69 73 65 20 77 65  |   ;otherwise we|
000084c0  20 6a 75 73 74 20 52 65  74 75 72 6e 2e 0d 22 10  | just Return..".|
000084d0  04 0d 22 1a 50 20 4c 44  52 20 20 20 20 20 52 30  |..".P LDR     R0|
000084e0  2c 5b 52 31 30 2c 23 69  6e 64 65 78 6d 61 78 25  |,[R10,#indexmax%|
000084f0  5d 20 20 20 20 20 20 20  20 20 20 20 3b 53 65 74  |]           ;Set|
00008500  20 75 70 20 43 75 72 72  65 6e 74 20 4d 61 78 69  | up Current Maxi|
00008510  6d 75 6d 20 52 65 63 6f  72 64 20 61 73 20 74 68  |mum Record as th|
00008520  65 0d 22 24 50 20 53 54  52 20 20 20 20 20 52 30  |e."$P STR     R0|
00008530  2c 5b 52 31 30 2c 23 6d  61 78 25 5d 20 20 20 20  |,[R10,#max%]    |
00008540  20 20 20 20 20 20 20 20  20 20 20 20 3b 4d 61 78  |            ;Max|
00008550  69 6d 75 6d 20 52 65 63  6f 72 64 20 66 6f 72 20  |imum Record for |
00008560  74 68 65 20 45 6e 74 69  72 65 20 49 6e 64 65 78  |the Entire Index|
00008570  2e 0d 22 2e 04 0d 22 38  52 20 4c 44 52 20 20 20  |.."..."8R LDR   |
00008580  20 20 52 30 2c 5b 52 31  30 2c 23 72 65 63 6f 72  |  R0,[R10,#recor|
00008590  64 25 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |d%]             |
000085a0  3b 53 74 6f 72 65 20 43  75 72 72 65 6e 74 20 52  |;Store Current R|
000085b0  65 63 6f 72 64 20 61 73  20 43 75 72 72 65 6e 74  |ecord as Current|
000085c0  20 53 65 61 72 63 68 0d  22 42 33 20 53 54 52 20  | Search."B3 STR |
000085d0  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 73 65 61  |    R0,[R10,#sea|
000085e0  72 63 68 72 65 63 6f 72  64 25 5d 20 20 20 20 20  |rchrecord%]     |
000085f0  20 20 3b 52 65 63 6f 72  64 2e 0d 22 4c 04 0d 22  |  ;Record.."L.."|
00008600  56 51 20 4c 44 52 20 20  20 20 20 52 30 2c 5b 52  |VQ LDR     R0,[R|
00008610  31 30 2c 23 69 6e 64 65  78 72 65 63 6f 72 64 25  |10,#indexrecord%|
00008620  5d 20 20 20 20 20 20 20  20 3b 53 74 6f 72 65 20  |]        ;Store |
00008630  43 75 72 72 65 6e 74 20  49 6e 64 65 78 20 52 65  |Current Index Re|
00008640  63 6f 72 64 20 61 73 20  43 75 72 72 65 6e 74 0d  |cord as Current.|
00008650  22 60 33 20 53 54 52 20  20 20 20 20 52 30 2c 5b  |"`3 STR     R0,[|
00008660  52 31 30 2c 23 72 65 63  6f 72 64 25 5d 20 20 20  |R10,#record%]   |
00008670  20 20 20 20 20 20 20 20  20 20 3b 52 65 63 6f 72  |          ;Recor|
00008680  64 2e 0d 22 6a 04 0d 22  74 4d 20 4d 4f 56 20 20  |d.."j.."tM MOV  |
00008690  20 20 20 52 30 2c 23 31  20 20 20 20 20 20 20 20  |   R0,#1        |
000086a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000086b0  20 3b 53 65 74 20 63 75  72 72 65 6e 74 20 6d 6f  | ;Set current mo|
000086c0  64 65 20 74 6f 20 31 20  74 6f 20 69 6e 64 69 63  |de to 1 to indic|
000086d0  61 74 65 0d 22 7e 4f 20  53 54 52 20 20 20 20 20  |ate."~O STR     |
000086e0  52 30 2c 5b 52 31 30 2c  23 73 68 6f 77 25 5d 20  |R0,[R10,#show%] |
000086f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00008700  77 65 20 61 72 65 20 73  68 6f 77 69 6e 67 20 74  |we are showing t|
00008710  68 65 20 27 45 6e 74 69  72 65 20 49 6e 64 65 78  |he 'Entire Index|
00008720  27 2e 0d 22 88 04 0d 22  92 1f 20 4c 44 52 20 20  |'.."...".. LDR  |
00008730  20 20 20 52 30 2c 5b 52  31 32 2c 23 64 69 73 70  |   R0,[R12,#disp|
00008740  6c 61 79 25 5d 0d 22 9c  1f 20 53 54 52 20 20 20  |lay%].".. STR   |
00008750  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00008760  25 2b 30 5d 0d 22 a6 04  0d 22 b0 4b 20 4d 4f 56  |%+0]."...".K MOV|
00008770  20 20 20 20 20 52 30 2c  23 33 37 20 20 20 20 20  |     R0,#37     |
00008780  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008790  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
000087a0  20 75 6e 73 68 61 64 65  73 20 74 68 65 20 27 45  | unshades the 'E|
000087b0  64 69 74 0d 22 ba 39 20  53 54 52 20 20 20 20 20  |dit.".9 STR     |
000087c0  52 30 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R0,[R12,#block%+|
000087d0  34 5d 20 20 20 20 20 20  20 20 20 20 20 20 3b 72  |4]            ;r|
000087e0  65 63 6f 72 64 27 20 69  63 6f 6e 2e 0d 22 c4 12  |ecord' icon.."..|
000087f0  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 30 0d 22  | MOV     R0,#0."|
00008800  ce 1f 20 53 54 52 20 20  20 20 20 52 30 2c 5b 52  |.. STR     R0,[R|
00008810  31 32 2c 23 62 6c 6f 63  6b 25 2b 38 5d 0d 22 d8  |12,#block%+8].".|
00008820  17 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 25 31  |. MOV     R0,#%1|
00008830  3c 3c 32 32 0d 22 e2 20  20 53 54 52 20 20 20 20  |<<22.".  STR    |
00008840  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00008850  2b 31 32 5d 0d 22 ec 1b  20 41 44 44 20 20 20 20  |+12].".. ADD    |
00008860  20 52 31 2c 52 31 32 2c  23 62 6c 6f 63 6b 25 0d  | R1,R12,#block%.|
00008870  22 f6 20 20 53 57 49 20  20 20 20 20 22 57 69 6d  |".  SWI     "Wim|
00008880  70 5f 53 65 74 49 63 6f  6e 53 74 61 74 65 22 0d  |p_SetIconState".|
00008890  23 00 04 0d 23 0a 51 20  4d 4f 56 20 20 20 20 20  |#...#.Q MOV     |
000088a0  52 30 2c 23 32 36 20 20  20 20 20 20 20 20 20 20  |R0,#26          |
000088b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
000088c0  68 69 73 20 73 65 63 74  69 6f 6e 20 6d 61 6b 65  |his section make|
000088d0  73 20 74 68 65 20 27 45  6e 74 69 72 65 20 49 6e  |s the 'Entire In|
000088e0  64 65 78 27 0d 23 14 3a  20 53 54 52 20 20 20 20  |dex'.#.: STR    |
000088f0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00008900  2b 34 5d 20 20 20 20 20  20 20 20 20 20 20 20 3b  |+4]            ;|
00008910  69 63 6f 6e 20 53 65 6c  65 63 74 65 64 2e 0d 23  |icon Selected..#|
00008920  1e 17 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 25  |.. MOV     R0,#%|
00008930  31 3c 3c 32 31 0d 23 28  1f 20 53 54 52 20 20 20  |1<<21.#(. STR   |
00008940  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00008950  25 2b 38 5d 0d 23 32 17  20 4d 4f 56 20 20 20 20  |%+8].#2. MOV    |
00008960  20 52 30 2c 23 25 31 3c  3c 32 31 0d 23 3c 20 20  | R0,#%1<<21.#<  |
00008970  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |STR     R0,[R12,|
00008980  23 62 6c 6f 63 6b 25 2b  31 32 5d 0d 23 46 1b 20  |#block%+12].#F. |
00008990  41 44 44 20 20 20 20 20  52 31 2c 52 31 32 2c 23  |ADD     R1,R12,#|
000089a0  62 6c 6f 63 6b 25 0d 23  50 20 20 53 57 49 20 20  |block%.#P  SWI  |
000089b0  20 20 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |   "Wimp_SetIcon|
000089c0  53 74 61 74 65 22 0d 23  5a 04 0d 23 64 50 20 4d  |State".#Z..#dP M|
000089d0  4f 56 20 20 20 20 20 52  30 2c 23 32 37 20 20 20  |OV     R0,#27   |
000089e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000089f0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00008a00  6f 6e 20 6d 61 6b 65 73  20 74 68 65 20 27 4c 61  |on makes the 'La|
00008a10  73 74 20 53 65 61 72 63  68 27 0d 23 6e 3c 20 53  |st Search'.#n< S|
00008a20  54 52 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |TR     R0,[R12,#|
00008a30  62 6c 6f 63 6b 25 2b 34  5d 20 20 20 20 20 20 20  |block%+4]       |
00008a40  20 20 20 20 20 3b 69 63  6f 6e 20 44 65 73 65 6c  |     ;icon Desel|
00008a50  65 63 74 65 64 2e 0d 23  78 12 20 4d 4f 56 20 20  |ected..#x. MOV  |
00008a60  20 20 20 52 30 2c 23 30  0d 23 82 1f 20 53 54 52  |   R0,#0.#.. STR|
00008a70  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
00008a80  6f 63 6b 25 2b 38 5d 0d  23 8c 17 20 4d 4f 56 20  |ock%+8].#.. MOV |
00008a90  20 20 20 20 52 30 2c 23  25 31 3c 3c 32 31 0d 23  |    R0,#%1<<21.#|
00008aa0  96 20 20 53 54 52 20 20  20 20 20 52 30 2c 5b 52  |.  STR     R0,[R|
00008ab0  31 32 2c 23 62 6c 6f 63  6b 25 2b 31 32 5d 0d 23  |12,#block%+12].#|
00008ac0  a0 1b 20 41 44 44 20 20  20 20 20 52 31 2c 52 31  |.. ADD     R1,R1|
00008ad0  32 2c 23 62 6c 6f 63 6b  25 0d 23 aa 20 20 53 57  |2,#block%.#.  SW|
00008ae0  49 20 20 20 20 20 22 57  69 6d 70 5f 53 65 74 49  |I     "Wimp_SetI|
00008af0  63 6f 6e 53 74 61 74 65  22 0d 23 b4 04 0d 23 be  |conState".#...#.|
00008b00  19 4c 44 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  |.LDMFD   R13!,{R|
00008b10  30 2c 50 43 7d 5e 0d 23  c8 04 0d 23 d2 52 3b 2d  |0,PC}^.#...#.R;-|
00008b20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00008b60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 23 dc 30  |------------.#.0|
00008b70  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00008b80  20 20 20 20 20 20 20 20  20 20 2a 2a 2a 20 53 68  |          *** Sh|
00008b90  6f 77 53 65 61 72 63 68  20 2a 2a 2a 0d 23 e6 50  |owSearch ***.#.P|
00008ba0  3b 20 54 68 69 73 20 73  75 62 72 6f 75 74 69 6e  |; This subroutin|
00008bb0  65 20 69 73 20 63 61 6c  6c 65 64 20 77 68 65 6e  |e is called when|
00008bc0  20 74 68 65 20 27 4c 61  73 74 20 53 65 61 72 63  | the 'Last Searc|
00008bd0  68 27 20 69 63 6f 6e 20  69 73 20 63 6c 69 63 6b  |h' icon is click|
00008be0  65 64 20 6f 6e 20 69 6e  20 74 68 65 0d 23 f0 51  |ed on in the.#.Q|
00008bf0  3b 20 44 69 73 70 6c 61  79 20 77 69 6e 64 6f 77  |; Display window|
00008c00  2e 20 49 74 20 63 68 61  6e 67 65 73 20 74 68 65  |. It changes the|
00008c10  20 76 61 6c 75 65 73 20  6f 66 20 74 68 65 20 43  | values of the C|
00008c20  75 72 72 65 6e 74 20 52  65 63 6f 72 64 20 61 6e  |urrent Record an|
00008c30  64 20 74 68 65 20 43 75  72 72 65 6e 74 0d 23 fa  |d the Current.#.|
00008c40  39 3b 20 4d 61 78 69 6d  75 6d 20 52 65 63 6f 72  |9; Maximum Recor|
00008c50  64 20 65 74 63 2e 20 66  6f 72 20 64 69 73 70 6c  |d etc. for displ|
00008c60  61 79 69 6e 67 20 74 68  65 20 4c 61 73 74 20 53  |aying the Last S|
00008c70  65 61 72 63 68 2e 0d 24  04 04 0d 24 0e 0f 2e 53  |earch..$...$...S|
00008c80  68 6f 77 53 65 61 72 63  68 0d 24 18 04 0d 24 22  |howSearch.$...$"|
00008c90  1c 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  |.STMFD   R13!,{R|
00008ca0  30 2d 52 31 2c 52 31 34  7d 0d 24 2c 04 0d 24 36  |0-R1,R14}.$,..$6|
00008cb0  4c 20 4c 44 52 20 20 20  20 20 52 30 2c 5b 52 31  |L LDR     R0,[R1|
00008cc0  30 2c 23 73 68 6f 77 25  5d 20 20 20 20 20 20 20  |0,#show%]       |
00008cd0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00008ce0  63 74 69 6f 6e 20 65 6e  73 75 72 65 73 20 74 68  |ction ensures th|
00008cf0  61 74 20 77 65 20 61 72  65 0d 24 40 50 20 43 4d  |at we are.$@P CM|
00008d00  50 20 20 20 20 20 52 30  2c 23 30 20 20 20 20 20  |P     R0,#0     |
00008d10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008d20  20 20 20 20 3b 69 6e 69  74 69 61 6c 6c 79 20 73  |    ;initially s|
00008d30  68 6f 77 69 6e 67 20 74  68 65 20 27 45 6e 74 69  |howing the 'Enti|
00008d40  72 65 20 49 6e 64 65 78  27 0d 24 4a 45 20 20 4c  |re Index'.$JE  L|
00008d50  44 4d 45 51 46 44 20 52  31 33 21 2c 7b 52 30 2d  |DMEQFD R13!,{R0-|
00008d60  52 31 2c 50 43 7d 5e 20  20 20 20 20 20 20 20 20  |R1,PC}^         |
00008d70  20 20 20 20 3b 6f 74 68  65 72 77 69 73 65 20 77  |    ;otherwise w|
00008d80  65 20 6a 75 73 74 20 72  65 74 75 72 6e 2e 0d 24  |e just return..$|
00008d90  54 04 0d 24 5e 51 20 4c  44 52 20 20 20 20 20 52  |T..$^Q LDR     R|
00008da0  30 2c 5b 52 31 30 2c 23  73 65 61 72 63 68 6d 61  |0,[R10,#searchma|
00008db0  78 25 5d 20 20 20 20 20  20 20 20 20 20 3b 53 65  |x%]          ;Se|
00008dc0  74 20 75 70 20 43 75 72  72 65 6e 74 20 4d 61 78  |t up Current Max|
00008dd0  69 6d 75 6d 20 61 73 20  74 68 65 20 43 75 72 72  |imum as the Curr|
00008de0  65 6e 74 0d 24 68 3b 20  53 54 52 20 20 20 20 20  |ent.$h; STR     |
00008df0  52 30 2c 5b 52 31 30 2c  23 6d 61 78 25 5d 20 20  |R0,[R10,#max%]  |
00008e00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 53  |              ;S|
00008e10  65 61 72 63 68 20 4d 61  78 69 6d 75 6d 2e 0d 24  |earch Maximum..$|
00008e20  72 04 0d 24 7c 4e 20 4c  44 52 20 20 20 20 20 52  |r..$|N LDR     R|
00008e30  30 2c 5b 52 31 30 2c 23  72 65 63 6f 72 64 25 5d  |0,[R10,#record%]|
00008e40  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 53 74  |             ;St|
00008e50  6f 72 65 20 74 68 65 20  43 75 72 72 65 6e 74 20  |ore the Current |
00008e60  52 65 63 6f 72 64 20 6e  75 6d 62 65 72 20 61 73  |Record number as|
00008e70  0d 24 86 4c 20 53 54 52  20 20 20 20 20 52 30 2c  |.$.L STR     R0,|
00008e80  5b 52 31 30 2c 23 69 6e  64 65 78 72 65 63 6f 72  |[R10,#indexrecor|
00008e90  64 25 5d 20 20 20 20 20  20 20 20 3b 74 68 65 20  |d%]        ;the |
00008ea0  43 75 72 72 65 6e 74 20  49 6e 64 65 78 20 52 65  |Current Index Re|
00008eb0  63 6f 72 64 20 6e 75 6d  62 65 72 2e 0d 24 90 04  |cord number..$..|
00008ec0  0d 24 9a 4f 20 4c 44 52  20 20 20 20 20 52 30 2c  |.$.O LDR     R0,|
00008ed0  5b 52 31 30 2c 23 73 65  61 72 63 68 72 65 63 6f  |[R10,#searchreco|
00008ee0  72 64 25 5d 20 20 20 20  20 20 20 3b 53 65 74 20  |rd%]       ;Set |
00008ef0  75 70 20 74 68 65 20 43  75 72 72 65 6e 74 20 52  |up the Current R|
00008f00  65 63 6f 72 64 20 6e 75  6d 62 65 72 20 61 73 0d  |ecord number as.|
00008f10  24 a4 4d 20 53 54 52 20  20 20 20 20 52 30 2c 5b  |$.M STR     R0,[|
00008f20  52 31 30 2c 23 72 65 63  6f 72 64 25 5d 20 20 20  |R10,#record%]   |
00008f30  20 20 20 20 20 20 20 20  20 20 3b 74 68 65 20 43  |          ;the C|
00008f40  75 72 72 65 6e 74 20 53  65 61 72 63 68 20 52 65  |urrent Search Re|
00008f50  63 6f 72 64 20 6e 75 6d  62 65 72 2e 0d 24 ae 04  |cord number..$..|
00008f60  0d 24 b8 51 20 4d 4f 56  20 20 20 20 20 52 30 2c  |.$.Q MOV     R0,|
00008f70  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00008f80  20 20 20 20 20 20 20 20  20 20 20 3b 53 65 74 20  |           ;Set |
00008f90  74 68 65 20 63 75 72 72  65 6e 74 20 6d 6f 64 65  |the current mode|
00008fa0  20 74 6f 20 30 20 74 6f  20 69 6e 64 69 63 61 74  | to 0 to indicat|
00008fb0  65 0d 24 c2 4d 20 53 54  52 20 20 20 20 20 52 30  |e.$.M STR     R0|
00008fc0  2c 5b 52 31 30 2c 23 73  68 6f 77 25 5d 20 20 20  |,[R10,#show%]   |
00008fd0  20 20 20 20 20 20 20 20  20 20 20 20 3b 77 65 20  |            ;we |
00008fe0  61 72 65 20 73 68 6f 77  69 6e 67 20 74 68 65 20  |are showing the |
00008ff0  27 4c 61 73 74 20 53 65  61 72 63 68 27 2e 0d 24  |'Last Search'..$|
00009000  cc 04 0d 24 d6 1f 20 4c  44 52 20 20 20 20 20 52  |...$.. LDR     R|
00009010  30 2c 5b 52 31 32 2c 23  64 69 73 70 6c 61 79 25  |0,[R12,#display%|
00009020  5d 0d 24 e0 1f 20 53 54  52 20 20 20 20 20 52 30  |].$.. STR     R0|
00009030  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 30 5d  |,[R12,#block%+0]|
00009040  0d 24 ea 04 0d 24 f4 51  20 4d 4f 56 20 20 20 20  |.$...$.Q MOV    |
00009050  20 52 30 2c 23 33 37 20  20 20 20 20 20 20 20 20  | R0,#37         |
00009060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00009070  54 68 69 73 20 73 65 63  74 69 6f 6e 20 53 68 61  |This section Sha|
00009080  64 65 73 20 74 68 65 20  27 45 64 69 74 20 52 65  |des the 'Edit Re|
00009090  63 6f 72 64 27 0d 24 fe  31 20 53 54 52 20 20 20  |cord'.$.1 STR   |
000090a0  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
000090b0  25 2b 34 5d 20 20 20 20  20 20 20 20 20 20 20 20  |%+4]            |
000090c0  3b 69 63 6f 6e 2e 0d 25  08 16 20 4d 4f 56 20 20  |;icon..%.. MOV  |
000090d0  20 20 20 52 30 2c 23 31  3c 3c 32 32 0d 25 12 1f  |   R0,#1<<22.%..|
000090e0  20 53 54 52 20 20 20 20  20 52 30 2c 5b 52 31 32  | STR     R0,[R12|
000090f0  2c 23 62 6c 6f 63 6b 25  2b 38 5d 0d 25 1c 20 20  |,#block%+8].%.  |
00009100  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |STR     R0,[R12,|
00009110  23 62 6c 6f 63 6b 25 2b  31 32 5d 0d 25 26 1b 20  |#block%+12].%&. |
00009120  41 44 44 20 20 20 20 20  52 31 2c 52 31 32 2c 23  |ADD     R1,R12,#|
00009130  62 6c 6f 63 6b 25 0d 25  30 20 20 53 57 49 20 20  |block%.%0  SWI  |
00009140  20 20 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |   "Wimp_SetIcon|
00009150  53 74 61 74 65 22 0d 25  3a 04 0d 25 44 50 20 4d  |State".%:..%DP M|
00009160  4f 56 20 20 20 20 20 52  30 2c 23 32 37 20 20 20  |OV     R0,#27   |
00009170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009180  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00009190  6f 6e 20 6d 61 6b 65 73  20 74 68 65 20 27 4c 61  |on makes the 'La|
000091a0  73 74 20 53 65 61 72 63  68 27 0d 25 4e 3a 20 53  |st Search'.%N: S|
000091b0  54 52 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |TR     R0,[R12,#|
000091c0  62 6c 6f 63 6b 25 2b 34  5d 20 20 20 20 20 20 20  |block%+4]       |
000091d0  20 20 20 20 20 3b 69 63  6f 6e 20 73 65 6c 65 63  |     ;icon selec|
000091e0  74 65 64 2e 0d 25 58 17  20 4d 4f 56 20 20 20 20  |ted..%X. MOV    |
000091f0  20 52 30 2c 23 25 31 3c  3c 32 31 0d 25 62 1f 20  | R0,#%1<<21.%b. |
00009200  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |STR     R0,[R12,|
00009210  23 62 6c 6f 63 6b 25 2b  38 5d 0d 25 6c 17 20 4d  |#block%+8].%l. M|
00009220  4f 56 20 20 20 20 20 52  30 2c 23 25 31 3c 3c 32  |OV     R0,#%1<<2|
00009230  31 0d 25 76 20 20 53 54  52 20 20 20 20 20 52 30  |1.%v  STR     R0|
00009240  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 31 32  |,[R12,#block%+12|
00009250  5d 0d 25 80 1b 20 41 44  44 20 20 20 20 20 52 31  |].%.. ADD     R1|
00009260  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 0d 25 8a 20  |,R12,#block%.%. |
00009270  20 53 57 49 20 20 20 20  20 22 57 69 6d 70 5f 53  | SWI     "Wimp_S|
00009280  65 74 49 63 6f 6e 53 74  61 74 65 22 0d 25 94 04  |etIconState".%..|
00009290  0d 25 9e 51 20 4d 4f 56  20 20 20 20 20 52 30 2c  |.%.Q MOV     R0,|
000092a0  23 32 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |#26             |
000092b0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
000092c0  20 73 65 63 74 69 6f 6e  20 6d 61 6b 65 73 20 74  | section makes t|
000092d0  68 65 20 27 45 6e 74 69  72 65 20 49 6e 64 65 78  |he 'Entire Index|
000092e0  27 0d 25 a8 3a 20 53 54  52 20 20 20 20 20 52 30  |'.%.: STR     R0|
000092f0  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 34 5d  |,[R12,#block%+4]|
00009300  20 20 20 20 20 20 20 20  20 20 20 20 3b 69 63 6f  |            ;ico|
00009310  6e 20 73 65 6c 65 63 74  65 64 2e 0d 25 b2 12 20  |n selected..%.. |
00009320  4d 4f 56 20 20 20 20 20  52 30 2c 23 30 0d 25 bc  |MOV     R0,#0.%.|
00009330  1f 20 53 54 52 20 20 20  20 20 52 30 2c 5b 52 31  |. STR     R0,[R1|
00009340  32 2c 23 62 6c 6f 63 6b  25 2b 38 5d 0d 25 c6 17  |2,#block%+8].%..|
00009350  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 25 31 3c  | MOV     R0,#%1<|
00009360  3c 32 31 0d 25 d0 20 20  53 54 52 20 20 20 20 20  |<21.%.  STR     |
00009370  52 30 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R0,[R12,#block%+|
00009380  31 32 5d 0d 25 da 1b 20  41 44 44 20 20 20 20 20  |12].%.. ADD     |
00009390  52 31 2c 52 31 32 2c 23  62 6c 6f 63 6b 25 0d 25  |R1,R12,#block%.%|
000093a0  e4 20 20 53 57 49 20 20  20 20 20 22 57 69 6d 70  |.  SWI     "Wimp|
000093b0  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 0d 25  |_SetIconState".%|
000093c0  ee 1c 4c 44 4d 46 44 20  20 20 52 31 33 21 2c 7b  |..LDMFD   R13!,{|
000093d0  52 30 2d 52 31 2c 50 43  7d 5e 0d 25 f8 04 0d 26  |R0-R1,PC}^.%...&|
000093e0  02 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.R;-------------|
000093f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00009430  0d 26 0c 3a 3b 20 20 20  20 20 20 20 20 20 20 20  |.&.:;           |
00009440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2a  |               *|
00009450  2a 2a 20 45 64 69 74 20  43 75 72 72 65 6e 74 20  |** Edit Current |
00009460  52 65 63 6f 72 64 20 2a  2a 2a 0d 26 16 50 3b 20  |Record ***.&.P; |
00009470  54 68 69 73 20 73 75 62  72 6f 75 74 69 6e 65 20  |This subroutine |
00009480  69 73 20 63 61 6c 6c 65  64 20 77 68 65 6e 20 74  |is called when t|
00009490  68 65 20 27 45 64 69 74  20 52 65 63 6f 72 64 27  |he 'Edit Record'|
000094a0  20 69 63 6f 6e 20 69 73  20 63 6c 69 63 6b 65 64  | icon is clicked|
000094b0  20 6f 6e 20 69 6e 20 74  68 65 0d 26 20 4d 3b 20  | on in the.& M; |
000094c0  44 69 73 70 6c 61 79 20  77 69 6e 64 6f 77 2e 20  |Display window. |
000094d0  49 74 20 6f 70 65 6e 73  20 74 68 65 20 45 64 69  |It opens the Edi|
000094e0  74 20 77 69 6e 64 6f 77  20 61 6e 64 20 70 6f 73  |t window and pos|
000094f0  69 74 69 6f 6e 73 20 74  68 65 20 43 61 72 65 74  |itions the Caret|
00009500  20 69 6e 20 74 68 65 0d  26 2a 0d 3b 20 77 69 6e  | in the.&*.; win|
00009510  64 6f 77 2e 0d 26 34 04  0d 26 3e 0f 2e 65 64 69  |dow..&4..&>..edi|
00009520  74 72 65 63 6f 72 64 0d  26 48 04 0d 26 52 1d 53  |trecord.&H..&R.S|
00009530  54 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2d  |TMFD   R13!,{R0-|
00009540  52 31 32 2c 52 31 34 7d  0d 26 5c 04 0d 26 66 51  |R12,R14}.&\..&fQ|
00009550  20 42 4c 20 20 20 20 20  20 67 65 74 65 64 69 74  | BL      getedit|
00009560  64 65 74 61 69 6c 73 20  20 20 20 20 20 20 20 20  |details         |
00009570  20 20 20 20 20 20 20 3b  46 69 6c 6c 20 69 6e 20  |       ;Fill in |
00009580  64 65 74 61 69 6c 73 20  6f 66 20 74 68 65 20 63  |details of the c|
00009590  75 72 72 65 6e 74 20 72  65 63 6f 72 64 0d 26 70  |urrent record.&p|
000095a0  04 0d 26 7a 4a 20 4c 44  52 20 20 20 20 20 52 30  |..&zJ LDR     R0|
000095b0  2c 5b 52 31 30 2c 23 72  65 63 6f 72 64 25 5d 20  |,[R10,#record%] |
000095c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 53 74 6f  |            ;Sto|
000095d0  72 65 20 43 75 72 72 65  6e 74 20 52 65 63 6f 72  |re Current Recor|
000095e0  64 20 4e 75 6d 62 65 72  20 61 73 0d 26 84 4c 20  |d Number as.&.L |
000095f0  53 54 52 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |STR     R0,[R10,|
00009600  23 65 64 69 74 72 65 63  6f 72 64 25 5d 20 20 20  |#editrecord%]   |
00009610  20 20 20 20 20 20 3b 20  74 68 65 20 43 75 72 72  |      ; the Curr|
00009620  65 6e 74 20 45 64 69 74  20 52 65 63 6f 72 64 20  |ent Edit Record |
00009630  4e 75 6d 62 65 72 2e 0d  26 8e 04 0d 26 98 4f 20  |Number..&...&.O |
00009640  4c 44 52 20 20 20 20 20  52 33 2c 5b 52 31 32 2c  |LDR     R3,[R12,|
00009650  23 65 64 69 74 25 5d 20  20 20 20 20 20 20 20 20  |#edit%]         |
00009660  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00009670  69 6f 6e 20 6f 70 65 6e  73 20 74 68 65 20 45 64  |ion opens the Ed|
00009680  69 74 20 77 69 6e 64 6f  77 2e 0d 26 a2 1d 20 53  |it window..&.. S|
00009690  54 52 20 20 20 20 20 52  33 2c 5b 52 31 32 2c 23  |TR     R3,[R12,#|
000096a0  62 6c 6f 63 6b 25 5d 0d  26 ac 1b 20 41 44 44 20  |block%].&.. ADD |
000096b0  20 20 20 20 52 31 2c 52  31 32 2c 23 62 6c 6f 63  |    R1,R12,#bloc|
000096c0  6b 25 0d 26 b6 22 20 53  57 49 20 20 20 20 20 22  |k%.&." SWI     "|
000096d0  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
000096e0  61 74 65 22 0d 26 c0 1e  20 53 57 49 20 20 20 20  |ate".&.. SWI    |
000096f0  20 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  | "Wimp_OpenWindo|
00009700  77 22 0d 26 ca 04 0d 26  d4 4e 20 4d 4f 56 20 20  |w".&...&.N MOV  |
00009710  20 20 20 52 30 2c 52 33  20 20 20 20 20 20 20 20  |   R0,R3        |
00009720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009730  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 72  | ;This section r|
00009740  65 61 64 73 20 74 68 65  20 73 74 72 69 6e 67 20  |eads the string |
00009750  66 72 6f 6d 0d 26 de 4e  20 4d 4f 56 20 20 20 20  |from.&.N MOV    |
00009760  20 52 31 2c 23 32 30 20  20 20 20 20 20 20 20 20  | R1,#20         |
00009770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00009780  74 68 65 20 50 61 67 65  20 4e 75 6d 62 65 72 20  |the Page Number |
00009790  69 63 6f 6e 20 61 6e 64  20 66 69 6e 64 73 20 69  |icon and finds i|
000097a0  74 73 0d 26 e8 33 20 4d  4f 56 20 20 20 20 20 52  |ts.&.3 MOV     R|
000097b0  32 2c 52 39 20 20 20 20  20 20 20 20 20 20 20 20  |2,R9            |
000097c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 6c 65  |             ;le|
000097d0  6e 67 74 68 2e 0d 26 f2  15 20 42 4c 20 20 20 20  |ngth..&.. BL    |
000097e0  20 20 52 65 61 64 49 63  6f 6e 0d 26 fc 12 20 4d  |  ReadIcon.&.. M|
000097f0  4f 56 20 20 20 20 20 52  30 2c 52 39 0d 27 06 13  |OV     R0,R9.'..|
00009800  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 31 33 0d  | MOV     R1,#13.|
00009810  27 10 19 20 53 57 49 20  20 20 20 20 22 53 74 72  |'.. SWI     "Str|
00009820  69 6e 67 5f 4c 65 6e 22  0d 27 1a 12 20 4d 4f 56  |ing_Len".'.. MOV|
00009830  20 20 20 20 20 52 35 2c  52 31 0d 27 24 04 0d 27  |     R5,R1.'$..'|
00009840  2e 4f 20 4d 4f 56 20 20  20 20 20 52 30 2c 52 33  |.O MOV     R0,R3|
00009850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009860  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00009870  65 63 74 69 6f 6e 20 70  6f 73 69 74 69 6f 6e 73  |ection positions|
00009880  20 74 68 65 20 63 61 72  65 74 20 61 74 0d 27 38  | the caret at.'8|
00009890  4c 20 4d 4f 56 20 20 20  20 20 52 31 2c 23 32 30  |L MOV     R1,#20|
000098a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000098b0  20 20 20 20 20 20 20 20  3b 74 68 65 20 65 6e 64  |        ;the end|
000098c0  20 6f 66 20 74 68 65 20  50 61 67 65 20 4e 75 6d  | of the Page Num|
000098d0  62 65 72 20 69 63 6f 6e  2e 0d 27 42 12 20 4d 56  |ber icon..'B. MV|
000098e0  4e 20 20 20 20 20 52 34  2c 23 30 0d 27 4c 24 20  |N     R4,#0.'L$ |
000098f0  53 57 49 20 20 20 20 20  22 57 69 6d 70 5f 53 65  |SWI     "Wimp_Se|
00009900  74 43 61 72 65 74 50 6f  73 69 74 69 6f 6e 22 0d  |tCaretPosition".|
00009910  27 56 04 0d 27 60 1d 4c  44 4d 46 44 20 20 20 52  |'V..'`.LDMFD   R|
00009920  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
00009930  0d 27 6a 04 0d 27 74 52  3b 2d 2d 2d 2d 2d 2d 2d  |.'j..'tR;-------|
00009940  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00009980  2d 2d 2d 2d 2d 2d 0d 27  7e 35 3b 20 20 20 20 20  |------.'~5;     |
00009990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000099a0  20 20 20 20 20 2a 2a 2a  20 47 65 74 45 64 69 74  |     *** GetEdit|
000099b0  44 65 74 61 69 6c 73 20  2a 2a 2a 0d 27 88 4f 3b  |Details ***.'.O;|
000099c0  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
000099d0  20 63 6f 70 69 65 73 20  74 68 65 20 64 65 74 61  | copies the deta|
000099e0  69 6c 73 20 6f 66 20 74  68 65 20 63 75 72 72 65  |ils of the curre|
000099f0  6e 74 20 72 65 63 6f 72  64 20 66 72 6f 6d 20 74  |nt record from t|
00009a00  68 65 20 44 69 73 70 6c  61 79 0d 27 92 2e 3b 20  |he Display.'..; |
00009a10  77 69 6e 64 6f 77 20 69  6e 74 6f 20 74 68 65 20  |window into the |
00009a20  45 64 69 74 20 77 69 6e  64 6f 77 20 66 6f 72 20  |Edit window for |
00009a30  65 64 69 74 69 6e 67 2e  0d 27 9c 04 0d 27 a6 13  |editing..'...'..|
00009a40  2e 67 65 74 65 64 69 74  64 65 74 61 69 6c 73 0d  |.geteditdetails.|
00009a50  27 b0 04 0d 27 ba 1d 53  54 4d 46 44 20 20 20 52  |'...'..STMFD   R|
00009a60  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
00009a70  0d 27 c4 04 0d 27 ce 12  20 4d 4f 56 20 20 20 20  |.'...'.. MOV    |
00009a80  20 52 32 2c 52 39 0d 27  d8 1f 20 4c 44 52 20 20  | R2,R9.'.. LDR  |
00009a90  20 20 20 52 38 2c 5b 52  31 32 2c 23 64 69 73 70  |   R8,[R12,#disp|
00009aa0  6c 61 79 25 5d 0d 27 e2  1c 20 4c 44 52 20 20 20  |lay%].'.. LDR   |
00009ab0  20 20 52 37 2c 5b 52 31  32 2c 23 65 64 69 74 25  |  R7,[R12,#edit%|
00009ac0  5d 0d 27 ec 04 0d 27 f6  24 20 4c 44 52 20 20 20  |].'...'.$ LDR   |
00009ad0  20 20 52 30 2c 5b 52 31  30 2c 23 64 69 73 70 6c  |  R0,[R10,#displ|
00009ae0  61 79 6d 6f 6e 74 68 25  5d 0d 28 00 21 20 53 54  |aymonth%].(.! ST|
00009af0  52 20 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 65  |R     R0,[R10,#e|
00009b00  64 69 74 6d 6f 6e 74 68  25 5d 0d 28 0a 04 0d 28  |ditmonth%].(...(|
00009b10  14 12 20 4d 4f 56 20 20  20 20 20 52 30 2c 52 38  |.. MOV     R0,R8|
00009b20  0d 28 1e 52 20 4d 4f 56  20 20 20 20 20 52 31 2c  |.(.R MOV     R1,|
00009b30  23 33 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |#32             |
00009b40  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 65 20  |           ;The |
00009b50  66 6f 6c 6c 6f 77 69 6e  67 20 73 65 63 74 69 6f  |following sectio|
00009b60  6e 73 20 72 65 61 64 20  74 68 65 20 73 74 72 69  |ns read the stri|
00009b70  6e 67 0d 28 28 50 20 42  4c 20 20 20 20 20 20 52  |ng.((P BL      R|
00009b80  65 61 64 49 63 6f 6e 20  20 20 20 20 20 20 20 20  |eadIcon         |
00009b90  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 66 72  |             ;fr|
00009ba0  6f 6d 20 69 63 6f 6e 73  20 69 6e 20 74 68 65 20  |om icons in the |
00009bb0  44 69 73 70 6c 61 79 20  77 69 6e 64 6f 77 20 61  |Display window a|
00009bc0  6e 64 0d 28 32 51 20 4d  4f 56 20 20 20 20 20 52  |nd.(2Q MOV     R|
00009bd0  30 2c 52 37 20 20 20 20  20 20 20 20 20 20 20 20  |0,R7            |
00009be0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 77 72  |             ;wr|
00009bf0  69 74 65 73 20 74 68 65  6d 20 69 6e 74 6f 20 74  |ites them into t|
00009c00  68 65 20 65 71 75 69 76  65 6c 65 61 6e 74 20 69  |he equiveleant i|
00009c10  63 6f 6e 0d 28 3c 50 20  4d 4f 56 20 20 20 20 20  |con.(<P MOV     |
00009c20  52 31 2c 23 31 37 20 20  20 20 20 20 20 20 20 20  |R1,#17          |
00009c30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 69  |              ;i|
00009c40  6e 20 74 68 65 20 45 64  69 74 20 77 69 6e 64 6f  |n the Edit windo|
00009c50  77 2c 20 74 6f 20 61 6c  6c 6f 77 20 74 68 65 6d  |w, to allow them|
00009c60  20 74 6f 0d 28 46 33 20  42 4c 20 20 20 20 20 20  | to.(F3 BL      |
00009c70  57 72 69 74 65 49 63 6f  6e 20 20 20 20 20 20 20  |WriteIcon       |
00009c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 65  |              ;e|
00009c90  64 69 74 65 64 2e 0d 28  50 04 0d 28 5a 12 20 4d  |dited..(P..(Z. M|
00009ca0  4f 56 20 20 20 20 20 52  30 2c 52 38 0d 28 64 13  |OV     R0,R8.(d.|
00009cb0  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 33 33 0d  | MOV     R1,#33.|
00009cc0  28 6e 15 20 42 4c 20 20  20 20 20 20 52 65 61 64  |(n. BL      Read|
00009cd0  49 63 6f 6e 0d 28 78 12  20 4d 4f 56 20 20 20 20  |Icon.(x. MOV    |
00009ce0  20 52 30 2c 52 37 0d 28  82 13 20 4d 4f 56 20 20  | R0,R7.(.. MOV  |
00009cf0  20 20 20 52 31 2c 23 31  38 0d 28 8c 16 20 42 4c  |   R1,#18.(.. BL|
00009d00  20 20 20 20 20 20 57 72  69 74 65 49 63 6f 6e 0d  |      WriteIcon.|
00009d10  28 96 04 0d 28 a0 12 20  4d 4f 56 20 20 20 20 20  |(...(.. MOV     |
00009d20  52 30 2c 52 38 0d 28 aa  13 20 4d 4f 56 20 20 20  |R0,R8.(.. MOV   |
00009d30  20 20 52 31 2c 23 33 34  0d 28 b4 15 20 42 4c 20  |  R1,#34.(.. BL |
00009d40  20 20 20 20 20 52 65 61  64 49 63 6f 6e 0d 28 be  |     ReadIcon.(.|
00009d50  12 20 4d 4f 56 20 20 20  20 20 52 30 2c 52 37 0d  |. MOV     R0,R7.|
00009d60  28 c8 13 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |(.. MOV     R1,#|
00009d70  31 39 0d 28 d2 16 20 42  4c 20 20 20 20 20 20 57  |19.(.. BL      W|
00009d80  72 69 74 65 49 63 6f 6e  0d 28 dc 04 0d 28 e6 12  |riteIcon.(...(..|
00009d90  20 4d 4f 56 20 20 20 20  20 52 30 2c 52 38 0d 28  | MOV     R0,R8.(|
00009da0  f0 13 20 4d 4f 56 20 20  20 20 20 52 31 2c 23 33  |.. MOV     R1,#3|
00009db0  35 0d 28 fa 15 20 42 4c  20 20 20 20 20 20 52 65  |5.(.. BL      Re|
00009dc0  61 64 49 63 6f 6e 0d 29  04 12 20 4d 4f 56 20 20  |adIcon.).. MOV  |
00009dd0  20 20 20 52 30 2c 52 37  0d 29 0e 13 20 4d 4f 56  |   R0,R7.).. MOV|
00009de0  20 20 20 20 20 52 31 2c  23 32 30 0d 29 18 16 20  |     R1,#20.).. |
00009df0  42 4c 20 20 20 20 20 20  57 72 69 74 65 49 63 6f  |BL      WriteIco|
00009e00  6e 0d 29 22 04 0d 29 2c  12 20 4d 4f 56 20 20 20  |n.)"..),. MOV   |
00009e10  20 20 52 30 2c 52 38 0d  29 36 13 20 4d 4f 56 20  |  R0,R8.)6. MOV |
00009e20  20 20 20 20 52 31 2c 23  33 30 0d 29 40 15 20 42  |    R1,#30.)@. B|
00009e30  4c 20 20 20 20 20 20 52  65 61 64 49 63 6f 6e 0d  |L      ReadIcon.|
00009e40  29 4a 12 20 4d 4f 56 20  20 20 20 20 52 30 2c 52  |)J. MOV     R0,R|
00009e50  37 0d 29 54 13 20 4d 4f  56 20 20 20 20 20 52 31  |7.)T. MOV     R1|
00009e60  2c 23 32 31 0d 29 5e 16  20 42 4c 20 20 20 20 20  |,#21.)^. BL     |
00009e70  20 57 72 69 74 65 49 63  6f 6e 0d 29 68 04 0d 29  | WriteIcon.)h..)|
00009e80  72 12 20 4d 4f 56 20 20  20 20 20 52 30 2c 52 38  |r. MOV     R0,R8|
00009e90  0d 29 7c 13 20 4d 4f 56  20 20 20 20 20 52 31 2c  |.)|. MOV     R1,|
00009ea0  23 33 31 0d 29 86 15 20  42 4c 20 20 20 20 20 20  |#31.).. BL      |
00009eb0  52 65 61 64 49 63 6f 6e  0d 29 90 12 20 4d 4f 56  |ReadIcon.).. MOV|
00009ec0  20 20 20 20 20 52 30 2c  52 37 0d 29 9a 13 20 4d  |     R0,R7.).. M|
00009ed0  4f 56 20 20 20 20 20 52  31 2c 23 32 32 0d 29 a4  |OV     R1,#22.).|
00009ee0  16 20 42 4c 20 20 20 20  20 20 57 72 69 74 65 49  |. BL      WriteI|
00009ef0  63 6f 6e 0d 29 ae 04 0d  29 b8 4e 20 53 54 52 20  |con.)...).N STR |
00009f00  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
00009f10  6f 63 6b 25 2b 30 5d 20  20 20 20 20 20 20 20 20  |ock%+0]         |
00009f20  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00009f30  64 69 73 70 6c 61 79 73  20 74 68 65 20 27 44 65  |displays the 'De|
00009f40  6c 65 74 65 27 0d 29 c2  4f 20 4d 4f 56 20 20 20  |lete'.).O MOV   |
00009f50  20 20 20 52 30 2c 23 32  36 20 20 20 20 20 20 20  |   R0,#26       |
00009f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009f70  3b 69 63 6f 6e 20 69 6e  20 74 68 65 20 45 64 69  |;icon in the Edi|
00009f80  74 20 77 69 6e 64 6f 77  20 62 79 20 63 6c 65 61  |t window by clea|
00009f90  72 69 6e 67 0d 29 cc 3c  20 53 54 52 20 20 20 20  |ring.).< STR    |
00009fa0  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00009fb0  25 2b 34 5d 20 20 20 20  20 20 20 20 20 20 20 3b  |%+4]           ;|
00009fc0  69 74 73 20 44 65 6c 65  74 65 64 20 62 69 74 2e  |its Deleted bit.|
00009fd0  0d 29 d6 13 20 4d 4f 56  20 20 20 20 20 20 52 30  |.).. MOV      R0|
00009fe0  2c 23 30 0d 29 e0 20 20  53 54 52 20 20 20 20 20  |,#0.).  STR     |
00009ff0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
0000a000  2b 38 5d 0d 29 ea 18 20  4d 4f 56 20 20 20 20 20  |+8].).. MOV     |
0000a010  20 52 30 2c 23 25 31 3c  3c 32 33 0d 29 f4 21 20  | R0,#%1<<23.).! |
0000a020  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |STR      R0,[R12|
0000a030  2c 23 62 6c 6f 63 6b 25  2b 31 32 5d 0d 29 fe 04  |,#block%+12].)..|
0000a040  0d 2a 08 1c 20 41 44 44  20 20 20 20 20 20 52 31  |.*.. ADD      R1|
0000a050  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 0d 2a 12 21  |,R12,#block%.*.!|
0000a060  20 53 57 49 20 20 20 20  20 20 22 57 69 6d 70 5f  | SWI      "Wimp_|
0000a070  53 65 74 49 63 6f 6e 53  74 61 74 65 22 0d 2a 1c  |SetIconState".*.|
0000a080  04 0d 2a 26 1d 4c 44 4d  46 44 20 20 20 52 31 33  |..*&.LDMFD   R13|
0000a090  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 2a  |!,{R0-R12,PC}^.*|
0000a0a0  30 04 0d 2a 3a 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |0..*:R;---------|
0000a0b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000a0f0  2d 2d 2d 2d 0d 2a 44 35  3b 20 20 20 20 20 20 20  |----.*D5;       |
0000a100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a110  20 20 20 20 20 2a 2a 2a  20 53 65 6c 65 63 74 49  |     *** SelectI|
0000a120  6e 45 64 69 74 20 2a 2a  2a 0d 2a 4e 4b 3b 20 54  |nEdit ***.*NK; T|
0000a130  68 69 73 20 73 75 62 72  6f 75 74 69 6e 65 20 64  |his subroutine d|
0000a140  65 61 6c 73 20 77 69 74  68 20 53 65 6c 65 63 74  |eals with Select|
0000a150  20 62 65 69 6e 67 20 70  72 65 73 73 65 64 20 6f  | being pressed o|
0000a160  76 65 72 20 74 68 65 20  45 64 69 74 20 57 69 6e  |ver the Edit Win|
0000a170  64 6f 77 2e 0d 2a 58 04  0d 2a 62 11 2e 53 65 6c  |dow..*X..*b..Sel|
0000a180  65 63 74 49 6e 45 64 69  74 0d 2a 6c 04 0d 2a 76  |ectInEdit.*l..*v|
0000a190  1e 53 54 4d 46 44 20 20  20 20 52 31 33 21 2c 7b  |.STMFD    R13!,{|
0000a1a0  52 30 2d 52 31 32 2c 52  31 34 7d 0d 2a 80 04 0d  |R0-R12,R14}.*...|
0000a1b0  2a 8a 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |*.. MOV      R0,|
0000a1c0  52 38 0d 2a 94 04 0d 2a  9e 52 20 43 4d 50 20 20  |R8.*...*.R CMP  |
0000a1d0  20 20 20 20 52 36 2c 23  39 20 20 20 20 20 20 20  |    R6,#9       |
0000a1e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a1f0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 64  | ;This section d|
0000a200  65 63 72 65 61 73 65 73  20 74 68 65 20 4d 6f 6e  |ecreases the Mon|
0000a210  74 68 20 69 63 6f 6e 2e  0d 2a a8 18 20 20 42 4c  |th icon..*..  BL|
0000a220  45 51 20 20 20 20 20 6d  6f 6e 74 68 64 6f 77 6e  |EQ     monthdown|
0000a230  0d 2a b2 04 0d 2a bc 52  20 43 4d 50 20 20 20 20  |.*...*.R CMP    |
0000a240  20 20 52 36 2c 23 31 30  20 20 20 20 20 20 20 20  |  R6,#10        |
0000a250  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000a260  54 68 69 73 20 73 65 63  74 69 6f 6e 20 69 6e 63  |This section inc|
0000a270  72 65 61 73 65 73 20 74  68 65 20 4d 6f 6e 74 68  |reases the Month|
0000a280  20 69 63 6f 6e 2e 0d 2a  c6 16 20 20 42 4c 45 51  | icon..*..  BLEQ|
0000a290  20 20 20 20 20 6d 6f 6e  74 68 75 70 0d 2a d0 04  |     monthup.*..|
0000a2a0  0d 2a da 51 20 43 4d 50  20 20 20 20 20 20 52 36  |.*.Q CMP      R6|
0000a2b0  2c 23 31 31 20 20 20 20  20 20 20 20 20 20 20 20  |,#11            |
0000a2c0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000a2d0  20 73 65 63 74 69 6f 6e  20 64 65 63 72 65 61 73  | section decreas|
0000a2e0  65 73 20 74 68 65 20 59  65 61 72 20 69 63 6f 6e  |es the Year icon|
0000a2f0  2e 0d 2a e4 12 20 20 ec  51 20 20 20 20 52 31 2c  |..*..  .Q    R1,|
0000a300  23 31 38 0d 2a ee 13 20  20 42 4c 45 51 20 20 20  |#18.*..  BLEQ   |
0000a310  20 20 64 6f 77 6e 0d 2a  f8 04 0d 2b 02 51 20 43  |  down.*...+.Q C|
0000a320  4d 50 20 20 20 20 20 20  52 36 2c 23 31 32 20 20  |MP      R6,#12  |
0000a330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a340  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0000a350  6f 6e 20 69 6e 63 72 65  61 73 65 73 20 74 68 65  |on increases the|
0000a360  20 59 65 61 72 20 69 63  6f 6e 2e 0d 2b 0c 12 20  | Year icon..+.. |
0000a370  20 ec 51 20 20 20 20 52  31 2c 23 31 38 0d 2b 16  | .Q    R1,#18.+.|
0000a380  11 20 20 42 4c 45 51 20  20 20 20 20 75 70 0d 2b  |.  BLEQ     up.+|
0000a390  20 04 0d 2b 2a 52 20 43  4d 50 20 20 20 20 20 20  | ..+*R CMP      |
0000a3a0  52 36 2c 23 31 33 20 20  20 20 20 20 20 20 20 20  |R6,#13          |
0000a3b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
0000a3c0  69 73 20 73 65 63 74 69  6f 6e 20 64 65 63 72 65  |is section decre|
0000a3d0  61 73 65 73 20 74 68 65  20 49 73 73 75 65 20 69  |ases the Issue i|
0000a3e0  63 6f 6e 2e 0d 2b 34 12  20 20 ec 51 20 20 20 20  |con..+4.  .Q    |
0000a3f0  52 31 2c 23 31 39 0d 2b  3e 13 20 20 42 4c 45 51  |R1,#19.+>.  BLEQ|
0000a400  20 20 20 20 20 64 6f 77  6e 0d 2b 48 04 0d 2b 52  |     down.+H..+R|
0000a410  52 20 43 4d 50 20 20 20  20 20 20 52 36 2c 23 31  |R CMP      R6,#1|
0000a420  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
0000a430  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0000a440  63 74 69 6f 6e 20 69 6e  63 72 65 61 73 65 73 20  |ction increases |
0000a450  74 68 65 20 49 73 73 75  65 20 69 63 6f 6e 2e 0d  |the Issue icon..|
0000a460  2b 5c 12 20 20 ec 51 20  20 20 20 52 31 2c 23 31  |+\.  .Q    R1,#1|
0000a470  39 0d 2b 66 11 20 20 42  4c 45 51 20 20 20 20 20  |9.+f.  BLEQ     |
0000a480  75 70 0d 2b 70 04 0d 2b  7a 51 20 43 4d 50 20 20  |up.+p..+zQ CMP  |
0000a490  20 20 20 20 52 36 2c 23  31 35 20 20 20 20 20 20  |    R6,#15      |
0000a4a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a4b0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 64  | ;This section d|
0000a4c0  65 63 72 65 61 73 65 73  20 74 68 65 20 50 61 67  |ecreases the Pag|
0000a4d0  65 20 69 63 6f 6e 2e 0d  2b 84 12 20 20 ec 51 20  |e icon..+..  .Q |
0000a4e0  20 20 20 52 31 2c 23 32  30 0d 2b 8e 13 20 20 42  |   R1,#20.+..  B|
0000a4f0  4c 45 51 20 20 20 20 20  64 6f 77 6e 0d 2b 98 04  |LEQ     down.+..|
0000a500  0d 2b a2 51 20 43 4d 50  20 20 20 20 20 20 52 36  |.+.Q CMP      R6|
0000a510  2c 23 31 36 20 20 20 20  20 20 20 20 20 20 20 20  |,#16            |
0000a520  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000a530  20 73 65 63 74 69 6f 6e  20 69 6e 63 72 65 61 73  | section increas|
0000a540  65 73 20 74 68 65 20 50  61 67 65 20 69 63 6f 6e  |es the Page icon|
0000a550  2e 0d 2b ac 12 20 20 ec  51 20 20 20 20 52 31 2c  |..+..  .Q    R1,|
0000a560  23 32 30 0d 2b b6 11 20  20 42 4c 45 51 20 20 20  |#20.+..  BLEQ   |
0000a570  20 20 75 70 0d 2b c0 04  0d 2b ca 4e 20 43 4d 50  |  up.+...+.N CMP|
0000a580  20 20 20 20 20 20 52 36  2c 23 32 33 20 20 20 20  |      R6,#23    |
0000a590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a5a0  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
0000a5b0  20 63 61 6c 6c 73 20 61  20 73 75 62 72 6f 75 74  | calls a subrout|
0000a5c0  69 6e 65 20 74 6f 0d 2b  d4 49 20 20 42 4c 45 51  |ine to.+.I  BLEQ|
0000a5d0  20 20 20 20 20 73 74 6f  72 65 72 65 63 6f 72 64  |     storerecord|
0000a5e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a5f0  20 3b 61 64 64 20 61 6e  64 2f 6f 72 20 64 65 6c  | ;add and/or del|
0000a600  65 74 65 20 74 68 65 20  72 65 63 6f 72 64 2e 0d  |ete the record..|
0000a610  2b de 12 20 20 ec 51 20  20 20 20 52 30 2c 23 31  |+..  .Q    R0,#1|
0000a620  33 0d 2b e8 16 20 20 53  54 52 45 51 42 20 20 20  |3.+..  STREQB   |
0000a630  52 30 2c 5b 52 39 5d 0d  2b f2 1e 20 20 4c 44 52  |R0,[R9].+..  LDR|
0000a640  45 51 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 65  |EQ    R0,[R12,#e|
0000a650  64 69 74 25 5d 0d 2b fc  11 20 20 ec 51 20 20 20  |dit%].+..  .Q   |
0000a660  20 52 32 2c 52 39 0d 2c  06 12 20 20 ec 51 20 20  | R2,R9.,..  .Q  |
0000a670  20 20 52 31 2c 23 32 32  0d 2c 10 18 20 20 42 4c  |  R1,#22.,..  BL|
0000a680  45 51 20 20 20 20 20 57  72 69 74 65 49 63 6f 6e  |EQ     WriteIcon|
0000a690  0d 2c 1a 04 0d 2c 24 4e  20 43 4d 50 20 20 20 20  |.,...,$N CMP    |
0000a6a0  20 20 52 36 2c 23 32 34  20 20 20 20 20 20 20 20  |  R6,#24        |
0000a6b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000a6c0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 61 6c  |This section cal|
0000a6d0  6c 73 20 61 20 73 75 62  72 6f 75 74 69 6e 65 20  |ls a subroutine |
0000a6e0  74 6f 0d 2c 2e 45 20 20  42 4c 45 51 20 20 20 20  |to.,.E  BLEQ    |
0000a6f0  20 63 61 6e 63 65 6c 65  64 69 74 20 20 20 20 20  | canceledit     |
0000a700  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 6f  |             ;to|
0000a710  20 63 6c 6f 73 65 20 74  68 65 20 65 64 69 74 20  | close the edit |
0000a720  77 69 6e 64 6f 77 2e 0d  2c 38 04 0d 2c 42 4e 20  |window..,8..,BN |
0000a730  43 4d 50 20 20 20 20 20  20 52 36 2c 23 32 36 20  |CMP      R6,#26 |
0000a740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a750  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000a760  69 6f 6e 20 63 61 6c 6c  73 20 61 20 73 75 62 72  |ion calls a subr|
0000a770  6f 75 74 69 6e 65 20 74  6f 0d 2c 4c 3e 20 20 42  |outine to.,L>  B|
0000a780  4c 45 51 20 20 20 20 20  73 74 6f 72 65 72 65 63  |LEQ     storerec|
0000a790  6f 72 64 20 20 20 20 20  20 20 20 20 20 20 20 20  |ord             |
0000a7a0  20 20 20 20 3b 64 65 6c  65 74 65 20 74 68 65 20  |    ;delete the |
0000a7b0  72 65 63 6f 72 64 2e 0d  2c 56 04 0d 2c 60 1e 4c  |record..,V..,`.L|
0000a7c0  44 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |DMFD    R13!,{R0|
0000a7d0  2d 52 31 32 2c 50 43 7d  5e 0d 2c 6a 04 0d 2c 74  |-R12,PC}^.,j..,t|
0000a7e0  52 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |R;--------------|
0000a7f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000a820  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
0000a830  2c 7e 35 3b 20 20 20 20  20 20 20 20 20 20 20 20  |,~5;            |
0000a840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000a850  2a 2a 2a 20 41 64 6a 75  73 74 49 6e 45 64 69 74  |*** AdjustInEdit|
0000a860  20 2a 2a 2a 0d 2c 88 4b  3b 20 54 68 69 73 20 73  | ***.,.K; This s|
0000a870  75 62 72 6f 75 74 69 6e  65 20 64 65 61 6c 73 20  |ubroutine deals |
0000a880  77 69 74 68 20 41 64 6a  75 73 74 20 62 65 69 6e  |with Adjust bein|
0000a890  67 20 63 6c 69 63 6b 65  64 20 6f 76 65 72 20 74  |g clicked over t|
0000a8a0  68 65 20 45 64 69 74 20  77 69 6e 64 6f 77 2e 0d  |he Edit window..|
0000a8b0  2c 92 51 3b 20 4e 42 3b  20 57 68 65 6e 20 41 64  |,.Q; NB; When Ad|
0000a8c0  6a 75 73 74 20 69 73 20  63 6c 69 63 6b 65 64 20  |just is clicked |
0000a8d0  6f 76 65 72 20 74 68 65  20 61 64 6a 75 73 74 65  |over the adjuste|
0000a8e0  72 20 69 63 6f 6e 73 2c  20 74 68 65 20 52 69 73  |r icons, the Ris|
0000a8f0  63 20 4f 53 20 53 74 79  6c 65 20 47 75 69 64 65  |c OS Style Guide|
0000a900  0d 2c 9c 50 3b 20 72 65  71 75 69 72 65 73 20 74  |.,.P; requires t|
0000a910  68 65 20 61 64 6a 75 73  74 6d 65 6e 74 20 74 6f  |he adjustment to|
0000a920  20 62 65 20 6d 61 64 65  20 69 6e 20 74 68 65 20  | be made in the |
0000a930  6f 70 70 6f 73 69 74 65  20 64 69 72 65 63 74 69  |opposite directi|
0000a940  6f 6e 20 74 6f 20 74 68  65 20 61 72 72 6f 77 2e  |on to the arrow.|
0000a950  0d 2c a6 04 0d 2c b0 11  2e 41 64 6a 75 73 74 49  |.,...,...AdjustI|
0000a960  6e 45 64 69 74 0d 2c ba  04 0d 2c c4 1e 53 54 4d  |nEdit.,...,..STM|
0000a970  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
0000a980  31 32 2c 52 31 34 7d 0d  2c ce 04 0d 2c d8 13 20  |12,R14}.,...,.. |
0000a990  4d 4f 56 20 20 20 20 20  20 52 30 2c 52 38 0d 2c  |MOV      R0,R8.,|
0000a9a0  e2 04 0d 2c ec 52 20 43  4d 50 20 20 20 20 20 20  |...,.R CMP      |
0000a9b0  52 36 2c 23 39 20 20 20  20 20 20 20 20 20 20 20  |R6,#9           |
0000a9c0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
0000a9d0  69 73 20 73 65 63 74 69  6f 6e 20 69 6e 63 72 65  |is section incre|
0000a9e0  61 73 65 73 20 74 68 65  20 4d 6f 6e 74 68 20 69  |ases the Month i|
0000a9f0  63 6f 6e 2e 0d 2c f6 16  20 20 42 4c 45 51 20 20  |con..,..  BLEQ  |
0000aa00  20 20 20 6d 6f 6e 74 68  75 70 0d 2d 00 04 0d 2d  |   monthup.-...-|
0000aa10  0a 52 20 43 4d 50 20 20  20 20 20 20 52 36 2c 23  |.R CMP      R6,#|
0000aa20  31 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |10              |
0000aa30  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000aa40  65 63 74 69 6f 6e 20 64  65 63 72 65 61 73 65 73  |ection decreases|
0000aa50  20 74 68 65 20 4d 6f 6e  74 68 20 49 63 6f 6e 2e  | the Month Icon.|
0000aa60  0d 2d 14 18 20 20 42 4c  45 51 20 20 20 20 20 6d  |.-..  BLEQ     m|
0000aa70  6f 6e 74 68 64 6f 77 6e  0d 2d 1e 04 0d 2d 28 51  |onthdown.-...-(Q|
0000aa80  20 43 4d 50 20 20 20 20  20 20 52 36 2c 23 31 31  | CMP      R6,#11|
0000aa90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000aaa0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
0000aab0  74 69 6f 6e 20 69 6e 63  72 65 61 73 65 73 20 74  |tion increases t|
0000aac0  68 65 20 59 65 61 72 20  69 63 6f 6e 2e 0d 2d 32  |he Year icon..-2|
0000aad0  12 20 20 ec 51 20 20 20  20 52 31 2c 23 31 38 0d  |.  .Q    R1,#18.|
0000aae0  2d 3c 11 20 20 42 4c 45  51 20 20 20 20 20 75 70  |-<.  BLEQ     up|
0000aaf0  0d 2d 46 04 0d 2d 50 51  20 43 4d 50 20 20 20 20  |.-F..-PQ CMP    |
0000ab00  20 20 52 36 2c 23 31 32  20 20 20 20 20 20 20 20  |  R6,#12        |
0000ab10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000ab20  54 68 69 73 20 73 65 63  74 69 6f 6e 20 64 65 63  |This section dec|
0000ab30  72 65 61 73 65 73 20 74  68 65 20 59 65 61 72 20  |reases the Year |
0000ab40  69 63 6f 6e 2e 0d 2d 5a  12 20 20 ec 51 20 20 20  |icon..-Z.  .Q   |
0000ab50  20 52 31 2c 23 31 38 0d  2d 64 13 20 20 42 4c 45  | R1,#18.-d.  BLE|
0000ab60  51 20 20 20 20 20 64 6f  77 6e 0d 2d 6e 04 0d 2d  |Q     down.-n..-|
0000ab70  78 52 20 43 4d 50 20 20  20 20 20 20 52 36 2c 23  |xR CMP      R6,#|
0000ab80  31 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |13              |
0000ab90  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000aba0  65 63 74 69 6f 6e 20 69  6e 63 72 65 61 73 65 73  |ection increases|
0000abb0  20 74 68 65 20 49 73 73  75 65 20 69 63 6f 6e 2e  | the Issue icon.|
0000abc0  0d 2d 82 12 20 20 ec 51  20 20 20 20 52 31 2c 23  |.-..  .Q    R1,#|
0000abd0  31 39 0d 2d 8c 11 20 20  42 4c 45 51 20 20 20 20  |19.-..  BLEQ    |
0000abe0  20 75 70 0d 2d 96 04 0d  2d a0 52 20 43 4d 50 20  | up.-...-.R CMP |
0000abf0  20 20 20 20 20 52 36 2c  23 31 34 20 20 20 20 20  |     R6,#14     |
0000ac00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ac10  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000ac20  64 65 63 72 65 61 73 65  73 20 74 68 65 20 49 73  |decreases the Is|
0000ac30  73 75 65 20 69 63 6f 6e  2e 0d 2d aa 12 20 20 ec  |sue icon..-..  .|
0000ac40  51 20 20 20 20 52 31 2c  23 31 39 0d 2d b4 13 20  |Q    R1,#19.-.. |
0000ac50  20 42 4c 45 51 20 20 20  20 20 64 6f 77 6e 0d 2d  | BLEQ     down.-|
0000ac60  be 04 0d 2d c8 51 20 43  4d 50 20 20 20 20 20 20  |...-.Q CMP      |
0000ac70  52 36 2c 23 31 35 20 20  20 20 20 20 20 20 20 20  |R6,#15          |
0000ac80  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
0000ac90  69 73 20 73 65 63 74 69  6f 6e 20 69 6e 63 72 65  |is section incre|
0000aca0  61 73 65 73 20 74 68 65  20 50 61 67 65 20 69 63  |ases the Page ic|
0000acb0  6f 6e 2e 0d 2d d2 12 20  20 ec 51 20 20 20 20 52  |on..-..  .Q    R|
0000acc0  31 2c 23 32 30 0d 2d dc  11 20 20 42 4c 45 51 20  |1,#20.-..  BLEQ |
0000acd0  20 20 20 20 75 70 0d 2d  e6 04 0d 2d f0 51 20 43  |    up.-...-.Q C|
0000ace0  4d 50 20 20 20 20 20 20  52 36 2c 23 31 36 20 20  |MP      R6,#16  |
0000acf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ad00  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0000ad10  6f 6e 20 64 65 63 72 65  61 73 65 73 20 74 68 65  |on decreases the|
0000ad20  20 50 61 67 65 20 69 63  6f 6e 2e 0d 2d fa 12 20  | Page icon..-.. |
0000ad30  20 ec 51 20 20 20 20 52  31 2c 23 32 30 0d 2e 04  | .Q    R1,#20...|
0000ad40  13 20 20 42 4c 45 51 20  20 20 20 20 64 6f 77 6e  |.  BLEQ     down|
0000ad50  0d 2e 0e 04 0d 2e 18 4e  20 43 4d 50 20 20 20 20  |.......N CMP    |
0000ad60  20 20 52 36 2c 23 32 33  20 20 20 20 20 20 20 20  |  R6,#23        |
0000ad70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000ad80  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 61 6c  |This section cal|
0000ad90  6c 73 20 61 20 73 75 62  72 6f 75 74 69 6e 65 20  |ls a subroutine |
0000ada0  74 6f 0d 2e 22 49 20 20  42 4c 45 51 20 20 20 20  |to.."I  BLEQ    |
0000adb0  20 73 74 6f 72 65 72 65  63 6f 72 64 20 20 20 20  | storerecord    |
0000adc0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 41 64  |             ;Ad|
0000add0  64 20 61 6e 64 2f 6f 72  20 44 65 6c 65 74 65 20  |d and/or Delete |
0000ade0  74 68 65 20 72 65 63 6f  72 64 2e 0d 2e 2c 12 20  |the record...,. |
0000adf0  20 ec 51 20 20 20 20 52  30 2c 23 31 33 0d 2e 36  | .Q    R0,#13..6|
0000ae00  16 20 20 53 54 52 45 51  42 20 20 20 52 30 2c 5b  |.  STREQB   R0,[|
0000ae10  52 39 5d 0d 2e 40 1e 20  20 4c 44 52 45 51 20 20  |R9]..@.  LDREQ  |
0000ae20  20 20 52 30 2c 5b 52 31  32 2c 23 65 64 69 74 25  |  R0,[R12,#edit%|
0000ae30  5d 0d 2e 4a 11 20 20 ec  51 20 20 20 20 52 32 2c  |]..J.  .Q    R2,|
0000ae40  52 39 0d 2e 54 12 20 20  ec 51 20 20 20 20 52 31  |R9..T.  .Q    R1|
0000ae50  2c 23 32 32 0d 2e 5e 18  20 20 42 4c 45 51 20 20  |,#22..^.  BLEQ  |
0000ae60  20 20 20 57 72 69 74 65  49 63 6f 6e 0d 2e 68 04  |   WriteIcon..h.|
0000ae70  0d 2e 72 4e 20 43 4d 50  20 20 20 20 20 20 52 36  |..rN CMP      R6|
0000ae80  2c 23 32 34 20 20 20 20  20 20 20 20 20 20 20 20  |,#24            |
0000ae90  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000aea0  20 73 65 63 74 69 6f 6e  20 63 61 6c 6c 73 20 61  | section calls a|
0000aeb0  20 73 75 62 72 6f 75 74  69 6e 65 20 74 6f 0d 2e  | subroutine to..|
0000aec0  7c 41 20 20 42 4c 45 51  20 20 20 20 20 63 61 6e  ||A  BLEQ     can|
0000aed0  63 65 6c 65 64 69 74 20  20 20 20 20 20 20 20 20  |celedit         |
0000aee0  20 20 20 20 20 20 20 20  20 3b 63 6c 6f 73 65 20  |         ;close |
0000aef0  74 68 65 20 45 64 69 74  20 77 69 6e 64 6f 77 0d  |the Edit window.|
0000af00  2e 86 04 0d 2e 90 4e 20  43 4d 50 20 20 20 20 20  |......N CMP     |
0000af10  20 52 36 2c 23 32 36 20  20 20 20 20 20 20 20 20  | R6,#26         |
0000af20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0000af30  68 69 73 20 73 65 63 74  69 6f 6e 20 63 61 6c 6c  |his section call|
0000af40  73 20 61 20 73 75 62 72  6f 75 74 69 6e 65 20 74  |s a subroutine t|
0000af50  6f 0d 2e 9a 3e 20 20 42  4c 45 51 20 20 20 20 20  |o...>  BLEQ     |
0000af60  73 74 6f 72 65 72 65 63  6f 72 64 20 20 20 20 20  |storerecord     |
0000af70  20 20 20 20 20 20 20 20  20 20 20 20 3b 64 65 6c  |            ;del|
0000af80  65 74 65 20 74 68 65 20  72 65 63 6f 72 64 2e 0d  |ete the record..|
0000af90  2e a4 04 0d 2e ae 1e 4c  44 4d 46 44 20 20 20 20  |.......LDMFD    |
0000afa0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
0000afb0  5e 0d 2e b8 04 0d 2e c2  52 3b 2d 2d 2d 2d 2d 2d  |^.......R;------|
0000afc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000b000  2d 2d 2d 2d 2d 2d 2d 0d  2e cc 34 3b 20 20 20 20  |-------...4;    |
0000b010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b020  20 20 20 20 20 20 20 20  20 2a 2a 2a 20 43 61 6e  |         *** Can|
0000b030  63 65 6c 45 64 69 74 20  2a 2a 2a 0d 2e d6 2d 3b  |celEdit ***...-;|
0000b040  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
0000b050  20 63 6c 6f 73 65 73 20  74 68 65 20 45 64 69 74  | closes the Edit|
0000b060  20 57 69 6e 64 6f 77 2e  0d 2e e0 04 0d 2e ea 0f  | Window.........|
0000b070  2e 63 61 6e 63 65 6c 65  64 69 74 0d 2e f4 04 0d  |.canceledit.....|
0000b080  2e fe 1e 53 54 4d 46 44  20 20 20 20 52 31 33 21  |...STMFD    R13!|
0000b090  2c 7b 52 30 2d 52 31 32  2c 52 31 34 7d 0d 2f 08  |,{R0-R12,R14}./.|
0000b0a0  04 0d 2f 12 1d 20 4c 44  52 20 20 20 20 20 20 52  |../.. LDR      R|
0000b0b0  30 2c 5b 52 31 32 2c 23  65 64 69 74 25 5d 0d 2f  |0,[R12,#edit%]./|
0000b0c0  1c 20 20 53 54 52 20 20  20 20 20 20 52 30 2c 5b  |.  STR      R0,[|
0000b0d0  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 30 5d 0d 2f  |R12,#block%+0]./|
0000b0e0  26 1c 20 41 44 44 20 20  20 20 20 20 52 31 2c 52  |&. ADD      R1,R|
0000b0f0  31 32 2c 23 62 6c 6f 63  6b 25 0d 2f 30 20 20 53  |12,#block%./0  S|
0000b100  57 49 20 20 20 20 20 20  22 57 69 6d 70 5f 43 6c  |WI      "Wimp_Cl|
0000b110  6f 73 65 57 69 6e 64 6f  77 22 0d 2f 3a 04 0d 2f  |oseWindow"./:../|
0000b120  44 1e 4c 44 4d 46 44 20  20 20 20 52 31 33 21 2c  |D.LDMFD    R13!,|
0000b130  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 2f 4e 04  |{R0-R12,PC}^./N.|
0000b140  0d 2f 58 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |./XR;-----------|
0000b150  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000b190  2d 2d 0d 2f 62 31 3b 20  20 20 20 20 20 20 20 20  |--./b1;         |
0000b1a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b1b0  20 20 2a 2a 2a 20 4d 6f  6e 74 68 44 6f 77 6e 20  |  *** MonthDown |
0000b1c0  2a 2a 2a 0d 2f 6c 3c 3b  20 54 68 69 73 20 73 75  |***./l<; This su|
0000b1d0  62 72 6f 75 74 69 6e 65  20 64 65 63 72 65 61 73  |broutine decreas|
0000b1e0  65 73 20 74 68 65 20 76  61 6c 75 65 20 69 6e 20  |es the value in |
0000b1f0  74 68 65 20 4d 6f 6e 74  68 20 69 63 6f 6e 2e 0d  |the Month icon..|
0000b200  2f 76 04 0d 2f 80 0e 2e  6d 6f 6e 74 68 64 6f 77  |/v../...monthdow|
0000b210  6e 0d 2f 8a 04 0d 2f 94  1e 53 54 4d 46 44 20 20  |n./.../..STMFD  |
0000b220  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 52  |  R13!,{R0-R12,R|
0000b230  31 34 7d 0d 2f 9e 04 0d  2f a8 4c 20 4c 44 52 20  |14}./.../.L LDR |
0000b240  20 20 20 20 20 52 30 2c  5b 52 31 30 2c 23 65 64  |     R0,[R10,#ed|
0000b250  69 74 6d 6f 6e 74 68 25  5d 20 20 20 20 20 20 3b  |itmonth%]      ;|
0000b260  54 68 69 73 20 73 65 63  74 69 6f 6e 20 64 65 63  |This section dec|
0000b270  72 65 61 73 65 73 20 74  68 65 20 76 61 6c 75 65  |reases the value|
0000b280  20 6f 66 0d 2f b2 4e 20  43 4d 50 20 20 20 20 20  | of./.N CMP     |
0000b290  20 52 30 2c 23 31 20 20  20 20 20 20 20 20 20 20  | R0,#1          |
0000b2a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
0000b2b0  68 65 20 43 75 72 72 65  6e 74 20 4d 6f 6e 74 68  |he Current Month|
0000b2c0  2e 20 49 74 20 69 73 20  73 65 74 20 74 6f 20 31  |. It is set to 1|
0000b2d0  33 0d 2f bc 40 20 20 ec  51 20 20 20 20 52 30 2c  |3./.@  .Q    R0,|
0000b2e0  23 31 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |#13             |
0000b2f0  20 20 20 20 20 20 20 20  20 3b 69 66 20 69 74 20  |         ;if it |
0000b300  77 61 73 20 6f 72 69 67  69 6e 61 6c 6c 79 20 31  |was originally 1|
0000b310  2e 0d 2f c6 17 20 20 53  55 42 4e 45 20 20 20 20  |../..  SUBNE    |
0000b320  52 30 2c 52 30 2c 23 31  0d 2f d0 22 20 53 54 52  |R0,R0,#1./." STR|
0000b330  20 20 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 65  |      R0,[R10,#e|
0000b340  64 69 74 6d 6f 6e 74 68  25 5d 0d 2f da 04 0d 2f  |ditmonth%]./.../|
0000b350  e4 4d 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |.M MOV      R2,#|
0000b360  6d 6f 6e 74 68 73 25 2d  26 31 30 20 20 20 20 20  |months%-&10     |
0000b370  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000b380  65 63 74 69 6f 6e 20 67  65 74 73 20 74 68 65 20  |ection gets the |
0000b390  6e 61 6d 65 20 6f 66 20  74 68 65 0d 2f ee 4f 20  |name of the./.O |
0000b3a0  41 44 44 20 20 20 20 20  20 52 32 2c 52 32 2c 52  |ADD      R2,R2,R|
0000b3b0  30 2c 4c 53 4c 20 23 34  20 20 20 20 20 20 20 20  |0,LSL #4        |
0000b3c0  20 20 20 20 20 20 3b 6f  66 20 74 68 65 20 43 75  |      ;of the Cu|
0000b3d0  72 72 65 6e 74 20 4d 6f  6e 74 68 20 66 72 6f 6d  |rrent Month from|
0000b3e0  20 61 20 6c 6f 6f 6b 2d  75 70 0d 2f f8 4e 20 41  | a look-up./.N A|
0000b3f0  44 44 20 20 20 20 20 20  52 32 2c 52 31 30 2c 52  |DD      R2,R10,R|
0000b400  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
0000b410  20 20 20 20 20 3b 74 61  62 6c 65 20 61 6e 64 20  |     ;table and |
0000b420  77 72 69 74 65 73 20 69  74 20 69 6e 74 6f 20 74  |writes it into t|
0000b430  68 65 20 4d 6f 6e 74 68  0d 30 02 31 20 4d 4f 56  |he Month.0.1 MOV|
0000b440  20 20 20 20 20 20 52 31  2c 23 31 37 20 20 20 20  |      R1,#17    |
0000b450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b460  20 20 20 3b 69 63 6f 6e  2e 0d 30 0c 1d 20 4c 44  |   ;icon..0.. LD|
0000b470  52 20 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |R      R0,[R12,#|
0000b480  65 64 69 74 25 5d 0d 30  16 17 20 42 4c 20 20 20  |edit%].0.. BL   |
0000b490  20 20 20 20 57 72 69 74  65 49 63 6f 6e 0d 30 20  |    WriteIcon.0 |
0000b4a0  04 0d 30 2a 1e 4c 44 4d  46 44 20 20 20 20 52 31  |..0*.LDMFD    R1|
0000b4b0  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
0000b4c0  30 34 04 0d 30 3e 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |04..0>R;--------|
0000b4d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000b510  2d 2d 2d 2d 2d 0d 30 48  2f 3b 20 20 20 20 20 20  |-----.0H/;      |
0000b520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b530  20 20 20 20 20 2a 2a 2a  20 4d 6f 6e 74 68 55 70  |     *** MonthUp|
0000b540  20 2a 2a 2a 0d 30 52 3c  3b 20 54 68 69 73 20 73  | ***.0R<; This s|
0000b550  75 62 72 6f 75 74 69 6e  65 20 69 6e 63 72 65 61  |ubroutine increa|
0000b560  73 65 73 20 74 68 65 20  76 61 6c 75 65 20 6f 66  |ses the value of|
0000b570  20 74 68 65 20 4d 6f 6e  74 68 20 69 63 6f 6e 2e  | the Month icon.|
0000b580  0d 30 5c 04 0d 30 66 0c  2e 6d 6f 6e 74 68 75 70  |.0\..0f..monthup|
0000b590  0d 30 70 04 0d 30 7a 1e  53 54 4d 46 44 20 20 20  |.0p..0z.STMFD   |
0000b5a0  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 52 31  | R13!,{R0-R12,R1|
0000b5b0  34 7d 0d 30 84 04 0d 30  8e 4c 20 4c 44 52 20 20  |4}.0...0.L LDR  |
0000b5c0  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 65 64 69  |    R0,[R10,#edi|
0000b5d0  74 6d 6f 6e 74 68 25 5d  20 20 20 20 20 20 3b 54  |tmonth%]      ;T|
0000b5e0  68 69 73 20 73 65 63 74  69 6f 6e 20 69 6e 63 72  |his section incr|
0000b5f0  65 61 73 65 73 20 74 68  65 20 76 61 6c 75 65 20  |eases the value |
0000b600  6f 66 0d 30 98 50 20 43  4d 50 20 20 20 20 20 20  |of.0.P CMP      |
0000b610  52 30 2c 23 31 33 20 20  20 20 20 20 20 20 20 20  |R0,#13          |
0000b620  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 68  |             ;th|
0000b630  65 20 43 75 72 72 65 6e  74 20 4d 6f 6e 74 68 2e  |e Current Month.|
0000b640  20 49 74 20 69 73 20 73  65 74 20 74 6f 20 31 20  | It is set to 1 |
0000b650  69 66 0d 30 a2 41 20 20  ec 51 20 20 20 20 52 30  |if.0.A  .Q    R0|
0000b660  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
0000b670  20 20 20 20 20 20 20 20  20 20 3b 69 66 20 69 74  |          ;if it|
0000b680  20 77 61 73 20 6f 72 69  67 69 6e 61 6c 6c 79 20  | was originally |
0000b690  31 33 2e 0d 30 ac 17 20  20 41 44 44 4e 45 20 20  |13..0..  ADDNE  |
0000b6a0  20 20 52 30 2c 52 30 2c  23 31 0d 30 b6 22 20 53  |  R0,R0,#1.0." S|
0000b6b0  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |TR      R0,[R10,|
0000b6c0  23 65 64 69 74 6d 6f 6e  74 68 25 5d 0d 30 c0 04  |#editmonth%].0..|
0000b6d0  0d 30 ca 4d 20 4d 4f 56  20 20 20 20 20 20 52 32  |.0.M MOV      R2|
0000b6e0  2c 23 6d 6f 6e 74 68 73  25 2d 26 31 30 20 20 20  |,#months%-&10   |
0000b6f0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000b700  20 73 65 63 74 69 6f 6e  20 67 65 74 73 20 74 68  | section gets th|
0000b710  65 20 6e 61 6d 65 20 6f  66 20 74 68 65 0d 30 d4  |e name of the.0.|
0000b720  4c 20 41 44 44 20 20 20  20 20 20 52 32 2c 52 32  |L ADD      R2,R2|
0000b730  2c 52 30 2c 4c 53 4c 20  23 34 20 20 20 20 20 20  |,R0,LSL #4      |
0000b740  20 20 20 20 20 20 20 20  3b 74 68 65 20 63 75 72  |        ;the cur|
0000b750  72 65 6e 74 20 6d 6f 6e  74 68 20 66 72 6f 6d 20  |rent month from |
0000b760  61 20 6c 6f 6f 6b 2d 75  70 0d 30 de 4e 20 41 44  |a look-up.0.N AD|
0000b770  44 20 20 20 20 20 20 52  32 2c 52 31 30 2c 52 32  |D      R2,R10,R2|
0000b780  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b790  20 20 20 20 3b 74 61 62  6c 65 20 61 6e 64 20 77  |    ;table and w|
0000b7a0  72 69 74 65 73 20 69 74  20 69 6e 74 6f 20 74 68  |rites it into th|
0000b7b0  65 20 6d 6f 6e 74 68 0d  30 e8 31 20 4d 4f 56 20  |e month.0.1 MOV |
0000b7c0  20 20 20 20 20 52 31 2c  23 31 37 20 20 20 20 20  |     R1,#17     |
0000b7d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b7e0  20 20 3b 69 63 6f 6e 2e  0d 30 f2 1d 20 4c 44 52  |  ;icon..0.. LDR|
0000b7f0  20 20 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 65  |      R0,[R12,#e|
0000b800  64 69 74 25 5d 0d 30 fc  17 20 42 4c 20 20 20 20  |dit%].0.. BL    |
0000b810  20 20 20 57 72 69 74 65  49 63 6f 6e 0d 31 06 04  |   WriteIcon.1..|
0000b820  0d 31 10 1e 4c 44 4d 46  44 20 20 20 20 52 31 33  |.1..LDMFD    R13|
0000b830  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 31  |!,{R0-R12,PC}^.1|
0000b840  1a 04 0d 31 24 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...1$R;---------|
0000b850  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000b890  2d 2d 2d 2d 0d 31 2e 2d  3b 20 20 20 20 20 20 20  |----.1.-;       |
0000b8a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b8b0  20 20 20 20 20 20 20 2a  2a 2a 20 55 70 20 2a 2a  |       *** Up **|
0000b8c0  2a 0d 31 38 4d 3b 20 54  68 69 73 20 73 75 62 72  |*.18M; This subr|
0000b8d0  6f 75 74 69 6e 65 20 69  6e 63 72 65 61 73 65 73  |outine increases|
0000b8e0  20 74 68 65 20 76 61 6c  75 65 20 6f 66 20 74 68  | the value of th|
0000b8f0  65 20 69 63 6f 6e 20 73  70 65 63 69 66 69 65 64  |e icon specified|
0000b900  20 62 79 20 74 68 65 20  57 69 6e 64 6f 77 0d 31  | by the Window.1|
0000b910  42 2c 3b 20 48 61 6e 64  6c 65 20 69 6e 20 52 30  |B,; Handle in R0|
0000b920  20 61 6e 64 20 61 6e 20  49 63 6f 6e 20 48 61 6e  | and an Icon Han|
0000b930  64 6c 65 20 69 6e 20 52  31 2e 0d 31 4c 04 0d 31  |dle in R1..1L..1|
0000b940  56 07 2e 75 70 0d 31 60  04 0d 31 6a 1e 53 54 4d  |V..up.1`..1j.STM|
0000b950  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
0000b960  31 32 2c 52 31 34 7d 0d  31 74 04 0d 31 7e 4e 20  |12,R14}.1t..1~N |
0000b970  4d 4f 56 20 20 20 20 20  20 52 32 2c 52 39 20 20  |MOV      R2,R9  |
0000b980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b990  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000b9a0  69 6f 6e 20 72 65 61 64  73 20 74 68 65 20 73 74  |ion reads the st|
0000b9b0  72 69 6e 67 20 66 72 6f  6d 0d 31 88 52 20 42 4c  |ring from.1.R BL|
0000b9c0  20 20 20 20 20 20 20 52  65 61 64 49 63 6f 6e 20  |       ReadIcon |
0000b9d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b9e0  20 20 20 20 3b 74 68 65  20 69 63 6f 6e 20 73 70  |    ;the icon sp|
0000b9f0  65 63 69 66 69 65 64 20  61 6e 64 20 66 69 6e 64  |ecified and find|
0000ba00  20 69 74 73 20 76 61 6c  75 65 2e 0d 31 92 13 20  | its value..1.. |
0000ba10  4d 4f 56 20 20 20 20 20  20 52 38 2c 52 30 0d 31  |MOV      R8,R0.1|
0000ba20  9c 13 20 4d 4f 56 20 20  20 20 20 20 52 37 2c 52  |.. MOV      R7,R|
0000ba30  31 0d 31 a6 13 20 4d 4f  56 20 20 20 20 20 20 52  |1.1.. MOV      R|
0000ba40  30 2c 52 32 0d 31 b0 14  20 4d 4f 56 20 20 20 20  |0,R2.1.. MOV    |
0000ba50  20 20 52 31 2c 23 31 33  0d 31 ba 1a 20 53 57 49  |  R1,#13.1.. SWI|
0000ba60  20 20 20 20 20 20 22 53  74 72 69 6e 67 5f 56 61  |      "String_Va|
0000ba70  6c 22 0d 31 c4 04 0d 31  ce 4f 20 4d 4f 56 20 20  |l".1...1.O MOV  |
0000ba80  20 20 20 20 52 30 2c 20  20 20 23 26 32 37 30 30  |    R0,   #&2700|
0000ba90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000baa0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
0000bab0  68 65 63 6b 73 20 69 66  20 74 68 65 20 76 61 6c  |hecks if the val|
0000bac0  75 65 20 69 73 0d 31 d8  51 20 41 44 44 20 20 20  |ue is.1.Q ADD   |
0000bad0  20 20 20 52 30 2c 52 30  2c 23 26 30 30 30 46 20  |   R0,R0,#&000F |
0000bae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000baf0  3b 39 39 39 39 20 28 26  32 37 30 46 29 20 61 6e  |;9999 (&270F) an|
0000bb00  64 20 69 66 20 73 6f 20  73 65 74 73 20 74 68 65  |d if so sets the|
0000bb10  20 76 61 6c 75 65 0d 31  e2 4e 20 43 4d 50 20 20  | value.1.N CMP  |
0000bb20  20 20 20 20 52 31 2c 52  30 20 20 20 20 20 20 20  |    R1,R0       |
0000bb30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000bb40  20 3b 74 6f 20 7a 65 72  6f 20 6f 74 68 65 72 77  | ;to zero otherw|
0000bb50  69 73 65 20 69 74 20 69  6e 63 65 6d 65 6e 74 73  |ise it incements|
0000bb60  20 69 74 2e 0d 31 ec 11  20 20 ec 51 20 20 20 20  | it..1..  .Q    |
0000bb70  52 31 2c 23 30 0d 31 f6  17 20 20 41 44 44 4e 45  |R1,#0.1..  ADDNE|
0000bb80  20 20 20 20 52 31 2c 52  31 2c 23 31 0d 32 00 04  |    R1,R1,#1.2..|
0000bb90  0d 32 0a 4f 20 4d 4f 56  20 20 20 20 20 20 52 30  |.2.O MOV      R0|
0000bba0  2c 52 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R1             |
0000bbb0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000bbc0  20 73 65 63 74 69 6f 6e  20 63 6f 6e 76 65 72 74  | section convert|
0000bbd0  73 20 74 68 65 20 6e 65  77 20 76 61 6c 75 65 0d  |s the new value.|
0000bbe0  32 14 4f 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |2.O MOV      R1,|
0000bbf0  52 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R9              |
0000bc00  20 20 20 20 20 20 20 20  20 20 3b 74 6f 20 69 74  |          ;to it|
0000bc10  73 20 73 74 72 69 6e 67  20 65 71 75 69 76 65 6c  |s string equivel|
0000bc20  65 6e 74 20 61 6e 64 20  77 72 69 74 65 73 0d 32  |ent and writes.2|
0000bc30  1e 4a 20 4d 4f 56 20 20  20 20 20 20 52 36 2c 23  |.J MOV      R6,#|
0000bc40  26 31 30 30 20 20 20 20  20 20 20 20 20 20 20 20  |&100            |
0000bc50  20 20 20 20 20 20 20 20  20 3b 69 74 20 62 61 63  |         ;it bac|
0000bc60  6b 20 69 6e 74 6f 20 61  70 70 72 6f 70 72 69 61  |k into appropria|
0000bc70  74 65 20 69 63 6f 6e 2e  0d 32 28 22 20 53 57 49  |te icon..2(" SWI|
0000bc80  20 20 20 20 20 20 22 4f  53 5f 43 6f 6e 76 65 72  |      "OS_Conver|
0000bc90  74 49 6e 74 65 67 65 72  32 22 0d 32 32 14 20 4d  |tInteger2".22. M|
0000bca0  4f 56 20 20 20 20 20 20  52 30 2c 23 31 33 0d 32  |OV      R0,#13.2|
0000bcb0  3c 15 20 53 54 52 42 20  20 20 20 20 52 30 2c 5b  |<. STRB     R0,[|
0000bcc0  52 31 5d 0d 32 46 13 20  4d 4f 56 20 20 20 20 20  |R1].2F. MOV     |
0000bcd0  20 52 30 2c 52 38 0d 32  50 13 20 4d 4f 56 20 20  | R0,R8.2P. MOV  |
0000bce0  20 20 20 20 52 31 2c 52  37 0d 32 5a 13 20 4d 4f  |    R1,R7.2Z. MO|
0000bcf0  56 20 20 20 20 20 20 52  32 2c 52 39 0d 32 64 17  |V      R2,R9.2d.|
0000bd00  20 42 4c 20 20 20 20 20  20 20 57 72 69 74 65 49  | BL       WriteI|
0000bd10  63 6f 6e 0d 32 6e 04 0d  32 78 1e 4c 44 4d 46 44  |con.2n..2x.LDMFD|
0000bd20  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
0000bd30  2c 50 43 7d 5e 0d 32 82  04 0d 32 8c 52 3b 2d 2d  |,PC}^.2...2.R;--|
0000bd40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000bd80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 32 96 2d 3b  |-----------.2.-;|
0000bd90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000bda0  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
0000bdb0  44 6f 77 6e 20 2a 2a 2a  0d 32 a0 4d 3b 20 54 68  |Down ***.2.M; Th|
0000bdc0  69 73 20 73 75 62 72 6f  75 74 69 6e 65 20 64 65  |is subroutine de|
0000bdd0  63 72 65 61 73 65 73 20  74 68 65 20 76 61 6c 75  |creases the valu|
0000bde0  65 20 6f 66 20 74 68 65  20 69 63 6f 6e 20 73 70  |e of the icon sp|
0000bdf0  65 63 69 66 69 65 64 20  62 79 20 74 68 65 20 57  |ecified by the W|
0000be00  69 6e 64 6f 77 0d 32 aa  2d 3b 20 68 61 6e 64 6c  |indow.2.-; handl|
0000be10  65 20 69 6e 20 52 30 20  61 6e 64 20 74 68 65 20  |e in R0 and the |
0000be20  49 63 6f 6e 20 68 61 6e  64 6c 65 20 69 6e 20 52  |Icon handle in R|
0000be30  31 2e 0d 32 b4 04 0d 32  be 09 2e 64 6f 77 6e 0d  |1..2...2...down.|
0000be40  32 c8 04 0d 32 d2 1e 53  54 4d 46 44 20 20 20 20  |2...2..STMFD    |
0000be50  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 52 31 34  |R13!,{R0-R12,R14|
0000be60  7d 0d 32 dc 04 0d 32 e6  52 20 4d 4f 56 20 20 20  |}.2...2.R MOV   |
0000be70  20 20 20 52 32 2c 52 39  20 20 20 20 20 20 20 20  |   R2,R9        |
0000be80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000be90  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
0000bea0  61 64 73 20 74 68 65 20  73 74 72 69 6e 67 20 66  |ads the string f|
0000beb0  72 6f 6d 20 74 68 65 0d  32 f0 4e 20 42 4c 20 20  |rom the.2.N BL  |
0000bec0  20 20 20 20 20 52 65 61  64 49 63 6f 6e 20 20 20  |     ReadIcon   |
0000bed0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000bee0  20 20 3b 69 63 6f 6e 20  73 70 65 63 69 66 69 65  |  ;icon specifie|
0000bef0  64 20 61 6e 64 20 66 69  6e 73 20 69 74 73 20 76  |d and fins its v|
0000bf00  61 6c 75 65 2e 0d 32 fa  13 20 4d 4f 56 20 20 20  |alue..2.. MOV   |
0000bf10  20 20 20 52 38 2c 52 30  0d 33 04 13 20 4d 4f 56  |   R8,R0.3.. MOV|
0000bf20  20 20 20 20 20 20 52 37  2c 52 31 0d 33 0e 13 20  |      R7,R1.3.. |
0000bf30  4d 4f 56 20 20 20 20 20  20 52 30 2c 52 32 0d 33  |MOV      R0,R2.3|
0000bf40  18 14 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 23  |.. MOV      R1,#|
0000bf50  31 33 0d 33 22 1a 20 53  57 49 20 20 20 20 20 20  |13.3". SWI      |
0000bf60  22 53 74 72 69 6e 67 5f  56 61 6c 22 0d 33 2c 04  |"String_Val".3,.|
0000bf70  0d 33 36 51 20 43 4d 50  20 20 20 20 20 20 52 31  |.36Q CMP      R1|
0000bf80  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
0000bf90  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000bfa0  20 73 65 63 74 69 6f 6e  20 63 68 65 63 6b 73 20  | section checks |
0000bfb0  69 66 20 74 68 65 20 76  61 6c 75 65 20 69 73 20  |if the value is |
0000bfc0  30 0d 33 40 4a 20 20 ec  51 20 20 20 20 52 31 2c  |0.3@J  .Q    R1,|
0000bfd0  20 20 20 23 26 32 37 30  30 20 20 20 20 20 20 20  |   #&2700       |
0000bfe0  20 20 20 20 20 20 20 20  20 3b 61 6e 64 20 69 66  |         ;and if|
0000bff0  20 73 6f 20 73 65 74 73  20 69 74 20 74 6f 20 39  | so sets it to 9|
0000c000  39 39 39 20 28 26 32 37  30 34 29 0d 33 4a 47 20  |999 (&2704).3JG |
0000c010  20 41 44 44 45 51 20 20  20 20 52 31 2c 52 31 2c  | ADDEQ    R1,R1,|
0000c020  23 26 30 30 30 46 20 20  20 20 20 20 20 20 20 20  |#&000F          |
0000c030  20 20 20 20 20 20 3b 6f  74 68 65 72 77 69 73 65  |      ;otherwise|
0000c040  20 69 74 20 64 65 63 72  65 6d 65 6e 74 73 20 69  | it decrements i|
0000c050  74 2e 0d 33 54 17 20 20  53 55 42 4e 45 20 20 20  |t..3T.  SUBNE   |
0000c060  20 52 31 2c 52 31 2c 23  31 0d 33 5e 04 0d 33 68  | R1,R1,#1.3^..3h|
0000c070  4f 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 52 31  |O MOV      R0,R1|
0000c080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c090  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0000c0a0  63 74 69 6f 6e 20 63 6f  6e 76 65 72 74 73 20 74  |ction converts t|
0000c0b0  68 65 20 6e 65 77 20 76  61 6c 75 65 0d 33 72 4f  |he new value.3rO|
0000c0c0  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 39 20  | MOV      R1,R9 |
0000c0d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c0e0  20 20 20 20 20 20 20 3b  74 6f 20 69 74 73 20 73  |       ;to its s|
0000c0f0  74 72 69 6e 67 20 65 71  75 69 76 65 6c 65 6e 74  |tring equivelent|
0000c100  20 61 6e 64 20 77 72 69  74 65 73 0d 33 7c 4e 20  | and writes.3|N |
0000c110  4d 4f 56 20 20 20 20 20  20 52 36 2c 23 26 31 30  |MOV      R6,#&10|
0000c120  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
0000c130  20 20 20 20 20 20 3b 69  74 20 62 61 63 6b 20 69  |      ;it back i|
0000c140  6e 74 6f 20 74 68 65 20  61 70 70 72 6f 70 72 69  |nto the appropri|
0000c150  61 74 65 20 69 63 6f 6e  2e 0d 33 86 22 20 53 57  |ate icon..3." SW|
0000c160  49 20 20 20 20 20 20 22  4f 53 5f 43 6f 6e 76 65  |I      "OS_Conve|
0000c170  72 74 49 6e 74 65 67 65  72 32 22 0d 33 90 14 20  |rtInteger2".3.. |
0000c180  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 31 33 0d  |MOV      R0,#13.|
0000c190  33 9a 15 20 53 54 52 42  20 20 20 20 20 52 30 2c  |3.. STRB     R0,|
0000c1a0  5b 52 31 5d 0d 33 a4 13  20 4d 4f 56 20 20 20 20  |[R1].3.. MOV    |
0000c1b0  20 20 52 30 2c 52 38 0d  33 ae 13 20 4d 4f 56 20  |  R0,R8.3.. MOV |
0000c1c0  20 20 20 20 20 52 31 2c  52 37 0d 33 b8 13 20 4d  |     R1,R7.3.. M|
0000c1d0  4f 56 20 20 20 20 20 20  52 32 2c 52 39 0d 33 c2  |OV      R2,R9.3.|
0000c1e0  17 20 42 4c 20 20 20 20  20 20 20 57 72 69 74 65  |. BL       Write|
0000c1f0  49 63 6f 6e 0d 33 cc 04  0d 33 d6 1e 4c 44 4d 46  |Icon.3...3..LDMF|
0000c200  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
0000c210  32 2c 50 43 7d 5e 0d 33  e0 04 0d 33 ea 52 3b 2d  |2,PC}^.3...3.R;-|
0000c220  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000c260  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 33 f4 32  |------------.3.2|
0000c270  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
0000c280  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
0000c290  4e 65 78 74 20 4d 6f 6e  74 68 20 2a 2a 2a 0d 33  |Next Month ***.3|
0000c2a0  fe 4f 3b 20 54 68 69 73  20 70 72 6f 63 65 64 75  |.O; This procedu|
0000c2b0  72 65 20 72 65 61 64 73  20 69 6e 20 72 65 63 6f  |re reads in reco|
0000c2c0  72 64 73 20 75 6e 74 69  6c 20 74 68 65 20 69 73  |rds until the is|
0000c2d0  73 75 65 20 6e 75 6d 62  65 72 20 69 73 20 69 6e  |sue number is in|
0000c2e0  63 72 65 61 73 65 64 20  62 79 20 61 74 0d 34 08  |creased by at.4.|
0000c2f0  10 3b 20 6c 65 61 73 74  20 6f 6e 65 2e 0d 34 12  |.; least one..4.|
0000c300  04 0d 34 1c 0e 2e 6e 65  78 74 6d 6f 6e 74 68 0d  |..4...nextmonth.|
0000c310  34 26 04 0d 34 30 1e 53  54 4d 46 44 20 20 20 20  |4&..40.STMFD    |
0000c320  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 52 31 34  |R13!,{R0-R12,R14|
0000c330  7d 0d 34 3a 04 0d 34 44  1b 20 53 57 49 20 20 20  |}.4:..4D. SWI   |
0000c340  20 20 22 48 6f 75 72 67  6c 61 73 73 5f 4f 6e 22  |  "Hourglass_On"|
0000c350  0d 34 4e 04 0d 34 58 4f  20 4c 44 52 20 20 20 20  |.4N..4XO LDR    |
0000c360  20 52 30 2c 5b 52 31 32  2c 23 64 69 73 70 6c 61  | R0,[R12,#displa|
0000c370  79 25 5d 20 20 20 20 20  20 20 20 20 20 20 20 3b  |y%]            ;|
0000c380  54 68 69 73 20 73 65 63  74 69 6f 6e 20 72 65 61  |This section rea|
0000c390  64 73 20 74 68 65 20 49  73 73 75 65 20 4e 75 6d  |ds the Issue Num|
0000c3a0  62 65 72 0d 34 62 49 20  4d 4f 56 20 20 20 20 20  |ber.4bI MOV     |
0000c3b0  52 31 2c 23 33 34 20 20  20 20 20 20 20 20 20 20  |R1,#34          |
0000c3c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 69  |              ;i|
0000c3d0  63 6f 6e 20 66 72 6f 6d  20 74 68 65 20 44 69 73  |con from the Dis|
0000c3e0  70 6c 61 79 20 77 69 6e  64 6f 77 2e 0d 34 6c 12  |play window..4l.|
0000c3f0  20 4d 4f 56 20 20 20 20  20 52 32 2c 52 39 0d 34  | MOV     R2,R9.4|
0000c400  76 15 20 42 4c 20 20 20  20 20 20 52 65 61 64 49  |v. BL      ReadI|
0000c410  63 6f 6e 0d 34 80 04 0d  34 8a 4e 20 4d 4f 56 20  |con.4...4.N MOV |
0000c420  20 20 20 20 52 30 2c 52  39 20 20 20 20 20 20 20  |    R0,R9       |
0000c430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c440  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000c450  67 65 74 73 20 74 68 65  20 76 61 6c 75 65 20 6f  |gets the value o|
0000c460  66 20 74 68 65 0d 34 94  39 20 4d 4f 56 20 20 20  |f the.4.9 MOV   |
0000c470  20 20 52 31 2c 23 31 33  20 20 20 20 20 20 20 20  |  R1,#13        |
0000c480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c490  3b 49 73 73 75 65 20 4e  75 6d 62 65 72 2e 0d 34  |;Issue Number..4|
0000c4a0  9e 19 20 53 57 49 20 20  20 20 20 22 53 74 72 69  |.. SWI     "Stri|
0000c4b0  6e 67 5f 56 61 6c 22 0d  34 a8 12 20 4d 4f 56 20  |ng_Val".4.. MOV |
0000c4c0  20 20 20 20 52 38 2c 52  31 0d 34 b2 04 0d 34 bc  |    R8,R1.4...4.|
0000c4d0  48 20 2e 6e 65 78 74 6d  6f 6e 74 68 6c 6f 6f 70  |H .nextmonthloop|
0000c4e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c4f0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 69 73  |        ;This is|
0000c500  20 74 68 65 20 73 74 61  72 74 20 6f 66 20 61 20  | the start of a |
0000c510  6c 6f 6f 70 2e 0d 34 c6  52 20 4c 44 52 20 20 20  |loop..4.R LDR   |
0000c520  20 20 52 30 2c 5b 52 31  30 2c 23 72 65 63 6f 72  |  R0,[R10,#recor|
0000c530  64 25 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |d%]             |
0000c540  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 65 78  |;This section ex|
0000c550  69 74 73 20 74 68 65 20  6c 6f 6f 70 20 69 66 20  |its the loop if |
0000c560  77 65 20 68 61 76 65 0d  34 d0 51 20 4c 44 52 20  |we have.4.Q LDR |
0000c570  20 20 20 20 52 31 2c 5b  52 31 30 2c 23 6d 61 78  |    R1,[R10,#max|
0000c580  25 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%]              |
0000c590  20 20 3b 72 65 61 63 68  65 64 20 74 68 65 20 6c  |  ;reached the l|
0000c5a0  61 73 74 20 72 65 63 6f  72 64 20 69 6e 20 74 68  |ast record in th|
0000c5b0  65 20 49 6e 64 65 78 2e  0d 34 da 12 20 43 4d 50  |e Index..4.. CMP|
0000c5c0  20 20 20 20 20 52 30 2c  52 31 0d 34 e4 1d 20 42  |     R0,R1.4.. B|
0000c5d0  45 51 20 20 20 20 20 6e  65 78 74 6d 6f 6e 74 68  |EQ     nextmonth|
0000c5e0  6c 6f 6f 70 65 6e 64 0d  34 ee 04 0d 34 f8 52 20  |loopend.4...4.R |
0000c5f0  4d 4f 56 20 20 20 20 20  52 30 2c 23 31 20 20 20  |MOV     R0,#1   |
0000c600  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c610  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000c620  69 6f 6e 20 72 65 61 64  73 20 69 6e 20 74 68 65  |ion reads in the|
0000c630  20 6e 65 78 74 20 72 65  63 6f 72 64 2e 0d 35 02  | next record..5.|
0000c640  12 20 4d 4f 56 20 20 20  20 20 52 31 2c 23 30 0d  |. MOV     R1,#0.|
0000c650  35 0c 17 20 42 4c 20 20  20 20 20 20 47 65 74 52  |5.. BL      GetR|
0000c660  65 63 6f 72 64 73 0d 35  16 04 0d 35 20 4f 20 41  |ecords.5...5 O A|
0000c670  44 44 20 20 20 20 20 52  30 2c 52 31 30 2c 23 72  |DD     R0,R10,#r|
0000c680  65 63 6f 72 64 20 20 20  20 20 20 20 20 20 20 20  |ecord           |
0000c690  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0000c6a0  6f 6e 20 66 69 6e 64 73  20 74 68 65 20 73 74 61  |on finds the sta|
0000c6b0  72 74 20 6f 66 20 74 68  65 0d 35 2a 47 20 41 44  |rt of the.5*G AD|
0000c6c0  44 20 20 20 20 20 52 31  2c 52 31 30 2c 23 62 61  |D     R1,R10,#ba|
0000c6d0  63 6b 73 6c 61 73 68 20  20 20 20 20 20 20 20 20  |ckslash         |
0000c6e0  20 20 20 20 3b 74 68 69  72 64 20 66 69 65 6c 64  |    ;third field|
0000c6f0  20 28 49 73 73 75 65 20  6e 75 6d 62 65 72 29 2e  | (Issue number).|
0000c700  0d 35 34 13 20 4d 4f 56  20 20 20 20 20 52 32 2c  |.54. MOV     R2,|
0000c710  23 31 33 0d 35 3e 12 20  4d 4f 56 20 20 20 20 20  |#13.5>. MOV     |
0000c720  52 33 2c 23 30 0d 35 48  1b 20 53 57 49 20 20 20  |R3,#0.5H. SWI   |
0000c730  20 20 22 53 74 72 69 6e  67 5f 49 6e 73 74 72 22  |  "String_Instr"|
0000c740  0d 35 52 15 20 41 44 44  20 20 20 20 20 52 33 2c  |.5R. ADD     R3,|
0000c750  52 33 2c 23 31 0d 35 5c  1b 20 53 57 49 20 20 20  |R3,#1.5\. SWI   |
0000c760  20 20 22 53 74 72 69 6e  67 5f 49 6e 73 74 72 22  |  "String_Instr"|
0000c770  0d 35 66 04 0d 35 70 4e  20 41 44 44 20 20 20 20  |.5f..5pN ADD    |
0000c780  20 52 30 2c 52 30 2c 52  33 20 20 20 20 20 20 20  | R0,R0,R3       |
0000c790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000c7a0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 67 65 74  |This section get|
0000c7b0  73 20 74 68 65 20 76 61  6c 75 65 20 6f 66 20 74  |s the value of t|
0000c7c0  68 65 0d 35 7a 3f 20 41  44 44 20 20 20 20 20 52  |he.5z? ADD     R|
0000c7d0  30 2c 52 30 2c 23 31 20  20 20 20 20 20 20 20 20  |0,R0,#1         |
0000c7e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 73  |             ;Is|
0000c7f0  73 75 65 20 4e 75 6d 62  65 72 20 66 69 65 6c 64  |sue Number field|
0000c800  2e 0d 35 84 17 20 4d 4f  56 20 20 20 20 20 52 31  |..5.. MOV     R1|
0000c810  2c 23 97 28 22 5c 22 29  0d 35 8e 19 20 53 57 49  |,#.("\").5.. SWI|
0000c820  20 20 20 20 20 22 53 74  72 69 6e 67 5f 56 61 6c  |     "String_Val|
0000c830  22 0d 35 98 04 0d 35 a2  52 20 43 4d 50 20 20 20  |".5...5.R CMP   |
0000c840  20 20 52 31 2c 52 38 20  20 20 20 20 20 20 20 20  |  R1,R8         |
0000c850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c860  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6f  |;This section co|
0000c870  6d 70 61 72 65 73 20 74  68 65 20 69 73 73 75 65  |mpares the issue|
0000c880  20 6e 75 6d 62 65 72 0d  35 ac 51 20 42 4c 45 20  | number.5.Q BLE |
0000c890  20 20 20 20 6e 65 78 74  6d 6f 6e 74 68 6c 6f 6f  |    nextmonthloo|
0000c8a0  70 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p               |
0000c8b0  20 20 3b 74 68 61 74 20  77 65 27 72 65 20 6c 6f  |  ;that we're lo|
0000c8c0  6f 6b 69 6e 67 20 66 6f  72 20 77 69 74 68 20 74  |oking for with t|
0000c8d0  68 65 20 69 73 73 75 65  0d 35 b6 46 20 2e 6e 65  |he issue.5.F .ne|
0000c8e0  78 74 6d 6f 6e 74 68 6c  6f 6f 70 65 6e 64 20 20  |xtmonthloopend  |
0000c8f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c900  20 20 20 3b 6e 75 6d 62  65 72 20 74 68 61 74 20  |   ;number that |
0000c910  77 65 20 68 61 76 65 20  66 6f 75 6e 64 2e 0d 35  |we have found..5|
0000c920  c0 04 0d 35 ca 13 20 42  4c 20 20 20 20 20 20 55  |...5.. BL      U|
0000c930  70 64 61 74 65 0d 35 d4  04 0d 35 de 1c 20 53 57  |pdate.5...5.. SW|
0000c940  49 20 20 20 20 20 22 48  6f 75 72 67 6c 61 73 73  |I     "Hourglass|
0000c950  5f 4f 66 66 22 0d 35 e8  04 0d 35 f2 1e 4c 44 4d  |_Off".5...5..LDM|
0000c960  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
0000c970  31 32 2c 50 43 7d 5e 0d  35 fc 04 0d 36 06 52 3b  |12,PC}^.5...6.R;|
0000c980  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000c9c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 36 10  |-------------.6.|
0000c9d0  34 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4;              |
0000c9e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000c9f0  2a 2a 2a 20 4c 61 73 74  4d 6f 6e 74 68 20 2a 2a  |*** LastMonth **|
0000ca00  2a 0d 36 1a 4f 3b 20 54  68 69 73 20 73 75 62 72  |*.6.O; This subr|
0000ca10  6f 75 74 69 6e 65 20 72  65 61 64 73 20 62 61 63  |outine reads bac|
0000ca20  6b 20 72 65 63 6f 72 64  73 20 75 6e 74 69 6c 20  |k records until |
0000ca30  74 68 65 20 49 73 73 75  65 20 4e 75 6d 62 65 72  |the Issue Number|
0000ca40  20 69 73 20 64 65 63 72  65 61 73 65 64 20 62 79  | is decreased by|
0000ca50  0d 36 24 13 3b 20 61 74  20 6c 65 61 73 74 20 6f  |.6$.; at least o|
0000ca60  6e 65 2e 0d 36 2e 04 0d  36 38 0e 2e 6c 61 73 74  |ne..6...68..last|
0000ca70  6d 6f 6e 74 68 0d 36 42  04 0d 36 4c 1e 53 54 4d  |month.6B..6L.STM|
0000ca80  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
0000ca90  31 32 2c 52 31 34 7d 0d  36 56 04 0d 36 60 1b 20  |12,R14}.6V..6`. |
0000caa0  53 57 49 20 20 20 20 20  22 48 6f 75 72 67 6c 61  |SWI     "Hourgla|
0000cab0  73 73 5f 4f 6e 22 0d 36  6a 04 0d 36 74 4f 20 4c  |ss_On".6j..6tO L|
0000cac0  44 52 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |DR     R0,[R12,#|
0000cad0  64 69 73 70 6c 61 79 25  5d 20 20 20 20 20 20 20  |display%]       |
0000cae0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0000caf0  6f 6e 20 72 65 61 64 73  20 74 68 65 20 49 73 73  |on reads the Iss|
0000cb00  75 65 20 4e 75 6d 62 65  72 0d 36 7e 44 20 4d 4f  |ue Number.6~D MO|
0000cb10  56 20 20 20 20 20 52 31  2c 23 33 34 20 20 20 20  |V     R1,#34    |
0000cb20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000cb30  20 20 20 20 3b 66 72 6f  6d 20 74 68 65 20 44 69  |    ;from the Di|
0000cb40  73 70 6c 61 79 20 77 69  6e 64 6f 77 2e 0d 36 88  |splay window..6.|
0000cb50  12 20 4d 4f 56 20 20 20  20 20 52 32 2c 52 39 0d  |. MOV     R2,R9.|
0000cb60  36 92 15 20 42 4c 20 20  20 20 20 20 52 65 61 64  |6.. BL      Read|
0000cb70  49 63 6f 6e 0d 36 9c 04  0d 36 a6 4e 20 4d 4f 56  |Icon.6...6.N MOV|
0000cb80  20 20 20 20 20 52 30 2c  52 39 20 20 20 20 20 20  |     R0,R9      |
0000cb90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000cba0  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
0000cbb0  20 67 65 74 73 20 74 68  65 20 76 61 6c 75 65 20  | gets the value |
0000cbc0  6f 66 20 74 68 65 0d 36  b0 39 20 4d 4f 56 20 20  |of the.6.9 MOV  |
0000cbd0  20 20 20 52 31 2c 23 31  33 20 20 20 20 20 20 20  |   R1,#13       |
0000cbe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000cbf0  20 3b 49 73 73 75 65 20  4e 75 6d 62 65 72 2e 0d  | ;Issue Number..|
0000cc00  36 ba 19 20 53 57 49 20  20 20 20 20 22 53 74 72  |6.. SWI     "Str|
0000cc10  69 6e 67 5f 56 61 6c 22  0d 36 c4 15 20 53 55 42  |ing_Val".6.. SUB|
0000cc20  20 20 20 20 20 52 38 2c  52 31 2c 23 31 0d 36 ce  |     R8,R1,#1.6.|
0000cc30  04 0d 36 d8 50 20 4d 4f  56 20 20 20 20 20 52 30  |..6.P MOV     R0|
0000cc40  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
0000cc50  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
0000cc60  73 20 73 65 63 74 69 6f  6e 20 72 65 61 64 73 20  |s section reads |
0000cc70  62 61 63 6b 20 74 6f 20  74 68 65 20 73 74 61 72  |back to the star|
0000cc80  74 0d 36 e2 42 20 4d 4f  56 20 20 20 20 20 52 31  |t.6.B MOV     R1|
0000cc90  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
0000cca0  20 20 20 20 20 20 20 20  20 20 20 20 3b 6f 66 20  |            ;of |
0000ccb0  74 68 65 20 63 75 72 72  65 6e 74 20 72 65 63 6f  |the current reco|
0000ccc0  72 64 2e 0d 36 ec 17 20  42 4c 20 20 20 20 20 20  |rd..6.. BL      |
0000ccd0  47 65 74 52 65 63 6f 72  64 73 0d 36 f6 04 0d 37  |GetRecords.6...7|
0000cce0  00 48 20 2e 6c 61 73 74  6d 6f 6e 74 68 6c 6f 6f  |.H .lastmonthloo|
0000ccf0  70 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p               |
0000cd00  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 69  |         ;This i|
0000cd10  73 20 74 68 65 20 73 74  61 72 74 20 6f 66 20 61  |s the start of a|
0000cd20  20 6c 6f 6f 70 2e 0d 37  0a 52 20 4c 44 52 20 20  | loop..7.R LDR  |
0000cd30  20 20 20 52 30 2c 5b 52  31 30 2c 23 72 65 63 6f  |   R0,[R10,#reco|
0000cd40  72 64 25 5d 20 20 20 20  20 20 20 20 20 20 20 20  |rd%]            |
0000cd50  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 65  | ;This section e|
0000cd60  78 69 74 73 20 74 68 65  20 6c 6f 6f 70 20 69 66  |xits the loop if|
0000cd70  20 77 65 20 68 61 76 65  0d 37 14 51 20 4d 4f 56  | we have.7.Q MOV|
0000cd80  20 20 20 20 20 52 31 2c  23 31 20 20 20 20 20 20  |     R1,#1      |
0000cd90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000cda0  20 20 20 3b 72 65 61 63  68 65 64 20 74 68 65 20  |   ;reached the |
0000cdb0  66 69 72 73 74 20 72 65  63 6f 72 64 20 69 6e 20  |first record in |
0000cdc0  74 68 65 20 66 69 6c 65  2e 0d 37 1e 12 20 43 4d  |the file..7.. CM|
0000cdd0  50 20 20 20 20 20 52 30  2c 52 31 0d 37 28 1d 20  |P     R0,R1.7(. |
0000cde0  42 45 51 20 20 20 20 20  6c 61 73 74 6d 6f 6e 74  |BEQ     lastmont|
0000cdf0  68 6c 6f 6f 70 65 6e 64  0d 37 32 04 0d 37 3c 4d  |hloopend.72..7<M|
0000ce00  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 31 20 20  | MOV     R0,#1  |
0000ce10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ce20  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
0000ce30  74 69 6f 6e 20 72 65 61  64 73 20 62 61 63 6b 20  |tion reads back |
0000ce40  61 20 72 65 63 6f 72 64  2e 0d 37 46 12 20 4d 4f  |a record..7F. MO|
0000ce50  56 20 20 20 20 20 52 31  2c 23 31 0d 37 50 17 20  |V     R1,#1.7P. |
0000ce60  42 4c 20 20 20 20 20 20  47 65 74 52 65 63 6f 72  |BL      GetRecor|
0000ce70  64 73 0d 37 5a 04 0d 37  64 4f 20 41 44 44 20 20  |ds.7Z..7dO ADD  |
0000ce80  20 20 20 52 30 2c 52 31  30 2c 23 72 65 63 6f 72  |   R0,R10,#recor|
0000ce90  64 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |d               |
0000cea0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 66  | ;This section f|
0000ceb0  69 6e 64 73 20 74 68 65  20 73 74 61 72 74 20 6f  |inds the start o|
0000cec0  66 20 74 68 65 0d 37 6e  47 20 41 44 44 20 20 20  |f the.7nG ADD   |
0000ced0  20 20 52 31 2c 52 31 30  2c 23 62 61 63 6b 73 6c  |  R1,R10,#backsl|
0000cee0  61 73 68 20 20 20 20 20  20 20 20 20 20 20 20 20  |ash             |
0000cef0  3b 74 68 69 72 64 20 66  69 65 6c 64 20 28 49 73  |;third field (Is|
0000cf00  73 75 65 20 4e 75 6d 62  65 72 29 2e 0d 37 78 13  |sue Number)..7x.|
0000cf10  20 4d 4f 56 20 20 20 20  20 52 32 2c 23 31 33 0d  | MOV     R2,#13.|
0000cf20  37 82 12 20 4d 4f 56 20  20 20 20 20 52 33 2c 23  |7.. MOV     R3,#|
0000cf30  30 0d 37 8c 1b 20 53 57  49 20 20 20 20 20 22 53  |0.7.. SWI     "S|
0000cf40  74 72 69 6e 67 5f 49 6e  73 74 72 22 0d 37 96 15  |tring_Instr".7..|
0000cf50  20 41 44 44 20 20 20 20  20 52 33 2c 52 33 2c 23  | ADD     R3,R3,#|
0000cf60  31 0d 37 a0 1b 20 53 57  49 20 20 20 20 20 22 53  |1.7.. SWI     "S|
0000cf70  74 72 69 6e 67 5f 49 6e  73 74 72 22 0d 37 aa 04  |tring_Instr".7..|
0000cf80  0d 37 b4 4e 20 41 44 44  20 20 20 20 20 52 30 2c  |.7.N ADD     R0,|
0000cf90  52 30 2c 52 33 20 20 20  20 20 20 20 20 20 20 20  |R0,R3           |
0000cfa0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000cfb0  20 73 65 63 74 69 6f 6e  20 67 65 74 73 20 74 68  | section gets th|
0000cfc0  65 20 76 61 6c 75 65 20  6f 66 20 74 68 65 0d 37  |e value of the.7|
0000cfd0  be 3f 20 41 44 44 20 20  20 20 20 52 30 2c 52 30  |.? ADD     R0,R0|
0000cfe0  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
0000cff0  20 20 20 20 20 20 20 20  20 3b 49 73 73 75 65 20  |         ;Issue |
0000d000  4e 75 6d 62 65 72 20 66  69 65 6c 64 2e 0d 37 c8  |Number field..7.|
0000d010  17 20 4d 4f 56 20 20 20  20 20 52 31 2c 23 97 28  |. MOV     R1,#.(|
0000d020  22 5c 22 29 0d 37 d2 19  20 53 57 49 20 20 20 20  |"\").7.. SWI    |
0000d030  20 22 53 74 72 69 6e 67  5f 56 61 6c 22 0d 37 dc  | "String_Val".7.|
0000d040  04 0d 37 e6 52 20 43 4d  50 20 20 20 20 20 52 31  |..7.R CMP     R1|
0000d050  2c 52 38 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R8             |
0000d060  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
0000d070  73 20 73 65 63 74 69 6f  6e 20 63 6f 6d 70 61 72  |s section compar|
0000d080  65 73 20 74 68 65 20 49  73 73 75 65 20 6e 75 6d  |es the Issue num|
0000d090  62 65 72 0d 37 f0 51 20  42 47 45 20 20 20 20 20  |ber.7.Q BGE     |
0000d0a0  6c 61 73 74 6d 6f 6e 74  68 6c 6f 6f 70 20 20 20  |lastmonthloop   |
0000d0b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
0000d0c0  68 61 74 20 77 65 27 72  65 20 6c 6f 6f 6b 69 6e  |hat we're lookin|
0000d0d0  67 20 66 6f 72 20 77 69  74 68 20 74 68 65 20 49  |g for with the I|
0000d0e0  73 73 75 65 0d 37 fa 44  20 20 20 20 20 20 20 20  |ssue.7.D        |
0000d0f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000d110  6e 75 6d 62 65 72 20 74  68 61 74 20 77 65 27 76  |number that we'v|
0000d120  65 20 66 6f 75 6e 64 2e  0d 38 04 16 20 2e 6c 61  |e found..8.. .la|
0000d130  73 74 6d 6f 6e 74 68 6c  6f 6f 70 65 6e 64 0d 38  |stmonthloopend.8|
0000d140  0e 04 0d 38 18 12 20 4d  4f 56 20 20 20 20 20 52  |...8.. MOV     R|
0000d150  30 2c 23 31 0d 38 22 12  20 4d 4f 56 20 20 20 20  |0,#1.8". MOV    |
0000d160  20 52 31 2c 23 30 0d 38  2c 17 20 42 4c 20 20 20  | R1,#0.8,. BL   |
0000d170  20 20 20 47 65 74 52 65  63 6f 72 64 73 0d 38 36  |   GetRecords.86|
0000d180  04 0d 38 40 13 20 42 4c  20 20 20 20 20 20 55 70  |..8@. BL      Up|
0000d190  64 61 74 65 0d 38 4a 1c  20 53 57 49 20 20 20 20  |date.8J. SWI    |
0000d1a0  20 22 48 6f 75 72 67 6c  61 73 73 5f 4f 66 66 22  | "Hourglass_Off"|
0000d1b0  0d 38 54 04 0d 38 5e 1e  4c 44 4d 46 44 20 20 20  |.8T..8^.LDMFD   |
0000d1c0  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
0000d1d0  7d 5e 0d 38 68 04 0d 38  72 52 3b 2d 2d 2d 2d 2d  |}^.8h..8rR;-----|
0000d1e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000d220  2d 2d 2d 2d 2d 2d 2d 2d  0d 38 7c 33 3b 20 20 20  |--------.8|3;   |
0000d230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d240  20 20 20 20 20 20 20 20  20 20 20 2a 2a 2a 20 4e  |           *** N|
0000d250  65 78 74 59 65 61 72 20  2a 2a 2a 0d 38 86 50 3b  |extYear ***.8.P;|
0000d260  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
0000d270  20 72 65 61 64 73 20 69  6e 20 72 65 63 6f 72 64  | reads in record|
0000d280  73 20 75 6e 74 69 6c 20  74 68 65 20 49 73 73 75  |s until the Issu|
0000d290  65 20 4e 75 6d 62 65 72  20 69 73 20 69 6e 63 72  |e Number is incr|
0000d2a0  65 61 73 65 64 20 62 79  20 61 74 0d 38 90 0f 3b  |eased by at.8..;|
0000d2b0  20 6c 65 61 73 74 20 31  32 2e 0d 38 9a 04 0d 38  | least 12..8...8|
0000d2c0  a4 0d 2e 6e 65 78 74 79  65 61 72 0d 38 ae 04 0d  |...nextyear.8...|
0000d2d0  38 b8 1e 53 54 4d 46 44  20 20 20 20 52 31 33 21  |8..STMFD    R13!|
0000d2e0  2c 7b 52 30 2d 52 31 32  2c 52 31 34 7d 0d 38 c2  |,{R0-R12,R14}.8.|
0000d2f0  04 0d 38 cc 1b 20 53 57  49 20 20 20 20 20 22 48  |..8.. SWI     "H|
0000d300  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 0d 38 d6 04  |ourglass_On".8..|
0000d310  0d 38 e0 4f 20 4c 44 52  20 20 20 20 20 52 30 2c  |.8.O LDR     R0,|
0000d320  5b 52 31 32 2c 23 64 69  73 70 6c 61 79 25 5d 20  |[R12,#display%] |
0000d330  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000d340  20 73 65 63 74 69 6f 6e  20 72 65 61 64 73 20 74  | section reads t|
0000d350  68 65 20 49 73 73 75 65  20 6e 75 6d 62 65 72 0d  |he Issue number.|
0000d360  38 ea 44 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |8.D MOV     R1,#|
0000d370  33 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |34              |
0000d380  20 20 20 20 20 20 20 20  20 20 3b 66 72 6f 6d 20  |          ;from |
0000d390  74 68 65 20 44 69 73 70  6c 61 79 20 77 69 6e 64  |the Display wind|
0000d3a0  6f 77 2e 0d 38 f4 12 20  4d 4f 56 20 20 20 20 20  |ow..8.. MOV     |
0000d3b0  52 32 2c 52 39 0d 38 fe  15 20 42 4c 20 20 20 20  |R2,R9.8.. BL    |
0000d3c0  20 20 52 65 61 64 49 63  6f 6e 0d 39 08 04 0d 39  |  ReadIcon.9...9|
0000d3d0  12 4e 20 4d 4f 56 20 20  20 20 20 52 30 2c 52 39  |.N MOV     R0,R9|
0000d3e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d3f0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000d400  65 63 74 69 6f 6e 20 67  65 74 73 20 74 68 65 20  |ection gets the |
0000d410  76 61 6c 75 65 20 6f 66  20 74 68 65 0d 39 1c 39  |value of the.9.9|
0000d420  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 31 33 20  | MOV     R1,#13 |
0000d430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d440  20 20 20 20 20 20 20 3b  49 73 73 75 65 20 4e 75  |       ;Issue Nu|
0000d450  6d 62 65 72 2e 0d 39 26  19 20 53 57 49 20 20 20  |mber..9&. SWI   |
0000d460  20 20 22 53 74 72 69 6e  67 5f 56 61 6c 22 0d 39  |  "String_Val".9|
0000d470  30 16 20 41 44 44 20 20  20 20 20 52 38 2c 52 31  |0. ADD     R8,R1|
0000d480  2c 23 31 31 0d 39 3a 04  0d 39 44 48 20 2e 6e 65  |,#11.9:..9DH .ne|
0000d490  78 74 79 65 61 72 6c 6f  6f 70 20 20 20 20 20 20  |xtyearloop      |
0000d4a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d4b0  20 20 20 3b 54 68 69 73  20 69 73 20 74 68 65 20  |   ;This is the |
0000d4c0  73 74 61 72 74 20 6f 66  20 61 20 6c 6f 6f 70 2e  |start of a loop.|
0000d4d0  0d 39 4e 52 20 4c 44 52  20 20 20 20 20 52 30 2c  |.9NR LDR     R0,|
0000d4e0  5b 52 31 30 2c 23 72 65  63 6f 72 64 25 5d 20 20  |[R10,#record%]  |
0000d4f0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000d500  20 73 65 63 74 69 6f 6e  20 65 78 69 74 73 20 74  | section exits t|
0000d510  68 65 20 6c 6f 6f 70 20  69 66 20 77 65 20 68 61  |he loop if we ha|
0000d520  76 65 0d 39 58 51 20 4c  44 52 20 20 20 20 20 52  |ve.9XQ LDR     R|
0000d530  31 2c 5b 52 31 30 2c 23  6d 61 78 25 5d 20 20 20  |1,[R10,#max%]   |
0000d540  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 72 65  |             ;re|
0000d550  61 63 68 65 64 20 74 68  65 20 6c 61 73 74 20 72  |ached the last r|
0000d560  65 63 6f 72 64 20 69 6e  20 74 68 65 20 49 6e 64  |ecord in the Ind|
0000d570  65 78 2e 0d 39 62 12 20  43 4d 50 20 20 20 20 20  |ex..9b. CMP     |
0000d580  52 30 2c 52 31 0d 39 6c  1c 20 42 45 51 20 20 20  |R0,R1.9l. BEQ   |
0000d590  20 20 6e 65 78 74 79 65  61 72 6c 6f 6f 70 65 6e  |  nextyearloopen|
0000d5a0  64 0d 39 76 04 0d 39 80  52 20 4d 4f 56 20 20 20  |d.9v..9.R MOV   |
0000d5b0  20 20 52 30 2c 23 31 20  20 20 20 20 20 20 20 20  |  R0,#1         |
0000d5c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d5d0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
0000d5e0  61 64 73 20 69 6e 20 74  68 65 20 6e 65 78 74 20  |ads in the next |
0000d5f0  72 65 63 6f 72 64 2e 0d  39 8a 12 20 4d 4f 56 20  |record..9.. MOV |
0000d600  20 20 20 20 52 31 2c 23  30 0d 39 94 17 20 42 4c  |    R1,#0.9.. BL|
0000d610  20 20 20 20 20 20 47 65  74 52 65 63 6f 72 64 73  |      GetRecords|
0000d620  0d 39 9e 04 0d 39 a8 4f  20 41 44 44 20 20 20 20  |.9...9.O ADD    |
0000d630  20 52 30 2c 52 31 30 2c  23 72 65 63 6f 72 64 20  | R0,R10,#record |
0000d640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000d650  54 68 69 73 20 73 65 63  74 69 6f 6e 20 66 69 6e  |This section fin|
0000d660  64 73 20 74 68 65 20 73  74 61 72 74 20 6f 66 20  |ds the start of |
0000d670  74 68 65 0d 39 b2 47 20  41 44 44 20 20 20 20 20  |the.9.G ADD     |
0000d680  52 31 2c 52 31 30 2c 23  62 61 63 6b 73 6c 61 73  |R1,R10,#backslas|
0000d690  68 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |h             ;t|
0000d6a0  68 69 72 64 20 66 69 65  6c 64 20 28 49 73 73 75  |hird field (Issu|
0000d6b0  65 20 4e 75 6d 62 65 72  29 2e 0d 39 bc 13 20 4d  |e Number)..9.. M|
0000d6c0  4f 56 20 20 20 20 20 52  32 2c 23 31 33 0d 39 c6  |OV     R2,#13.9.|
0000d6d0  12 20 4d 4f 56 20 20 20  20 20 52 33 2c 23 30 0d  |. MOV     R3,#0.|
0000d6e0  39 d0 1b 20 53 57 49 20  20 20 20 20 22 53 74 72  |9.. SWI     "Str|
0000d6f0  69 6e 67 5f 49 6e 73 74  72 22 0d 39 da 15 20 41  |ing_Instr".9.. A|
0000d700  44 44 20 20 20 20 20 52  33 2c 52 33 2c 23 31 0d  |DD     R3,R3,#1.|
0000d710  39 e4 1b 20 53 57 49 20  20 20 20 20 22 53 74 72  |9.. SWI     "Str|
0000d720  69 6e 67 5f 49 6e 73 74  72 22 0d 39 ee 04 0d 39  |ing_Instr".9...9|
0000d730  f8 4e 20 41 44 44 20 20  20 20 20 52 30 2c 52 30  |.N ADD     R0,R0|
0000d740  2c 52 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R3             |
0000d750  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000d760  65 63 74 69 6f 6e 20 67  65 74 73 20 74 68 65 20  |ection gets the |
0000d770  76 61 6c 75 65 20 6f 66  20 74 68 65 0d 3a 02 39  |value of the.:.9|
0000d780  20 41 44 44 20 20 20 20  20 52 30 2c 52 30 2c 23  | ADD     R0,R0,#|
0000d790  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
0000d7a0  20 20 20 20 20 20 20 3b  49 73 73 75 65 20 4e 75  |       ;Issue Nu|
0000d7b0  6d 62 65 72 2e 0d 3a 0c  17 20 4d 4f 56 20 20 20  |mber..:.. MOV   |
0000d7c0  20 20 52 31 2c 23 97 28  22 5c 22 29 0d 3a 16 19  |  R1,#.("\").:..|
0000d7d0  20 53 57 49 20 20 20 20  20 22 53 74 72 69 6e 67  | SWI     "String|
0000d7e0  5f 56 61 6c 22 0d 3a 20  04 0d 3a 2a 52 20 43 4d  |_Val".: ..:*R CM|
0000d7f0  50 20 20 20 20 20 52 31  2c 52 38 20 20 20 20 20  |P     R1,R8     |
0000d800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d810  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0000d820  6e 20 63 6f 6d 70 61 72  65 73 20 74 68 65 20 49  |n compares the I|
0000d830  73 73 75 65 20 4e 75 6d  62 65 72 0d 3a 34 51 20  |ssue Number.:4Q |
0000d840  42 4c 45 20 20 20 20 20  6e 65 78 74 79 65 61 72  |BLE     nextyear|
0000d850  6c 6f 6f 70 20 20 20 20  20 20 20 20 20 20 20 20  |loop            |
0000d860  20 20 20 20 20 20 3b 74  68 61 74 20 77 65 27 72  |      ;that we'r|
0000d870  65 20 6c 6f 6f 6b 69 6e  67 20 66 6f 72 20 77 69  |e looking for wi|
0000d880  74 68 20 74 68 65 20 49  73 73 75 65 0d 3a 3e 44  |th the Issue.:>D|
0000d890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
0000d8b0  20 20 20 20 20 20 20 3b  4e 75 6d 62 65 72 20 74  |       ;Number t|
0000d8c0  68 61 74 20 77 65 27 76  65 20 66 6f 75 6e 64 2e  |hat we've found.|
0000d8d0  0d 3a 48 15 20 2e 6e 65  78 74 79 65 61 72 6c 6f  |.:H. .nextyearlo|
0000d8e0  6f 70 65 6e 64 0d 3a 52  04 0d 3a 5c 13 20 42 4c  |opend.:R..:\. BL|
0000d8f0  20 20 20 20 20 20 55 70  64 61 74 65 0d 3a 66 1c  |      Update.:f.|
0000d900  20 53 57 49 20 20 20 20  20 22 48 6f 75 72 67 6c  | SWI     "Hourgl|
0000d910  61 73 73 5f 4f 66 66 22  0d 3a 70 04 0d 3a 7a 1e  |ass_Off".:p..:z.|
0000d920  4c 44 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |LDMFD    R13!,{R|
0000d930  30 2d 52 31 32 2c 50 43  7d 5e 0d 3a 84 04 0d 3a  |0-R12,PC}^.:...:|
0000d940  8e 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.R;-------------|
0000d950  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000d990  0d 3a 98 30 3b 20 20 20  20 20 20 20 20 20 20 20  |.:.0;           |
0000d9a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000d9b0  2a 2a 2a 20 4c 61 73 74  59 65 61 72 20 2a 2a 2a  |*** LastYear ***|
0000d9c0  0d 3a a2 4f 3b 20 54 68  69 73 20 73 75 62 72 6f  |.:.O; This subro|
0000d9d0  75 74 69 6e 65 20 72 65  61 64 73 20 62 61 63 6b  |utine reads back|
0000d9e0  20 72 65 63 6f 72 64 73  20 75 6e 74 69 6c 20 74  | records until t|
0000d9f0  68 65 20 49 73 73 75 65  20 6e 75 6d 62 65 72 20  |he Issue number |
0000da00  69 73 20 64 65 63 72 65  61 73 65 64 20 62 79 0d  |is decreased by.|
0000da10  3a ac 12 3b 20 61 74 20  6c 65 61 73 74 20 31 32  |:..; at least 12|
0000da20  2e 0d 3a b6 04 0d 3a c0  0d 2e 6c 61 73 74 79 65  |..:...:...lastye|
0000da30  61 72 0d 3a ca 04 0d 3a  d4 1e 53 54 4d 46 44 20  |ar.:...:..STMFD |
0000da40  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
0000da50  52 31 34 7d 0d 3a de 04  0d 3a e8 1b 20 53 57 49  |R14}.:...:.. SWI|
0000da60  20 20 20 20 20 22 48 6f  75 72 67 6c 61 73 73 5f  |     "Hourglass_|
0000da70  4f 6e 22 0d 3a f2 04 0d  3a fc 4f 20 4c 44 52 20  |On".:...:.O LDR |
0000da80  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 64 69 73  |    R0,[R12,#dis|
0000da90  70 6c 61 79 25 5d 20 20  20 20 20 20 20 20 20 20  |play%]          |
0000daa0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000dab0  72 65 61 64 73 20 74 68  65 20 49 73 73 75 65 20  |reads the Issue |
0000dac0  4e 75 6d 62 65 72 0d 3b  06 44 20 4d 4f 56 20 20  |Number.;.D MOV  |
0000dad0  20 20 20 52 31 2c 23 33  34 20 20 20 20 20 20 20  |   R1,#34       |
0000dae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000daf0  20 3b 66 72 6f 6d 20 74  68 65 20 44 69 73 70 6c  | ;from the Displ|
0000db00  61 79 20 77 69 6e 64 6f  77 2e 0d 3b 10 12 20 4d  |ay window..;.. M|
0000db10  4f 56 20 20 20 20 20 52  32 2c 52 39 0d 3b 1a 15  |OV     R2,R9.;..|
0000db20  20 42 4c 20 20 20 20 20  20 52 65 61 64 49 63 6f  | BL      ReadIco|
0000db30  6e 0d 3b 24 04 0d 3b 2e  4e 20 4d 4f 56 20 20 20  |n.;$..;.N MOV   |
0000db40  20 20 52 30 2c 52 39 20  20 20 20 20 20 20 20 20  |  R0,R9         |
0000db50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000db60  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 67 65  |;This section ge|
0000db70  74 73 20 74 68 65 20 76  61 6c 75 65 20 6f 66 20  |ts the value of |
0000db80  74 68 65 0d 3b 38 39 20  4d 4f 56 20 20 20 20 20  |the.;89 MOV     |
0000db90  52 31 2c 23 31 33 20 20  20 20 20 20 20 20 20 20  |R1,#13          |
0000dba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 49  |              ;I|
0000dbb0  73 73 75 65 20 4e 75 6d  62 65 72 2e 0d 3b 42 19  |ssue Number..;B.|
0000dbc0  20 53 57 49 20 20 20 20  20 22 53 74 72 69 6e 67  | SWI     "String|
0000dbd0  5f 56 61 6c 22 0d 3b 4c  16 20 53 55 42 20 20 20  |_Val".;L. SUB   |
0000dbe0  20 20 52 38 2c 52 31 2c  23 31 32 0d 3b 56 04 0d  |  R8,R1,#12.;V..|
0000dbf0  3b 60 50 20 4d 4f 56 20  20 20 20 20 52 30 2c 23  |;`P MOV     R0,#|
0000dc00  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
0000dc10  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0000dc20  73 65 63 74 69 6f 6e 20  72 65 61 64 73 20 62 61  |section reads ba|
0000dc30  63 6b 20 74 6f 20 74 68  65 20 73 74 61 72 74 0d  |ck to the start.|
0000dc40  3b 6a 42 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |;jB MOV     R1,#|
0000dc50  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
0000dc60  20 20 20 20 20 20 20 20  20 20 3b 6f 66 20 74 68  |          ;of th|
0000dc70  65 20 63 75 72 72 65 6e  74 20 72 65 63 6f 72 64  |e current record|
0000dc80  2e 0d 3b 74 17 20 42 4c  20 20 20 20 20 20 47 65  |..;t. BL      Ge|
0000dc90  74 52 65 63 6f 72 64 73  0d 3b 7e 04 0d 3b 88 48  |tRecords.;~..;.H|
0000dca0  20 2e 6c 61 73 74 79 65  61 72 6c 6f 6f 70 20 20  | .lastyearloop  |
0000dcb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000dcc0  20 20 20 20 20 20 20 3b  54 68 69 73 20 69 73 20  |       ;This is |
0000dcd0  74 68 65 20 73 74 61 72  74 20 6f 66 20 61 20 6c  |the start of a l|
0000dce0  6f 6f 70 2e 0d 3b 92 52  20 4c 44 52 20 20 20 20  |oop..;.R LDR    |
0000dcf0  20 52 30 2c 5b 52 31 30  2c 23 72 65 63 6f 72 64  | R0,[R10,#record|
0000dd00  25 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |%]             ;|
0000dd10  54 68 69 73 20 73 65 63  74 69 6f 6e 20 65 78 69  |This section exi|
0000dd20  74 73 20 74 68 65 20 6c  6f 6f 70 20 69 66 20 77  |ts the loop if w|
0000dd30  65 20 68 61 76 65 0d 3b  9c 45 20 4d 4f 56 20 20  |e have.;.E MOV  |
0000dd40  20 20 20 52 31 2c 23 31  20 20 20 20 20 20 20 20  |   R1,#1        |
0000dd50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000dd60  20 3b 72 65 61 63 68 65  64 20 74 68 65 20 66 69  | ;reached the fi|
0000dd70  72 73 74 20 72 65 63 6f  72 64 2e 0d 3b a6 12 20  |rst record..;.. |
0000dd80  43 4d 50 20 20 20 20 20  52 30 2c 52 31 0d 3b b0  |CMP     R0,R1.;.|
0000dd90  1c 20 42 45 51 20 20 20  20 20 6c 61 73 74 79 65  |. BEQ     lastye|
0000dda0  61 72 6c 6f 6f 70 65 6e  64 0d 3b ba 04 0d 3b c4  |arloopend.;...;.|
0000ddb0  4d 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 31 20  |M MOV     R0,#1 |
0000ddc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ddd0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0000dde0  63 74 69 6f 6e 20 72 65  61 64 73 20 62 61 63 6b  |ction reads back|
0000ddf0  20 31 20 72 65 63 6f 72  64 2e 0d 3b ce 12 20 4d  | 1 record..;.. M|
0000de00  4f 56 20 20 20 20 20 52  31 2c 23 31 0d 3b d8 17  |OV     R1,#1.;..|
0000de10  20 42 4c 20 20 20 20 20  20 47 65 74 52 65 63 6f  | BL      GetReco|
0000de20  72 64 73 0d 3b e2 04 0d  3b ec 4f 20 41 44 44 20  |rds.;...;.O ADD |
0000de30  20 20 20 20 52 30 2c 52  31 30 2c 23 72 65 63 6f  |    R0,R10,#reco|
0000de40  72 64 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |rd              |
0000de50  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000de60  66 69 6e 64 73 20 74 68  65 20 73 74 61 72 74 20  |finds the start |
0000de70  6f 66 20 74 68 65 0d 3b  f6 47 20 41 44 44 20 20  |of the.;.G ADD  |
0000de80  20 20 20 52 31 2c 52 31  30 2c 23 62 61 63 6b 73  |   R1,R10,#backs|
0000de90  6c 61 73 68 20 20 20 20  20 20 20 20 20 20 20 20  |lash            |
0000dea0  20 3b 74 68 69 72 64 20  66 69 65 6c 64 20 28 49  | ;third field (I|
0000deb0  73 73 75 65 20 4e 75 6d  62 65 72 29 2e 0d 3c 00  |ssue Number)..<.|
0000dec0  13 20 4d 4f 56 20 20 20  20 20 52 32 2c 23 31 33  |. MOV     R2,#13|
0000ded0  0d 3c 0a 12 20 4d 4f 56  20 20 20 20 20 52 33 2c  |.<.. MOV     R3,|
0000dee0  23 30 0d 3c 14 1b 20 53  57 49 20 20 20 20 20 22  |#0.<.. SWI     "|
0000def0  53 74 72 69 6e 67 5f 49  6e 73 74 72 22 0d 3c 1e  |String_Instr".<.|
0000df00  15 20 41 44 44 20 20 20  20 20 52 33 2c 52 33 2c  |. ADD     R3,R3,|
0000df10  23 31 0d 3c 28 1b 20 53  57 49 20 20 20 20 20 22  |#1.<(. SWI     "|
0000df20  53 74 72 69 6e 67 5f 49  6e 73 74 72 22 0d 3c 32  |String_Instr".<2|
0000df30  04 0d 3c 3c 4e 20 41 44  44 20 20 20 20 20 52 30  |..<<N ADD     R0|
0000df40  2c 52 30 2c 52 33 20 20  20 20 20 20 20 20 20 20  |,R0,R3          |
0000df50  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
0000df60  73 20 73 65 63 74 69 6f  6e 20 67 65 74 73 20 74  |s section gets t|
0000df70  68 65 20 76 61 6c 75 65  20 6f 66 20 74 68 65 0d  |he value of the.|
0000df80  3c 46 38 20 41 44 44 20  20 20 20 20 52 30 2c 52  |<F8 ADD     R0,R|
0000df90  30 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |0,#1            |
0000dfa0  20 20 20 20 20 20 20 20  20 20 3b 49 73 73 75 65  |          ;Issue|
0000dfb0  20 4e 75 6d 62 65 72 0d  3c 50 17 20 4d 4f 56 20  | Number.<P. MOV |
0000dfc0  20 20 20 20 52 31 2c 23  97 28 22 5c 22 29 0d 3c  |    R1,#.("\").<|
0000dfd0  5a 19 20 53 57 49 20 20  20 20 20 22 53 74 72 69  |Z. SWI     "Stri|
0000dfe0  6e 67 5f 56 61 6c 22 0d  3c 64 04 0d 3c 6e 52 20  |ng_Val".<d..<nR |
0000dff0  43 4d 50 20 20 20 20 20  52 31 2c 52 38 20 20 20  |CMP     R1,R8   |
0000e000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e010  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000e020  69 6f 6e 20 63 6f 6d 70  61 72 65 73 20 74 68 65  |ion compares the|
0000e030  20 49 73 73 75 65 20 6e  75 6d 62 65 72 0d 3c 78  | Issue number.<x|
0000e040  51 20 42 47 45 20 20 20  20 20 6c 61 73 74 79 65  |Q BGE     lastye|
0000e050  61 72 6c 6f 6f 70 20 20  20 20 20 20 20 20 20 20  |arloop          |
0000e060  20 20 20 20 20 20 20 20  3b 74 68 61 74 20 77 65  |        ;that we|
0000e070  27 72 65 20 6c 6f 6f 6b  69 6e 67 20 66 6f 72 20  |'re looking for |
0000e080  77 69 74 68 20 74 68 65  20 49 73 73 75 65 0d 3c  |with the Issue.<|
0000e090  82 44 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.D              |
0000e0a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e0b0  20 20 20 20 20 20 20 20  20 3b 4e 75 6d 62 65 72  |         ;Number|
0000e0c0  20 74 68 61 74 20 77 65  27 76 65 20 66 6f 75 6e  | that we've foun|
0000e0d0  64 2e 0d 3c 8c 15 20 2e  6c 61 73 74 79 65 61 72  |d..<.. .lastyear|
0000e0e0  6c 6f 6f 70 65 6e 64 0d  3c 96 04 0d 3c a0 13 20  |loopend.<...<.. |
0000e0f0  42 4c 20 20 20 20 20 20  55 70 64 61 74 65 0d 3c  |BL      Update.<|
0000e100  aa 1c 20 53 57 49 20 20  20 20 20 22 48 6f 75 72  |.. SWI     "Hour|
0000e110  67 6c 61 73 73 5f 4f 66  66 22 0d 3c b4 04 0d 3c  |glass_Off".<...<|
0000e120  be 1e 4c 44 4d 46 44 20  20 20 20 52 31 33 21 2c  |..LDMFD    R13!,|
0000e130  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 3c c8 04  |{R0-R12,PC}^.<..|
0000e140  0d 3c d2 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.<.R;-----------|
0000e150  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000e190  2d 2d 0d 3c dc 34 3b 20  20 20 20 20 20 20 20 20  |--.<.4;         |
0000e1a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e1b0  20 20 2a 2a 2a 20 53 65  6c 65 63 74 49 6e 53 61  |  *** SelectInSa|
0000e1c0  76 65 20 2a 2a 2a 0d 3c  e6 50 3b 54 68 69 73 20  |ve ***.<.P;This |
0000e1d0  73 75 62 72 6f 75 74 69  6e 65 20 64 65 61 6c 73  |subroutine deals|
0000e1e0  20 77 69 74 68 20 53 65  6c 65 63 74 20 62 65 69  | with Select bei|
0000e1f0  6e 67 20 63 6c 69 63 6b  65 64 20 6f 76 65 72 20  |ng clicked over |
0000e200  74 68 65 20 53 61 76 65  20 44 69 61 6c 6f 67 75  |the Save Dialogu|
0000e210  65 20 42 6f 78 2e 0d 3c  f0 04 0d 3c fa 11 2e 53  |e Box..<...<...S|
0000e220  65 6c 65 63 74 49 6e 53  61 76 65 0d 3d 04 04 0d  |electInSave.=...|
0000e230  3d 0e 1e 53 54 4d 46 44  20 20 20 20 52 31 33 21  |=..STMFD    R13!|
0000e240  2c 7b 52 30 2d 52 31 32  2c 52 31 34 7d 0d 3d 18  |,{R0-R12,R14}.=.|
0000e250  04 0d 3d 22 13 20 4d 4f  56 20 20 20 20 20 20 52  |..=". MOV      R|
0000e260  30 2c 52 38 0d 3d 2c 04  0d 3d 36 51 20 43 4d 50  |0,R8.=,..=6Q CMP|
0000e270  20 20 20 20 20 20 52 36  2c 23 34 20 20 20 20 20  |      R6,#4     |
0000e280  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e290  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
0000e2a0  20 63 68 61 6e 67 65 73  20 74 68 65 20 73 74 61  | changes the sta|
0000e2b0  74 65 20 6f 66 20 74 68  65 0d 3d 40 4f 20 20 4c  |te of the.=@O  L|
0000e2c0  44 52 45 51 20 20 20 20  52 30 2c 5b 52 31 30 2c  |DREQ    R0,[R10,|
0000e2d0  23 6d 75 6c 74 69 70 6c  65 25 5d 20 20 20 20 20  |#multiple%]     |
0000e2e0  20 20 20 20 3b 4d 75 6c  74 69 70 6c 65 20 49 73  |    ;Multiple Is|
0000e2f0  73 75 65 20 69 63 6f 6e  20 61 6e 64 20 75 70 64  |sue icon and upd|
0000e300  61 74 65 73 20 74 68 65  0d 3d 4a 4d 20 20 82 45  |ates the.=JM  .E|
0000e310  51 20 20 20 20 52 30 2c  52 30 2c 23 31 20 20 20  |Q    R0,R0,#1   |
0000e320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e330  20 3b 4c 65 61 66 6e 61  6d 65 20 61 73 20 61 70  | ;Leafname as ap|
0000e340  70 72 6f 70 72 69 61 74  65 20 77 68 65 6e 20 53  |propriate when S|
0000e350  65 6c 65 63 74 0d 3d 54  4e 20 20 53 54 52 45 51  |elect.=TN  STREQ|
0000e360  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 6d 75 6c  |    R0,[R10,#mul|
0000e370  74 69 70 6c 65 25 5d 20  20 20 20 20 20 20 20 20  |tiple%]         |
0000e380  3b 69 73 20 63 6c 69 63  6b 65 64 20 6f 76 65 72  |;is clicked over|
0000e390  20 74 68 65 20 4d 75 6c  74 69 70 6c 65 20 69 63  | the Multiple ic|
0000e3a0  6f 6e 2e 0d 3d 5e 1d 20  20 42 4c 45 51 20 20 20  |on..=^.  BLEQ   |
0000e3b0  20 20 55 70 64 61 74 65  4c 65 61 66 4e 61 6d 65  |  UpdateLeafName|
0000e3c0  0d 3d 68 04 0d 3d 72 4e  20 43 4d 50 20 20 20 20  |.=h..=rN CMP    |
0000e3d0  20 20 52 36 2c 23 31 20  20 20 20 20 20 20 20 20  |  R6,#1         |
0000e3e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0000e3f0  54 68 69 73 20 63 61 6c  6c 73 20 61 20 73 75 62  |This calls a sub|
0000e400  72 6f 75 74 69 6e 65 20  74 6f 20 73 74 61 72 74  |routine to start|
0000e410  20 61 0d 3d 7c 52 20 20  42 4c 45 51 20 20 20 20  | a.=|R  BLEQ    |
0000e420  20 53 74 61 72 74 44 72  61 67 20 20 20 20 20 20  | StartDrag      |
0000e430  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 44 72  |             ;Dr|
0000e440  61 67 20 77 68 65 6e 20  74 68 65 20 75 73 65 72  |ag when the user|
0000e450  20 64 72 61 67 73 20 74  68 65 20 46 69 6c 65 20  | drags the File |
0000e460  49 63 6f 6e 0d 3d 86 04  0d 3d 90 50 20 43 4d 50  |Icon.=...=.P CMP|
0000e470  20 20 20 20 20 20 52 36  2c 23 33 20 20 20 20 20  |      R6,#3     |
0000e480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e490  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
0000e4a0  20 72 65 61 64 73 20 74  68 65 20 46 69 6c 65 6e  | reads the Filen|
0000e4b0  61 6d 65 20 66 72 6f 6d  0d 3d 9a 4d 20 20 ec 51  |ame from.=.M  .Q|
0000e4c0  20 20 20 20 52 31 2c 23  32 20 20 20 20 20 20 20  |    R1,#2       |
0000e4d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e4e0  3b 74 68 65 20 69 63 6f  6e 20 77 68 65 6e 20 53  |;the icon when S|
0000e4f0  65 6c 65 63 74 20 69 73  20 63 6c 69 63 6b 65 64  |elect is clicked|
0000e500  20 6f 76 65 72 0d 3d a4  49 20 20 ec 51 20 20 20  | over.=.I  .Q   |
0000e510  20 52 32 2c 52 39 20 20  20 20 20 20 20 20 20 20  | R2,R9          |
0000e520  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 68  |             ;th|
0000e530  65 20 27 4f 4b 27 20 69  63 6f 6e 2e 20 49 74 20  |e 'OK' icon. It |
0000e540  74 68 65 6e 20 73 61 76  65 73 20 74 68 65 0d 3d  |then saves the.=|
0000e550  ae 4e 20 20 42 4c 45 51  20 20 20 20 20 52 65 61  |.N  BLEQ     Rea|
0000e560  64 49 63 6f 6e 20 20 20  20 20 20 20 20 20 20 20  |dIcon           |
0000e570  20 20 20 20 20 20 20 20  20 3b 72 65 63 6f 72 64  |         ;record|
0000e580  73 20 74 6f 20 74 68 65  20 66 69 6c 65 20 61 6e  |s to the file an|
0000e590  64 20 63 6c 6f 73 65 73  20 74 68 65 0d 3d b8 3b  |d closes the.=.;|
0000e5a0  20 20 42 4c 45 51 20 20  20 20 20 53 61 76 65 49  |  BLEQ     SaveI|
0000e5b0  73 73 75 65 20 20 20 20  20 20 20 20 20 20 20 20  |ssue            |
0000e5c0  20 20 20 20 20 20 20 3b  4d 65 6e 75 20 53 74 72  |       ;Menu Str|
0000e5d0  75 63 74 75 72 65 2e 0d  3d c2 14 20 20 4d 56 4e  |ucture..=..  MVN|
0000e5e0  45 51 20 20 20 20 52 31  2c 23 30 0d 3d cc 20 20  |EQ    R1,#0.=.  |
0000e5f0  20 53 57 49 45 51 20 20  20 20 22 57 69 6d 70 5f  | SWIEQ    "Wimp_|
0000e600  43 72 65 61 74 65 4d 65  6e 75 22 0d 3d d6 04 0d  |CreateMenu".=...|
0000e610  3d e0 4b 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |=.K MOV      R1,|
0000e620  23 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#7              |
0000e630  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0000e640  69 73 20 53 74 61 72 74  20 49 73 73 75 65 20 69  |is Start Issue i|
0000e650  63 6f 6e 20 6e 75 6d 62  65 72 0d 3d ea 04 0d 3d  |con number.=...=|
0000e660  f4 50 20 43 4d 50 20 20  20 20 20 20 52 36 2c 23  |.P CMP      R6,#|
0000e670  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
0000e680  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 64  |         ;This d|
0000e690  65 63 72 65 73 65 73 20  74 68 65 20 76 61 6c 75  |ecreses the valu|
0000e6a0  65 20 6f 66 20 74 68 65  20 53 74 61 72 74 0d 3d  |e of the Start.=|
0000e6b0  fe 4f 20 20 42 4c 45 51  20 20 20 20 20 64 6f 77  |.O  BLEQ     dow|
0000e6c0  6e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |n               |
0000e6d0  20 20 20 20 20 20 20 20  20 3b 49 73 73 75 65 20  |         ;Issue |
0000e6e0  49 63 6f 6e 20 61 6e 64  20 75 70 64 61 74 65 73  |Icon and updates|
0000e6f0  20 74 68 65 20 4c 65 61  66 6e 61 6d 65 0d 3e 08  | the Leafname.>.|
0000e700  51 20 20 4c 44 52 45 51  20 20 20 20 52 31 2c 5b  |Q  LDREQ    R1,[|
0000e710  52 31 30 2c 23 6d 75 6c  74 69 70 6c 65 25 5d 20  |R10,#multiple%] |
0000e720  20 20 20 20 20 20 20 20  3b 69 66 20 6e 65 63 63  |        ;if necc|
0000e730  65 73 73 61 72 79 2c 20  77 68 65 6e 20 53 65 6c  |essary, when Sel|
0000e740  65 63 74 20 69 73 20 63  6c 69 63 6b 65 64 0d 3e  |ect is clicked.>|
0000e750  12 50 20 20 43 4d 50 45  51 20 20 20 20 52 31 2c  |.P  CMPEQ    R1,|
0000e760  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
0000e770  20 20 20 20 20 20 20 20  20 3b 6f 76 65 72 20 74  |         ;over t|
0000e780  68 65 20 53 74 61 72 74  20 44 6f 77 6e 20 69 63  |he Start Down ic|
0000e790  6f 6e 20 69 6e 20 74 68  65 20 53 61 76 65 0d 3e  |on in the Save.>|
0000e7a0  1c 36 20 20 20 ec 51 20  20 20 20 52 31 2c 23 37  |.6   .Q    R1,#7|
0000e7b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e7c0  20 20 20 20 20 20 3b 44  69 61 6c 6f 67 75 65 20  |      ;Dialogue |
0000e7d0  62 6f 78 2e 0d 3e 26 12  20 20 20 ec 51 20 20 20  |box..>&.   .Q   |
0000e7e0  20 52 32 2c 52 39 0d 3e  30 18 20 20 20 42 4c 45  | R2,R9.>0.   BLE|
0000e7f0  51 20 20 20 20 20 52 65  61 64 49 63 6f 6e 0d 3e  |Q     ReadIcon.>|
0000e800  3a 13 20 20 20 ec 51 20  20 20 20 52 31 2c 23 31  |:.   .Q    R1,#1|
0000e810  30 0d 3e 44 19 20 20 20  42 4c 45 51 20 20 20 20  |0.>D.   BLEQ    |
0000e820  20 57 72 69 74 65 49 63  6f 6e 0d 3e 4e 1e 20 20  | WriteIcon.>N.  |
0000e830  20 42 4c 45 51 20 20 20  20 20 55 70 64 61 74 65  | BLEQ     Update|
0000e840  4c 65 61 66 4e 61 6d 65  0d 3e 58 04 0d 3e 62 51  |LeafName.>X..>bQ|
0000e850  20 43 4d 50 20 20 20 20  20 20 52 36 2c 23 39 20  | CMP      R6,#9 |
0000e860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e870  20 20 20 20 20 20 20 3b  54 68 69 73 20 69 6e 63  |       ;This inc|
0000e880  72 65 61 73 65 73 20 74  68 65 20 76 61 6c 75 65  |reases the value|
0000e890  20 6f 66 20 74 68 65 20  53 74 61 72 74 0d 3e 6c  | of the Start.>l|
0000e8a0  4f 20 20 42 4c 45 51 20  20 20 20 20 75 70 20 20  |O  BLEQ     up  |
0000e8b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e8c0  20 20 20 20 20 20 20 20  3b 49 73 73 75 65 20 49  |        ;Issue I|
0000e8d0  63 6f 6e 20 61 6e 64 20  75 70 64 61 74 65 73 20  |con and updates |
0000e8e0  74 68 65 20 4c 65 61 66  6e 61 6d 65 0d 3e 76 51  |the Leafname.>vQ|
0000e8f0  20 20 4c 44 52 45 51 20  20 20 20 52 31 2c 5b 52  |  LDREQ    R1,[R|
0000e900  31 30 2c 23 6d 75 6c 74  69 70 6c 65 25 5d 20 20  |10,#multiple%]  |
0000e910  20 20 20 20 20 20 20 3b  69 66 20 6e 65 63 63 65  |       ;if necce|
0000e920  73 73 61 72 79 2c 20 77  68 65 6e 20 53 65 6c 65  |ssary, when Sele|
0000e930  63 74 20 69 73 20 63 6c  69 63 6b 65 64 0d 3e 80  |ct is clicked.>.|
0000e940  4e 20 20 43 4d 50 45 51  20 20 20 20 52 31 2c 23  |N  CMPEQ    R1,#|
0000e950  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
0000e960  20 20 20 20 20 20 20 20  3b 6f 76 65 72 20 74 68  |        ;over th|
0000e970  65 20 53 74 61 72 74 20  55 70 20 69 63 6f 6e 20  |e Start Up icon |
0000e980  69 6e 20 74 68 65 20 53  61 76 65 0d 3e 8a 36 20  |in the Save.>.6 |
0000e990  20 20 ec 51 20 20 20 20  52 31 2c 23 37 20 20 20  |  .Q    R1,#7   |
0000e9a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000e9b0  20 20 20 3b 44 69 61 6c  6f 67 75 65 20 62 6f 78  |   ;Dialogue box|
0000e9c0  2e 0d 3e 94 12 20 20 20  ec 51 20 20 20 20 52 32  |..>..   .Q    R2|
0000e9d0  2c 52 39 0d 3e 9e 18 20  20 20 42 4c 45 51 20 20  |,R9.>..   BLEQ  |
0000e9e0  20 20 20 52 65 61 64 49  63 6f 6e 0d 3e a8 13 20  |   ReadIcon.>.. |
0000e9f0  20 20 ec 51 20 20 20 20  52 31 2c 23 31 30 0d 3e  |  .Q    R1,#10.>|
0000ea00  b2 19 20 20 20 42 4c 45  51 20 20 20 20 20 57 72  |..   BLEQ     Wr|
0000ea10  69 74 65 49 63 6f 6e 0d  3e bc 1e 20 20 20 42 4c  |iteIcon.>..   BL|
0000ea20  45 51 20 20 20 20 20 55  70 64 61 74 65 4c 65 61  |EQ     UpdateLea|
0000ea30  66 4e 61 6d 65 0d 3e c6  04 0d 3e d0 4e 20 4d 4f  |fName.>...>.N MO|
0000ea40  56 20 20 20 20 20 20 52  31 2c 23 31 30 20 20 20  |V      R1,#10   |
0000ea50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ea60  20 20 20 20 3b 54 68 69  73 20 69 73 20 74 68 65  |    ;This is the|
0000ea70  20 45 6e 64 20 49 73 73  75 65 20 49 63 6f 6e 20  | End Issue Icon |
0000ea80  6e 75 6d 62 65 72 2e 0d  3e da 04 0d 3e e4 50 20  |number..>...>.P |
0000ea90  43 4d 50 20 20 20 20 20  20 52 36 2c 23 31 31 20  |CMP      R6,#11 |
0000eaa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000eab0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000eac0  69 6f 6e 20 64 65 63 72  65 61 73 65 73 20 74 68  |ion decreases th|
0000ead0  65 20 45 6e 64 20 49 73  73 75 65 0d 3e ee 48 20  |e End Issue.>.H |
0000eae0  20 42 4c 45 51 20 20 20  20 20 64 6f 77 6e 20 20  | BLEQ     down  |
0000eaf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000eb00  20 20 20 20 20 20 3b 69  63 6f 6e 20 77 68 65 6e  |      ;icon when|
0000eb10  20 53 65 6c 65 63 74 20  69 73 20 63 6c 69 63 6b  | Select is click|
0000eb20  65 64 2e 0d 3e f8 04 0d  3f 02 50 20 43 4d 50 20  |ed..>...?.P CMP |
0000eb30  20 20 20 20 20 52 36 2c  23 31 32 20 20 20 20 20  |     R6,#12     |
0000eb40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000eb50  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000eb60  69 6e 63 72 65 61 73 65  73 20 74 68 65 20 45 6e  |increases the En|
0000eb70  64 20 49 73 73 75 65 0d  3f 0c 48 20 20 42 4c 45  |d Issue.?.H  BLE|
0000eb80  51 20 20 20 20 20 75 70  20 20 20 20 20 20 20 20  |Q     up        |
0000eb90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000eba0  20 20 3b 69 63 6f 6e 20  77 68 65 6e 20 53 65 6c  |  ;icon when Sel|
0000ebb0  65 63 74 20 69 73 20 63  6c 69 63 6b 65 64 2e 0d  |ect is clicked..|
0000ebc0  3f 16 04 0d 3f 20 1e 4c  44 4d 46 44 20 20 20 20  |?...? .LDMFD    |
0000ebd0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
0000ebe0  5e 0d 3f 2a 04 0d 3f 34  52 3b 2d 2d 2d 2d 2d 2d  |^.?*..?4R;------|
0000ebf0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000ec30  2d 2d 2d 2d 2d 2d 2d 0d  3f 3e 35 3b 20 20 20 20  |-------.?>5;    |
0000ec40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ec50  20 20 20 20 20 20 20 20  2a 2a 2a 20 41 64 6a 75  |        *** Adju|
0000ec60  73 74 49 6e 53 61 76 65  20 2a 2a 2a 0d 3f 48 51  |stInSave ***.?HQ|
0000ec70  3b 20 54 68 69 73 20 73  75 62 72 6f 75 74 69 6e  |; This subroutin|
0000ec80  65 20 64 65 61 6c 73 20  77 69 74 68 20 41 64 6a  |e deals with Adj|
0000ec90  75 73 74 20 62 65 69 6e  67 20 63 6c 69 63 6b 65  |ust being clicke|
0000eca0  64 20 6f 76 65 72 20 74  68 65 20 53 61 76 65 20  |d over the Save |
0000ecb0  64 69 61 6c 6f 67 75 65  20 62 6f 78 2e 0d 3f 52  |dialogue box..?R|
0000ecc0  52 3b 20 4e 42 20 3b 20  57 68 65 6e 20 41 64 6a  |R; NB ; When Adj|
0000ecd0  75 73 74 20 69 73 20 63  6c 69 63 6b 65 64 20 6f  |ust is clicked o|
0000ece0  76 65 72 20 74 68 65 20  61 64 6a 75 73 74 65 72  |ver the adjuster|
0000ecf0  20 69 63 6f 6e 73 2c 20  74 68 65 20 52 69 73 63  | icons, the Risc|
0000ed00  20 4f 53 20 53 74 79 6c  65 20 47 75 69 64 65 0d  | OS Style Guide.|
0000ed10  3f 5c 50 3b 20 72 65 71  75 69 72 65 73 20 74 68  |?\P; requires th|
0000ed20  65 20 61 64 6a 75 73 74  6d 65 6e 74 20 74 6f 20  |e adjustment to |
0000ed30  62 65 20 6d 61 64 65 20  69 6e 20 74 68 65 20 6f  |be made in the o|
0000ed40  70 70 6f 73 69 74 65 20  64 69 72 65 63 74 69 6f  |pposite directio|
0000ed50  6e 20 74 6f 20 74 68 65  20 61 72 72 6f 77 2e 0d  |n to the arrow..|
0000ed60  3f 66 04 0d 3f 70 11 2e  41 64 6a 75 73 74 49 6e  |?f..?p..AdjustIn|
0000ed70  53 61 76 65 0d 3f 7a 04  0d 3f 84 1e 53 54 4d 46  |Save.?z..?..STMF|
0000ed80  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
0000ed90  32 2c 52 31 34 7d 0d 3f  8e 04 0d 3f 98 3f 20 4d  |2,R14}.?...?.? M|
0000eda0  4f 56 20 20 20 20 20 20  52 30 2c 52 38 20 20 20  |OV      R0,R8   |
0000edb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000edc0  20 20 20 20 20 3b 53 61  76 65 20 77 69 6e 64 6f  |     ;Save windo|
0000edd0  77 20 68 61 6e 64 6c 65  2e 0d 3f a2 04 0d 3f ac  |w handle..?...?.|
0000ede0  4d 20 43 4d 50 20 20 20  20 20 20 52 36 2c 23 34  |M CMP      R6,#4|
0000edf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ee00  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0000ee10  63 74 69 6f 6e 20 75 70  64 61 74 65 73 20 74 68  |ction updates th|
0000ee20  65 20 6d 75 6c 74 69 70  6c 65 0d 3f b6 51 20 20  |e multiple.?.Q  |
0000ee30  4c 44 52 45 51 20 20 20  20 52 30 2c 5b 52 31 30  |LDREQ    R0,[R10|
0000ee40  2c 23 6d 75 6c 74 69 70  6c 65 25 5d 20 20 20 20  |,#multiple%]    |
0000ee50  20 20 20 20 20 3b 66 6c  61 67 20 61 6e 64 20 63  |     ;flag and c|
0000ee60  61 6c 6c 73 20 61 20 73  75 62 72 6f 75 74 69 6e  |alls a subroutin|
0000ee70  65 20 74 6f 20 75 70 64  61 74 65 0d 3f c0 4c 20  |e to update.?.L |
0000ee80  20 82 45 51 20 20 20 20  52 30 2c 52 30 2c 23 31  | .EQ    R0,R0,#1|
0000ee90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000eea0  20 20 20 20 3b 74 68 65  20 6c 65 61 66 6e 61 6d  |    ;the leafnam|
0000eeb0  65 20 69 6e 20 74 68 65  20 66 69 6c 65 6e 61 6d  |e in the filenam|
0000eec0  65 20 69 63 6f 6e 2e 0d  3f ca 22 20 20 53 54 52  |e icon..?."  STR|
0000eed0  45 51 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 6d  |EQ    R0,[R10,#m|
0000eee0  75 6c 74 69 70 6c 65 25  5d 0d 3f d4 1d 20 20 42  |ultiple%].?..  B|
0000eef0  4c 45 51 20 20 20 20 20  55 70 64 61 74 65 4c 65  |LEQ     UpdateLe|
0000ef00  61 66 4e 61 6d 65 0d 3f  de 04 0d 3f e8 4e 20 43  |afName.?...?.N C|
0000ef10  4d 50 20 20 20 20 20 20  52 36 2c 23 31 20 20 20  |MP      R6,#1   |
0000ef20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ef30  20 20 20 20 20 3b 54 68  69 73 20 63 61 6c 6c 73  |     ;This calls|
0000ef40  20 61 20 73 75 62 72 6f  75 74 69 6e 65 20 74 6f  | a subroutine to|
0000ef50  20 73 74 61 72 74 20 61  0d 3f f2 52 20 20 42 4c  | start a.?.R  BL|
0000ef60  45 51 20 20 20 20 20 53  74 61 72 74 44 72 61 67  |EQ     StartDrag|
0000ef70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ef80  20 20 20 3b 44 72 61 67  20 77 68 65 6e 20 74 68  |   ;Drag when th|
0000ef90  65 20 75 73 65 72 20 64  72 61 67 73 20 74 68 65  |e user drags the|
0000efa0  20 66 69 6c 65 69 63 6f  6e 2e 0d 3f fc 04 0d 40  | fileicon..?...@|
0000efb0  06 50 20 43 4d 50 20 20  20 20 20 20 52 36 2c 23  |.P CMP      R6,#|
0000efc0  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
0000efd0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000efe0  65 63 74 69 6f 6e 20 72  65 61 64 73 20 74 68 65  |ection reads the|
0000eff0  20 66 69 6c 65 6e 61 6d  65 20 66 72 6f 6d 0d 40  | filename from.@|
0000f000  10 51 20 20 ec 51 20 20  20 20 52 31 2c 23 32 20  |.Q  .Q    R1,#2 |
0000f010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f020  20 20 20 20 20 20 3b 74  68 65 20 66 69 6c 65 6e  |      ;the filen|
0000f030  61 6d 65 20 69 63 6f 6e  20 61 6e 64 20 63 61 6c  |ame icon and cal|
0000f040  6c 73 20 61 20 73 75 62  72 6f 75 74 69 6e 65 0d  |ls a subroutine.|
0000f050  40 1a 45 20 20 ec 51 20  20 20 20 52 32 2c 52 39  |@.E  .Q    R2,R9|
0000f060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f070  20 20 20 20 20 20 20 3b  74 6f 20 73 61 76 65 20  |       ;to save |
0000f080  74 68 65 20 73 65 6c 65  63 74 65 64 20 69 73 73  |the selected iss|
0000f090  75 65 73 2e 0d 40 24 17  20 20 42 4c 45 51 20 20  |ues..@$.  BLEQ  |
0000f0a0  20 20 20 52 65 61 64 49  63 6f 6e 0d 40 2e 18 20  |   ReadIcon.@.. |
0000f0b0  20 42 4c 45 51 20 20 20  20 20 53 61 76 65 49 73  | BLEQ     SaveIs|
0000f0c0  73 75 65 0d 40 38 04 0d  40 42 40 20 4d 4f 56 20  |sue.@8..@B@ MOV |
0000f0d0  20 20 20 20 20 52 31 2c  23 37 20 20 20 20 20 20  |     R1,#7      |
0000f0e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f0f0  20 20 3b 27 53 74 61 72  74 27 20 69 63 6f 6e 20  |  ;'Start' icon |
0000f100  6e 75 6d 62 65 72 2e 0d  40 4c 04 0d 40 56 4f 20  |number..@L..@VO |
0000f110  43 4d 50 20 20 20 20 20  20 52 36 2c 23 38 20 20  |CMP      R6,#8  |
0000f120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f130  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000f140  69 6f 6e 20 69 6e 63 72  65 61 73 65 73 20 74 68  |ion increases th|
0000f150  65 20 76 61 6c 75 65 20  69 6e 0d 40 60 50 20 20  |e value in.@`P  |
0000f160  42 4c 45 51 20 20 20 20  20 75 70 20 20 20 20 20  |BLEQ     up     |
0000f170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f180  20 20 20 20 20 3b 53 74  61 72 74 20 69 63 6f 6e  |     ;Start icon|
0000f190  20 61 6e 64 20 63 61 6c  6c 73 20 61 20 73 75 62  | and calls a sub|
0000f1a0  72 6f 75 74 69 6e 65 20  74 6f 0d 40 6a 4f 20 20  |routine to.@jO  |
0000f1b0  20 20 4c 44 52 45 51 20  20 20 20 52 31 2c 5b 52  |  LDREQ    R1,[R|
0000f1c0  31 30 2c 23 6d 75 6c 74  69 70 6c 65 25 5d 20 20  |10,#multiple%]  |
0000f1d0  20 20 20 20 20 3b 63 68  61 6e 67 65 20 74 68 65  |     ;change the|
0000f1e0  20 6c 65 61 66 6e 61 6d  65 20 69 6e 20 74 68 65  | leafname in the|
0000f1f0  20 66 69 6c 65 6e 61 6d  65 0d 40 74 31 20 20 20  | filename.@t1   |
0000f200  20 43 4d 50 45 51 20 20  20 20 52 31 2c 23 30 20  | CMPEQ    R1,#0 |
0000f210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f220  20 20 20 20 3b 69 63 6f  6e 2e 0d 40 7e 14 20 20  |    ;icon..@~.  |
0000f230  20 20 20 ec 51 20 20 20  20 52 31 2c 23 37 0d 40  |   .Q    R1,#7.@|
0000f240  88 14 20 20 20 20 20 ec  51 20 20 20 20 52 32 2c  |..     .Q    R2,|
0000f250  52 39 0d 40 92 1a 20 20  20 20 20 42 4c 45 51 20  |R9.@..     BLEQ |
0000f260  20 20 20 20 52 65 61 64  49 63 6f 6e 0d 40 9c 15  |    ReadIcon.@..|
0000f270  20 20 20 20 20 ec 51 20  20 20 20 52 31 2c 23 31  |     .Q    R1,#1|
0000f280  30 0d 40 a6 1b 20 20 20  20 20 42 4c 45 51 20 20  |0.@..     BLEQ  |
0000f290  20 20 20 57 72 69 74 65  49 63 6f 6e 0d 40 b0 20  |   WriteIcon.@. |
0000f2a0  20 20 20 20 20 42 4c 45  51 20 20 20 20 20 55 70  |     BLEQ     Up|
0000f2b0  64 61 74 65 4c 65 61 66  4e 61 6d 65 0d 40 ba 04  |dateLeafName.@..|
0000f2c0  0d 40 c4 4f 20 43 4d 50  20 20 20 20 20 20 52 36  |.@.O CMP      R6|
0000f2d0  2c 23 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#9             |
0000f2e0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0000f2f0  20 73 65 63 74 69 6f 6e  20 64 65 63 72 65 61 73  | section decreas|
0000f300  65 73 20 74 68 65 20 76  61 6c 75 65 20 6f 66 0d  |es the value of.|
0000f310  40 ce 50 20 20 42 4c 45  51 20 20 20 20 20 64 6f  |@.P  BLEQ     do|
0000f320  77 6e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |wn              |
0000f330  20 20 20 20 20 20 20 20  20 20 3b 53 74 61 72 74  |          ;Start|
0000f340  20 69 63 6f 6e 20 61 6e  64 20 63 61 6c 6c 73 20  | icon and calls |
0000f350  61 20 73 75 62 72 6f 75  74 69 6e 65 20 74 6f 0d  |a subroutine to.|
0000f360  40 d8 4f 20 20 20 20 4c  44 52 45 51 20 20 20 20  |@.O    LDREQ    |
0000f370  52 31 2c 5b 52 31 30 2c  23 6d 75 6c 74 69 70 6c  |R1,[R10,#multipl|
0000f380  65 25 5d 20 20 20 20 20  20 20 3b 63 68 61 6e 67  |e%]       ;chang|
0000f390  65 20 74 68 65 20 6c 65  61 66 6e 61 6d 65 20 69  |e the leafname i|
0000f3a0  6e 20 74 68 65 20 66 69  6c 65 6e 61 6d 65 0d 40  |n the filename.@|
0000f3b0  e2 31 20 20 20 20 43 4d  50 45 51 20 20 20 20 52  |.1    CMPEQ    R|
0000f3c0  31 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |1,#0            |
0000f3d0  20 20 20 20 20 20 20 20  20 3b 69 63 6f 6e 2e 0d  |         ;icon..|
0000f3e0  40 ec 14 20 20 20 20 20  ec 51 20 20 20 20 52 31  |@..     .Q    R1|
0000f3f0  2c 23 37 0d 40 f6 14 20  20 20 20 20 ec 51 20 20  |,#7.@..     .Q  |
0000f400  20 20 52 32 2c 52 39 0d  41 00 1a 20 20 20 20 20  |  R2,R9.A..     |
0000f410  42 4c 45 51 20 20 20 20  20 52 65 61 64 49 63 6f  |BLEQ     ReadIco|
0000f420  6e 0d 41 0a 15 20 20 20  20 20 ec 51 20 20 20 20  |n.A..     .Q    |
0000f430  52 31 2c 23 31 30 0d 41  14 1b 20 20 20 20 20 42  |R1,#10.A..     B|
0000f440  4c 45 51 20 20 20 20 20  57 72 69 74 65 49 63 6f  |LEQ     WriteIco|
0000f450  6e 0d 41 1e 20 20 20 20  20 20 42 4c 45 51 20 20  |n.A.      BLEQ  |
0000f460  20 20 20 55 70 64 61 74  65 4c 65 61 66 4e 61 6d  |   UpdateLeafNam|
0000f470  65 0d 41 28 04 0d 41 32  3e 20 4d 4f 56 20 20 20  |e.A(..A2> MOV   |
0000f480  20 20 20 52 31 2c 23 31  30 20 20 20 20 20 20 20  |   R1,#10       |
0000f490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f4a0  3b 27 45 6e 64 27 20 69  63 6f 6e 20 6e 75 6d 62  |;'End' icon numb|
0000f4b0  65 72 2e 0d 41 3c 04 0d  41 46 4f 20 43 4d 50 20  |er..A<..AFO CMP |
0000f4c0  20 20 20 20 20 52 36 2c  23 31 31 20 20 20 20 20  |     R6,#11     |
0000f4d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f4e0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000f4f0  69 6e 63 72 65 61 73 65  73 20 74 68 65 20 76 61  |increases the va|
0000f500  6c 75 65 20 6f 66 0d 41  50 39 20 20 42 4c 45 51  |lue of.AP9  BLEQ|
0000f510  20 20 20 20 20 75 70 20  20 20 20 20 20 20 20 20  |     up         |
0000f520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f530  20 3b 74 68 65 20 45 6e  64 20 69 63 6f 6e 2e 0d  | ;the End icon..|
0000f540  41 5a 04 0d 41 64 4f 20  43 4d 50 20 20 20 20 20  |AZ..AdO CMP     |
0000f550  20 52 36 2c 23 31 32 20  20 20 20 20 20 20 20 20  | R6,#12         |
0000f560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0000f570  68 69 73 20 73 65 63 74  69 6f 6e 20 64 65 63 72  |his section decr|
0000f580  65 61 73 65 73 20 74 68  65 20 76 61 6c 75 65 20  |eases the value |
0000f590  6f 66 0d 41 6e 39 20 20  42 4c 45 51 20 20 20 20  |of.An9  BLEQ    |
0000f5a0  20 64 6f 77 6e 20 20 20  20 20 20 20 20 20 20 20  | down           |
0000f5b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 68  |             ;th|
0000f5c0  65 20 45 6e 64 20 69 63  6f 6e 2e 0d 41 78 04 0d  |e End icon..Ax..|
0000f5d0  41 82 1e 4c 44 4d 46 44  20 20 20 20 52 31 33 21  |A..LDMFD    R13!|
0000f5e0  2c 7b 52 30 2d 52 31 32  2c 50 43 7d 5e 0d 41 8c  |,{R0-R12,PC}^.A.|
0000f5f0  04 0d 41 96 52 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..A.R;----------|
0000f600  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000f640  2d 2d 2d 0d 41 a0 33 3b  20 20 20 20 20 20 20 20  |---.A.3;        |
0000f650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f660  20 20 20 20 20 2a 2a 2a  20 53 74 61 72 74 44 72  |     *** StartDr|
0000f670  61 67 20 2a 2a 2a 0d 41  aa 52 3b 20 54 68 69 73  |ag ***.A.R; This|
0000f680  20 73 75 62 72 6f 75 74  69 6e 65 20 69 6e 69 74  | subroutine init|
0000f690  69 61 74 65 73 20 61 20  64 72 61 67 20 6f 70 65  |iates a drag ope|
0000f6a0  72 61 74 69 6f 6e 20 77  68 65 6e 20 74 68 65 20  |ration when the |
0000f6b0  75 73 65 72 20 64 72 61  67 73 20 6f 75 72 20 66  |user drags our f|
0000f6c0  69 6c 65 20 69 63 6f 6e  0d 41 b4 52 3b 20 66 72  |ile icon.A.R; fr|
0000f6d0  6f 6d 20 74 68 65 20 53  61 76 65 20 64 69 61 6c  |om the Save dial|
0000f6e0  6f 67 75 65 20 62 6f 78  2e 20 44 65 70 65 6e 64  |ogue box. Depend|
0000f6f0  69 6e 67 20 6f 6e 20 68  6f 77 20 74 68 65 20 68  |ing on how the h|
0000f700  6f 73 74 20 63 6f 6d 70  75 74 65 72 20 69 73 20  |ost computer is |
0000f710  63 6f 6e 66 69 67 75 72  65 64 0d 41 be 51 3b 20  |configured.A.Q; |
0000f720  65 69 74 68 65 72 20 61  20 64 61 73 68 65 64 20  |either a dashed |
0000f730  6f 75 74 6c 69 6e 65 20  6f 72 20 61 20 73 6f 6c  |outline or a sol|
0000f740  69 64 20 73 70 72 69 74  65 20 77 69 6c 6c 20 66  |id sprite will f|
0000f750  6f 6c 6c 6f 77 20 74 68  65 20 6d 6f 75 73 65 20  |ollow the mouse |
0000f760  70 6f 69 6e 74 65 72 20  66 6f 72 0d 41 c8 51 3b  |pointer for.A.Q;|
0000f770  20 74 68 65 20 64 75 72  61 74 69 6f 6e 20 6f 66  | the duration of|
0000f780  20 74 68 65 20 64 72 61  67 2e 20 41 20 27 44 72  | the drag. A 'Dr|
0000f790  61 67 5f 46 69 6e 69 73  68 65 64 27 20 72 65 61  |ag_Finished' rea|
0000f7a0  73 6f 6e 20 63 6f 64 65  20 77 69 6c 6c 20 62 65  |son code will be|
0000f7b0  20 72 65 74 75 72 6e 65  64 20 74 6f 0d 41 d2 43  | returned to.A.C|
0000f7c0  3b 20 75 73 20 62 79 20  57 69 6d 70 5f 50 6f 6c  |; us by Wimp_Pol|
0000f7d0  6c 20 77 68 65 6e 20 74  68 65 20 75 73 65 72 20  |l when the user |
0000f7e0  72 65 6c 65 61 73 65 73  20 61 6c 6c 20 74 68 65  |releases all the|
0000f7f0  20 6d 6f 75 73 65 20 62  75 74 74 6f 6e 73 2e 0d  | mouse buttons..|
0000f800  41 dc 04 0d 41 e6 0e 2e  53 74 61 72 74 44 72 61  |A...A...StartDra|
0000f810  67 0d 41 f0 04 0d 41 fa  1e 53 54 4d 46 44 20 20  |g.A...A..STMFD  |
0000f820  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 52  |  R13!,{R0-R12,R|
0000f830  31 34 7d 0d 42 04 04 0d  42 0e 4f 20 4c 44 52 20  |14}.B...B.O LDR |
0000f840  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 73 61  |     R0,[R12,#sa|
0000f850  76 65 25 5d 20 20 20 20  20 20 20 20 20 20 20 20  |ve%]            |
0000f860  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000f870  73 74 6f 72 65 73 20 74  68 65 20 53 61 76 65 20  |stores the Save |
0000f880  77 69 6e 64 6f 77 0d 42  18 52 20 53 54 52 20 20  |window.B.R STR  |
0000f890  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 62 6c 6f  |    R0,[R12,#blo|
0000f8a0  63 6b 25 2b 30 5d 20 20  20 20 20 20 20 20 20 20  |ck%+0]          |
0000f8b0  20 3b 68 61 6e 64 6c 65  20 69 6e 20 74 68 65 20  | ;handle in the |
0000f8c0  57 69 6d 70 20 50 61 72  61 6d 65 74 65 72 20 42  |Wimp Parameter B|
0000f8d0  6c 6f 63 6b 20 61 6e 64  0d 42 22 40 20 53 54 52  |lock and.B"@ STR|
0000f8e0  20 20 20 20 20 20 52 30  2c 5b 52 39 2c 23 30 5d  |      R0,[R9,#0]|
0000f8f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f900  20 20 20 3b 74 68 65 20  4d 69 73 63 2e 20 77 6f  |   ;the Misc. wo|
0000f910  72 6b 73 70 61 63 65 2e  0d 42 2c 04 0d 42 36 52  |rkspace..B,..B6R|
0000f920  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 31 20  | MOV      R0,#1 |
0000f930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000f940  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
0000f950  74 69 6f 6e 20 73 74 6f  72 65 73 20 74 68 65 20  |tion stores the |
0000f960  69 63 6f 6e 20 68 61 6e  64 6c 65 20 6f 66 0d 42  |icon handle of.B|
0000f970  40 4c 20 53 54 52 20 20  20 20 20 20 52 30 2c 5b  |@L STR      R0,[|
0000f980  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 34 5d 20 20  |R12,#block%+4]  |
0000f990  20 20 20 20 20 20 20 20  20 3b 74 68 65 20 46 69  |         ;the Fi|
0000f9a0  6c 65 20 69 63 6f 6e 20  69 6e 20 74 68 65 20 57  |le icon in the W|
0000f9b0  69 6d 70 20 42 6c 6f 63  6b 2e 0d 42 4a 04 0d 42  |imp Block..BJ..B|
0000f9c0  54 4f 20 41 44 44 20 20  20 20 20 20 52 31 2c 52  |TO ADD      R1,R|
0000f9d0  31 32 2c 23 62 6c 6f 63  6b 25 20 20 20 20 20 20  |12,#block%      |
0000f9e0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0000f9f0  65 63 74 69 6f 6e 20 67  65 74 73 20 69 6e 66 6f  |ection gets info|
0000fa00  72 6d 61 74 69 6f 6e 20  61 62 6f 75 74 0d 42 5e  |rmation about.B^|
0000fa10  4a 20 53 57 49 20 20 20  20 20 20 22 57 69 6d 70  |J SWI      "Wimp|
0000fa20  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 20 20  |_GetIconState"  |
0000fa30  20 20 20 20 20 20 20 20  3b 74 68 65 20 70 6f 73  |        ;the pos|
0000fa40  69 74 69 6f 6e 20 6f 66  20 74 68 65 20 46 69 6c  |ition of the Fil|
0000fa50  65 20 69 63 6f 6e 2e 0d  42 68 04 0d 42 72 4f 20  |e icon..Bh..BrO |
0000fa60  4d 4f 56 20 20 20 20 20  20 52 31 2c 52 39 20 20  |MOV      R1,R9  |
0000fa70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fa80  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000fa90  69 6f 6e 20 67 65 74 73  20 69 6e 66 6f 72 6d 61  |ion gets informa|
0000faa0  74 69 6f 6e 20 61 62 6f  75 74 0d 42 7c 52 20 53  |tion about.B|R S|
0000fab0  57 49 20 20 20 20 20 20  22 57 69 6d 70 5f 47 65  |WI      "Wimp_Ge|
0000fac0  74 57 69 6e 64 6f 77 53  74 61 74 65 22 20 20 20  |tWindowState"   |
0000fad0  20 20 20 20 20 3b 74 68  65 20 70 6f 73 69 74 69  |     ;the positi|
0000fae0  6f 6e 20 6f 66 20 74 68  65 20 53 61 76 65 20 44  |on of the Save D|
0000faf0  69 61 6c 6f 67 75 65 20  62 6f 78 2e 0d 42 86 04  |ialogue box..B..|
0000fb00  0d 42 90 4d 20 4c 44 52  20 20 20 20 20 20 52 31  |.B.M LDR      R1|
0000fb10  2c 5b 52 39 2c 23 34 5d  20 20 20 20 20 20 20 20  |,[R9,#4]        |
0000fb20  20 20 20 20 20 20 20 20  20 20 20 3b 56 69 73 69  |           ;Visi|
0000fb30  62 6c 65 20 61 72 65 61  20 6d 69 6e 69 6d 75 6d  |ble area minimum|
0000fb40  20 78 20 63 6f 6f 72 64  69 6e 61 74 65 0d 42 9a  | x coordinate.B.|
0000fb50  53 20 4c 44 52 20 20 20  20 20 20 52 32 2c 5b 52  |S LDR      R2,[R|
0000fb60  39 2c 23 32 30 5d 20 20  20 20 20 20 20 20 20 20  |9,#20]          |
0000fb70  20 20 20 20 20 20 20 20  3b 53 63 72 6f 6c 6c 20  |        ;Scroll |
0000fb80  78 20 6f 66 66 73 65 74  20 72 65 6c 61 74 69 76  |x offset relativ|
0000fb90  65 20 74 6f 20 77 6f 72  6b 20 6f 72 69 67 69 6e  |e to work origin|
0000fba0  0d 42 a4 51 20 53 55 42  20 20 20 20 20 20 52 31  |.B.Q SUB      R1|
0000fbb0  2c 52 31 2c 52 32 20 20  20 20 20 20 20 20 20 20  |,R1,R2          |
0000fbc0  20 20 20 20 20 20 20 20  20 20 20 3b 63 61 6c 63  |           ;calc|
0000fbd0  75 6c 61 74 65 20 78 20  6f 66 66 73 65 74 20 6f  |ulate x offset o|
0000fbe0  66 20 69 63 6f 6e 20 69  6e 20 77 69 6e 64 6f 77  |f icon in window|
0000fbf0  2e 0d 42 ae 04 0d 42 b8  4e 20 4c 44 52 20 20 20  |..B...B.N LDR   |
0000fc00  20 20 20 52 32 2c 5b 52  39 2c 23 31 36 5d 20 20  |   R2,[R9,#16]  |
0000fc10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fc20  3b 56 69 73 69 62 6c 65  20 61 72 65 61 20 6d 61  |;Visible area ma|
0000fc30  78 69 6d 75 6d 20 79 20  63 6f 6f 72 64 69 6e 61  |ximum y coordina|
0000fc40  74 65 2e 0d 42 c2 53 20  4c 44 52 20 20 20 20 20  |te..B.S LDR     |
0000fc50  20 52 33 2c 5b 52 39 2c  23 32 34 5d 20 20 20 20  | R3,[R9,#24]    |
0000fc60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 53  |              ;S|
0000fc70  63 72 6f 6c 6c 20 79 20  6f 66 66 73 65 74 20 72  |croll y offset r|
0000fc80  65 6c 61 74 69 76 65 20  74 6f 20 77 6f 72 6b 20  |elative to work |
0000fc90  6f 72 69 67 69 6e 0d 42  cc 51 20 53 55 42 20 20  |origin.B.Q SUB  |
0000fca0  20 20 20 20 52 32 2c 52  32 2c 52 33 20 20 20 20  |    R2,R2,R3    |
0000fcb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fcc0  20 3b 63 61 6c 63 75 6c  61 74 65 20 79 20 6f 66  | ;calculate y of|
0000fcd0  66 73 65 74 20 6f 66 20  69 63 6f 6e 20 69 6e 20  |fset of icon in |
0000fce0  77 69 6e 64 6f 77 2e 0d  42 d6 04 0d 42 e0 52 20  |window..B...B.R |
0000fcf0  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
0000fd00  2c 23 62 6c 6f 63 6b 25  2b 38 5d 20 20 20 20 20  |,#block%+8]     |
0000fd10  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0000fd20  69 6f 6e 20 63 61 6c 63  75 6c 61 74 65 73 20 74  |ion calculates t|
0000fd30  68 65 20 61 63 74 75 61  6c 20 6d 61 78 0d 42 ea  |he actual max.B.|
0000fd40  4e 20 41 44 44 20 20 20  20 20 20 52 30 2c 52 30  |N ADD      R0,R0|
0000fd50  2c 52 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R1             |
0000fd60  20 20 20 20 20 20 20 20  3b 79 20 63 6f 6f 72 64  |        ;y coord|
0000fd70  69 6e 61 74 65 20 6f 66  20 74 68 65 20 69 63 6f  |inate of the ico|
0000fd80  6e 20 69 6e 20 73 63 72  65 65 6e 0d 42 f4 38 20  |n in screen.B.8 |
0000fd90  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |STR      R0,[R12|
0000fda0  2c 23 62 6c 6f 63 6b 25  2b 38 5d 20 20 20 20 20  |,#block%+8]     |
0000fdb0  20 20 20 20 20 20 3b 63  6f 6f 72 64 69 6e 61 74  |      ;coordinat|
0000fdc0  65 73 2e 0d 42 fe 04 0d  43 08 52 20 4c 44 52 20  |es..B...C.R LDR |
0000fdd0  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
0000fde0  6f 63 6b 25 2b 31 32 5d  20 20 20 20 20 20 20 20  |ock%+12]        |
0000fdf0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0000fe00  63 61 6c 63 75 6c 61 74  65 73 20 74 68 65 20 61  |calculates the a|
0000fe10  63 74 75 61 6c 20 6d 61  78 0d 43 12 4e 20 41 44  |ctual max.C.N AD|
0000fe20  44 20 20 20 20 20 20 52  30 2c 52 30 2c 52 32 20  |D      R0,R0,R2 |
0000fe30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000fe40  20 20 20 20 3b 78 20 63  6f 6f 72 64 69 6e 61 74  |    ;x coordinat|
0000fe50  65 20 6f 66 20 74 68 65  20 69 63 6f 6e 20 69 6e  |e of the icon in|
0000fe60  20 73 63 72 65 65 6e 0d  43 1c 38 20 53 54 52 20  | screen.C.8 STR |
0000fe70  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
0000fe80  6f 63 6b 25 2b 31 32 5d  20 20 20 20 20 20 20 20  |ock%+12]        |
0000fe90  20 20 3b 63 6f 6f 72 64  69 6e 61 74 65 73 2e 0d  |  ;coordinates..|
0000fea0  43 26 04 0d 43 30 52 20  4c 44 52 20 20 20 20 20  |C&..C0R LDR     |
0000feb0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
0000fec0  2b 31 36 5d 20 20 20 20  20 20 20 20 20 20 3b 54  |+16]          ;T|
0000fed0  68 69 73 20 73 65 63 74  69 6f 6e 20 63 61 6c 63  |his section calc|
0000fee0  75 6c 61 74 65 73 20 74  68 65 20 61 63 74 75 61  |ulates the actua|
0000fef0  6c 20 6d 69 6e 0d 43 3a  4e 20 41 44 44 20 20 20  |l min.C:N ADD   |
0000ff00  20 20 20 52 30 2c 52 30  2c 52 31 20 20 20 20 20  |   R0,R0,R1     |
0000ff10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000ff20  3b 79 20 63 6f 6f 72 64  69 6e 61 74 65 20 6f 66  |;y coordinate of|
0000ff30  20 74 68 65 20 69 63 6f  6e 20 69 6e 20 73 63 72  | the icon in scr|
0000ff40  65 65 6e 0d 43 44 38 20  53 54 52 20 20 20 20 20  |een.CD8 STR     |
0000ff50  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
0000ff60  2b 31 36 5d 20 20 20 20  20 20 20 20 20 20 3b 63  |+16]          ;c|
0000ff70  6f 6f 72 64 69 6e 61 74  65 73 2e 0d 43 4e 04 0d  |oordinates..CN..|
0000ff80  43 58 52 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |CXR LDR      R0,|
0000ff90  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 32 30 5d  |[R12,#block%+20]|
0000ffa0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0000ffb0  73 65 63 74 69 6f 6e 20  63 61 6c 63 75 6c 61 74  |section calculat|
0000ffc0  65 73 20 74 68 65 20 61  63 74 75 61 6c 20 6d 69  |es the actual mi|
0000ffd0  6e 0d 43 62 4e 20 41 44  44 20 20 20 20 20 20 52  |n.CbN ADD      R|
0000ffe0  30 2c 52 30 2c 52 32 20  20 20 20 20 20 20 20 20  |0,R0,R2         |
0000fff0  20 20 20 20 20 20 20 20  20 20 20 20 3b 78 20 63  |            ;x c|
00010000  6f 6f 72 64 69 6e 61 74  65 20 6f 66 20 74 68 65  |oordinate of the|
00010010  20 69 63 6f 6e 20 69 6e  20 73 63 72 65 65 6e 0d  | icon in screen.|
00010020  43 6c 38 20 53 54 52 20  20 20 20 20 20 52 30 2c  |Cl8 STR      R0,|
00010030  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 32 30 5d  |[R12,#block%+20]|
00010040  20 20 20 20 20 20 20 20  20 20 3b 63 6f 6f 72 64  |          ;coord|
00010050  69 6e 61 74 65 73 2e 0d  43 76 04 0d 43 80 4d 20  |inates..Cv..C.M |
00010060  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 35 20 20  |MOV      R0,#5  |
00010070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010080  20 20 20 20 20 20 3b 44  72 61 67 20 74 79 70 65  |      ;Drag type|
00010090  20 35 20 2d 20 44 72 61  67 20 66 69 78 65 64 20  | 5 - Drag fixed |
000100a0  73 69 78 65 20 62 6f 78  0d 43 8a 20 20 53 54 52  |sixe box.C.  STR|
000100b0  20 20 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 62  |      R0,[R12,#b|
000100c0  6c 6f 63 6b 25 2b 34 5d  0d 43 94 04 0d 43 9e 53  |lock%+4].C...C.S|
000100d0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 30 20  | MOV      R0,#0 |
000100e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000100f0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00010100  74 69 6f 6e 20 73 65 74  73 20 74 68 65 20 70 61  |tion sets the pa|
00010110  72 65 6e 74 20 62 6f 78  2c 20 77 68 69 63 68 0d  |rent box, which.|
00010120  43 a8 52 20 53 54 52 20  20 20 20 20 20 52 30 2c  |C.R STR      R0,|
00010130  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 32 34 5d  |[R12,#block%+24]|
00010140  20 20 20 20 20 20 20 20  20 20 3b 74 68 65 20 69  |          ;the i|
00010150  63 6f 6e 20 63 61 6e 20  62 65 20 64 72 61 67 67  |con can be dragg|
00010160  65 64 20 61 72 6f 75 6e  64 20 69 6e 73 69 64 65  |ed around inside|
00010170  2c 0d 43 b2 3c 20 53 54  52 20 20 20 20 20 20 52  |,.C.< STR      R|
00010180  30 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 32  |0,[R12,#block%+2|
00010190  38 5d 20 20 20 20 20 20  20 20 20 20 3b 74 6f 20  |8]          ;to |
000101a0  6d 61 78 69 6d 75 6d 20  73 69 7a 65 2e 0d 43 bc  |maximum size..C.|
000101b0  13 20 4d 56 4e 20 20 20  20 20 20 52 30 2c 23 30  |. MVN      R0,#0|
000101c0  0d 43 c6 21 20 53 54 52  20 20 20 20 20 20 52 30  |.C.! STR      R0|
000101d0  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 33 32  |,[R12,#block%+32|
000101e0  5d 0d 43 d0 21 20 53 54  52 20 20 20 20 20 20 52  |].C.! STR      R|
000101f0  30 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 33  |0,[R12,#block%+3|
00010200  36 5d 0d 43 da 04 0d 43  e4 51 20 41 44 44 20 20  |6].C...C.Q ADD  |
00010210  20 20 20 20 52 31 2c 52  31 32 2c 23 62 6c 6f 63  |    R1,R12,#bloc|
00010220  6b 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |k%              |
00010230  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 73  | ;This section s|
00010240  74 61 72 74 73 20 61 20  64 72 61 67 20 6f 70 65  |tarts a drag ope|
00010250  72 61 74 69 6f 6e 2e 0d  43 ee 1c 20 53 57 49 20  |ration..C.. SWI |
00010260  20 20 20 20 20 22 57 69  6d 70 5f 44 72 61 67 42  |     "Wimp_DragB|
00010270  6f 78 22 0d 43 f8 04 0d  44 02 1e 4c 44 4d 46 44  |ox".C...D..LDMFD|
00010280  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
00010290  2c 50 43 7d 5e 0d 44 0c  04 0d 44 16 53 3b 2d 2d  |,PC}^.D...D.S;--|
000102a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000102e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 44 20 32  |------------.D 2|
000102f0  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00010300  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
00010310  4b 65 79 50 72 65 73 73  65 64 20 2a 2a 2a 0d 44  |KeyPressed ***.D|
00010320  2a 51 3b 20 54 68 69 73  20 73 65 63 74 69 6f 6e  |*Q; This section|
00010330  20 64 65 61 6c 73 20 77  69 74 68 20 6b 65 79 70  | deals with keyp|
00010340  72 65 73 73 65 73 20 69  6e 20 61 6e 79 20 6f 66  |resses in any of|
00010350  20 6f 75 72 20 77 72 69  74 65 61 62 6c 65 20 69  | our writeable i|
00010360  63 6f 6e 73 2e 20 50 72  69 6e 74 61 62 6c 65 0d  |cons. Printable.|
00010370  44 34 51 3b 20 63 68 61  72 61 63 74 65 72 73 20  |D4Q; characters |
00010380  77 68 69 63 68 20 61 72  65 20 61 6c 6c 6f 77 65  |which are allowe|
00010390  64 20 62 79 20 74 68 65  20 69 63 6f 6e 73 20 76  |d by the icons v|
000103a0  61 6c 69 64 61 74 69 6f  6e 20 73 74 72 69 6e 67  |alidation string|
000103b0  20 77 69 6c 6c 20 62 65  20 77 72 69 74 74 65 6e  | will be written|
000103c0  0d 44 3e 4d 3b 20 61 75  74 6f 6d 61 74 69 63 61  |.D>M; automatica|
000103d0  6c 6c 79 20 69 6e 74 6f  20 74 68 65 20 77 72 69  |lly into the wri|
000103e0  74 61 62 6c 65 20 69 63  6f 6e 2e 20 4f 6e 6c 79  |table icon. Only|
000103f0  20 6e 6f 6e 20 70 72 69  6e 74 61 62 6c 65 20 63  | non printable c|
00010400  68 61 72 61 63 74 65 72  73 20 61 72 65 0d 44 48  |haracters are.DH|
00010410  44 3b 20 72 65 74 75 72  6e 65 64 20 74 6f 20 75  |D; returned to u|
00010420  73 20 76 69 61 20 61 20  27 4b 65 79 5f 50 72 65  |s via a 'Key_Pre|
00010430  73 73 65 64 27 20 72 65  61 73 6f 6e 20 63 6f 64  |ssed' reason cod|
00010440  65 20 66 72 6f 6d 20 57  69 6d 70 5f 50 6f 6c 6c  |e from Wimp_Poll|
00010450  2e 0d 44 52 04 0d 44 5c  0f 2e 4b 65 79 50 72 65  |..DR..D\..KeyPre|
00010460  73 73 65 64 0d 44 66 04  0d 44 70 1e 53 54 4d 46  |ssed.Df..Dp.STMF|
00010470  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
00010480  32 2c 52 31 34 7d 0d 44  7a 04 0d 44 84 3a 20 4c  |2,R14}.Dz..D.: L|
00010490  44 52 20 20 20 20 20 20  52 32 2c 5b 52 31 32 2c  |DR      R2,[R12,|
000104a0  23 62 6c 6f 63 6b 25 2b  30 5d 20 20 20 20 20 20  |#block%+0]      |
000104b0  20 20 20 20 20 3b 57 69  6e 64 6f 77 20 68 61 6e  |     ;Window han|
000104c0  64 6c 65 2e 0d 44 8e 38  20 4c 44 52 20 20 20 20  |dle..D.8 LDR    |
000104d0  20 20 52 33 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R3,[R12,#block|
000104e0  25 2b 34 5d 20 20 20 20  20 20 20 20 20 20 20 3b  |%+4]           ;|
000104f0  49 63 6f 6e 20 68 61 6e  64 6c 65 2e 0d 44 98 3c  |Icon handle..D.<|
00010500  20 4c 44 52 20 20 20 20  20 20 52 34 2c 5b 52 31  | LDR      R4,[R1|
00010510  32 2c 23 62 6c 6f 63 6b  25 2b 32 34 5d 20 20 20  |2,#block%+24]   |
00010520  20 20 20 20 20 20 20 3b  4b 65 79 63 6f 64 65 20  |       ;Keycode |
00010530  70 72 65 73 73 65 64 2e  0d 44 a2 41 20 4c 44 52  |pressed..D.A LDR|
00010540  20 20 20 20 20 20 52 35  2c 5b 52 31 32 2c 23 73  |      R5,[R12,#s|
00010550  65 61 72 63 68 25 5d 20  20 20 20 20 20 20 20 20  |earch%]         |
00010560  20 20 20 3b 53 65 61 72  63 68 20 77 69 6e 64 6f  |   ;Search windo|
00010570  77 20 68 61 6e 64 6c 65  2e 0d 44 ac 3f 20 4c 44  |w handle..D.? LD|
00010580  52 20 20 20 20 20 20 52  36 2c 5b 52 31 32 2c 23  |R      R6,[R12,#|
00010590  65 64 69 74 25 5d 20 20  20 20 20 20 20 20 20 20  |edit%]          |
000105a0  20 20 20 20 3b 45 64 69  74 20 77 69 6e 64 6f 77  |    ;Edit window|
000105b0  20 68 61 6e 64 6c 65 2e  0d 44 b6 04 0d 44 c0 52  | handle..D...D.R|
000105c0  20 43 4d 50 20 20 20 20  20 20 52 32 2c 52 35 20  | CMP      R2,R5 |
000105d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000105e0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000105f0  74 69 6f 6e 20 73 74 61  72 74 73 20 61 20 73 65  |tion starts a se|
00010600  61 72 63 68 20 69 66 20  52 65 74 75 72 6e 0d 44  |arch if Return.D|
00010610  ca 4f 20 20 43 4d 50 45  51 20 20 20 20 52 33 2c  |.O  CMPEQ    R3,|
00010620  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00010630  20 20 20 20 20 20 20 20  20 3b 69 73 20 70 72 65  |         ;is pre|
00010640  73 73 65 64 20 69 6e 20  74 68 65 20 77 72 69 74  |ssed in the writ|
00010650  65 61 62 6c 65 20 69 63  6f 6e 20 69 6e 0d 44 d4  |eable icon in.D.|
00010660  4e 20 20 20 43 4d 50 45  51 20 20 20 20 52 34 2c  |N   CMPEQ    R4,|
00010670  23 31 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |#13             |
00010680  20 20 20 20 20 20 20 20  3b 53 65 61 72 63 68 20  |        ;Search |
00010690  57 69 6e 64 6f 77 2e 20  49 74 20 61 6c 73 6f 20  |Window. It also |
000106a0  72 65 6d 6f 76 65 73 20  74 68 65 0d 44 de 41 20  |removes the.D.A |
000106b0  20 20 20 20 42 4c 45 51  20 20 20 20 53 74 61 72  |    BLEQ    Star|
000106c0  74 53 65 61 72 63 68 20  20 20 20 20 20 20 20 20  |tSearch         |
000106d0  20 20 20 20 20 20 3b 4d  65 6e 75 20 66 72 6f 6d  |      ;Menu from|
000106e0  20 74 68 65 20 73 63 72  65 65 6e 2e 0d 44 e8 16  | the screen..D..|
000106f0  20 20 20 20 20 4d 56 4e  45 51 20 20 20 52 31 2c  |     MVNEQ   R1,|
00010700  23 30 0d 44 f2 22 20 20  20 20 20 53 57 49 45 51  |#0.D."     SWIEQ|
00010710  20 20 20 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  |   "Wimp_CreateM|
00010720  65 6e 75 22 0d 44 fc 22  20 20 20 20 20 4c 44 4d  |enu".D."     LDM|
00010730  45 51 46 44 20 52 31 33  21 2c 7b 52 30 2d 52 31  |EQFD R13!,{R0-R1|
00010740  32 2c 50 43 7d 5e 0d 45  06 4e 20 20 20 20 20 20  |2,PC}^.E.N      |
00010750  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00010770  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
00010780  61 6c 6c 73 20 61 20 73  75 62 72 6f 75 74 69 6e  |alls a subroutin|
00010790  65 20 74 6f 0d 45 10 4d  20 43 4d 50 20 20 20 20  |e to.E.M CMP    |
000107a0  20 20 52 36 2c 52 32 20  20 20 20 20 20 20 20 20  |  R6,R2         |
000107b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000107c0  6d 6f 76 65 20 74 68 65  20 63 61 72 65 74 20 64  |move the caret d|
000107d0  6f 77 6e 20 69 6e 74 6f  20 74 68 65 20 6e 65 78  |own into the nex|
000107e0  74 0d 45 1a 51 20 20 43  4d 50 45 51 20 20 20 20  |t.E.Q  CMPEQ    |
000107f0  52 34 2c 23 31 33 20 20  20 20 20 20 20 20 20 20  |R4,#13          |
00010800  20 20 20 20 20 20 20 20  20 20 20 20 3b 77 72 69  |            ;wri|
00010810  74 65 61 62 6c 65 20 69  63 6f 6e 20 77 68 65 6e  |teable icon when|
00010820  20 52 65 74 75 72 6e 20  69 73 20 70 72 65 73 73  | Return is press|
00010830  65 64 0d 45 24 3f 20 20  20 42 4c 45 51 20 20 20  |ed.E$?   BLEQ   |
00010840  20 20 6d 6f 76 65 63 61  72 65 74 64 6f 77 6e 20  |  movecaretdown |
00010850  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 69 6e  |             ;in|
00010860  20 74 68 65 20 45 64 69  74 20 77 69 6e 64 6f 77  | the Edit window|
00010870  2e 0d 45 2e 21 20 20 20  4c 44 4d 45 51 46 44 20  |..E.!   LDMEQFD |
00010880  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
00010890  7d 5e 0d 45 38 04 0d 45  42 4e 20 43 4d 50 20 20  |}^.E8..EBN CMP  |
000108a0  20 20 20 20 52 36 2c 52  32 20 20 20 20 20 20 20  |    R6,R2       |
000108b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000108c0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
000108d0  61 6c 6c 73 20 61 20 73  75 62 72 6f 75 74 69 6e  |alls a subroutin|
000108e0  65 20 74 6f 0d 45 4c 4a  20 20 ec 51 20 20 20 20  |e to.ELJ  .Q    |
000108f0  52 38 2c 20 20 20 23 26  31 30 30 20 20 20 20 20  |R8,   #&100     |
00010900  20 20 20 20 20 20 20 20  20 20 20 20 3b 6d 6f 76  |            ;mov|
00010910  65 20 74 68 65 20 63 61  72 65 74 20 64 6f 77 6e  |e the caret down|
00010920  20 69 6e 74 6f 20 74 68  65 20 6e 65 78 74 0d 45  | into the next.E|
00010930  56 51 20 20 41 44 44 45  51 20 20 20 20 52 38 2c  |VQ  ADDEQ    R8,|
00010940  52 38 2c 23 26 30 38 45  20 20 20 20 20 20 20 20  |R8,#&08E        |
00010950  20 20 20 20 20 20 20 20  20 3b 77 72 69 74 65 61  |         ;writea|
00010960  62 6c 65 20 69 63 6f 6e  20 77 68 65 6e 20 74 68  |ble icon when th|
00010970  65 20 44 6f 77 6e 20 61  72 72 6f 77 20 69 73 0d  |e Down arrow is.|
00010980  45 60 4b 20 20 43 4d 50  45 51 20 20 20 20 52 34  |E`K  CMPEQ    R4|
00010990  2c 52 38 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R8             |
000109a0  20 20 20 20 20 20 20 20  20 20 3b 70 72 65 73 73  |          ;press|
000109b0  65 64 20 77 69 74 68 69  6e 20 74 68 65 20 45 64  |ed within the Ed|
000109c0  69 74 20 77 69 6e 64 6f  77 2e 0d 45 6a 1d 20 20  |it window..Ej.  |
000109d0  20 42 4c 45 51 20 20 20  20 20 6d 6f 76 65 63 61  | BLEQ     moveca|
000109e0  72 65 74 64 6f 77 6e 0d  45 74 21 20 20 20 4c 44  |retdown.Et!   LD|
000109f0  4d 45 51 46 44 20 20 52  31 33 21 2c 7b 52 30 2d  |MEQFD  R13!,{R0-|
00010a00  52 31 32 2c 50 43 7d 5e  0d 45 7e 04 0d 45 88 4e  |R12,PC}^.E~..E.N|
00010a10  20 43 4d 50 20 20 20 20  20 20 52 36 2c 52 32 20  | CMP      R6,R2 |
00010a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010a30  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00010a40  74 69 6f 6e 20 63 61 6c  6c 73 20 61 20 73 75 62  |tion calls a sub|
00010a50  72 6f 75 74 69 6e 65 20  74 6f 0d 45 92 48 20 20  |routine to.E.H  |
00010a60  ec 51 20 20 20 20 52 38  2c 20 20 20 23 26 31 30  |.Q    R8,   #&10|
00010a70  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00010a80  20 20 3b 6d 6f 76 65 20  74 68 65 20 63 61 72 65  |  ;move the care|
00010a90  74 20 75 70 20 69 6e 74  6f 20 74 68 65 20 6e 65  |t up into the ne|
00010aa0  78 74 0d 45 9c 4f 20 20  41 44 44 45 51 20 20 20  |xt.E.O  ADDEQ   |
00010ab0  20 52 38 2c 52 38 2c 23  26 30 38 46 20 20 20 20  | R8,R8,#&08F    |
00010ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 77 72  |             ;wr|
00010ad0  69 74 65 61 62 6c 65 20  69 63 6f 6e 20 77 68 65  |iteable icon whe|
00010ae0  6e 20 74 68 65 20 55 70  20 61 72 72 6f 77 20 69  |n the Up arrow i|
00010af0  73 0d 45 a6 4b 20 20 43  4d 50 45 51 20 20 20 20  |s.E.K  CMPEQ    |
00010b00  52 34 2c 52 38 20 20 20  20 20 20 20 20 20 20 20  |R4,R8           |
00010b10  20 20 20 20 20 20 20 20  20 20 20 20 3b 70 72 65  |            ;pre|
00010b20  73 73 65 64 20 77 69 74  68 69 6e 20 74 68 65 20  |ssed within the |
00010b30  45 64 69 74 20 77 69 6e  64 6f 77 2e 0d 45 b0 1b  |Edit window..E..|
00010b40  20 20 20 42 4c 45 51 20  20 20 20 20 6d 6f 76 65  |   BLEQ     move|
00010b50  63 61 72 65 74 75 70 0d  45 ba 21 20 20 20 4c 44  |caretup.E.!   LD|
00010b60  4d 45 51 46 44 20 20 52  31 33 21 2c 7b 52 30 2d  |MEQFD  R13!,{R0-|
00010b70  52 31 32 2c 50 43 7d 5e  0d 45 c4 04 0d 45 ce 4e  |R12,PC}^.E...E.N|
00010b80  20 4c 44 52 20 20 20 20  20 20 52 38 2c 5b 52 31  | LDR      R8,[R1|
00010b90  32 2c 23 73 61 76 65 25  5d 20 20 20 20 20 20 20  |2,#save%]       |
00010ba0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00010bb0  74 69 6f 6e 20 63 61 6c  6c 73 20 61 20 73 75 62  |tion calls a sub|
00010bc0  72 6f 75 74 69 6e 65 20  74 6f 0d 45 d8 4c 20 43  |routine to.E.L C|
00010bd0  4d 50 20 20 20 20 20 20  52 32 2c 52 38 20 20 20  |MP      R2,R8   |
00010be0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010bf0  20 20 20 20 20 3b 73 61  76 65 20 6f 72 20 65 78  |     ;save or ex|
00010c00  70 6f 72 74 20 61 72 74  69 63 6c 65 20 64 61 74  |port article dat|
00010c10  61 20 77 68 65 6e 0d 45  e2 51 20 20 43 4d 50 45  |a when.E.Q  CMPE|
00010c20  51 20 20 20 20 52 34 2c  23 31 33 20 20 20 20 20  |Q    R4,#13     |
00010c30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010c40  20 3b 52 65 74 75 72 6e  20 69 73 20 70 72 65 73  | ;Return is pres|
00010c50  73 65 64 20 77 69 74 68  69 6e 20 74 68 65 20 46  |sed within the F|
00010c60  69 6c 65 6e 61 6d 65 0d  45 ec 4d 20 20 20 43 4d  |ilename.E.M   CM|
00010c70  50 45 51 20 20 20 20 52  33 2c 23 32 20 20 20 20  |PEQ    R3,#2    |
00010c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010c90  20 20 3b 69 63 6f 6e 20  69 6e 20 74 68 65 20 53  |  ;icon in the S|
00010ca0  61 76 65 20 64 69 61 6c  6f 67 75 65 20 62 6f 78  |ave dialogue box|
00010cb0  2e 20 49 74 0d 45 f6 3e  20 20 20 20 ec 51 20 20  |. It.E.>    .Q  |
00010cc0  20 20 52 30 2c 52 38 20  20 20 20 20 20 20 20 20  |  R0,R8         |
00010cd0  20 20 20 20 20 20 20 20  20 20 20 20 3b 61 6c 73  |            ;als|
00010ce0  6f 20 63 6c 6f 73 65 73  20 74 68 65 20 6d 65 6e  |o closes the men|
00010cf0  75 2e 0d 46 00 13 20 20  20 20 ec 51 20 20 20 20  |u..F..    .Q    |
00010d00  52 31 2c 23 32 0d 46 0a  13 20 20 20 20 ec 51 20  |R1,#2.F..    .Q |
00010d10  20 20 20 52 32 2c 52 39  0d 46 14 19 20 20 20 20  |   R2,R9.F..    |
00010d20  42 4c 45 51 20 20 20 20  20 52 65 61 64 49 63 6f  |BLEQ     ReadIco|
00010d30  6e 0d 46 1e 1a 20 20 20  20 42 4c 45 51 20 20 20  |n.F..    BLEQ   |
00010d40  20 20 53 61 76 65 49 73  73 75 65 0d 46 28 16 20  |  SaveIssue.F(. |
00010d50  20 20 20 4d 56 4e 45 51  20 20 20 20 52 31 2c 23  |   MVNEQ    R1,#|
00010d60  30 0d 46 32 22 20 20 20  20 53 57 49 45 51 20 20  |0.F2"    SWIEQ  |
00010d70  20 20 22 57 69 6d 70 5f  43 72 65 61 74 65 4d 65  |  "Wimp_CreateMe|
00010d80  6e 75 22 0d 46 3c 22 20  20 20 20 4c 44 4d 45 51  |nu".F<"    LDMEQ|
00010d90  46 44 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |FD  R13!,{R0-R12|
00010da0  2c 50 43 7d 5e 0d 46 46  04 0d 46 50 4c 20 43 4d  |,PC}^.FF..FPL CM|
00010db0  50 20 20 20 20 20 20 52  32 2c 52 38 20 20 20 20  |P      R2,R8    |
00010dc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010dd0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00010de0  6e 20 75 70 64 61 74 65  73 20 74 68 65 20 64 65  |n updates the de|
00010df0  66 61 75 6c 74 0d 46 5a  4e 20 20 43 4d 50 45 51  |fault.FZN  CMPEQ|
00010e00  20 20 20 20 52 34 2c 23  31 33 20 20 20 20 20 20  |    R4,#13      |
00010e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00010e20  3b 46 69 6c 65 6e 61 6d  65 20 77 68 65 6e 20 52  |;Filename when R|
00010e30  65 74 75 72 6e 20 69 73  20 70 72 65 73 73 65 64  |eturn is pressed|
00010e40  20 69 6e 0d 46 64 3d 20  20 20 43 4d 50 45 51 20  | in.Fd=   CMPEQ |
00010e50  20 20 20 52 33 2c 23 37  20 20 20 20 20 20 20 20  |   R3,#7        |
00010e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 53  |              ;S|
00010e70  74 61 72 74 20 69 73 73  75 65 20 69 63 6f 6e 2e  |tart issue icon.|
00010e80  0d 46 6e 24 20 20 20 20  4c 44 52 45 51 20 20 20  |.Fn$    LDREQ   |
00010e90  20 52 30 2c 5b 52 31 30  2c 23 6d 75 6c 74 69 70  | R0,[R10,#multip|
00010ea0  6c 65 25 5d 0d 46 78 16  20 20 20 20 43 4d 50 45  |le%].Fx.    CMPE|
00010eb0  51 20 20 20 20 52 30 2c  23 30 0d 46 82 14 20 20  |Q    R0,#0.F..  |
00010ec0  20 20 20 ec 51 20 20 20  20 52 30 2c 52 38 0d 46  |   .Q    R0,R8.F|
00010ed0  8c 14 20 20 20 20 20 ec  51 20 20 20 20 52 31 2c  |..     .Q    R1,|
00010ee0  23 37 0d 46 96 14 20 20  20 20 20 ec 51 20 20 20  |#7.F..     .Q   |
00010ef0  20 52 32 2c 52 39 0d 46  a0 1a 20 20 20 20 20 42  | R2,R9.F..     B|
00010f00  4c 45 51 20 20 20 20 20  52 65 61 64 49 63 6f 6e  |LEQ     ReadIcon|
00010f10  0d 46 aa 15 20 20 20 20  20 ec 51 20 20 20 20 52  |.F..     .Q    R|
00010f20  31 2c 23 31 30 0d 46 b4  1b 20 20 20 20 20 42 4c  |1,#10.F..     BL|
00010f30  45 51 20 20 20 20 20 57  72 69 74 65 49 63 6f 6e  |EQ     WriteIcon|
00010f40  0d 46 be 20 20 20 20 20  20 42 4c 45 51 20 20 20  |.F.      BLEQ   |
00010f50  20 20 55 70 64 61 74 65  4c 65 61 66 4e 61 6d 65  |  UpdateLeafName|
00010f60  0d 46 c8 23 20 20 20 20  20 4c 44 4d 45 51 46 44  |.F.#     LDMEQFD|
00010f70  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 50  |  R13!,{R0-R12,P|
00010f80  43 7d 5e 0d 46 d2 04 0d  46 dc 51 20 4c 44 52 20  |C}^.F...F.Q LDR |
00010f90  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
00010fa0  6f 63 6b 25 2b 32 34 5d  20 20 20 20 20 20 20 20  |ock%+24]        |
00010fb0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00010fc0  70 61 73 73 65 73 20 61  6e 79 20 6b 65 79 70 72  |passes any keypr|
00010fd0  65 73 73 65 73 20 77 65  0d 46 e6 4e 20 53 57 49  |esses we.F.N SWI|
00010fe0  20 20 20 20 20 20 22 57  69 6d 70 5f 50 72 6f 63  |      "Wimp_Proc|
00010ff0  65 73 73 4b 65 79 22 20  20 20 20 20 20 20 20 20  |essKey"         |
00011000  20 20 20 3b 64 6f 6e 27  74 20 75 6e 64 65 72 73  |   ;don't unders|
00011010  74 61 6e 64 20 62 61 63  6b 20 74 6f 20 74 68 65  |tand back to the|
00011020  20 57 49 4d 50 2e 0d 46  f0 04 0d 46 fa 1e 4c 44  | WIMP..F...F..LD|
00011030  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00011040  52 31 32 2c 50 43 7d 5e  0d 47 04 04 0d 47 0e 53  |R12,PC}^.G...G.S|
00011050  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00011060  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00011090  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
000110a0  47 18 31 3b 20 20 20 20  20 20 20 20 20 20 20 20  |G.1;            |
000110b0  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2a 2a  |             ***|
000110c0  20 4d 6f 76 65 43 61 72  65 74 55 70 20 2a 2a 2a  | MoveCaretUp ***|
000110d0  0d 47 22 4d 3b 20 54 68  69 73 20 73 65 63 74 69  |.G"M; This secti|
000110e0  6f 6e 20 6d 6f 76 65 73  20 74 68 65 20 63 61 72  |on moves the car|
000110f0  65 74 20 69 6e 74 6f 20  74 68 65 20 70 72 65 76  |et into the prev|
00011100  69 6f 75 73 20 69 63 6f  6e 20 69 6e 20 74 68 65  |ious icon in the|
00011110  20 45 64 69 74 20 77 69  6e 64 6f 77 2e 0d 47 2c  | Edit window..G,|
00011120  04 0d 47 36 10 2e 6d 6f  76 65 63 61 72 65 74 75  |..G6..movecaretu|
00011130  70 0d 47 40 04 0d 47 4a  1e 53 54 4d 46 44 20 20  |p.G@..GJ.STMFD  |
00011140  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 52  |  R13!,{R0-R12,R|
00011150  31 34 7d 0d 47 54 04 0d  47 5e 51 20 43 4d 50 20  |14}.GT..G^Q CMP |
00011160  20 20 20 20 20 52 33 2c  23 31 38 20 20 20 20 20  |     R3,#18     |
00011170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011180  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00011190  63 68 65 63 6b 73 20 74  68 61 74 20 74 68 65 20  |checks that the |
000111a0  63 61 72 65 74 20 69 73  0d 47 68 4c 20 20 4c 44  |caret is.GhL  LD|
000111b0  4d 4c 53 46 44 20 20 52  31 33 21 2c 7b 52 30 2d  |MLSFD  R13!,{R0-|
000111c0  52 31 32 2c 50 43 7d 5e  20 20 20 20 20 20 20 20  |R12,PC}^        |
000111d0  20 20 20 3b 6e 6f 74 20  69 6e 20 74 68 65 20 66  |   ;not in the f|
000111e0  69 72 73 74 20 77 72 69  74 65 61 62 6c 65 20 69  |irst writeable i|
000111f0  63 6f 6e 2e 0d 47 72 04  0d 47 7c 4e 20 53 55 42  |con..Gr..G|N SUB|
00011200  20 20 20 20 20 20 52 37  2c 52 33 2c 23 31 20 20  |      R7,R3,#1  |
00011210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011220  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00011230  20 72 65 61 64 73 20 74  68 65 20 63 6f 6e 74 65  | reads the conte|
00011240  6e 74 73 20 6f 66 0d 47  86 50 20 4d 4f 56 20 20  |nts of.G.P MOV  |
00011250  20 20 20 20 52 30 2c 52  32 20 20 20 20 20 20 20  |    R0,R2       |
00011260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011270  20 3b 70 72 65 76 69 6f  75 73 20 69 63 6f 6e 20  | ;previous icon |
00011280  69 6e 74 6f 20 74 68 65  20 6d 69 73 63 2e 20 62  |into the misc. b|
00011290  75 66 66 65 72 2e 0d 47  90 13 20 4d 4f 56 20 20  |uffer..G.. MOV  |
000112a0  20 20 20 20 52 31 2c 52  37 0d 47 9a 13 20 4d 4f  |    R1,R7.G.. MO|
000112b0  56 20 20 20 20 20 20 52  32 2c 52 39 0d 47 a4 16  |V      R2,R9.G..|
000112c0  20 42 4c 20 20 20 20 20  20 20 52 65 61 64 49 63  | BL       ReadIc|
000112d0  6f 6e 0d 47 ae 04 0d 47  b8 50 20 4d 4f 56 20 20  |on.G...G.P MOV  |
000112e0  20 20 20 20 52 30 2c 52  39 20 20 20 20 20 20 20  |    R0,R9       |
000112f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011300  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 66  | ;This section f|
00011310  69 6e 64 73 20 74 68 65  20 6c 65 6e 67 74 68 20  |inds the length |
00011320  6f 66 20 74 68 65 0d 47  c2 52 20 4d 4f 56 20 20  |of the.G.R MOV  |
00011330  20 20 20 20 52 31 2c 23  31 33 20 20 20 20 20 20  |    R1,#13      |
00011340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011350  20 3b 73 74 72 69 6e 67  20 69 6e 20 74 68 65 20  | ;string in the |
00011360  70 72 65 76 69 6f 75 73  20 77 72 69 74 65 61 62  |previous writeab|
00011370  6c 65 20 69 63 6f 6e 2e  0d 47 cc 1a 20 53 57 49  |le icon..G.. SWI|
00011380  20 20 20 20 20 20 22 53  74 72 69 6e 67 5f 4c 65  |      "String_Le|
00011390  6e 22 0d 47 d6 51 20 20  20 20 20 20 20 20 20 20  |n".G.Q          |
000113a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000113b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
000113c0  69 73 20 73 65 63 74 69  6f 6e 20 6d 6f 76 65 73  |is section moves|
000113d0  20 74 68 65 20 63 61 72  65 74 20 74 6f 20 61 66  | the caret to af|
000113e0  74 65 72 0d 47 e0 4e 20  4d 4f 56 20 20 20 20 20  |ter.G.N MOV     |
000113f0  20 52 35 2c 52 31 20 20  20 20 20 20 20 20 20 20  | R5,R1          |
00011400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
00011410  68 65 20 6c 61 73 74 20  63 68 61 72 61 63 74 65  |he last characte|
00011420  72 20 69 6e 20 74 68 65  20 70 72 65 76 69 6f 75  |r in the previou|
00011430  73 0d 47 ea 3b 20 4d 4f  56 20 20 20 20 20 20 52  |s.G.; MOV      R|
00011440  30 2c 52 36 20 20 20 20  20 20 20 20 20 20 20 20  |0,R6            |
00011450  20 20 20 20 20 20 20 20  20 20 20 20 3b 77 72 69  |            ;wri|
00011460  74 65 61 62 6c 65 20 69  63 6f 6e 2e 0d 47 f4 13  |teable icon..G..|
00011470  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 37 0d  | MOV      R1,R7.|
00011480  47 fe 13 20 4d 56 4e 20  20 20 20 20 20 52 34 2c  |G.. MVN      R4,|
00011490  23 30 0d 48 08 25 20 53  57 49 20 20 20 20 20 20  |#0.H.% SWI      |
000114a0  22 57 69 6d 70 5f 53 65  74 43 61 72 65 74 50 6f  |"Wimp_SetCaretPo|
000114b0  73 69 74 69 6f 6e 22 0d  48 12 04 0d 48 1c 1e 4c  |sition".H...H..L|
000114c0  44 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |DMFD    R13!,{R0|
000114d0  2d 52 31 32 2c 50 43 7d  5e 0d 48 26 04 0d 48 30  |-R12,PC}^.H&..H0|
000114e0  53 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S;--------------|
000114f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00011530  0d 48 3a 31 3b 20 20 20  20 20 20 20 20 20 20 20  |.H:1;           |
00011540  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
00011550  4d 6f 76 65 43 61 72 65  74 44 6f 77 6e 20 2a 2a  |MoveCaretDown **|
00011560  2a 0d 48 44 4b 3b 20 54  68 69 73 20 73 65 63 74  |*.HDK; This sect|
00011570  69 6f 6e 20 6d 6f 76 65  73 20 74 68 65 20 63 61  |ion moves the ca|
00011580  72 65 74 20 69 6e 74 6f  20 74 68 65 20 6e 65 78  |ret into the nex|
00011590  74 20 77 72 69 74 65 61  62 6c 65 20 69 63 6f 6e  |t writeable icon|
000115a0  20 69 6e 20 74 68 65 20  45 64 69 74 0d 48 4e 0d  | in the Edit.HN.|
000115b0  3b 20 77 69 6e 64 6f 77  2e 0d 48 58 04 0d 48 62  |; window..HX..Hb|
000115c0  12 2e 6d 6f 76 65 63 61  72 65 74 64 6f 77 6e 0d  |..movecaretdown.|
000115d0  48 6c 04 0d 48 76 1e 53  54 4d 46 44 20 20 20 20  |Hl..Hv.STMFD    |
000115e0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 52 31 34  |R13!,{R0-R12,R14|
000115f0  7d 0d 48 80 04 0d 48 8a  51 20 43 4d 50 20 20 20  |}.H...H.Q CMP   |
00011600  20 20 20 52 33 2c 23 32  32 20 20 20 20 20 20 20  |   R3,#22       |
00011610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011620  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 68  |;This section ch|
00011630  65 63 6b 73 20 74 68 61  74 20 74 68 65 20 63 61  |ecks that the ca|
00011640  72 65 74 20 69 73 0d 48  94 51 20 20 41 44 44 4c  |ret is.H.Q  ADDL|
00011650  54 20 20 20 20 52 37 2c  52 33 2c 23 31 20 20 20  |T    R7,R3,#1   |
00011660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011670  20 3b 6e 6f 74 20 69 6e  20 74 68 65 20 6c 61 73  | ;not in the las|
00011680  74 20 69 63 6f 6e 20 61  6c 72 65 61 64 79 20 61  |t icon already a|
00011690  6e 64 20 74 68 65 6e 0d  48 9e 4f 20 20 4d 4f 56  |nd then.H.O  MOV|
000116a0  4c 54 20 20 20 20 52 30  2c 52 32 20 20 20 20 20  |LT    R0,R2     |
000116b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000116c0  20 20 3b 72 65 61 64 73  20 74 68 65 20 73 74 72  |  ;reads the str|
000116d0  69 6e 67 20 69 6e 74 6f  20 6d 69 73 63 2e 20 62  |ing into misc. b|
000116e0  75 66 66 65 72 2e 0d 48  a8 14 20 20 4d 4f 56 4c  |uffer..H..  MOVL|
000116f0  54 20 20 20 20 52 31 2c  52 37 0d 48 b2 14 20 20  |T    R1,R7.H..  |
00011700  4d 4f 56 4c 54 20 20 20  20 52 32 2c 52 39 0d 48  |MOVLT    R2,R9.H|
00011710  bc 17 20 20 42 4c 4c 54  20 20 20 20 20 52 65 61  |..  BLLT     Rea|
00011720  64 49 63 6f 6e 0d 48 c6  04 0d 48 d0 50 20 20 4d  |dIcon.H...H.P  M|
00011730  4f 56 4c 54 20 20 20 20  52 30 2c 52 39 20 20 20  |OVLT    R0,R9   |
00011740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011750  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00011760  6e 20 66 69 6e 64 73 20  74 68 65 20 6c 65 6e 67  |n finds the leng|
00011770  74 68 20 6f 66 20 74 68  65 0d 48 da 33 20 20 4d  |th of the.H.3  M|
00011780  4f 56 4c 54 20 20 20 20  52 31 2c 23 31 33 20 20  |OVLT    R1,#13  |
00011790  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000117a0  20 20 20 20 3b 73 74 72  69 6e 67 2e 0d 48 e4 1b  |    ;string..H..|
000117b0  20 20 53 57 49 4c 54 20  20 20 20 22 53 74 72 69  |  SWILT    "Stri|
000117c0  6e 67 5f 4c 65 6e 22 0d  48 ee 04 0d 48 f8 52 20  |ng_Len".H...H.R |
000117d0  20 4d 4f 56 4c 54 20 20  20 20 52 35 2c 52 31 20  | MOVLT    R5,R1 |
000117e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000117f0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00011800  69 6f 6e 20 70 6f 73 69  74 69 6f 6e 73 20 74 68  |ion positions th|
00011810  65 20 63 61 72 65 74 20  61 66 74 65 72 0d 49 02  |e caret after.I.|
00011820  50 20 20 4d 4f 56 4c 54  20 20 20 20 52 30 2c 52  |P  MOVLT    R0,R|
00011830  36 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |6               |
00011840  20 20 20 20 20 20 20 20  3b 74 68 65 20 6c 61 73  |        ;the las|
00011850  74 20 63 68 61 72 61 63  74 65 72 20 69 6e 20 74  |t character in t|
00011860  68 65 20 6e 65 78 74 20  69 63 6f 6e 2e 0d 49 0c  |he next icon..I.|
00011870  14 20 20 4d 4f 56 4c 54  20 20 20 20 52 31 2c 52  |.  MOVLT    R1,R|
00011880  37 0d 49 16 14 20 20 4d  56 4e 4c 54 20 20 20 20  |7.I..  MVNLT    |
00011890  52 34 2c 23 30 0d 49 20  26 20 20 53 57 49 4c 54  |R4,#0.I &  SWILT|
000118a0  20 20 20 20 22 57 69 6d  70 5f 53 65 74 43 61 72  |    "Wimp_SetCar|
000118b0  65 74 50 6f 73 69 74 69  6f 6e 22 0d 49 2a 20 20  |etPosition".I*  |
000118c0  20 4c 44 4d 4c 54 46 44  20 20 52 31 33 21 2c 7b  | LDMLTFD  R13!,{|
000118d0  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 49 34 04 0d  |R0-R12,PC}^.I4..|
000118e0  49 3e 51 20 43 4d 50 20  20 20 20 20 20 52 34 2c  |I>Q CMP      R4,|
000118f0  23 31 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |#13             |
00011900  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00011910  73 65 63 74 69 6f 6e 20  63 68 65 63 6b 73 20 69  |section checks i|
00011920  66 20 74 68 65 20 52 65  74 75 72 6e 20 6b 65 79  |f the Return key|
00011930  0d 49 48 50 20 20 4c 44  4d 4e 45 46 44 20 20 52  |.IHP  LDMNEFD  R|
00011940  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
00011950  20 20 20 20 20 20 20 20  20 20 20 3b 77 61 73 20  |           ;was |
00011960  70 72 65 73 73 65 64 20  65 6c 73 65 20 65 6e 64  |pressed else end|
00011970  73 20 74 68 65 20 73 75  62 72 6f 75 74 69 6e 65  |s the subroutine|
00011980  0d 49 52 04 0d 49 5c 4e  20 42 4c 20 20 20 20 20  |.IR..I\N BL     |
00011990  20 20 73 74 6f 72 65 72  65 63 6f 72 64 20 20 20  |  storerecord   |
000119a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000119b0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 61 6c  |This section cal|
000119c0  6c 73 20 61 20 73 75 62  72 6f 75 74 69 6e 65 20  |ls a subroutine |
000119d0  74 6f 0d 49 66 50 20 4d  4f 56 20 20 20 20 20 20  |to.IfP MOV      |
000119e0  52 30 2c 23 31 33 20 20  20 20 20 20 20 20 20 20  |R0,#13          |
000119f0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 75 70  |             ;up|
00011a00  64 61 74 65 20 74 68 65  20 49 6e 64 65 78 46 69  |date the IndexFi|
00011a10  6c 65 20 77 69 74 68 20  74 68 65 20 65 64 69 74  |le with the edit|
00011a20  65 64 0d 49 70 50 20 53  54 52 42 20 20 20 20 20  |ed.IpP STRB     |
00011a30  52 30 2c 5b 52 39 5d 20  20 20 20 20 20 20 20 20  |R0,[R9]         |
00011a40  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 72 65  |             ;re|
00011a50  63 6f 72 64 2e 20 54 68  65 20 64 65 73 63 72 69  |cord. The descri|
00011a60  70 74 69 6f 6e 20 69 63  6f 6e 20 69 73 20 74 68  |ption icon is th|
00011a70  65 6e 0d 49 7a 34 20 4c  44 52 20 20 20 20 20 20  |en.Iz4 LDR      |
00011a80  52 30 2c 5b 52 31 32 2c  23 65 64 69 74 25 5d 20  |R0,[R12,#edit%] |
00011a90  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 63 6c  |             ;cl|
00011aa0  65 61 72 65 64 2e 0d 49  84 13 20 4d 4f 56 20 20  |eared..I.. MOV  |
00011ab0  20 20 20 20 52 32 2c 52  39 0d 49 8e 14 20 4d 4f  |    R2,R9.I.. MO|
00011ac0  56 20 20 20 20 20 20 52  31 2c 23 32 32 0d 49 98  |V      R1,#22.I.|
00011ad0  17 20 42 4c 20 20 20 20  20 20 20 57 72 69 74 65  |. BL       Write|
00011ae0  49 63 6f 6e 0d 49 a2 04  0d 49 ac 51 20 4c 44 52  |Icon.I...I.Q LDR|
00011af0  20 20 20 20 20 20 52 36  2c 5b 52 31 30 2c 23 65  |      R6,[R10,#e|
00011b00  64 69 74 72 65 63 6f 72  64 25 5d 20 20 20 20 20  |ditrecord%]     |
00011b10  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00011b20  20 63 68 65 63 6b 73 20  74 6f 20 73 65 65 20 69  | checks to see i|
00011b30  66 20 77 65 20 68 61 76  65 0d 49 b6 4e 20 43 4d  |f we have.I.N CM|
00011b40  50 20 20 20 20 20 20 52  36 2c 23 30 20 20 20 20  |P      R6,#0    |
00011b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011b60  20 20 20 20 3b 62 65 65  6e 20 61 64 64 69 6e 67  |    ;been adding|
00011b70  20 6e 65 77 20 72 65 63  6f 72 64 73 2e 20 49 66  | new records. If|
00011b80  20 73 6f 20 74 68 65 0d  49 c0 4e 20 20 ec 51 20  | so the.I.N  .Q |
00011b90  20 20 20 52 31 2c 23 32  30 20 20 20 20 20 20 20  |   R1,#20       |
00011ba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00011bb0  63 61 72 65 74 20 69 73  20 70 6f 73 69 74 69 6f  |caret is positio|
00011bc0  6e 65 64 20 61 74 20 74  68 65 20 65 6e 64 20 6f  |ned at the end o|
00011bd0  66 20 74 68 65 0d 49 ca  4a 20 20 ec 51 20 20 20  |f the.I.J  .Q   |
00011be0  20 52 32 2c 52 39 20 20  20 20 20 20 20 20 20 20  | R2,R9          |
00011bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 50 61  |             ;Pa|
00011c00  67 65 20 4e 6f 2e 20 69  63 6f 6e 2c 20 72 65 61  |ge No. icon, rea|
00011c10  64 79 20 66 6f 72 20 74  68 65 20 6e 65 78 74 0d  |dy for the next.|
00011c20  49 d4 3f 20 20 42 4c 45  51 20 20 20 20 20 52 65  |I.?  BLEQ     Re|
00011c30  61 64 49 63 6f 6e 20 20  20 20 20 20 20 20 20 20  |adIcon          |
00011c40  20 20 20 20 20 20 20 20  20 20 3b 72 65 63 6f 72  |          ;recor|
00011c50  64 20 74 6f 20 62 65 20  69 6e 70 75 74 2e 0d 49  |d to be input..I|
00011c60  de 11 20 20 ec 51 20 20  20 20 52 30 2c 52 39 0d  |..  .Q    R0,R9.|
00011c70  49 e8 12 20 20 ec 51 20  20 20 20 52 31 2c 23 31  |I..  .Q    R1,#1|
00011c80  33 0d 49 f2 1b 20 20 53  57 49 45 51 20 20 20 20  |3.I..  SWIEQ    |
00011c90  22 53 74 72 69 6e 67 5f  4c 65 6e 22 0d 49 fc 11  |"String_Len".I..|
00011ca0  20 20 ec 51 20 20 20 20  52 35 2c 52 31 0d 4a 06  |  .Q    R5,R1.J.|
00011cb0  1e 20 20 4c 44 52 45 51  20 20 20 20 52 30 2c 5b  |.  LDREQ    R0,[|
00011cc0  52 31 32 2c 23 65 64 69  74 25 5d 0d 4a 10 12 20  |R12,#edit%].J.. |
00011cd0  20 ec 51 20 20 20 20 52  31 2c 23 32 30 0d 4a 1a  | .Q    R1,#20.J.|
00011ce0  14 20 20 4d 56 4e 45 51  20 20 20 20 52 34 2c 23  |.  MVNEQ    R4,#|
00011cf0  30 0d 4a 24 26 20 20 53  57 49 45 51 20 20 20 20  |0.J$&  SWIEQ    |
00011d00  22 57 69 6d 70 5f 53 65  74 43 61 72 65 74 50 6f  |"Wimp_SetCaretPo|
00011d10  73 69 74 69 6f 6e 22 0d  4a 2e 04 0d 4a 38 1e 4c  |sition".J...J8.L|
00011d20  44 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |DMFD    R13!,{R0|
00011d30  2d 52 31 32 2c 50 43 7d  5e 0d 4a 42 04 0d 4a 4c  |-R12,PC}^.JB..JL|
00011d40  53 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S;--------------|
00011d50  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00011d90  0d 4a 56 34 3b 20 20 20  20 20 20 20 20 20 20 20  |.JV4;           |
00011da0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011db0  20 2a 2a 2a 20 53 74 6f  72 65 52 65 63 6f 72 64  | *** StoreRecord|
00011dc0  20 2a 2a 2a 0d 4a 60 50  3b 20 54 68 69 73 20 73  | ***.J`P; This s|
00011dd0  75 62 72 6f 75 74 69 6e  65 20 75 70 64 61 74 65  |ubroutine update|
00011de0  73 20 74 68 65 20 49 6e  64 65 78 46 69 6c 65 20  |s the IndexFile |
00011df0  62 79 20 72 65 6d 6f 76  69 6e 67 20 61 6e 64 20  |by removing and |
00011e00  61 64 64 69 6e 67 20 74  68 65 20 72 65 63 6f 72  |adding the recor|
00011e10  64 20 61 73 0d 4a 6a 50  3b 20 61 70 70 72 6f 70  |d as.JjP; approp|
00011e20  72 69 61 74 65 2e 20 49  66 20 74 68 65 20 72 65  |riate. If the re|
00011e30  63 6f 72 64 20 69 73 20  61 20 6e 65 77 20 6f 6e  |cord is a new on|
00011e40  65 20 69 74 20 69 73 20  73 69 6d 70 6c 79 20 61  |e it is simply a|
00011e50  64 64 65 64 2e 20 49 66  20 69 74 20 69 73 20 62  |dded. If it is b|
00011e60  65 69 6e 67 0d 4a 74 4f  3b 20 65 64 69 74 65 64  |eing.JtO; edited|
00011e70  20 74 68 65 20 6f 6c 64  65 72 20 76 65 72 73 69  | the older versi|
00011e80  6f 6e 20 6f 66 20 74 68  65 20 72 65 63 6f 72 64  |on of the record|
00011e90  20 69 73 20 72 65 6d 6f  76 65 64 20 66 69 72 73  | is removed firs|
00011ea0  74 2e 20 49 66 20 74 68  65 20 72 65 63 6f 72 64  |t. If the record|
00011eb0  20 69 73 0d 4a 7e 27 3b  20 74 6f 20 62 65 20 64  | is.J~'; to be d|
00011ec0  65 6c 65 74 65 64 20 69  74 20 69 73 20 6a 75 73  |eleted it is jus|
00011ed0  74 20 72 65 6d 6f 76 65  64 2e 0d 4a 88 04 0d 4a  |t removed..J...J|
00011ee0  92 10 2e 73 74 6f 72 65  72 65 63 6f 72 64 0d 4a  |...storerecord.J|
00011ef0  9c 04 0d 4a a6 1e 53 54  4d 46 44 20 20 20 20 52  |...J..STMFD    R|
00011f00  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
00011f10  0d 4a b0 04 0d 4a ba 1c  20 53 57 49 20 20 20 20  |.J...J.. SWI    |
00011f20  20 20 22 48 6f 75 72 67  6c 61 73 73 5f 4f 6e 22  |  "Hourglass_On"|
00011f30  0d 4a c4 04 0d 4a ce 1d  20 4c 44 52 20 20 20 20  |.J...J.. LDR    |
00011f40  20 20 52 38 2c 5b 52 31  32 2c 23 65 64 69 74 25  |  R8,[R12,#edit%|
00011f50  5d 0d 4a d8 4d 20 20 20  20 20 20 20 20 20 20 20  |].J.M           |
00011f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011f70  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 65  |            ;The|
00011f80  20 66 69 72 73 74 20 70  61 72 74 20 6f 66 20 74  | first part of t|
00011f90  68 69 73 20 73 75 62 72  6f 75 74 69 6e 65 0d 4a  |his subroutine.J|
00011fa0  e2 51 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.Q              |
00011fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00011fc0  20 20 20 20 20 20 20 20  20 3b 63 72 65 61 74 65  |         ;create|
00011fd0  73 20 61 20 72 65 63 6f  72 64 20 66 72 6f 6d 20  |s a record from |
00011fe0  74 68 65 20 63 6f 6e 74  65 6e 74 73 20 6f 66 0d  |the contents of.|
00011ff0  4a ec 4d 20 20 20 20 20  20 20 20 20 20 20 20 20  |J.M             |
00012000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012010  20 20 20 20 20 20 20 20  20 20 3b 61 6c 6c 20 74  |          ;all t|
00012020  68 65 20 69 63 6f 6e 73  20 69 6e 20 74 68 65 20  |he icons in the |
00012030  45 64 69 74 20 77 69 6e  64 6f 77 2e 0d 4a f6 04  |Edit window..J..|
00012040  0d 4b 00 4d 20 4c 44 52  20 20 20 20 20 20 52 30  |.K.M LDR      R0|
00012050  2c 5b 52 31 30 2c 23 65  64 69 74 6d 6f 6e 74 68  |,[R10,#editmonth|
00012060  25 5d 20 20 20 20 20 20  3b 54 68 69 73 20 69 73  |%]      ;This is|
00012070  20 73 65 63 74 69 6f 6e  20 63 6f 6e 76 65 72 74  | section convert|
00012080  73 20 74 68 65 20 6e 75  6d 65 72 69 63 0d 4b 0a  |s the numeric.K.|
00012090  4c 20 41 44 44 20 20 20  20 20 20 52 31 2c 52 31  |L ADD      R1,R1|
000120a0  30 2c 23 72 65 63 6f 72  64 20 20 20 20 20 20 20  |0,#record       |
000120b0  20 20 20 20 20 20 20 20  3b 6d 6f 6e 74 68 20 6e  |        ;month n|
000120c0  75 6d 62 65 72 20 69 6e  74 6f 20 61 20 73 74 72  |umber into a str|
000120d0  69 6e 67 20 77 68 69 63  68 0d 4b 14 42 20 4d 4f  |ing which.K.B MO|
000120e0  56 20 20 20 20 20 20 52  32 2c 23 26 31 30 30 20  |V      R2,#&100 |
000120f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012100  20 20 20 20 3b 72 65 70  72 65 73 65 6e 74 73 20  |    ;represents |
00012110  74 68 65 20 6e 75 6d 62  65 72 2e 0d 4b 1e 22 20  |the number..K." |
00012120  53 57 49 20 20 20 20 20  20 22 4f 53 5f 43 6f 6e  |SWI      "OS_Con|
00012130  76 65 72 74 49 6e 74 65  67 65 72 31 22 0d 4b 28  |vertInteger1".K(|
00012140  13 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 52 31  |. MOV      R2,R1|
00012150  0d 4b 32 18 20 4d 4f 56  20 20 20 20 20 20 52 30  |.K2. MOV      R0|
00012160  2c 23 97 28 22 5c 22 29  0d 4b 3c 18 20 53 54 52  |,#.("\").K<. STR|
00012170  42 20 20 20 20 20 52 30  2c 5b 52 32 5d 2c 23 31  |B     R0,[R2],#1|
00012180  0d 4b 46 04 0d 4b 50 47  20 4d 4f 56 20 20 20 20  |.KF..KPG MOV    |
00012190  20 20 52 30 2c 52 38 20  20 20 20 20 20 20 20 20  |  R0,R8         |
000121a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000121b0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 61 64 64  |This section add|
000121c0  73 20 74 68 65 20 79 65  61 72 2e 0d 4b 5a 14 20  |s the year..KZ. |
000121d0  4d 4f 56 20 20 20 20 20  20 52 31 2c 23 31 38 0d  |MOV      R1,#18.|
000121e0  4b 64 16 20 42 4c 20 20  20 20 20 20 20 52 65 61  |Kd. BL       Rea|
000121f0  64 49 63 6f 6e 0d 4b 6e  13 20 4d 4f 56 20 20 20  |dIcon.Kn. MOV   |
00012200  20 20 20 52 30 2c 52 32  0d 4b 78 14 20 4d 4f 56  |   R0,R2.Kx. MOV|
00012210  20 20 20 20 20 20 52 31  2c 23 31 33 0d 4b 82 1a  |      R1,#13.K..|
00012220  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
00012230  67 5f 4c 65 6e 22 0d 4b  8c 13 20 43 4d 50 20 20  |g_Len".K.. CMP  |
00012240  20 20 20 20 52 31 2c 23  30 0d 4b 96 11 20 20 ec  |    R1,#0.K..  .|
00012250  51 20 20 20 20 52 31 2c  23 31 0d 4b a0 16 20 20  |Q    R1,#1.K..  |
00012260  ec 51 20 20 20 20 52 30  2c 23 97 28 22 30 22 29  |.Q    R0,#.("0")|
00012270  0d 4b aa 16 20 20 53 54  52 45 51 42 20 20 20 52  |.K..  STREQB   R|
00012280  30 2c 5b 52 32 5d 0d 4b  b4 16 20 41 44 44 20 20  |0,[R2].K.. ADD  |
00012290  20 20 20 20 52 32 2c 52  32 2c 52 31 0d 4b be 18  |    R2,R2,R1.K..|
000122a0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 97 28  | MOV      R0,#.(|
000122b0  22 5c 22 29 0d 4b c8 18  20 53 54 52 42 20 20 20  |"\").K.. STRB   |
000122c0  20 20 52 30 2c 5b 52 32  5d 2c 23 31 0d 4b d2 04  |  R0,[R2],#1.K..|
000122d0  0d 4b dc 4b 20 4d 4f 56  20 20 20 20 20 20 52 30  |.K.K MOV      R0|
000122e0  2c 52 38 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R8             |
000122f0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00012300  20 73 65 63 74 69 6f 6e  20 61 64 64 73 20 74 68  | section adds th|
00012310  65 20 49 73 73 75 65 20  4e 6f 2e 0d 4b e6 14 20  |e Issue No..K.. |
00012320  4d 4f 56 20 20 20 20 20  20 52 31 2c 23 31 39 0d  |MOV      R1,#19.|
00012330  4b f0 16 20 42 4c 20 20  20 20 20 20 20 52 65 61  |K.. BL       Rea|
00012340  64 49 63 6f 6e 0d 4b fa  13 20 4d 4f 56 20 20 20  |dIcon.K.. MOV   |
00012350  20 20 20 52 30 2c 52 32  0d 4c 04 14 20 4d 4f 56  |   R0,R2.L.. MOV|
00012360  20 20 20 20 20 20 52 31  2c 23 31 33 0d 4c 0e 1a  |      R1,#13.L..|
00012370  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
00012380  67 5f 4c 65 6e 22 0d 4c  18 13 20 43 4d 50 20 20  |g_Len".L.. CMP  |
00012390  20 20 20 20 52 31 2c 23  30 0d 4c 22 11 20 20 ec  |    R1,#0.L".  .|
000123a0  51 20 20 20 20 52 31 2c  23 31 0d 4c 2c 16 20 20  |Q    R1,#1.L,.  |
000123b0  ec 51 20 20 20 20 52 30  2c 23 97 28 22 30 22 29  |.Q    R0,#.("0")|
000123c0  0d 4c 36 16 20 20 53 54  52 45 51 42 20 20 20 52  |.L6.  STREQB   R|
000123d0  30 2c 5b 52 32 5d 0d 4c  40 16 20 41 44 44 20 20  |0,[R2].L@. ADD  |
000123e0  20 20 20 20 52 32 2c 52  32 2c 52 31 0d 4c 4a 18  |    R2,R2,R1.LJ.|
000123f0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 97 28  | MOV      R0,#.(|
00012400  22 5c 22 29 0d 4c 54 18  20 53 54 52 42 20 20 20  |"\").LT. STRB   |
00012410  20 20 52 30 2c 5b 52 32  5d 2c 23 31 0d 4c 5e 4a  |  R0,[R2],#1.L^J|
00012420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00012440  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00012450  74 69 6f 6e 20 61 64 64  73 20 74 68 65 20 50 61  |tion adds the Pa|
00012460  67 65 20 4e 6f 2e 0d 4c  68 13 20 4d 4f 56 20 20  |ge No..Lh. MOV  |
00012470  20 20 20 20 52 30 2c 52  38 0d 4c 72 14 20 4d 4f  |    R0,R8.Lr. MO|
00012480  56 20 20 20 20 20 20 52  31 2c 23 32 30 0d 4c 7c  |V      R1,#20.L||
00012490  16 20 42 4c 20 20 20 20  20 20 20 52 65 61 64 49  |. BL       ReadI|
000124a0  63 6f 6e 0d 4c 86 13 20  4d 4f 56 20 20 20 20 20  |con.L.. MOV     |
000124b0  20 52 30 2c 52 32 0d 4c  90 14 20 4d 4f 56 20 20  | R0,R2.L.. MOV  |
000124c0  20 20 20 20 52 31 2c 23  31 33 0d 4c 9a 1a 20 53  |    R1,#13.L.. S|
000124d0  57 49 20 20 20 20 20 20  22 53 74 72 69 6e 67 5f  |WI      "String_|
000124e0  4c 65 6e 22 0d 4c a4 13  20 43 4d 50 20 20 20 20  |Len".L.. CMP    |
000124f0  20 20 52 31 2c 23 30 0d  4c ae 11 20 20 ec 51 20  |  R1,#0.L..  .Q |
00012500  20 20 20 52 31 2c 23 31  0d 4c b8 16 20 20 ec 51  |   R1,#1.L..  .Q|
00012510  20 20 20 20 52 30 2c 23  97 28 22 30 22 29 0d 4c  |    R0,#.("0").L|
00012520  c2 16 20 20 53 54 52 45  51 42 20 20 20 52 30 2c  |..  STREQB   R0,|
00012530  5b 52 32 5d 0d 4c cc 16  20 41 44 44 20 20 20 20  |[R2].L.. ADD    |
00012540  20 20 52 32 2c 52 32 2c  52 31 0d 4c d6 18 20 4d  |  R2,R2,R1.L.. M|
00012550  4f 56 20 20 20 20 20 20  52 30 2c 23 97 28 22 5c  |OV      R0,#.("\|
00012560  22 29 0d 4c e0 18 20 53  54 52 42 20 20 20 20 20  |").L.. STRB     |
00012570  52 30 2c 5b 52 32 5d 2c  23 31 0d 4c ea 04 0d 4c  |R0,[R2],#1.L...L|
00012580  f4 48 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 52  |.H MOV      R0,R|
00012590  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
000125a0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
000125b0  65 63 74 69 6f 6e 20 61  64 64 73 20 74 68 65 20  |ection adds the |
000125c0  54 6f 70 69 63 2e 0d 4c  fe 14 20 4d 4f 56 20 20  |Topic..L.. MOV  |
000125d0  20 20 20 20 52 31 2c 23  32 31 0d 4d 08 16 20 42  |    R1,#21.M.. B|
000125e0  4c 20 20 20 20 20 20 20  52 65 61 64 49 63 6f 6e  |L       ReadIcon|
000125f0  0d 4d 12 13 20 4d 4f 56  20 20 20 20 20 20 52 30  |.M.. MOV      R0|
00012600  2c 52 32 0d 4d 1c 14 20  4d 4f 56 20 20 20 20 20  |,R2.M.. MOV     |
00012610  20 52 31 2c 23 31 33 0d  4d 26 1a 20 53 57 49 20  | R1,#13.M&. SWI |
00012620  20 20 20 20 20 22 53 74  72 69 6e 67 5f 4c 65 6e  |     "String_Len|
00012630  22 0d 4d 30 16 20 41 44  44 20 20 20 20 20 20 52  |".M0. ADD      R|
00012640  32 2c 52 32 2c 52 31 0d  4d 3a 18 20 4d 4f 56 20  |2,R2,R1.M:. MOV |
00012650  20 20 20 20 20 52 30 2c  23 97 28 22 5c 22 29 0d  |     R0,#.("\").|
00012660  4d 44 18 20 53 54 52 42  20 20 20 20 20 52 30 2c  |MD. STRB     R0,|
00012670  5b 52 32 5d 2c 23 31 0d  4d 4e 04 0d 4d 58 4e 20  |[R2],#1.MN..MXN |
00012680  4d 4f 56 20 20 20 20 20  20 52 30 2c 52 38 20 20  |MOV      R0,R8  |
00012690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000126a0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
000126b0  69 6f 6e 20 61 64 64 73  20 74 68 65 20 44 65 73  |ion adds the Des|
000126c0  63 72 69 70 74 69 6f 6e  2e 0d 4d 62 14 20 4d 4f  |cription..Mb. MO|
000126d0  56 20 20 20 20 20 20 52  31 2c 23 32 32 0d 4d 6c  |V      R1,#22.Ml|
000126e0  16 20 42 4c 20 20 20 20  20 20 20 52 65 61 64 49  |. BL       ReadI|
000126f0  63 6f 6e 0d 4d 76 13 20  4d 4f 56 20 20 20 20 20  |con.Mv. MOV     |
00012700  20 52 30 2c 52 32 0d 4d  80 14 20 4d 4f 56 20 20  | R0,R2.M.. MOV  |
00012710  20 20 20 20 52 31 2c 23  31 33 0d 4d 8a 1a 20 53  |    R1,#13.M.. S|
00012720  57 49 20 20 20 20 20 20  22 53 74 72 69 6e 67 5f  |WI      "String_|
00012730  4c 65 6e 22 0d 4d 94 13  20 43 4d 50 20 20 20 20  |Len".M.. CMP    |
00012740  20 20 52 31 2c 23 31 0d  4d 9e 1d 20 20 53 57 49  |  R1,#1.M..  SWI|
00012750  4c 45 20 20 20 22 48 6f  75 72 67 6c 61 73 73 5f  |LE   "Hourglass_|
00012760  4f 66 66 22 0d 4d a8 1f  20 20 4c 44 4d 4c 45 46  |Off".M..  LDMLEF|
00012770  44 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 50  |D R13!,{R0-R12,P|
00012780  43 7d 5e 0d 4d b2 16 20  41 44 44 20 20 20 20 20  |C}^.M.. ADD     |
00012790  20 52 32 2c 52 32 2c 52  31 0d 4d bc 14 20 4d 4f  | R2,R2,R1.M.. MO|
000127a0  56 20 20 20 20 20 20 52  30 2c 23 31 33 0d 4d c6  |V      R0,#13.M.|
000127b0  18 20 53 54 52 42 20 20  20 20 20 52 30 2c 5b 52  |. STRB     R0,[R|
000127c0  32 5d 2c 23 31 0d 4d d0  04 0d 4d da 50 20 4d 4f  |2],#1.M...M.P MO|
000127d0  56 20 20 20 20 20 20 52  30 2c 23 26 43 46 20 20  |V      R0,#&CF  |
000127e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000127f0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00012800  6e 20 6f 70 65 6e 73 20  74 68 65 20 49 6e 64 65  |n opens the Inde|
00012810  78 46 69 6c 65 20 66 6f  72 0d 4d e4 35 20 41 44  |xFile for.M.5 AD|
00012820  44 20 20 20 20 20 20 52  31 2c 52 31 30 2c 23 69  |D      R1,R10,#i|
00012830  6e 64 65 78 66 69 6c 65  20 20 20 20 20 20 20 20  |ndexfile        |
00012840  20 20 20 20 3b 75 70 64  61 74 69 6e 67 2e 0d 4d  |    ;updating..M|
00012850  ee 18 20 53 57 49 20 20  20 20 20 20 22 58 4f 53  |.. SWI      "XOS|
00012860  5f 46 69 6e 64 22 0d 4d  f8 16 20 20 42 56 53 20  |_Find".M..  BVS |
00012870  20 20 20 20 20 6e 6f 69  6e 64 65 78 0d 4e 02 24  |     noindex.N.$|
00012880  20 53 54 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | STR      R0,[R1|
00012890  30 2c 23 69 6e 64 65 78  68 61 6e 64 6c 65 25 5d  |0,#indexhandle%]|
000128a0  0d 4e 0c 23 20 53 54 52  20 20 20 20 20 20 52 30  |.N.# STR      R0|
000128b0  2c 5b 52 31 30 2c 23 66  69 6c 65 68 61 6e 64 6c  |,[R10,#filehandl|
000128c0  65 25 5d 0d 4e 16 04 0d  4e 20 4f 20 4c 44 52 20  |e%].N...N O LDR |
000128d0  20 20 20 20 20 52 30 2c  5b 52 31 30 2c 23 65 64  |     R0,[R10,#ed|
000128e0  69 74 72 65 63 6f 72 64  25 5d 20 20 20 20 20 20  |itrecord%]      |
000128f0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00012900  72 65 6d 6f 76 65 73 20  74 68 65 20 6f 6c 64 20  |removes the old |
00012910  72 65 63 6f 72 64 0d 4e  2a 4c 20 43 4d 50 20 20  |record.N*L CMP  |
00012920  20 20 20 20 52 30 2c 23  30 20 20 20 20 20 20 20  |    R0,#0       |
00012930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012940  20 3b 69 66 20 6e 65 63  63 65 73 61 72 79 20 61  | ;if neccesary a|
00012950  6e 64 20 63 6c 6f 73 65  73 20 74 68 65 20 65 64  |nd closes the ed|
00012960  69 74 0d 4e 34 3e 20 20  42 4c 4e 45 20 20 20 20  |it.N4>  BLNE    |
00012970  20 72 65 6d 6f 76 65 20  20 20 20 20 20 20 20 20  | remove         |
00012980  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 77 69  |             ;wi|
00012990  6e 64 6f 77 20 61 66 74  65 72 77 61 72 64 73 2e  |ndow afterwards.|
000129a0  0d 4e 3e 1e 20 20 4c 44  52 4e 45 20 20 20 20 52  |.N>.  LDRNE    R|
000129b0  30 2c 5b 52 31 32 2c 23  65 64 69 74 25 5d 0d 4e  |0,[R12,#edit%].N|
000129c0  48 21 20 20 53 54 52 4e  45 20 20 20 20 52 30 2c  |H!  STRNE    R0,|
000129d0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 30 5d 0d  |[R12,#block%+0].|
000129e0  4e 52 1d 20 20 41 44 44  4e 45 20 20 20 20 52 31  |NR.  ADDNE    R1|
000129f0  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 0d 4e 5c 21  |,R12,#block%.N\!|
00012a00  20 20 53 57 49 4e 45 20  20 20 20 22 57 69 6d 70  |  SWINE    "Wimp|
00012a10  5f 43 6c 6f 73 65 57 69  6e 64 6f 77 22 0d 4e 66  |_CloseWindow".Nf|
00012a20  04 0d 4e 70 4f 20 43 4d  50 20 20 20 20 20 52 36  |..NpO CMP     R6|
00012a30  2c 23 32 36 20 20 20 20  20 20 20 20 20 20 20 20  |,#26            |
00012a40  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00012a50  73 20 73 65 63 74 69 6f  6e 20 61 64 64 73 20 74  |s section adds t|
00012a60  68 65 20 72 65 63 6f 72  64 20 74 6f 20 74 68 65  |he record to the|
00012a70  0d 4e 7a 14 20 20 4d 4f  56 4e 45 20 20 20 20 52  |.Nz.  MOVNE    R|
00012a80  38 2c 23 30 0d 4e 84 18  20 20 42 4c 4e 45 20 20  |8,#0.N..  BLNE  |
00012a90  20 20 20 66 69 6e 64 70  6c 61 63 65 0d 4e 8e 3e  |   findplace.N.>|
00012aa0  20 20 42 4c 4e 45 20 20  20 20 20 69 6e 73 65 72  |  BLNE     inser|
00012ab0  74 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |t               |
00012ac0  20 20 20 20 20 20 20 3b  69 6e 64 65 78 20 69 66  |       ;index if|
00012ad0  20 6e 65 63 65 73 73 61  79 2e 0d 4e 98 04 0d 4e  | necessay..N...N|
00012ae0  a2 4f 20 4c 44 52 20 20  20 20 20 20 52 30 2c 5b  |.O LDR      R0,[|
00012af0  52 31 30 2c 23 73 68 6f  77 25 5d 20 20 20 20 20  |R10,#show%]     |
00012b00  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00012b10  65 63 74 69 6f 6e 20 75  70 64 61 74 65 73 20 61  |ection updates a|
00012b20  20 63 6f 75 6e 74 20 6f  66 20 74 68 65 0d 4e ac  | count of the.N.|
00012b30  51 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |Q CMP      R0,#1|
00012b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012b50  20 20 20 20 20 20 20 20  3b 6e 75 6d 62 65 72 20  |        ;number |
00012b60  6f 66 20 72 65 63 6f 72  64 73 20 69 6e 20 74 68  |of records in th|
00012b70  65 20 63 75 72 72 65 6e  74 20 66 69 6c 65 0d 4e  |e current file.N|
00012b80  b6 39 20 20 4c 44 52 45  51 20 20 20 20 52 31 2c  |.9  LDREQ    R1,|
00012b90  5b 52 31 30 2c 23 69 6e  64 65 78 6d 61 78 25 5d  |[R10,#indexmax%]|
00012ba0  20 20 20 20 20 20 20 20  20 3b 69 66 20 6e 65 63  |         ;if nec|
00012bb0  65 73 73 61 72 79 2e 0d  4e c0 1d 20 20 53 54 52  |essary..N..  STR|
00012bc0  45 51 20 20 20 20 52 31  2c 5b 52 31 30 2c 23 6d  |EQ    R1,[R10,#m|
00012bd0  61 78 25 5d 0d 4e ca 04  0d 4e d4 51 20 4c 44 52  |ax%].N...N.Q LDR|
00012be0  20 20 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 72  |      R0,[R10,#r|
00012bf0  65 63 6f 72 64 25 5d 20  20 20 20 20 20 20 20 20  |ecord%]         |
00012c00  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00012c10  20 63 68 65 63 6b 73 20  69 66 20 74 68 65 20 6e  | checks if the n|
00012c20  65 77 20 72 65 63 6f 72  64 0d 4e de 51 20 4c 44  |ew record.N.Q LD|
00012c30  52 20 20 20 20 20 20 52  31 2c 5b 52 31 30 2c 23  |R      R1,[R10,#|
00012c40  6d 61 78 25 5d 20 20 20  20 20 20 20 20 20 20 20  |max%]           |
00012c50  20 20 20 20 3b 69 73 20  67 72 65 61 74 65 72 20  |    ;is greater |
00012c60  74 68 61 6e 20 74 68 65  20 6d 61 78 69 6d 75 6d  |than the maximum|
00012c70  20 61 6e 64 20 69 66 20  73 6f 0d 4e e8 40 20 43  | and if so.N.@ C|
00012c80  4d 50 20 20 20 20 20 20  52 30 2c 52 31 20 20 20  |MP      R0,R1   |
00012c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012ca0  20 20 20 20 20 3b 75 70  64 61 74 65 73 20 74 68  |     ;updates th|
00012cb0  65 20 6d 61 78 69 6d 75  6d 2e 0d 4e f2 20 20 20  |e maximum..N.   |
00012cc0  53 54 52 47 54 20 20 20  20 52 31 2c 5b 52 31 30  |STRGT    R1,[R10|
00012cd0  2c 23 72 65 63 6f 72 64  25 5d 0d 4e fc 14 20 20  |,#record%].N..  |
00012ce0  4d 4f 56 47 54 20 20 20  20 52 30 2c 52 31 0d 4f  |MOVGT    R0,R1.O|
00012cf0  06 04 0d 4f 10 51 20 4d  4f 56 20 20 20 20 20 20  |...O.Q MOV      |
00012d00  52 31 2c 23 32 20 20 20  20 20 20 20 20 20 20 20  |R1,#2           |
00012d10  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00012d20  69 73 20 73 65 63 74 69  6f 6e 20 72 65 61 64 73  |is section reads|
00012d30  20 74 68 65 20 63 75 72  72 65 6e 74 20 72 65 63  | the current rec|
00012d40  6f 72 64 0d 4f 1a 42 20  42 4c 20 20 20 20 20 20  |ord.O.B BL      |
00012d50  20 47 65 74 52 65 63 6f  72 64 73 20 20 20 20 20  | GetRecords     |
00012d60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 69  |              ;i|
00012d70  6e 74 6f 20 74 68 65 20  72 65 63 6f 72 64 20 62  |nto the record b|
00012d80  75 66 66 65 72 0d 4f 24  04 0d 4f 2e 4e 20 4d 4f  |uffer.O$..O.N MO|
00012d90  56 20 20 20 20 20 20 52  30 2c 23 30 20 20 20 20  |V      R0,#0    |
00012da0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012db0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00012dc0  6e 20 63 6c 6f 73 65 73  20 74 68 65 20 69 6e 64  |n closes the ind|
00012dd0  65 78 20 66 69 6c 65 0d  4f 38 24 20 4c 44 52 20  |ex file.O8$ LDR |
00012de0  20 20 20 20 20 52 31 2c  5b 52 31 30 2c 23 69 6e  |     R1,[R10,#in|
00012df0  64 65 78 68 61 6e 64 6c  65 25 5d 0d 4f 42 18 20  |dexhandle%].OB. |
00012e00  53 57 49 20 20 20 20 20  20 22 58 4f 53 5f 46 69  |SWI      "XOS_Fi|
00012e10  6e 64 22 0d 4f 4c 04 0d  4f 56 14 20 42 4c 20 20  |nd".OL..OV. BL  |
00012e20  20 20 20 20 20 55 70 64  61 74 65 0d 4f 60 1d 20  |     Update.O`. |
00012e30  53 57 49 20 20 20 20 20  20 22 48 6f 75 72 67 6c  |SWI      "Hourgl|
00012e40  61 73 73 5f 4f 66 66 22  0d 4f 6a 04 0d 4f 74 1e  |ass_Off".Oj..Ot.|
00012e50  4c 44 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |LDMFD    R13!,{R|
00012e60  30 2d 52 31 32 2c 50 43  7d 5e 0d 4f 7e 04 0d 4f  |0-R12,PC}^.O~..O|
00012e70  88 53 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.S;-------------|
00012e80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00012ec0  2d 0d 4f 92 2d 3b 20 20  20 20 20 20 20 20 20 20  |-.O.-;          |
00012ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012ee0  2a 2a 2a 20 52 65 6d 6f  76 65 20 2a 2a 2a 0d 4f  |*** Remove ***.O|
00012ef0  9c 50 3b 20 54 68 69 73  20 73 65 63 74 69 6f 6e  |.P; This section|
00012f00  20 72 65 6d 6f 76 65 73  20 74 68 65 20 6f 72 69  | removes the ori|
00012f10  67 69 6e 61 6c 20 63 6f  70 79 20 6f 66 20 74 68  |ginal copy of th|
00012f20  65 20 72 65 63 6f 72 64  20 77 68 69 63 68 20 69  |e record which i|
00012f30  73 20 62 65 69 6e 67 20  65 64 69 74 65 64 0d 4f  |s being edited.O|
00012f40  a6 1a 3b 20 66 72 6f 6d  20 74 68 65 20 69 6e 64  |..; from the ind|
00012f50  65 78 20 66 69 6c 65 2e  0d 4f b0 04 0d 4f ba 0d  |ex file..O...O..|
00012f60  3b 4f 6e 20 45 6e 74 72  79 0d 4f c4 30 3b 20 20  |;On Entry.O.0;  |
00012f70  20 20 20 20 20 20 52 30  20 3d 20 4e 75 6d 62 65  |      R0 = Numbe|
00012f80  72 20 6f 66 20 72 65 63  6f 72 64 20 74 6f 20 62  |r of record to b|
00012f90  65 20 64 65 6c 65 74 65  64 0d 4f ce 04 0d 4f d8  |e deleted.O...O.|
00012fa0  0b 2e 72 65 6d 6f 76 65  0d 4f e2 04 0d 4f ec 1e  |..remove.O...O..|
00012fb0  53 54 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |STMFD    R13!,{R|
00012fc0  30 2d 52 31 32 2c 52 31  34 7d 0d 4f f6 04 0d 50  |0-R12,R14}.O...P|
00012fd0  00 51 20 4c 44 52 20 20  20 20 20 20 52 37 2c 5b  |.Q LDR      R7,[|
00012fe0  52 31 30 2c 23 69 6e 64  65 78 6d 61 78 25 5d 20  |R10,#indexmax%] |
00012ff0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00013000  65 63 74 69 6f 6e 20 6d  75 6c 74 69 70 6c 69 65  |ection multiplie|
00013010  73 20 74 68 65 20 6e 75  6d 62 65 72 20 6f 66 0d  |s the number of.|
00013020  50 0a 4f 20 53 55 42 20  20 20 20 20 20 52 37 2c  |P.O SUB      R7,|
00013030  52 37 2c 52 30 20 20 20  20 20 20 20 20 20 20 20  |R7,R0           |
00013040  20 20 20 20 20 20 20 20  20 20 3b 72 65 63 6f 72  |          ;recor|
00013050  64 73 20 27 74 69 6c 20  74 68 65 20 65 6e 64 20  |ds 'til the end |
00013060  6f 66 20 74 68 65 20 66  69 6c 65 20 62 79 0d 50  |of the file by.P|
00013070  14 4e 20 4d 4f 56 20 20  20 20 20 20 52 38 2c 20  |.N MOV      R8, |
00013080  20 20 52 37 2c 20 4c 53  4c 20 23 33 20 20 20 20  |  R7, LSL #3    |
00013090  20 20 20 20 20 20 20 20  20 3b 62 79 20 38 38 20  |         ;by 88 |
000130a0  2d 20 74 68 65 20 6c 65  6e 67 74 68 20 6f 66 20  |- the length of |
000130b0  65 61 63 68 20 72 65 63  6f 72 64 2e 0d 50 1e 1e  |each record..P..|
000130c0  20 41 44 44 20 20 20 20  20 20 52 38 2c 52 38 2c  | ADD      R8,R8,|
000130d0  52 37 2c 20 4c 53 4c 20  23 34 0d 50 28 1e 20 41  |R7, LSL #4.P(. A|
000130e0  44 44 20 20 20 20 20 20  52 38 2c 52 38 2c 52 37  |DD      R8,R8,R7|
000130f0  2c 20 4c 53 4c 20 23 36  0d 50 32 13 20 4d 4f 56  |, LSL #6.P2. MOV|
00013100  20 20 20 20 20 20 52 35  2c 52 30 0d 50 3c 04 0d  |      R5,R0.P<..|
00013110  50 46 4e 20 43 4d 50 20  20 20 20 20 20 52 38 2c  |PFN CMP      R8,|
00013120  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
00013130  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00013140  73 65 63 74 69 6f 6e 20  6d 6f 76 65 73 20 74 68  |section moves th|
00013150  65 20 66 69 6c 65 20 65  78 74 65 6e 74 0d 50 50  |e file extent.PP|
00013160  47 20 20 ec 51 20 20 20  20 52 30 2c 23 32 20 20  |G  .Q    R0,#2  |
00013170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013180  20 20 20 20 20 3b 62 61  63 6b 20 62 79 20 38 38  |     ;back by 88|
00013190  20 62 79 74 65 73 20 2d  20 6f 6e 65 20 72 65 63  | bytes - one rec|
000131a0  6f 72 64 2e 0d 50 5a 25  20 20 4c 44 52 45 51 20  |ord..PZ%  LDREQ |
000131b0  20 20 20 52 31 2c 5b 52  31 30 2c 23 69 6e 64 65  |   R1,[R10,#inde|
000131c0  78 68 61 6e 64 6c 65 25  5d 0d 50 64 18 20 20 53  |xhandle%].Pd.  S|
000131d0  57 49 45 51 20 20 20 20  22 4f 53 5f 41 72 67 73  |WIEQ    "OS_Args|
000131e0  22 0d 50 6e 11 20 20 ec  51 20 20 20 20 52 30 2c  |".Pn.  .Q    R0,|
000131f0  23 33 0d 50 78 18 20 20  53 55 42 45 51 20 20 20  |#3.Px.  SUBEQ   |
00013200  20 52 32 2c 52 32 2c 23  38 38 0d 50 82 18 20 20  | R2,R2,#88.P..  |
00013210  53 57 49 45 51 20 20 20  20 22 4f 53 5f 41 72 67  |SWIEQ    "OS_Arg|
00013220  73 22 0d 50 8c 22 20 20  4c 44 52 45 51 20 20 20  |s".P."  LDREQ   |
00013230  20 52 30 2c 5b 52 31 30  2c 23 69 6e 64 65 78 6d  | R0,[R10,#indexm|
00013240  61 78 25 5d 0d 50 96 17  20 20 53 55 42 45 51 20  |ax%].P..  SUBEQ |
00013250  20 20 20 52 30 2c 52 30  2c 23 31 0d 50 a0 22 20  |   R0,R0,#1.P." |
00013260  20 53 54 52 45 51 20 20  20 20 52 30 2c 5b 52 31  | STREQ    R0,[R1|
00013270  30 2c 23 69 6e 64 65 78  6d 61 78 25 5d 0d 50 aa  |0,#indexmax%].P.|
00013280  20 20 20 4c 44 4d 45 51  46 44 20 20 52 31 33 21  |   LDMEQFD  R13!|
00013290  2c 7b 52 30 2d 52 31 32  2c 50 43 7d 5e 0d 50 b4  |,{R0-R12,PC}^.P.|
000132a0  04 0d 50 be 4f 20 4d 4f  56 20 20 20 20 20 20 52  |..P.O MOV      R|
000132b0  30 2c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |0,#2            |
000132c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
000132d0  73 20 73 65 63 74 69 6f  6e 20 67 72 61 62 73 20  |s section grabs |
000132e0  65 6e 6f 75 67 68 20 6d  65 6d 6f 72 79 20 74 6f  |enough memory to|
000132f0  0d 50 c8 50 20 a4 4c 6f  6e 67 41 64 72 28 22 22  |.P.P .LongAdr(""|
00013300  2c 31 2c 68 65 61 70 29  20 20 20 20 20 20 20 20  |,1,heap)        |
00013310  20 20 20 20 20 20 20 20  20 20 3b 73 74 6f 72 65  |          ;store|
00013320  20 74 68 65 20 72 65 63  6f 72 64 73 20 61 66 74  | the records aft|
00013330  65 72 20 74 68 65 20 72  65 63 6f 72 64 20 74 6f  |er the record to|
00013340  0d 50 d2 37 20 4d 4f 56  20 20 20 20 20 20 52 33  |.P.7 MOV      R3|
00013350  2c 52 38 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R8             |
00013360  20 20 20 20 20 20 20 20  20 20 20 3b 62 65 20 64  |           ;be d|
00013370  65 6c 65 74 65 64 2e 0d  50 dc 18 20 53 57 49 20  |eleted..P.. SWI |
00013380  20 20 20 20 20 22 58 4f  53 5f 48 65 61 70 22 0d  |     "XOS_Heap".|
00013390  50 e6 15 20 20 20 42 4c  56 53 20 20 20 20 6e 6f  |P..   BLVS    no|
000133a0  72 6f 6f 6d 0d 50 f0 20  20 20 20 4c 44 4d 56 53  |room.P.    LDMVS|
000133b0  46 44 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |FD R13!,{R0-R12,|
000133c0  50 43 7d 5e 0d 50 fa 13  20 4d 4f 56 20 20 20 20  |PC}^.P.. MOV    |
000133d0  20 20 52 36 2c 52 32 0d  51 04 04 0d 51 0e 1e 20  |  R6,R2.Q...Q.. |
000133e0  4d 4f 56 20 20 20 20 20  20 52 37 2c 20 20 20 52  |MOV      R7,   R|
000133f0  35 2c 20 4c 53 4c 20 23  33 0d 51 18 1e 20 41 44  |5, LSL #3.Q.. AD|
00013400  44 20 20 20 20 20 20 52  37 2c 52 37 2c 52 35 2c  |D      R7,R7,R5,|
00013410  20 4c 53 4c 20 23 34 0d  51 22 1e 20 41 44 44 20  | LSL #4.Q". ADD |
00013420  20 20 20 20 20 52 37 2c  52 37 2c 52 35 2c 20 4c  |     R7,R7,R5, L|
00013430  53 4c 20 23 36 0d 51 2c  04 0d 51 36 51 20 4d 4f  |SL #6.Q,..Q6Q MO|
00013440  56 20 20 20 20 20 20 52  30 2c 23 33 20 20 20 20  |V      R0,#3    |
00013450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013460  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00013470  6e 20 6c 6f 61 64 73 20  69 6e 20 61 6c 6c 20 74  |n loads in all t|
00013480  68 65 20 72 65 63 6f 72  64 73 0d 51 40 4a 20 4c  |he records.Q@J L|
00013490  44 52 20 20 20 20 20 20  52 31 2c 5b 52 31 30 2c  |DR      R1,[R10,|
000134a0  23 69 6e 64 65 78 68 61  6e 64 6c 65 25 5d 20 20  |#indexhandle%]  |
000134b0  20 20 20 20 20 3b 61 66  74 65 72 20 74 68 65 20  |     ;after the |
000134c0  72 65 63 6f 72 64 20 74  6f 20 62 65 20 64 65 6c  |record to be del|
000134d0  65 74 65 64 0d 51 4a 13  20 4d 4f 56 20 20 20 20  |eted.QJ. MOV    |
000134e0  20 20 52 33 2c 52 38 0d  51 54 13 20 4d 4f 56 20  |  R3,R8.QT. MOV |
000134f0  20 20 20 20 20 52 34 2c  52 37 0d 51 5e 18 20 53  |     R4,R7.Q^. S|
00013500  57 49 20 20 20 20 20 20  22 58 4f 53 5f 47 42 50  |WI      "XOS_GBP|
00013510  42 22 0d 51 68 16 20 20  42 56 53 20 20 20 20 20  |B".Qh.  BVS     |
00013520  20 6e 6f 69 6e 64 65 78  0d 51 72 04 0d 51 7c 4f  | noindex.Qr..Q|O|
00013530  20 41 44 44 20 20 20 20  20 20 52 32 2c 52 37 2c  | ADD      R2,R7,|
00013540  52 38 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R8              |
00013550  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00013560  74 69 6f 6e 20 6d 6f 76  65 73 20 74 68 65 20 66  |tion moves the f|
00013570  69 6c 65 20 70 6f 69 6e  74 65 72 0d 51 86 45 20  |ile pointer.Q.E |
00013580  53 55 42 20 20 20 20 20  20 52 32 2c 52 32 2c 23  |SUB      R2,R2,#|
00013590  38 38 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |88              |
000135a0  20 20 20 20 20 20 3b 62  61 63 6b 20 31 20 72 65  |      ;back 1 re|
000135b0  63 6f 72 64 20 2d 20 38  38 20 62 79 74 65 73 2e  |cord - 88 bytes.|
000135c0  0d 51 90 18 20 53 57 49  20 20 20 20 20 20 22 58  |.Q.. SWI      "X|
000135d0  4f 53 5f 41 72 67 73 22  0d 51 9a 16 20 20 42 56  |OS_Args".Q..  BV|
000135e0  53 20 20 20 20 20 20 6e  6f 69 6e 64 65 78 0d 51  |S      noindex.Q|
000135f0  a4 04 0d 51 ae 4e 20 4d  4f 56 20 20 20 20 20 20  |...Q.N MOV      |
00013600  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
00013610  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00013620  69 73 20 73 65 63 74 69  6f 6e 20 73 61 76 65 73  |is section saves|
00013630  20 6f 75 74 20 74 68 65  20 72 65 63 6f 72 64 73  | out the records|
00013640  0d 51 b8 4e 20 4d 4f 56  20 20 20 20 20 20 52 32  |.Q.N MOV      R2|
00013650  2c 52 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |,R6             |
00013660  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 75 73  |           ;Thus|
00013670  20 64 65 6c 65 74 69 6e  67 20 74 68 65 20 72 65  | deleting the re|
00013680  71 75 69 72 65 64 20 72  65 63 6f 72 64 2e 0d 51  |quired record..Q|
00013690  c2 13 20 4d 4f 56 20 20  20 20 20 20 52 33 2c 52  |.. MOV      R3,R|
000136a0  38 0d 51 cc 17 20 53 55  42 20 20 20 20 20 20 52  |8.Q.. SUB      R|
000136b0  34 2c 52 37 2c 23 38 38  0d 51 d6 18 20 53 57 49  |4,R7,#88.Q.. SWI|
000136c0  20 20 20 20 20 20 22 58  4f 53 5f 47 42 50 42 22  |      "XOS_GBPB"|
000136d0  0d 51 e0 19 20 20 42 43  53 20 20 20 20 20 20 63  |.Q..  BCS      c|
000136e0  61 6e 74 75 70 64 61 74  65 0d 51 ea 04 0d 51 f4  |antupdate.Q...Q.|
000136f0  4c 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 33  |L MOV      R0,#3|
00013700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013710  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00013720  63 74 69 6f 6e 20 72 65  6c 65 61 73 65 73 20 74  |ction releases t|
00013730  68 65 20 6d 65 6d 6f 72  79 0d 51 fe 33 20 a4 4c  |he memory.Q.3 .L|
00013740  6f 6e 67 41 64 72 28 22  22 2c 31 2c 68 65 61 70  |ongAdr("",1,heap|
00013750  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
00013760  20 20 20 3b 63 6c 61 69  6d 65 64 2e 0d 52 08 13  |   ;claimed..R..|
00013770  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 52 36 0d  | MOV      R2,R6.|
00013780  52 12 18 20 53 57 49 20  20 20 20 20 20 22 58 4f  |R.. SWI      "XO|
00013790  53 5f 48 65 61 70 22 0d  52 1c 15 20 20 42 56 53  |S_Heap".R..  BVS|
000137a0  20 20 20 20 20 20 6e 6f  68 65 61 70 0d 52 26 04  |      noheap.R&.|
000137b0  0d 52 30 51 20 4c 44 52  20 20 20 20 20 20 52 30  |.R0Q LDR      R0|
000137c0  2c 5b 52 31 30 2c 23 69  6e 64 65 78 6d 61 78 25  |,[R10,#indexmax%|
000137d0  5d 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |]          ;This|
000137e0  20 73 65 63 74 69 6f 6e  20 64 65 63 72 65 6d 65  | section decreme|
000137f0  6e 74 73 20 74 68 65 20  6e 75 6d 62 65 72 20 6f  |nts the number o|
00013800  66 0d 52 3a 34 20 53 55  42 20 20 20 20 20 20 52  |f.R:4 SUB      R|
00013810  30 2c 52 30 2c 23 31 20  20 20 20 20 20 20 20 20  |0,R0,#1         |
00013820  20 20 20 20 20 20 20 20  20 20 20 20 3b 72 65 63  |            ;rec|
00013830  6f 72 64 73 2e 0d 52 44  21 20 53 54 52 20 20 20  |ords..RD! STR   |
00013840  20 20 20 52 30 2c 5b 52  31 30 2c 23 69 6e 64 65  |   R0,[R10,#inde|
00013850  78 6d 61 78 25 5d 0d 52  4e 04 0d 52 58 1e 4c 44  |xmax%].RN..RX.LD|
00013860  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00013870  52 31 32 2c 50 43 7d 5e  0d 52 62 04 0d 52 6c 53  |R12,PC}^.Rb..RlS|
00013880  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00013890  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000138c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
000138d0  52 76 31 3b 20 20 20 20  20 20 20 20 20 20 20 20  |Rv1;            |
000138e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2a  |               *|
000138f0  2a 2a 20 46 69 6e 64 50  6c 61 63 65 20 2a 2a 2a  |** FindPlace ***|
00013900  0d 52 80 51 3b 20 54 68  69 73 20 73 75 62 72 6f  |.R.Q; This subro|
00013910  75 74 69 6e 65 20 6c 6f  63 61 74 65 73 20 74 68  |utine locates th|
00013920  65 20 70 6f 73 69 74 69  6f 6e 20 69 6e 20 74 68  |e position in th|
00013930  65 20 66 69 6c 65 20 77  68 65 72 65 20 74 68 65  |e file where the|
00013940  20 6e 65 77 20 72 65 63  6f 72 64 20 6e 65 65 64  | new record need|
00013950  73 0d 52 8a 42 3b 20 74  6f 20 69 6e 73 65 72 74  |s.R.B; to insert|
00013960  65 64 2e 20 49 74 20 63  68 65 63 6b 73 20 74 68  |ed. It checks th|
00013970  65 20 49 73 73 75 65 20  4e 75 6d 62 65 72 20 61  |e Issue Number a|
00013980  6e 64 20 74 68 65 20 50  61 67 65 20 6e 75 6d 62  |nd the Page numb|
00013990  65 72 2e 0d 52 94 04 0d  52 9e 0c 3b 4f 6e 20 45  |er..R...R..;On E|
000139a0  78 69 74 0d 52 a8 4d 3b  20 20 20 20 20 20 20 20  |xit.R.M;        |
000139b0  52 38 20 3d 20 50 6f 73  69 74 69 6f 6e 20 69 6e  |R8 = Position in|
000139c0  20 66 69 6c 65 20 77 68  65 72 65 20 74 68 65 20  | file where the |
000139d0  72 65 63 6f 72 64 20 73  68 6f 75 6c 64 20 62 65  |record should be|
000139e0  20 69 6e 73 65 72 74 65  64 20 61 66 74 65 72 2e  | inserted after.|
000139f0  0d 52 b2 04 0d 52 bc 0e  2e 66 69 6e 64 70 6c 61  |.R...R...findpla|
00013a00  63 65 0d 52 c6 04 0d 52  d0 24 53 54 4d 46 44 20  |ce.R...R.$STMFD |
00013a10  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 37 2c 52  |   R13!,{R0-R7,R|
00013a20  39 2d 52 31 32 2c 52 31  34 7d 0d 52 da 04 0d 52  |9-R12,R14}.R...R|
00013a30  e4 4e 20 41 44 44 20 20  20 20 20 20 52 30 2c 52  |.N ADD      R0,R|
00013a40  31 30 2c 23 72 65 63 6f  72 64 20 20 20 20 20 20  |10,#record      |
00013a50  20 20 20 20 20 20 20 20  20 3b 47 65 74 20 49 73  |         ;Get Is|
00013a60  73 75 65 20 4e 75 6d 62  65 72 20 74 6f 20 53 65  |sue Number to Se|
00013a70  61 72 63 68 20 46 6f 72  20 61 6e 64 0d 52 ee 3a  |arch For and.R.:|
00013a80  20 41 44 44 20 20 20 20  20 20 52 31 2c 52 31 30  | ADD      R1,R10|
00013a90  2c 23 62 61 63 6b 73 6c  61 73 68 20 20 20 20 20  |,#backslash     |
00013aa0  20 20 20 20 20 20 20 3b  68 6f 6c 64 73 20 69 74  |       ;holds it|
00013ab0  20 69 6e 20 52 36 0d 52  f8 14 20 4d 4f 56 20 20  | in R6.R.. MOV  |
00013ac0  20 20 20 20 52 32 2c 23  31 33 0d 53 02 13 20 4d  |    R2,#13.S.. M|
00013ad0  4f 56 20 20 20 20 20 20  52 33 2c 23 30 0d 53 0c  |OV      R3,#0.S.|
00013ae0  1c 20 53 57 49 20 20 20  20 20 20 22 53 74 72 69  |. SWI      "Stri|
00013af0  6e 67 5f 49 6e 73 74 72  22 0d 53 16 16 20 41 44  |ng_Instr".S.. AD|
00013b00  44 20 20 20 20 20 20 52  33 2c 52 33 2c 23 31 0d  |D      R3,R3,#1.|
00013b10  53 20 1c 20 53 57 49 20  20 20 20 20 20 22 53 74  |S . SWI      "St|
00013b20  72 69 6e 67 5f 49 6e 73  74 72 22 0d 53 2a 16 20  |ring_Instr".S*. |
00013b30  41 44 44 20 20 20 20 20  20 52 33 2c 52 33 2c 23  |ADD      R3,R3,#|
00013b40  31 0d 53 34 16 20 41 44  44 20 20 20 20 20 20 52  |1.S4. ADD      R|
00013b50  30 2c 52 30 2c 52 33 0d  53 3e 18 20 4d 4f 56 20  |0,R0,R3.S>. MOV |
00013b60  20 20 20 20 20 52 31 2c  23 97 28 22 5c 22 29 0d  |     R1,#.("\").|
00013b70  53 48 1a 20 53 57 49 20  20 20 20 20 20 22 53 74  |SH. SWI      "St|
00013b80  72 69 6e 67 5f 56 61 6c  22 0d 53 52 13 20 4d 4f  |ring_Val".SR. MO|
00013b90  56 20 20 20 20 20 20 52  36 2c 52 31 0d 53 5c 04  |V      R6,R1.S\.|
00013ba0  0d 53 66 04 0d 53 70 4f  20 2e 69 73 73 75 65 6c  |.Sf..SpO .issuel|
00013bb0  6f 6f 70 20 20 20 20 20  20 20 20 20 20 20 20 20  |oop             |
00013bc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00013bd0  54 68 69 73 20 6c 6f 6f  70 20 73 74 65 70 73 20  |This loop steps |
00013be0  74 68 72 6f 75 67 68 20  74 68 65 20 72 65 63 6f  |through the reco|
00013bf0  72 64 73 0d 53 7a 4d 20  20 20 20 20 20 20 20 20  |rds.SzM         |
00013c00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013c10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 75  |              ;u|
00013c20  6e 74 69 6c 20 74 68 65  20 63 6f 72 72 65 63 74  |ntil the correct|
00013c30  20 69 73 73 75 65 20 69  73 20 66 6f 75 6e 64 2e  | issue is found.|
00013c40  0d 53 84 04 0d 53 8e 49  20 4d 4f 56 20 20 20 20  |.S...S.I MOV    |
00013c50  20 20 52 30 2c 23 32 20  20 20 20 20 20 20 20 20  |  R0,#2         |
00013c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00013c70  54 68 69 73 20 73 65 63  74 69 6f 6e 20 66 69 6e  |This section fin|
00013c80  64 73 20 74 68 65 20 6c  65 6e 67 74 68 0d 53 98  |ds the length.S.|
00013c90  4b 20 4c 44 52 20 20 20  20 20 20 52 31 2c 5b 52  |K LDR      R1,[R|
00013ca0  31 30 2c 23 69 6e 64 65  78 68 61 6e 64 6c 65 25  |10,#indexhandle%|
00013cb0  5d 20 20 20 20 20 20 20  3b 6f 66 20 74 68 65 20  |]       ;of the |
00013cc0  66 69 6c 65 20 61 6e 64  20 63 68 65 63 6b 73 20  |file and checks |
00013cd0  74 68 61 74 20 74 68 65  0d 53 a2 45 20 53 57 49  |that the.S.E SWI|
00013ce0  20 20 20 20 20 20 22 58  4f 53 5f 41 72 67 73 22  |      "XOS_Args"|
00013cf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013d00  20 20 20 3b 65 6e 64 20  68 61 73 20 6e 6f 74 20  |   ;end has not |
00013d10  62 65 65 6e 20 72 65 61  63 68 65 64 2e 0d 53 ac  |been reached..S.|
00013d20  16 20 20 42 56 53 20 20  20 20 20 20 6e 6f 69 6e  |.  BVS      noin|
00013d30  64 65 78 0d 53 b6 13 20  43 4d 50 20 20 20 20 20  |dex.S.. CMP     |
00013d40  20 52 38 2c 52 32 0d 53  c0 28 20 20 4c 44 4d 47  | R8,R2.S.(  LDMG|
00013d50  45 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |EFD    R13!,{R0-|
00013d60  52 37 2c 52 39 2d 52 31  32 2c 50 43 7d 5e 0d 53  |R7,R9-R12,PC}^.S|
00013d70  ca 04 0d 53 d4 4b 20 4d  4f 56 20 20 20 20 20 20  |...S.K MOV      |
00013d80  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
00013d90  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00013da0  69 73 20 73 65 63 74 69  6f 6e 20 70 6f 73 69 74  |is section posit|
00013db0  69 6f 6e 73 20 74 68 65  20 66 69 6c 65 0d 53 de  |ions the file.S.|
00013dc0  33 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 52 38  |3 MOV      R2,R8|
00013dd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00013de0  20 20 20 20 20 20 20 20  3b 70 6f 69 6e 74 65 72  |        ;pointer|
00013df0  0d 53 e8 18 20 53 57 49  20 20 20 20 20 20 22 58  |.S.. SWI      "X|
00013e00  4f 53 5f 41 72 67 73 22  0d 53 f2 16 20 20 42 56  |OS_Args".S..  BV|
00013e10  53 20 20 20 20 20 20 6e  6f 69 6e 64 65 78 0d 53  |S      noindex.S|
00013e20  fc 04 0d 54 06 51 20 4d  4f 56 20 20 20 20 20 20  |...T.Q MOV      |
00013e30  52 30 2c 52 39 20 20 20  20 20 20 20 20 20 20 20  |R0,R9           |
00013e40  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00013e50  69 73 20 73 65 63 74 69  6f 6e 20 72 65 61 64 73  |is section reads|
00013e60  20 65 61 63 68 20 72 65  63 6f 72 64 20 69 6e 74  | each record int|
00013e70  6f 20 61 0d 54 10 32 20  4d 4f 56 20 20 20 20 20  |o a.T.2 MOV     |
00013e80  20 52 32 2c 23 32 35 36  20 20 20 20 20 20 20 20  | R2,#256        |
00013e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 62  |              ;b|
00013ea0  75 66 66 65 72 0d 54 1a  14 20 4d 4f 56 20 20 20  |uffer.T.. MOV   |
00013eb0  20 20 20 52 33 2c 23 31  33 0d 54 24 13 20 4d 4f  |   R3,#13.T$. MO|
00013ec0  56 20 20 20 20 20 20 52  34 2c 23 30 0d 54 2e 1d  |V      R4,#0.T..|
00013ed0  20 53 57 49 20 20 20 20  20 20 22 58 53 74 72 69  | SWI      "XStri|
00013ee0  6e 67 5f 47 65 74 24 23  22 0d 54 38 16 20 20 42  |ng_Get$#".T8.  B|
00013ef0  56 53 20 20 20 20 20 20  6e 6f 69 6e 64 65 78 0d  |VS      noindex.|
00013f00  54 42 04 0d 54 4c 52 20  4d 4f 56 20 20 20 20 20  |TB..TLR MOV     |
00013f10  20 52 30 2c 52 39 20 20  20 20 20 20 20 20 20 20  | R0,R9          |
00013f20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00013f30  68 69 73 20 73 65 63 74  69 6f 6e 20 69 73 6f 6c  |his section isol|
00013f40  61 74 65 73 20 74 68 65  20 49 73 73 75 65 20 6e  |ates the Issue n|
00013f50  75 6d 62 65 72 0d 54 56  4a 20 41 44 44 20 20 20  |umber.TVJ ADD   |
00013f60  20 20 20 52 31 2c 52 31  30 2c 23 62 61 63 6b 73  |   R1,R10,#backs|
00013f70  6c 61 73 68 20 20 20 20  20 20 20 20 20 20 20 20  |lash            |
00013f80  3b 61 6e 64 20 61 6e 64  20 67 65 74 73 20 69 74  |;and and gets it|
00013f90  73 20 76 61 6c 75 65 20  69 6e 74 6f 20 52 31 0d  |s value into R1.|
00013fa0  54 60 14 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |T`. MOV      R2,|
00013fb0  23 31 33 0d 54 6a 13 20  4d 4f 56 20 20 20 20 20  |#13.Tj. MOV     |
00013fc0  20 52 33 2c 23 30 0d 54  74 1c 20 53 57 49 20 20  | R3,#0.Tt. SWI  |
00013fd0  20 20 20 20 22 53 74 72  69 6e 67 5f 49 6e 73 74  |    "String_Inst|
00013fe0  72 22 0d 54 7e 16 20 41  44 44 20 20 20 20 20 20  |r".T~. ADD      |
00013ff0  52 33 2c 52 33 2c 23 31  0d 54 88 1c 20 53 57 49  |R3,R3,#1.T.. SWI|
00014000  20 20 20 20 20 20 22 53  74 72 69 6e 67 5f 49 6e  |      "String_In|
00014010  73 74 72 22 0d 54 92 16  20 41 44 44 20 20 20 20  |str".T.. ADD    |
00014020  20 20 52 33 2c 52 33 2c  23 31 0d 54 9c 16 20 41  |  R3,R3,#1.T.. A|
00014030  44 44 20 20 20 20 20 20  52 30 2c 52 30 2c 52 33  |DD      R0,R0,R3|
00014040  0d 54 a6 18 20 4d 4f 56  20 20 20 20 20 20 52 31  |.T.. MOV      R1|
00014050  2c 23 97 28 22 5c 22 29  0d 54 b0 1a 20 53 57 49  |,#.("\").T.. SWI|
00014060  20 20 20 20 20 20 22 53  74 72 69 6e 67 5f 56 61  |      "String_Va|
00014070  6c 22 0d 54 ba 04 0d 54  c4 52 20 43 4d 50 20 20  |l".T...T.R CMP  |
00014080  20 20 20 20 52 31 2c 52  36 20 20 20 20 20 20 20  |    R1,R6       |
00014090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000140a0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
000140b0  6f 6d 70 61 72 65 73 20  74 68 65 20 69 73 73 75  |ompares the issu|
000140c0  65 20 6e 75 6d 62 65 72  0d 54 ce 50 20 20 41 44  |e number.T.P  AD|
000140d0  44 4c 54 20 20 20 20 52  38 2c 52 38 2c 23 38 38  |DLT    R8,R8,#88|
000140e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000140f0  20 20 20 3b 6f 66 20 74  68 65 20 63 75 72 72 65  |   ;of the curre|
00014100  6e 74 20 72 65 63 6f 72  64 20 77 69 74 68 20 74  |nt record with t|
00014110  68 65 20 69 73 73 75 65  0d 54 d8 51 20 20 42 4c  |he issue.T.Q  BL|
00014120  54 20 20 20 20 20 20 69  73 73 75 65 6c 6f 6f 70  |T      issueloop|
00014130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014140  20 20 20 3b 6e 75 6d 62  65 72 20 77 65 20 61 72  |   ;number we ar|
00014150  65 20 6c 6f 6f 6b 69 6e  67 20 66 6f 72 20 61 6e  |e looking for an|
00014160  64 20 72 65 70 65 61 74  73 0d 54 e2 43 20 20 20  |d repeats.T.C   |
00014170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00014190  20 20 20 20 3b 74 68 65  20 6c 6f 6f 70 20 69 66  |    ;the loop if|
000141a0  20 69 74 20 69 73 20 6c  65 73 73 2e 0d 54 ec 04  | it is less..T..|
000141b0  0d 54 f6 04 0d 55 00 50  20 41 44 44 20 20 20 20  |.T...U.P ADD    |
000141c0  20 20 52 30 2c 52 31 30  2c 23 72 65 63 6f 72 64  |  R0,R10,#record|
000141d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000141e0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 67 65 74  |This section get|
000141f0  73 20 74 68 65 20 70 61  67 65 20 6e 75 6d 62 65  |s the page numbe|
00014200  72 20 74 6f 0d 55 0a 51  20 41 44 44 20 20 20 20  |r to.U.Q ADD    |
00014210  20 20 52 31 2c 52 31 30  2c 23 62 61 63 6b 73 6c  |  R1,R10,#backsl|
00014220  61 73 68 20 20 20 20 20  20 20 20 20 20 20 20 3b  |ash            ;|
00014230  73 65 61 72 63 68 20 66  6f 72 20 61 6e 64 20 68  |search for and h|
00014240  6f 6c 64 73 20 74 68 65  20 72 65 73 75 6c 74 20  |olds the result |
00014250  69 6e 20 52 36 0d 55 14  14 20 4d 4f 56 20 20 20  |in R6.U.. MOV   |
00014260  20 20 20 52 32 2c 23 31  33 0d 55 1e 13 20 4d 4f  |   R2,#13.U.. MO|
00014270  56 20 20 20 20 20 20 52  33 2c 23 30 0d 55 28 1c  |V      R3,#0.U(.|
00014280  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
00014290  67 5f 49 6e 73 74 72 22  0d 55 32 16 20 41 44 44  |g_Instr".U2. ADD|
000142a0  20 20 20 20 20 20 52 33  2c 52 33 2c 23 31 0d 55  |      R3,R3,#1.U|
000142b0  3c 1c 20 53 57 49 20 20  20 20 20 20 22 53 74 72  |<. SWI      "Str|
000142c0  69 6e 67 5f 49 6e 73 74  72 22 0d 55 46 16 20 41  |ing_Instr".UF. A|
000142d0  44 44 20 20 20 20 20 20  52 33 2c 52 33 2c 23 31  |DD      R3,R3,#1|
000142e0  0d 55 50 1c 20 53 57 49  20 20 20 20 20 20 22 53  |.UP. SWI      "S|
000142f0  74 72 69 6e 67 5f 49 6e  73 74 72 22 0d 55 5a 16  |tring_Instr".UZ.|
00014300  20 41 44 44 20 20 20 20  20 20 52 33 2c 52 33 2c  | ADD      R3,R3,|
00014310  23 31 0d 55 64 16 20 41  44 44 20 20 20 20 20 20  |#1.Ud. ADD      |
00014320  52 30 2c 52 30 2c 52 33  0d 55 6e 18 20 4d 4f 56  |R0,R0,R3.Un. MOV|
00014330  20 20 20 20 20 20 52 31  2c 23 97 28 22 5c 22 29  |      R1,#.("\")|
00014340  0d 55 78 1a 20 53 57 49  20 20 20 20 20 20 22 53  |.Ux. SWI      "S|
00014350  74 72 69 6e 67 5f 56 61  6c 22 0d 55 82 13 20 4d  |tring_Val".U.. M|
00014360  4f 56 20 20 20 20 20 20  52 36 2c 52 31 0d 55 8c  |OV      R6,R1.U.|
00014370  04 0d 55 96 13 20 4d 4f  56 20 20 20 20 20 20 52  |..U.. MOV      R|
00014380  35 2c 23 30 0d 55 a0 04  0d 55 aa 4f 20 2e 70 61  |5,#0.U...U.O .pa|
00014390  67 65 6c 6f 6f 70 20 20  20 20 20 20 20 20 20 20  |geloop          |
000143a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000143b0  20 20 20 3b 54 68 69 73  20 6c 6f 6f 70 20 73 74  |   ;This loop st|
000143c0  65 70 73 20 74 68 72 6f  75 67 68 20 74 68 65 20  |eps through the |
000143d0  72 65 63 6f 72 64 73 0d  55 b4 4c 20 20 20 20 20  |records.U.L     |
000143e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00014400  20 20 3b 75 6e 74 69 6c  20 74 68 65 20 63 6f 72  |  ;until the cor|
00014410  72 65 63 74 20 70 61 67  65 20 69 73 20 66 6f 75  |rect page is fou|
00014420  6e 64 2e 0d 55 be 04 0d  55 c8 50 20 4d 4f 56 20  |nd..U...U.P MOV |
00014430  20 20 20 20 20 52 30 2c  23 32 20 20 20 20 20 20  |     R0,#2      |
00014440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014450  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00014460  66 69 6e 64 73 20 74 68  65 20 6c 65 6e 67 74 68  |finds the length|
00014470  20 6f 66 20 74 68 65 0d  55 d2 4f 20 4c 44 52 20  | of the.U.O LDR |
00014480  20 20 20 20 20 52 31 2c  5b 52 31 30 2c 23 69 6e  |     R1,[R10,#in|
00014490  64 65 78 68 61 6e 64 6c  65 25 5d 20 20 20 20 20  |dexhandle%]     |
000144a0  20 20 3b 66 69 6c 65 20  61 6e 64 20 63 68 65 63  |  ;file and chec|
000144b0  6b 73 20 77 65 20 68 61  76 65 20 6e 6f 74 20 72  |ks we have not r|
000144c0  65 61 63 68 65 64 0d 55  dc 3b 20 53 57 49 20 20  |eached.U.; SWI  |
000144d0  20 20 20 20 22 58 4f 53  5f 41 72 67 73 22 20 20  |    "XOS_Args"  |
000144e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000144f0  20 3b 74 68 65 20 65 6e  64 20 61 6c 72 65 61 64  | ;the end alread|
00014500  79 0d 55 e6 16 20 20 42  56 53 20 20 20 20 20 20  |y.U..  BVS      |
00014510  6e 6f 69 6e 64 65 78 0d  55 f0 13 20 43 4d 50 20  |noindex.U.. CMP |
00014520  20 20 20 20 20 52 32 2c  52 38 0d 55 fa 28 20 20  |     R2,R8.U.(  |
00014530  4c 44 4d 4c 45 46 44 20  20 20 20 52 31 33 21 2c  |LDMLEFD    R13!,|
00014540  7b 52 30 2d 52 37 2c 52  39 2d 52 31 32 2c 50 43  |{R0-R7,R9-R12,PC|
00014550  7d 5e 0d 56 04 04 0d 56  0e 4f 20 4d 4f 56 20 20  |}^.V...V.O MOV  |
00014560  20 20 20 20 52 30 2c 23  31 20 20 20 20 20 20 20  |    R0,#1       |
00014570  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014580  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 72  | ;This section r|
00014590  65 61 64 73 20 65 61 63  68 20 72 65 63 6f 72 64  |eads each record|
000145a0  20 69 6e 74 6f 0d 56 18  35 20 4d 4f 56 20 20 20  | into.V.5 MOV   |
000145b0  20 20 20 52 32 2c 52 38  20 20 20 20 20 20 20 20  |   R2,R8        |
000145c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000145d0  3b 61 20 62 75 66 66 65  72 2e 0d 56 22 18 20 53  |;a buffer..V". S|
000145e0  57 49 20 20 20 20 20 20  22 58 4f 53 5f 41 72 67  |WI      "XOS_Arg|
000145f0  73 22 0d 56 2c 16 20 20  42 56 53 20 20 20 20 20  |s".V,.  BVS     |
00014600  20 6e 6f 69 6e 64 65 78  0d 56 36 13 20 4d 4f 56  | noindex.V6. MOV|
00014610  20 20 20 20 20 20 52 30  2c 52 39 0d 56 40 15 20  |      R0,R9.V@. |
00014620  4d 4f 56 20 20 20 20 20  20 52 32 2c 23 32 35 36  |MOV      R2,#256|
00014630  0d 56 4a 14 20 4d 4f 56  20 20 20 20 20 20 52 33  |.VJ. MOV      R3|
00014640  2c 23 31 33 0d 56 54 13  20 4d 4f 56 20 20 20 20  |,#13.VT. MOV    |
00014650  20 20 52 34 2c 23 30 0d  56 5e 1d 20 53 57 49 20  |  R4,#0.V^. SWI |
00014660  20 20 20 20 20 22 58 53  74 72 69 6e 67 5f 47 65  |     "XString_Ge|
00014670  74 24 23 22 0d 56 68 16  20 20 42 56 53 20 20 20  |t$#".Vh.  BVS   |
00014680  20 20 20 6e 6f 69 6e 64  65 78 0d 56 72 04 0d 56  |   noindex.Vr..V|
00014690  7c 51 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 52  ||Q MOV      R0,R|
000146a0  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
000146b0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
000146c0  65 63 74 69 6f 6e 20 69  73 6f 6c 61 74 65 73 20  |ection isolates |
000146d0  74 68 65 20 50 61 67 65  20 6e 75 6d 62 65 72 0d  |the Page number.|
000146e0  56 86 3d 20 41 44 44 20  20 20 20 20 20 52 31 2c  |V.= ADD      R1,|
000146f0  52 31 30 2c 23 62 61 63  6b 73 6c 61 73 68 20 20  |R10,#backslash  |
00014700  20 20 20 20 20 20 20 20  20 20 3b 66 72 6f 6d 20  |          ;from |
00014710  65 61 63 68 20 72 65 63  6f 72 64 2e 0d 56 90 14  |each record..V..|
00014720  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 23 31 33  | MOV      R2,#13|
00014730  0d 56 9a 13 20 4d 4f 56  20 20 20 20 20 20 52 33  |.V.. MOV      R3|
00014740  2c 23 30 0d 56 a4 1c 20  53 57 49 20 20 20 20 20  |,#0.V.. SWI     |
00014750  20 22 53 74 72 69 6e 67  5f 49 6e 73 74 72 22 0d  | "String_Instr".|
00014760  56 ae 16 20 41 44 44 20  20 20 20 20 20 52 33 2c  |V.. ADD      R3,|
00014770  52 33 2c 23 31 0d 56 b8  1c 20 53 57 49 20 20 20  |R3,#1.V.. SWI   |
00014780  20 20 20 22 53 74 72 69  6e 67 5f 49 6e 73 74 72  |   "String_Instr|
00014790  22 0d 56 c2 16 20 41 44  44 20 20 20 20 20 20 52  |".V.. ADD      R|
000147a0  33 2c 52 33 2c 23 31 0d  56 cc 1c 20 53 57 49 20  |3,R3,#1.V.. SWI |
000147b0  20 20 20 20 20 22 53 74  72 69 6e 67 5f 49 6e 73  |     "String_Ins|
000147c0  74 72 22 0d 56 d6 16 20  41 44 44 20 20 20 20 20  |tr".V.. ADD     |
000147d0  20 52 33 2c 52 33 2c 23  31 0d 56 e0 16 20 41 44  | R3,R3,#1.V.. AD|
000147e0  44 20 20 20 20 20 20 52  30 2c 52 30 2c 52 33 0d  |D      R0,R0,R3.|
000147f0  56 ea 18 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |V.. MOV      R1,|
00014800  23 97 28 22 5c 22 29 0d  56 f4 1a 20 53 57 49 20  |#.("\").V.. SWI |
00014810  20 20 20 20 20 22 53 74  72 69 6e 67 5f 56 61 6c  |     "String_Val|
00014820  22 0d 56 fe 04 0d 57 08  4e 20 43 4d 50 20 20 20  |".V...W.N CMP   |
00014830  20 20 20 52 31 2c 52 35  20 20 20 20 20 20 20 20  |   R1,R5        |
00014840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014850  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6f  |;This section co|
00014860  6d 70 61 72 65 73 20 74  68 65 20 74 77 6f 20 70  |mpares the two p|
00014870  61 67 65 0d 57 12 4f 20  20 4d 4f 56 4c 54 20 20  |age.W.O  MOVLT  |
00014880  20 20 52 32 2c 52 38 20  20 20 20 20 20 20 20 20  |  R2,R8         |
00014890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 6e  |              ;n|
000148a0  75 6d 62 65 72 73 20 61  6e 64 20 65 78 69 74 73  |umbers and exits|
000148b0  20 74 68 65 20 73 75 62  72 6f 75 74 69 6e 65 20  | the subroutine |
000148c0  69 66 0d 57 1c 36 20 20  4c 44 4d 4c 54 46 44 20  |if.W.6  LDMLTFD |
000148d0  20 52 31 33 21 2c 7b 52  30 2d 52 37 2c 52 39 2d  | R13!,{R0-R7,R9-|
000148e0  52 31 32 2c 50 43 7d 5e  20 20 20 20 20 3b 6e 65  |R12,PC}^     ;ne|
000148f0  63 65 73 73 61 72 79 2e  0d 57 26 04 0d 57 30 13  |cessary..W&..W0.|
00014900  20 4d 4f 56 20 20 20 20  20 20 52 35 2c 52 31 0d  | MOV      R5,R1.|
00014910  57 3a 04 0d 57 44 4c 20  43 4d 50 20 20 20 20 52  |W:..WDL CMP    R|
00014920  31 2c 52 36 20 20 20 20  20 20 20 20 20 20 20 20  |1,R6            |
00014930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00014940  68 69 73 20 73 65 63 74  69 6f 6e 20 72 65 70 65  |his section repe|
00014950  61 74 73 20 74 68 65 20  6c 6f 6f 70 20 69 66 0d  |ats the loop if.|
00014960  57 4e 4b 20 20 41 44 44  4c 45 20 20 20 20 52 38  |WNK  ADDLE    R8|
00014970  2c 52 38 2c 23 38 38 20  20 20 20 20 20 20 20 20  |,R8,#88         |
00014980  20 20 20 20 20 20 20 20  20 20 3b 74 68 65 20 70  |          ;the p|
00014990  61 67 65 20 6e 75 6d 62  65 72 73 20 61 72 65 20  |age numbers are |
000149a0  6e 6f 74 20 65 71 75 61  6c 2e 0d 57 58 17 20 20  |not equal..WX.  |
000149b0  42 4c 45 20 20 20 20 20  20 70 61 67 65 6c 6f 6f  |BLE      pageloo|
000149c0  70 0d 57 62 04 0d 57 6c  13 20 4d 4f 56 20 20 20  |p.Wb..Wl. MOV   |
000149d0  20 20 20 52 32 2c 52 38  0d 57 76 04 0d 57 80 24  |   R2,R8.Wv..W.$|
000149e0  4c 44 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |LDMFD    R13!,{R|
000149f0  30 2d 52 37 2c 52 39 2d  52 31 32 2c 50 43 7d 5e  |0-R7,R9-R12,PC}^|
00014a00  0d 57 8a 04 0d 57 94 52  3b 2d 2d 2d 2d 2d 2d 2d  |.W...W.R;-------|
00014a10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00014a50  2d 2d 2d 2d 2d 2d 0d 57  9e 2d 3b 20 20 20 20 20  |------.W.-;     |
00014a60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014a70  20 20 20 20 20 2a 2a 2a  20 49 6e 73 65 72 74 20  |     *** Insert |
00014a80  2a 2a 2a 0d 57 a8 52 3b  20 54 68 69 73 20 73 75  |***.W.R; This su|
00014a90  62 72 6f 75 74 69 6e 65  20 69 6e 73 65 72 74 73  |broutine inserts|
00014aa0  20 74 68 65 20 6e 65 77  20 72 65 63 6f 72 64 20  | the new record |
00014ab0  69 6e 74 6f 20 74 68 65  20 66 69 6c 65 20 61 74  |into the file at|
00014ac0  20 74 68 65 20 70 6c 61  63 65 20 70 6f 69 6e 74  | the place point|
00014ad0  65 64 20 74 6f 0d 57 b2  15 3b 20 62 79 20 27 66  |ed to.W..; by 'f|
00014ae0  69 6e 64 70 6c 61 63 65  27 2e 0d 57 bc 04 0d 57  |indplace'..W...W|
00014af0  c6 0b 2e 69 6e 73 65 72  74 0d 57 d0 04 0d 57 da  |...insert.W...W.|
00014b00  1e 53 54 4d 46 44 20 20  20 20 52 31 33 21 2c 7b  |.STMFD    R13!,{|
00014b10  52 30 2d 52 31 32 2c 52  31 34 7d 0d 57 e4 04 0d  |R0-R12,R14}.W...|
00014b20  57 ee 13 20 4d 4f 56 20  20 20 20 20 20 52 38 2c  |W.. MOV      R8,|
00014b30  23 30 0d 57 f8 17 20 42  4c 20 20 20 20 20 20 20  |#0.W.. BL       |
00014b40  66 69 6e 64 70 6c 61 63  65 0d 58 02 04 0d 58 0c  |findplace.X...X.|
00014b50  51 20 4c 44 52 20 20 20  20 20 20 52 30 2c 5b 52  |Q LDR      R0,[R|
00014b60  31 30 2c 23 69 6e 64 65  78 6d 61 78 25 5d 20 20  |10,#indexmax%]  |
00014b70  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00014b80  63 74 69 6f 6e 20 63 61  6c 63 75 6c 61 74 65 73  |ction calculates|
00014b90  20 74 68 65 20 6c 65 6e  67 74 68 20 6f 66 0d 58  | the length of.X|
00014ba0  16 4c 20 4d 4f 56 20 20  20 20 20 20 52 37 2c 20  |.L MOV      R7, |
00014bb0  20 20 52 30 2c 20 4c 53  4c 20 23 33 20 20 20 20  |  R0, LSL #3    |
00014bc0  20 20 20 20 20 20 20 20  20 3b 74 68 65 20 69 6e  |         ;the in|
00014bd0  64 65 78 66 69 6c 65 20  62 79 20 6d 75 6c 74 69  |dexfile by multi|
00014be0  70 6c 79 69 6e 67 20 74  68 65 0d 58 20 4f 20 41  |plying the.X O A|
00014bf0  44 44 20 20 20 20 20 20  52 37 2c 52 37 2c 52 30  |DD      R7,R7,R0|
00014c00  2c 20 4c 53 4c 20 23 34  20 20 20 20 20 20 20 20  |, LSL #4        |
00014c10  20 20 20 20 20 3b 6e 75  6d 62 65 72 20 6f 66 20  |     ;number of |
00014c20  72 65 63 6f 72 64 73 20  62 79 20 38 38 2e 20 54  |records by 88. T|
00014c30  68 65 20 6e 75 6d 62 65  72 0d 58 2a 51 20 41 44  |he number.X*Q AD|
00014c40  44 20 20 20 20 20 20 52  37 2c 52 37 2c 52 30 2c  |D      R7,R7,R0,|
00014c50  20 4c 53 4c 20 23 36 20  20 20 20 20 20 20 20 20  | LSL #6         |
00014c60  20 20 20 20 3b 6f 66 20  62 79 74 65 73 20 61 66  |    ;of bytes af|
00014c70  74 65 72 20 74 68 65 20  69 6e 73 65 72 74 69 6f  |ter the insertio|
00014c80  6e 20 70 6f 69 6e 74 20  69 73 0d 58 34 3f 20 53  |n point is.X4? S|
00014c90  55 42 20 20 20 20 20 20  52 37 2c 52 37 2c 52 38  |UB      R7,R7,R8|
00014ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014cb0  20 20 20 20 20 3b 63 61  6c 63 75 6c 61 74 65 64  |     ;calculated|
00014cc0  20 66 72 6f 6d 20 52 38  2e 0d 58 3e 04 0d 58 48  | from R8..X>..XH|
00014cd0  52 20 43 4d 50 20 20 20  20 20 20 52 37 2c 23 30  |R CMP      R7,#0|
00014ce0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014cf0  20 20 20 20 20 20 20 20  3b 54 68 65 20 6e 65 78  |        ;The nex|
00014d00  74 20 73 65 63 74 69 6f  6e 20 69 73 20 73 6b 69  |t section is ski|
00014d10  70 70 65 64 20 69 66 20  74 68 65 20 6e 65 77 0d  |pped if the new.|
00014d20  58 52 52 20 20 42 4c 45  20 20 20 20 20 20 73 61  |XRR  BLE      sa|
00014d30  76 65 72 65 63 6f 72 64  20 20 20 20 20 20 20 20  |verecord        |
00014d40  20 20 20 20 20 20 20 20  20 20 3b 72 65 63 6f 72  |          ;recor|
00014d50  64 20 69 73 20 74 6f 20  67 6f 20 61 74 20 74 68  |d is to go at th|
00014d60  65 20 65 6e 64 20 6f 66  20 74 68 65 20 66 69 6c  |e end of the fil|
00014d70  65 0d 58 5c 04 0d 58 66  52 20 4d 4f 56 20 20 20  |e.X\..XfR MOV   |
00014d80  20 20 20 52 30 2c 23 32  20 20 20 20 20 20 20 20  |   R0,#2        |
00014d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014da0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6c  |;This section cl|
00014db0  61 69 6d 73 20 65 6e 6f  75 67 68 20 66 72 65 65  |aims enough free|
00014dc0  20 6d 65 6d 6f 72 79 0d  58 70 4b 20 a4 4c 6f 6e  | memory.XpK .Lon|
00014dd0  67 41 64 72 28 22 22 2c  31 2c 68 65 61 70 29 20  |gAdr("",1,heap) |
00014de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00014df0  20 3b 74 6f 20 6c 6f 61  64 20 69 6e 20 74 68 65  | ;to load in the|
00014e00  20 72 65 63 6f 72 64 73  20 61 66 74 65 72 20 74  | records after t|
00014e10  68 65 0d 58 7a 3c 20 4d  4f 56 20 20 20 20 20 20  |he.Xz< MOV      |
00014e20  52 33 2c 52 37 20 20 20  20 20 20 20 20 20 20 20  |R3,R7           |
00014e30  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 69 6e  |             ;in|
00014e40  73 65 72 74 69 6f 6e 20  70 6f 69 6e 74 2e 0d 58  |sertion point..X|
00014e50  84 18 20 53 57 49 20 20  20 20 20 20 22 58 4f 53  |.. SWI      "XOS|
00014e60  5f 48 65 61 70 22 0d 58  8e 15 20 20 20 42 4c 56  |_Heap".X..   BLV|
00014e70  53 20 20 20 20 6e 6f 72  6f 6f 6d 0d 58 98 20 20  |S    noroom.X.  |
00014e80  20 20 4c 44 4d 56 53 46  44 20 52 31 33 21 2c 7b  |  LDMVSFD R13!,{|
00014e90  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 58 a2 13 20  |R0-R12,PC}^.X.. |
00014ea0  4d 4f 56 20 20 20 20 20  20 52 36 2c 52 32 0d 58  |MOV      R6,R2.X|
00014eb0  ac 04 0d 58 b6 51 20 4d  4f 56 20 20 20 20 20 20  |...X.Q MOV      |
00014ec0  52 30 2c 23 33 20 20 20  20 20 20 20 20 20 20 20  |R0,#3           |
00014ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00014ee0  69 73 20 73 65 63 74 69  6f 6e 20 6c 6f 61 64 73  |is section loads|
00014ef0  20 69 6e 20 61 6c 6c 20  74 68 65 20 72 65 63 6f  | in all the reco|
00014f00  72 64 73 0d 58 c0 46 20  4c 44 52 20 20 20 20 20  |rds.X.F LDR     |
00014f10  20 52 31 2c 5b 52 31 30  2c 23 69 6e 64 65 78 68  | R1,[R10,#indexh|
00014f20  61 6e 64 6c 65 25 5d 20  20 20 20 20 20 20 3b 61  |andle%]       ;a|
00014f30  66 74 65 72 20 74 68 65  20 69 6e 73 65 72 74 69  |fter the inserti|
00014f40  6f 6e 20 70 6f 69 6e 74  2e 0d 58 ca 13 20 4d 4f  |on point..X.. MO|
00014f50  56 20 20 20 20 20 20 52  33 2c 52 37 0d 58 d4 13  |V      R3,R7.X..|
00014f60  20 4d 4f 56 20 20 20 20  20 20 52 34 2c 52 38 0d  | MOV      R4,R8.|
00014f70  58 de 18 20 53 57 49 20  20 20 20 20 20 22 58 4f  |X.. SWI      "XO|
00014f80  53 5f 47 42 50 42 22 0d  58 e8 19 20 20 42 56 53  |S_GBPB".X..  BVS|
00014f90  20 20 20 20 20 20 63 61  6e 74 75 70 64 61 74 65  |      cantupdate|
00014fa0  0d 58 f2 04 0d 58 fc 10  20 2e 73 61 76 65 72 65  |.X...X.. .savere|
00014fb0  63 6f 72 64 0d 59 06 51  20 41 44 44 20 20 20 20  |cord.Y.Q ADD    |
00014fc0  20 20 52 30 2c 52 31 30  2c 23 72 65 63 6f 72 64  |  R0,R10,#record|
00014fd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00014fe0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 61 6c  |This section cal|
00014ff0  63 75 6c 61 74 65 73 20  74 68 65 20 6e 75 6d 62  |culates the numb|
00015000  65 72 20 6f 66 0d 59 10  51 20 4d 4f 56 20 20 20  |er of.Y.Q MOV   |
00015010  20 20 20 52 31 2c 23 31  33 20 20 20 20 20 20 20  |   R1,#13       |
00015020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015030  3b 6f 66 20 62 79 74 65  73 20 6e 65 65 64 65 64  |;of bytes needed|
00015040  20 74 6f 20 70 61 64 20  74 68 65 20 6e 65 77 20  | to pad the new |
00015050  72 65 63 6f 72 64 0d 59  1a 3c 20 53 57 49 20 20  |record.Y.< SWI  |
00015060  20 20 20 20 22 53 74 72  69 6e 67 5f 4c 65 6e 22  |    "String_Len"|
00015070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015080  20 3b 6f 75 74 20 74 6f  20 38 38 20 62 79 74 65  | ;out to 88 byte|
00015090  73 2e 0d 59 24 14 20 4d  4f 56 20 20 20 20 20 20  |s..Y$. MOV      |
000150a0  52 32 2c 23 31 33 0d 59  2e 18 20 53 54 52 42 20  |R2,#13.Y.. STRB |
000150b0  20 20 20 20 52 32 2c 5b  52 30 2c 52 31 5d 0d 59  |    R2,[R0,R1].Y|
000150c0  38 16 20 41 44 44 20 20  20 20 20 20 52 30 2c 52  |8. ADD      R0,R|
000150d0  30 2c 52 31 0d 59 42 17  20 52 53 42 20 20 20 20  |0,R1.YB. RSB    |
000150e0  20 20 52 31 2c 52 31 2c  23 38 37 0d 59 4c 16 20  |  R1,R1,#87.YL. |
000150f0  53 55 42 20 20 20 20 20  20 52 31 2c 52 31 2c 23  |SUB      R1,R1,#|
00015100  31 0d 59 56 04 0d 59 60  4f 20 4d 4f 56 20 20 20  |1.YV..Y`O MOV   |
00015110  20 20 20 52 32 2c 23 30  20 20 20 20 20 20 20 20  |   R2,#0        |
00015120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015130  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 66 69  |;This section fi|
00015140  6c 6c 73 20 74 68 65 20  72 65 6d 61 69 6e 64 65  |lls the remainde|
00015150  72 20 6f 66 0d 59 6a 47  2e 69 6e 73 65 72 74 6c  |r of.YjG.insertl|
00015160  6f 6f 70 20 20 20 20 20  20 20 20 20 20 20 20 20  |oop             |
00015170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00015180  74 68 65 20 72 65 63 6f  72 64 20 77 69 74 68 20  |the record with |
00015190  7a 65 72 6f 20 62 79 74  65 73 2e 0d 59 74 18 20  |zero bytes..Yt. |
000151a0  53 54 52 42 20 20 20 20  20 52 32 2c 5b 52 30 2c  |STRB     R2,[R0,|
000151b0  52 31 5d 0d 59 7e 16 20  53 55 42 53 20 20 20 20  |R1].Y~. SUBS    |
000151c0  20 52 31 2c 52 31 2c 23  31 0d 59 88 19 20 20 42  | R1,R1,#1.Y..  B|
000151d0  4e 45 20 20 20 20 20 20  69 6e 73 65 72 74 6c 6f  |NE      insertlo|
000151e0  6f 70 0d 59 92 04 0d 59  9c 52 20 4d 4f 56 20 20  |op.Y...Y.R MOV  |
000151f0  20 20 20 20 52 30 2c 23  31 20 20 20 20 20 20 20  |    R0,#1       |
00015200  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015210  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 73  | ;This section s|
00015220  61 76 65 73 20 74 68 65  20 6e 65 77 20 72 65 63  |aves the new rec|
00015230  6f 72 64 20 69 6e 74 6f  0d 59 a6 3b 20 4c 44 52  |ord into.Y.; LDR|
00015240  20 20 20 20 20 20 52 31  2c 5b 52 31 30 2c 23 69  |      R1,[R10,#i|
00015250  6e 64 65 78 68 61 6e 64  6c 65 25 5d 20 20 20 20  |ndexhandle%]    |
00015260  20 20 20 3b 74 68 65 20  69 6e 64 65 78 20 66 69  |   ;the index fi|
00015270  6c 65 2e 0d 59 b0 1c 20  41 44 44 20 20 20 20 20  |le..Y.. ADD     |
00015280  20 52 32 2c 52 31 30 2c  23 72 65 63 6f 72 64 0d  | R2,R10,#record.|
00015290  59 ba 14 20 4d 4f 56 20  20 20 20 20 20 52 33 2c  |Y.. MOV      R3,|
000152a0  23 38 38 0d 59 c4 13 20  4d 4f 56 20 20 20 20 20  |#88.Y.. MOV     |
000152b0  20 52 34 2c 52 38 0d 59  ce 18 20 53 57 49 20 20  | R4,R8.Y.. SWI  |
000152c0  20 20 20 20 22 58 4f 53  5f 47 42 50 42 22 0d 59  |    "XOS_GBPB".Y|
000152d0  d8 19 20 20 42 56 53 20  20 20 20 20 20 63 61 6e  |..  BVS      can|
000152e0  74 75 70 64 61 74 65 0d  59 e2 04 0d 59 ec 4f 20  |tupdate.Y...Y.O |
000152f0  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 30  |LDR      R0,[R10|
00015300  2c 23 69 6e 64 65 78 6d  61 78 25 5d 20 20 20 20  |,#indexmax%]    |
00015310  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00015320  69 6f 6e 20 69 6e 63 72  65 6d 65 6e 74 73 20 74  |ion increments t|
00015330  68 65 20 6d 61 78 69 6d  75 6d 0d 59 f6 3a 20 41  |he maximum.Y.: A|
00015340  44 44 20 20 20 20 20 20  52 30 2c 52 30 2c 23 31  |DD      R0,R0,#1|
00015350  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015360  20 20 20 20 20 3b 72 65  63 6f 72 64 20 6e 75 6d  |     ;record num|
00015370  62 65 72 2e 0d 5a 00 21  20 53 54 52 20 20 20 20  |ber..Z.! STR    |
00015380  20 20 52 30 2c 5b 52 31  30 2c 23 69 6e 64 65 78  |  R0,[R10,#index|
00015390  6d 61 78 25 5d 0d 5a 0a  04 0d 5a 14 4f 20 43 4d  |max%].Z...Z.O CM|
000153a0  50 20 20 20 20 20 20 52  37 2c 23 30 20 20 20 20  |P      R7,#0    |
000153b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000153c0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
000153d0  6e 20 65 6e 64 73 20 74  68 65 20 73 75 62 72 6f  |n ends the subro|
000153e0  75 74 69 6e 65 20 69 66  0d 5a 1e 4f 20 20 4c 44  |utine if.Z.O  LD|
000153f0  4d 45 51 46 44 20 20 52  31 33 21 2c 7b 52 30 2d  |MEQFD  R13!,{R0-|
00015400  52 31 32 2c 50 43 7d 5e  20 20 20 20 20 20 20 20  |R12,PC}^        |
00015410  20 20 20 3b 74 68 65 20  72 65 63 6f 72 64 20 77  |   ;the record w|
00015420  61 73 20 69 6e 73 65 72  74 65 64 20 61 74 20 74  |as inserted at t|
00015430  68 65 20 65 6e 64 2e 0d  5a 28 04 0d 5a 32 50 20  |he end..Z(..Z2P |
00015440  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 31 20 20  |MOV      R0,#1  |
00015450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015460  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00015470  69 6f 6e 20 77 72 69 74  65 73 20 74 68 65 20 72  |ion writes the r|
00015480  65 6d 61 69 6e 64 65 72  20 6f 66 0d 5a 3c 4b 20  |emainder of.Z<K |
00015490  4d 4f 56 20 20 20 20 20  20 52 32 2c 52 36 20 20  |MOV      R2,R6  |
000154a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000154b0  20 20 20 20 20 20 3b 74  68 65 20 72 65 63 6f 72  |      ;the recor|
000154c0  64 73 20 62 61 63 6b 20  69 6e 74 6f 20 74 68 65  |ds back into the|
000154d0  20 66 69 6c 65 2e 0d 5a  46 13 20 4d 4f 56 20 20  | file..ZF. MOV  |
000154e0  20 20 20 20 52 33 2c 52  37 0d 5a 50 18 20 53 57  |    R3,R7.ZP. SW|
000154f0  49 20 20 20 20 20 20 22  58 4f 53 5f 47 42 50 42  |I      "XOS_GBPB|
00015500  22 0d 5a 5a 19 20 20 42  56 53 20 20 20 20 20 20  |".ZZ.  BVS      |
00015510  63 61 6e 74 75 70 64 61  74 65 0d 5a 64 04 0d 5a  |cantupdate.Zd..Z|
00015520  6e 4c 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 33  |nL MOV     R0,#3|
00015530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015540  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00015550  65 63 74 69 6f 6e 20 72  65 6c 65 61 73 65 73 20  |ection releases |
00015560  74 68 65 20 6d 65 6d 6f  72 79 0d 5a 78 33 20 a4  |the memory.Zx3 .|
00015570  4c 6f 6e 67 41 64 72 28  22 22 2c 31 2c 68 65 61  |LongAdr("",1,hea|
00015580  70 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p)              |
00015590  20 20 20 20 3b 63 6c 61  69 6d 65 64 2e 0d 5a 82  |    ;claimed..Z.|
000155a0  12 20 4d 4f 56 20 20 20  20 20 52 32 2c 52 36 0d  |. MOV     R2,R6.|
000155b0  5a 8c 17 20 53 57 49 20  20 20 20 20 22 58 4f 53  |Z.. SWI     "XOS|
000155c0  5f 48 65 61 70 22 0d 5a  96 14 20 20 42 56 53 20  |_Heap".Z..  BVS |
000155d0  20 20 20 20 6e 6f 68 65  61 70 0d 5a a0 04 0d 5a  |    noheap.Z...Z|
000155e0  aa 1e 4c 44 4d 46 44 20  20 20 20 52 31 33 21 2c  |..LDMFD    R13!,|
000155f0  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 5a b4 04  |{R0-R12,PC}^.Z..|
00015600  0d 5a be 53 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.Z.S;-----------|
00015610  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00015650  2d 2d 2d 0d 5a c8 34 3b  20 20 20 20 20 20 20 20  |---.Z.4;        |
00015660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015670  20 20 20 2a 2a 2a 20 44  72 61 67 46 69 6e 69 73  |   *** DragFinis|
00015680  68 65 64 20 2a 2a 2a 0d  5a d2 52 3b 20 54 68 69  |hed ***.Z.R; Thi|
00015690  73 20 73 75 62 72 6f 75  74 69 6e 65 20 69 73 20  |s subroutine is |
000156a0  63 61 6c 6c 65 64 20 77  68 65 6e 20 74 68 65 20  |called when the |
000156b0  75 73 65 72 20 72 65 6c  65 61 73 65 73 20 61 6c  |user releases al|
000156c0  6c 20 74 68 65 20 6d 6f  75 73 65 20 62 75 74 74  |l the mouse butt|
000156d0  6f 6e 73 20 61 66 74 65  72 0d 5a dc 4d 3b 20 70  |ons after.Z.M; p|
000156e0  65 72 66 6f 72 6d 69 6e  67 20 61 20 64 72 61 67  |erforming a drag|
000156f0  20 6f 70 65 72 61 74 69  6f 6e 2e 20 69 2e 65 2e  | operation. i.e.|
00015700  20 64 72 61 67 67 69 6e  67 20 6f 75 72 20 73 61  | dragging our sa|
00015710  76 65 20 69 63 6f 6e 20  74 6f 20 61 20 64 69 72  |ve icon to a dir|
00015720  65 63 74 6f 72 79 0d 5a  e6 0e 3b 20 64 69 73 70  |ectory.Z..; disp|
00015730  6c 61 79 2e 0d 5a f0 04  0d 5a fa 11 2e 44 72 61  |lay..Z...Z...Dra|
00015740  67 46 69 6e 69 73 68 65  64 0d 5b 04 04 0d 5b 0e  |gFinished.[...[.|
00015750  1e 53 54 4d 46 44 20 20  20 20 52 31 33 21 2c 7b  |.STMFD    R13!,{|
00015760  52 30 2d 52 31 32 2c 52  31 34 7d 0d 5b 18 04 0d  |R0-R12,R14}.[...|
00015770  5b 22 4e 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |["N LDR      R0,|
00015780  5b 52 31 32 2c 23 73 61  76 65 25 5d 20 20 20 20  |[R12,#save%]    |
00015790  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
000157a0  73 65 63 74 69 6f 6e 20  72 65 61 64 73 20 74 68  |section reads th|
000157b0  65 20 73 74 72 69 6e 67  20 66 72 6f 6d 0d 5b 2c  |e string from.[,|
000157c0  4e 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 23 32  |N MOV      R1,#2|
000157d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000157e0  20 20 20 20 20 20 20 20  3b 74 68 65 20 66 69 6c  |        ;the fil|
000157f0  65 6e 61 6d 65 20 69 63  6f 6e 20 28 23 32 29 20  |ename icon (#2) |
00015800  69 6e 20 74 68 65 20 73  61 76 65 0d 5b 36 35 20  |in the save.[65 |
00015810  4d 4f 56 20 20 20 20 20  20 52 32 2c 52 39 20 20  |MOV      R2,R9  |
00015820  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015830  20 20 20 20 20 20 3b 64  69 61 6c 6f 67 75 65 2e  |      ;dialogue.|
00015840  0d 5b 40 16 20 42 4c 20  20 20 20 20 20 20 52 65  |.[@. BL       Re|
00015850  61 64 49 63 6f 6e 0d 5b  4a 04 0d 5b 54 50 20 4d  |adIcon.[J..[TP M|
00015860  4f 56 20 20 20 20 20 20  52 30 2c 52 39 20 20 20  |OV      R0,R9   |
00015870  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015880  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00015890  6f 6e 20 66 69 6e 64 73  20 74 68 65 20 6c 65 6e  |on finds the len|
000158a0  67 74 68 20 6f 66 20 74  68 65 0d 5b 5e 35 20 4d  |gth of the.[^5 M|
000158b0  4f 56 20 20 20 20 20 20  52 31 2c 23 31 33 20 20  |OV      R1,#13  |
000158c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000158d0  20 20 20 20 20 3b 66 69  6c 65 6e 61 6d 65 2e 0d  |     ;filename..|
000158e0  5b 68 1a 20 53 57 49 20  20 20 20 20 20 22 53 74  |[h. SWI      "St|
000158f0  72 69 6e 67 5f 4c 65 6e  22 0d 5b 72 13 20 4d 4f  |ring_Len".[r. MO|
00015900  56 20 20 20 20 20 20 52  38 2c 52 31 0d 5b 7c 04  |V      R8,R1.[|.|
00015910  0d 5b 86 50 20 53 55 42  20 20 20 20 20 20 52 31  |.[.P SUB      R1|
00015920  2c 52 31 2c 23 31 20 20  20 20 20 20 20 20 20 20  |,R1,#1          |
00015930  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00015940  20 73 65 63 74 69 6f 6e  20 6c 6f 63 61 74 65 73  | section locates|
00015950  20 74 68 65 20 6c 61 73  74 20 27 2e 27 20 69 6e  | the last '.' in|
00015960  0d 5b 90 4f 20 2e 64 72  61 67 66 69 6e 69 73 68  |.[.O .dragfinish|
00015970  65 64 6c 6f 6f 70 20 20  20 20 20 20 20 20 20 20  |edloop          |
00015980  20 20 20 20 20 20 20 20  20 20 20 3b 66 69 6c 65  |           ;file|
00015990  6e 61 6d 65 2e 20 4e 6f  74 65 3b 20 53 75 62 2d  |name. Note; Sub-|
000159a0  64 69 72 65 63 74 6f 72  79 20 6e 61 6d 65 73 0d  |directory names.|
000159b0  5b 9a 50 20 20 4c 44 52  42 20 20 20 20 20 52 30  |[.P  LDRB     R0|
000159c0  2c 5b 52 39 2c 52 31 5d  20 20 20 20 20 20 20 20  |,[R9,R1]        |
000159d0  20 20 20 20 20 20 20 20  20 20 3b 61 72 65 20 73  |          ;are s|
000159e0  65 70 65 72 61 74 65 64  20 62 79 20 61 20 66 75  |eperated by a fu|
000159f0  6c 6c 20 73 74 6f 70 2c  20 73 6f 20 74 68 65 0d  |ll stop, so the.|
00015a00  5b a4 4f 20 20 43 4d 50  20 20 20 20 20 20 52 30  |[.O  CMP      R0|
00015a10  2c 23 97 28 22 2e 22 29  20 20 20 20 20 20 20 20  |,#.(".")        |
00015a20  20 20 20 20 20 20 20 20  3b 6e 61 6d 65 20 61 66  |        ;name af|
00015a30  74 65 72 20 74 68 65 20  66 69 6e 61 6c 20 66 75  |ter the final fu|
00015a40  6c 6c 20 73 74 6f 70 20  69 73 20 74 68 65 0d 5b  |ll stop is the.[|
00015a50  ae 35 20 20 20 41 44 44  45 51 20 20 20 20 52 31  |.5   ADDEQ    R1|
00015a60  2c 52 31 2c 23 31 20 20  20 20 20 20 20 20 20 20  |,R1,#1          |
00015a70  20 20 20 20 20 20 20 20  20 3b 6c 65 61 66 6e 61  |         ;leafna|
00015a80  6d 65 2e 0d 5b b8 15 20  20 20 43 4d 50 4e 45 20  |me..[..   CMPNE |
00015a90  20 20 20 52 31 2c 23 30  0d 5b c2 19 20 20 20 20  |   R1,#0.[..    |
00015aa0  53 55 42 4e 45 20 20 20  20 52 31 2c 52 31 2c 23  |SUBNE    R1,R1,#|
00015ab0  31 0d 5b cc 1e 20 42 4e  45 20 20 20 20 20 20 64  |1.[.. BNE      d|
00015ac0  72 61 67 66 69 6e 69 73  68 65 64 6c 6f 6f 70 0d  |ragfinishedloop.|
00015ad0  5b d6 04 0d 5b e0 16 20  53 55 42 20 20 20 20 20  |[...[.. SUB     |
00015ae0  20 52 38 2c 52 38 2c 52  31 0d 5b ea 04 0d 5b f4  | R8,R8,R1.[...[.|
00015af0  4f 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 52 39  |O MOV      R0,R9|
00015b00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015b10  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00015b20  63 74 69 6f 6e 20 69 73  6f 6c 61 74 65 73 20 74  |ction isolates t|
00015b30  68 65 20 6c 65 61 66 6e  61 6d 65 2e 0d 5b fe 13  |he leafname..[..|
00015b40  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 39 0d  | MOV      R1,R9.|
00015b50  5c 08 14 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |\.. MOV      R2,|
00015b60  23 31 33 0d 5c 12 13 20  4d 4f 56 20 20 20 20 20  |#13.\.. MOV     |
00015b70  20 52 33 2c 52 38 0d 5c  1c 1d 20 53 57 49 20 20  | R3,R8.\.. SWI  |
00015b80  20 20 20 20 22 53 74 72  69 6e 67 5f 52 69 67 68  |    "String_Righ|
00015b90  74 24 22 0d 5c 26 04 0d  5c 30 52 20 41 44 44 20  |t$".\&..\0R ADD |
00015ba0  20 20 20 20 20 52 31 2c  52 31 32 2c 23 62 6c 6f  |     R1,R12,#blo|
00015bb0  63 6b 25 20 20 20 20 20  20 20 20 20 20 20 20 20  |ck%             |
00015bc0  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00015bd0  67 65 74 73 20 64 65 74  61 69 6c 73 20 6f 66 20  |gets details of |
00015be0  74 68 65 20 6d 6f 75 73  65 0d 5c 3a 4f 20 53 57  |the mouse.\:O SW|
00015bf0  49 20 20 20 20 20 20 22  57 69 6d 70 5f 47 65 74  |I      "Wimp_Get|
00015c00  50 6f 69 6e 74 65 72 49  6e 66 6f 22 20 20 20 20  |PointerInfo"    |
00015c10  20 20 20 20 3b 70 6f 69  6e 74 65 72 20 61 6e 64  |    ;pointer and|
00015c20  20 75 73 65 73 20 74 68  65 20 69 6e 66 6f 72 6d  | uses the inform|
00015c30  61 74 69 6f 6e 20 74 6f  0d 5c 44 50 20 20 20 20  |ation to.\DP    |
00015c40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00015c60  20 20 20 3b 63 72 65 61  74 65 20 61 20 6d 65 73  |   ;create a mes|
00015c70  73 61 67 65 20 62 6c 6f  63 6b 2e 20 54 68 69 73  |sage block. This|
00015c80  20 6d 65 73 73 61 67 65  0d 5c 4e 4d 20 20 20 20  | message.\NM    |
00015c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00015cb0  20 20 20 3b 69 73 20 74  68 65 6e 20 73 65 6e 74  |   ;is then sent|
00015cc0  20 74 6f 20 74 68 65 20  54 61 73 6b 20 4d 61 6e  | to the Task Man|
00015cd0  61 67 65 72 2e 0d 5c 58  04 0d 5c 62 3e 20 4c 44  |ager..\X..\b> LD|
00015ce0  52 20 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |R      R0,[R12,#|
00015cf0  62 6c 6f 63 6b 25 2b 30  5d 20 20 20 20 20 20 20  |block%+0]       |
00015d00  20 20 20 20 3b 4d 6f 75  73 65 20 58 20 63 6f 6f  |    ;Mouse X coo|
00015d10  72 64 69 6e 61 74 65 0d  5c 6c 21 20 53 54 52 20  |rdinate.\l! STR |
00015d20  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
00015d30  6f 63 6b 25 2b 32 38 5d  0d 5c 76 04 0d 5c 80 3e  |ock%+28].\v..\.>|
00015d40  20 4c 44 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | LDR      R0,[R1|
00015d50  32 2c 23 62 6c 6f 63 6b  25 2b 34 5d 20 20 20 20  |2,#block%+4]    |
00015d60  20 20 20 20 20 20 20 3b  4d 6f 75 73 65 20 59 20  |       ;Mouse Y |
00015d70  63 6f 6f 72 64 69 6e 61  74 65 0d 5c 8a 21 20 53  |coordinate.\.! S|
00015d80  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |TR      R0,[R12,|
00015d90  23 62 6c 6f 63 6b 25 2b  33 32 5d 0d 5c 94 04 0d  |#block%+32].\...|
00015da0  5c 9e 39 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |\.9 LDR      R0,|
00015db0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 31 32 5d  |[R12,#block%+12]|
00015dc0  20 20 20 20 20 20 20 20  20 20 3b 57 69 6e 64 6f  |          ;Windo|
00015dd0  77 20 48 61 6e 64 6c 65  0d 5c a8 21 20 53 54 52  |w Handle.\.! STR|
00015de0  20 20 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 62  |      R0,[R12,#b|
00015df0  6c 6f 63 6b 25 2b 32 30  5d 0d 5c b2 04 0d 5c bc  |lock%+20].\...\.|
00015e00  37 20 4c 44 52 20 20 20  20 20 20 52 33 2c 5b 52  |7 LDR      R3,[R|
00015e10  31 32 2c 23 62 6c 6f 63  6b 25 2b 31 36 5d 20 20  |12,#block%+16]  |
00015e20  20 20 20 20 20 20 20 20  3b 49 63 6f 6e 20 48 61  |        ;Icon Ha|
00015e30  6e 64 6c 65 0d 5c c6 21  20 53 54 52 20 20 20 20  |ndle.\.! STR    |
00015e40  20 20 52 33 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R3,[R12,#block|
00015e50  25 2b 32 34 5d 0d 5c d0  04 0d 5c da 51 20 4d 4f  |%+24].\...\.Q MO|
00015e60  56 20 20 20 20 20 20 52  30 2c 23 30 20 20 20 20  |V      R0,#0    |
00015e70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015e80  20 20 20 20 3b 4f 75 72  20 52 65 66 65 72 65 6e  |    ;Our Referen|
00015e90  63 65 20 2d 20 30 20 66  6f 72 20 69 6e 69 74 69  |ce - 0 for initi|
00015ea0  61 6c 20 6d 65 73 73 61  67 65 0d 5c e4 21 20 53  |al message.\.! S|
00015eb0  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |TR      R0,[R12,|
00015ec0  23 62 6c 6f 63 6b 25 2b  31 32 5d 0d 5c ee 04 0d  |#block%+12].\...|
00015ed0  5c f8 47 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |\.G MOV      R0,|
00015ee0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00015ef0  20 20 20 20 20 20 20 20  20 20 3b 4d 65 73 73 61  |          ;Messa|
00015f00  67 65 20 6e 75 6d 62 65  72 20 2d 20 31 20 44 61  |ge number - 1 Da|
00015f10  74 61 53 61 76 65 0d 5d  02 21 20 53 54 52 20 20  |taSave.].! STR  |
00015f20  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 62 6c 6f  |    R0,[R12,#blo|
00015f30  63 6b 25 2b 31 36 5d 0d  5d 0c 04 0d 5d 16 42 20  |ck%+16].]...].B |
00015f40  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 38 38 20  |MOV      R0,#88 |
00015f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00015f60  20 20 20 20 20 20 3b 45  73 74 69 6d 61 74 65 64  |      ;Estimated|
00015f70  20 73 69 7a 65 20 6f 66  20 66 69 6c 65 0d 5d 20  | size of file.] |
00015f80  4f 20 53 54 52 20 20 20  20 20 20 52 30 2c 5b 52  |O STR      R0,[R|
00015f90  31 32 2c 23 62 6c 6f 63  6b 25 2b 33 36 5d 20 20  |12,#block%+36]  |
00015fa0  20 20 20 20 20 20 20 20  3b 54 68 65 20 66 69 6c  |        ;The fil|
00015fb0  65 20 77 69 6c 6c 20 61  6c 77 61 79 73 20 62 65  |e will always be|
00015fc0  20 61 74 20 6c 65 61 73  74 20 38 38 0d 5d 2a 04  | at least 88.]*.|
00015fd0  0d 5d 34 34 20 4d 4f 56  20 20 20 20 20 20 52 30  |.]44 MOV      R0|
00015fe0  2c 23 26 30 41 43 20 20  20 20 20 20 20 20 20 20  |,#&0AC          |
00015ff0  20 20 20 20 20 20 20 20  20 20 20 3b 46 69 6c 65  |           ;File|
00016000  74 79 70 65 0d 5d 3e 21  20 53 54 52 20 20 20 20  |type.]>! STR    |
00016010  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00016020  25 2b 34 30 5d 0d 5d 48  04 0d 5d 52 3d 20 4d 4f  |%+40].]H..]R= MO|
00016030  56 20 20 20 20 20 20 52  30 2c 52 39 20 20 20 20  |V      R0,R9    |
00016040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00016050  20 20 20 20 3b 50 72 6f  70 6f 73 65 64 20 4c 65  |    ;Proposed Le|
00016060  61 66 6e 61 6d 65 0d 5d  5c 1f 20 41 44 44 20 20  |afname.]\. ADD  |
00016070  20 20 20 20 52 31 2c 52  31 32 2c 23 62 6c 6f 63  |    R1,R12,#bloc|
00016080  6b 25 2b 34 34 0d 5d 66  14 20 4d 4f 56 20 20 20  |k%+44.]f. MOV   |
00016090  20 20 20 52 32 2c 23 31  33 0d 5d 70 1c 20 53 57  |   R2,#13.]p. SW|
000160a0  49 20 20 20 20 20 20 22  53 74 72 69 6e 67 5f 4d  |I      "String_M|
000160b0  6f 76 65 24 22 0d 5d 7a  04 0d 5d 84 50 20 4d 4f  |ove$".]z..].P MO|
000160c0  56 20 20 20 20 20 20 52  30 2c 23 30 20 20 20 20  |V      R0,#0    |
000160d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000160e0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
000160f0  6e 20 61 64 64 73 20 61  20 74 65 72 6d 69 6e 61  |n adds a termina|
00016100  74 69 6e 67 20 7a 65 72  6f 0d 5d 8e 41 20 41 44  |ting zero.].A AD|
00016110  44 20 20 20 20 20 20 52  32 2c 52 31 32 2c 23 62  |D      R2,R12,#b|
00016120  6c 6f 63 6b 25 2b 34 34  20 20 20 20 20 20 20 20  |lock%+44        |
00016130  20 20 20 20 3b 62 79 74  65 20 74 6f 20 74 68 65  |    ;byte to the|
00016140  20 6c 65 61 66 6e 61 6d  65 2e 0d 5d 98 16 20 41  | leafname..].. A|
00016150  44 44 20 20 20 20 20 20  52 31 2c 52 32 2c 52 38  |DD      R1,R2,R8|
00016160  0d 5d a2 18 20 53 54 52  42 20 20 20 20 20 52 30  |.].. STRB     R0|
00016170  2c 5b 52 31 5d 2c 23 31  0d 5d ac 04 0d 5d b6 50  |,[R1],#1.]...].P|
00016180  20 41 44 44 20 20 20 20  20 20 52 32 2c 52 38 2c  | ADD      R2,R8,|
00016190  23 34 34 2b 33 20 20 20  20 20 20 20 20 20 20 20  |#44+3           |
000161a0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000161b0  74 69 6f 6e 20 66 69 6e  64 73 20 74 68 65 20 6c  |tion finds the l|
000161c0  65 6e 67 74 68 20 6f 66  20 74 68 65 0d 5d c0 51  |ength of the.].Q|
000161d0  20 42 49 43 20 20 20 20  20 20 52 32 2c 52 32 2c  | BIC      R2,R2,|
000161e0  23 25 31 31 20 20 20 20  20 20 20 20 20 20 20 20  |#%11            |
000161f0  20 20 20 20 20 20 20 3b  65 6e 74 69 72 65 20 6d  |       ;entire m|
00016200  65 73 73 61 67 65 20 62  6c 6f 63 6b 20 61 6e 64  |essage block and|
00016210  20 72 6f 75 6e 64 73 20  69 74 20 75 70 0d 5d ca  | rounds it up.].|
00016220  40 20 53 54 52 20 20 20  20 20 20 52 32 2c 5b 52  |@ STR      R2,[R|
00016230  31 32 2c 23 62 6c 6f 63  6b 25 2b 30 5d 20 20 20  |12,#block%+0]   |
00016240  20 20 20 20 20 20 20 20  3b 74 6f 20 74 68 65 20  |        ;to the |
00016250  6e 65 61 72 65 73 74 20  77 6f 72 64 2e 0d 5d d4  |nearest word..].|
00016260  04 0d 5d de 4f 20 4d 4f  56 20 20 20 20 20 20 52  |..].O MOV      R|
00016270  30 2c 23 31 38 20 20 20  20 20 20 20 20 20 20 20  |0,#18           |
00016280  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00016290  73 20 73 65 63 74 69 6f  6e 20 63 61 6c 6c 73 20  |s section calls |
000162a0  74 68 65 20 57 69 6d 70  20 74 6f 20 70 61 73 73  |the Wimp to pass|
000162b0  0d 5d e8 51 20 41 44 44  20 20 20 20 20 20 52 31  |.].Q ADD      R1|
000162c0  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 20 20 20 20  |,R12,#block%    |
000162d0  20 20 20 20 20 20 20 20  20 20 20 3b 6f 75 72 20  |           ;our |
000162e0  6d 65 73 73 61 67 65 20  62 6c 6f 63 6b 20 74 6f  |message block to|
000162f0  20 74 68 65 20 54 61 73  6b 20 4d 61 6e 61 67 65  | the Task Manage|
00016300  72 0d 5d f2 21 20 4c 44  52 20 20 20 20 20 20 52  |r.].! LDR      R|
00016310  32 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 32  |2,[R12,#block%+2|
00016320  30 5d 0d 5d fc 20 20 53  57 49 20 20 20 20 20 20  |0].].  SWI      |
00016330  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00016340  65 22 0d 5e 06 04 0d 5e  10 1e 4c 44 4d 46 44 20  |e".^...^..LDMFD |
00016350  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
00016360  50 43 7d 5e 0d 5e 1a 04  0d 5e 24 53 3b 2d 2d 2d  |PC}^.^...^$S;---|
00016370  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000163b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 5e 2e 2f 3b  |-----------.^./;|
000163c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000163d0  20 20 20 20 20 20 20 2a  2a 2a 20 44 61 74 61 53  |       *** DataS|
000163e0  61 76 65 41 63 6b 20 2a  2a 2a 0d 5e 38 51 3b 20  |aveAck ***.^8Q; |
000163f0  54 68 69 73 20 73 75 62  72 6f 75 74 69 6e 65 20  |This subroutine |
00016400  69 73 20 63 61 6c 6c 65  64 20 77 68 65 6e 20 74  |is called when t|
00016410  68 65 20 74 61 72 67 65  74 20 74 61 73 6b 20 61  |he target task a|
00016420  63 6b 6e 6f 6c 77 6c 65  67 64 65 73 20 74 68 61  |cknolwlegdes tha|
00016430  74 20 77 65 20 63 61 6e  20 67 6f 0d 5e 42 50 3b  |t we can go.^BP;|
00016440  20 61 68 65 61 64 20 61  6e 64 20 73 61 76 65 20  | ahead and save |
00016450  6f 75 72 20 64 61 74 61  2e 20 54 68 65 20 27 74  |our data. The 't|
00016460  61 72 67 65 74 20 74 61  73 6b 27 20 77 69 6c 6c  |arget task' will|
00016470  20 62 65 20 65 69 74 68  65 72 20 74 68 65 20 46  | be either the F|
00016480  69 6c 65 72 20 69 66 20  74 68 65 0d 5e 4c 52 3b  |iler if the.^LR;|
00016490  20 75 73 65 72 20 77 61  6e 74 73 20 74 6f 20 73  | user wants to s|
000164a0  61 76 65 20 74 68 65 20  66 69 6c 65 20 74 6f 20  |ave the file to |
000164b0  64 69 73 63 20 6f 72 20  61 6e 6f 74 68 65 72 20  |disc or another |
000164c0  61 70 70 6c 69 63 61 74  69 6f 6e 20 69 66 20 74  |application if t|
000164d0  68 65 20 75 73 65 72 20  77 61 6e 74 73 0d 5e 56  |he user wants.^V|
000164e0  19 3b 20 74 6f 20 65 78  70 6f 72 74 20 6f 75 72  |.; to export our|
000164f0  20 64 61 74 61 2e 0d 5e  60 04 0d 5e 6a 10 2e 44  | data..^`..^j..D|
00016500  61 74 61 53 61 76 65 41  63 6b 0d 5e 74 04 0d 5e  |ataSaveAck.^t..^|
00016510  7e 1e 53 54 4d 46 44 20  20 20 20 52 31 33 21 2c  |~.STMFD    R13!,|
00016520  7b 52 30 2d 52 31 32 2c  52 31 34 7d 0d 5e 88 04  |{R0-R12,R14}.^..|
00016530  0d 5e 92 51 20 41 44 44  20 20 20 20 20 20 52 30  |.^.Q ADD      R0|
00016540  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 34 34 20  |,R12,#block%+44 |
00016550  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00016560  20 73 65 63 74 69 6f 6e  20 63 6f 70 69 65 73 20  | section copies |
00016570  74 68 65 20 66 69 6c 65  6e 61 6d 65 20 66 72 6f  |the filename fro|
00016580  6d 0d 5e 9c 4d 20 4d 4f  56 20 20 20 20 20 20 52  |m.^.M MOV      R|
00016590  31 2c 52 39 20 20 20 20  20 20 20 20 20 20 20 20  |1,R9            |
000165a0  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 68 65  |            ;the|
000165b0  20 6d 65 73 73 61 67 65  20 62 6c 6f 63 6b 20 69  | message block i|
000165c0  6e 74 6f 20 77 6f 72 6b  73 70 61 63 65 2e 0d 5e  |nto workspace..^|
000165d0  a6 13 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |.. MOV      R2,#|
000165e0  30 0d 5e b0 1c 20 53 57  49 20 20 20 20 20 20 22  |0.^.. SWI      "|
000165f0  53 74 72 69 6e 67 5f 4d  6f 76 65 24 22 0d 5e ba  |String_Move$".^.|
00016600  04 0d 5e c4 04 0d 5e ce  4f 20 4c 44 52 20 20 20  |..^...^.O LDR   |
00016610  20 20 20 52 30 2c 5b 52  31 32 2c 23 62 6c 6f 63  |   R0,[R12,#bloc|
00016620  6b 25 2b 30 5d 20 20 20  20 20 20 20 20 20 20 20  |k%+0]           |
00016630  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6f  |;This section co|
00016640  70 69 65 73 20 74 68 65  20 63 6f 6e 74 65 6e 74  |pies the content|
00016650  73 20 6f 66 0d 5e d8 50  20 4c 44 52 20 20 20 20  |s of.^.P LDR    |
00016660  20 20 52 38 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R8,[R12,#block|
00016670  25 2b 34 5d 20 20 20 20  20 20 20 20 20 20 20 3b  |%+4]           ;|
00016680  74 68 65 20 6d 65 73 73  61 67 65 20 62 6c 6f 63  |the message bloc|
00016690  6b 20 69 6e 74 6f 20 52  30 2d 52 38 20 73 6f 20  |k into R0-R8 so |
000166a0  74 68 61 74 0d 5e e2 4f  20 4c 44 52 20 20 20 20  |that.^.O LDR    |
000166b0  20 20 52 31 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R1,[R12,#block|
000166c0  25 2b 38 5d 20 20 20 20  20 20 20 20 20 20 20 3b  |%+8]           ;|
000166d0  74 68 65 20 6d 65 73 73  61 67 65 20 62 6c 6f 63  |the message bloc|
000166e0  6b 20 63 61 6e 20 62 65  20 72 65 62 75 69 6c 74  |k can be rebuilt|
000166f0  20 61 73 0d 5e ec 4c 20  4c 44 52 20 20 20 20 20  | as.^.L LDR     |
00016700  20 52 32 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R2,[R12,#block%|
00016710  2b 32 30 5d 20 20 20 20  20 20 20 20 20 20 3b 73  |+20]          ;s|
00016720  6f 6f 6e 20 61 73 20 77  65 20 68 61 76 65 20 66  |oon as we have f|
00016730  69 6e 69 73 68 65 64 20  73 61 76 69 6e 67 2e 0d  |inished saving..|
00016740  5e f6 21 20 4c 44 52 20  20 20 20 20 20 52 33 2c  |^.! LDR      R3,|
00016750  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 32 34 5d  |[R12,#block%+24]|
00016760  0d 5f 00 21 20 4c 44 52  20 20 20 20 20 20 52 34  |._.! LDR      R4|
00016770  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 32 38  |,[R12,#block%+28|
00016780  5d 0d 5f 0a 21 20 4c 44  52 20 20 20 20 20 20 52  |]._.! LDR      R|
00016790  35 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 33  |5,[R12,#block%+3|
000167a0  32 5d 0d 5f 14 21 20 4c  44 52 20 20 20 20 20 20  |2]._.! LDR      |
000167b0  52 36 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R6,[R12,#block%+|
000167c0  33 36 5d 0d 5f 1e 21 20  4c 44 52 20 20 20 20 20  |36]._.! LDR     |
000167d0  20 52 37 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R7,[R12,#block%|
000167e0  2b 34 30 5d 0d 5f 28 04  0d 5f 32 17 20 42 4c 20  |+40]._(.._2. BL |
000167f0  20 20 20 20 20 20 53 61  76 65 49 73 73 75 65 0d  |      SaveIssue.|
00016800  5f 3c 04 0d 5f 46 51 20  53 54 52 20 20 20 20 20  |_<.._FQ STR     |
00016810  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00016820  2b 30 5d 20 20 20 20 20  20 20 20 20 20 20 3b 54  |+0]           ;T|
00016830  68 65 20 73 65 63 74 69  6f 6e 20 72 65 62 75 69  |he section rebui|
00016840  6c 64 73 20 74 68 65 20  77 69 6d 70 20 6d 65 73  |lds the wimp mes|
00016850  73 61 67 65 0d 5f 50 32  20 53 54 52 20 20 20 20  |sage._P2 STR    |
00016860  20 20 52 31 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R1,[R12,#block|
00016870  25 2b 31 32 5d 20 20 20  20 20 20 20 20 20 20 3b  |%+12]          ;|
00016880  62 6c 6f 63 6b 2e 0d 5f  5a 21 20 53 54 52 20 20  |block.._Z! STR  |
00016890  20 20 20 20 52 32 2c 5b  52 31 32 2c 23 62 6c 6f  |    R2,[R12,#blo|
000168a0  63 6b 25 2b 32 30 5d 0d  5f 64 21 20 53 54 52 20  |ck%+20]._d! STR |
000168b0  20 20 20 20 20 52 33 2c  5b 52 31 32 2c 23 62 6c  |     R3,[R12,#bl|
000168c0  6f 63 6b 25 2b 32 34 5d  0d 5f 6e 21 20 53 54 52  |ock%+24]._n! STR|
000168d0  20 20 20 20 20 20 52 34  2c 5b 52 31 32 2c 23 62  |      R4,[R12,#b|
000168e0  6c 6f 63 6b 25 2b 32 38  5d 0d 5f 78 21 20 53 54  |lock%+28]._x! ST|
000168f0  52 20 20 20 20 20 20 52  35 2c 5b 52 31 32 2c 23  |R      R5,[R12,#|
00016900  62 6c 6f 63 6b 25 2b 33  32 5d 0d 5f 82 21 20 53  |block%+32]._.! S|
00016910  54 52 20 20 20 20 20 20  52 36 2c 5b 52 31 32 2c  |TR      R6,[R12,|
00016920  23 62 6c 6f 63 6b 25 2b  33 36 5d 0d 5f 8c 21 20  |#block%+36]._.! |
00016930  53 54 52 20 20 20 20 20  20 52 37 2c 5b 52 31 32  |STR      R7,[R12|
00016940  2c 23 62 6c 6f 63 6b 25  2b 34 30 5d 0d 5f 96 13  |,#block%+40]._..|
00016950  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 33 0d  | MOV      R0,#3.|
00016960  5f a0 21 20 53 54 52 20  20 20 20 20 20 52 30 2c  |_.! STR      R0,|
00016970  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 31 36 5d  |[R12,#block%+16]|
00016980  0d 5f aa 04 0d 5f b4 4c  20 4d 4f 56 20 20 20 20  |._..._.L MOV    |
00016990  20 20 52 30 2c 23 31 38  20 20 20 20 20 20 20 20  |  R0,#18        |
000169a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000169b0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 73 65 6e  |This section sen|
000169c0  64 73 20 61 20 27 44 61  74 61 5f 4c 6f 61 64 27  |ds a 'Data_Load'|
000169d0  0d 5f be 52 20 41 44 44  20 20 20 20 20 20 52 31  |._.R ADD      R1|
000169e0  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 20 20 20 20  |,R12,#block%    |
000169f0  20 20 20 20 20 20 20 20  20 20 20 3b 6d 65 73 73  |           ;mess|
00016a00  61 67 65 20 74 6f 20 74  68 65 20 74 61 72 67 65  |age to the targe|
00016a10  74 20 74 61 73 6b 2c 20  74 6f 20 63 6f 6e 66 69  |t task, to confi|
00016a20  72 6d 0d 5f c8 4b 20 4d  4f 56 20 20 20 20 20 20  |rm._.K MOV      |
00016a30  52 32 2c 52 38 20 20 20  20 20 20 20 20 20 20 20  |R2,R8           |
00016a40  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 68  |             ;th|
00016a50  61 74 20 77 65 20 68 61  76 65 20 73 65 6e 74 20  |at we have sent |
00016a60  61 6c 6c 20 6f 75 72 20  64 61 74 61 2e 0d 5f d2  |all our data.._.|
00016a70  20 20 53 57 49 20 20 20  20 20 20 22 57 69 6d 70  |  SWI      "Wimp|
00016a80  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 0d 5f dc  |_SendMessage"._.|
00016a90  04 0d 5f e6 4e 20 4d 56  4e 20 20 20 20 20 20 52  |.._.N MVN      R|
00016aa0  31 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |1,#0            |
00016ab0  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00016ac0  73 20 73 65 63 74 69 6f  6e 20 65 6e 73 75 72 65  |s section ensure|
00016ad0  73 20 74 68 61 74 20 74  68 65 20 6d 65 6e 75 0d  |s that the menu.|
00016ae0  5f f0 47 20 53 57 49 20  20 20 20 20 20 22 57 69  |_.G SWI      "Wi|
00016af0  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 20 20  |mp_CreateMenu"  |
00016b00  20 20 20 20 20 20 20 20  20 20 3b 69 73 20 72 65  |          ;is re|
00016b10  6d 6f 76 65 64 20 66 72  6f 6d 20 74 68 65 20 73  |moved from the s|
00016b20  63 72 65 65 6e 2e 0d 5f  fa 04 0d 60 04 1e 4c 44  |creen.._...`..LD|
00016b30  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00016b40  52 31 32 2c 50 43 7d 5e  0d 60 0e 04 0d 60 18 04  |R12,PC}^.`...`..|
00016b50  0d 60 22 53 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.`"S;-----------|
00016b60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00016ba0  2d 2d 2d 0d 60 2c 30 3b  20 20 20 20 20 20 20 20  |---.`,0;        |
00016bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00016bc0  20 20 2a 2a 2a 20 53 61  76 65 49 73 73 75 65 20  |  *** SaveIssue |
00016bd0  2a 2a 2a 0d 60 36 50 3b  20 54 68 69 73 20 73 75  |***.`6P; This su|
00016be0  62 72 6f 75 74 69 6e 65  20 70 65 72 66 6f 72 6d  |broutine perform|
00016bf0  73 20 74 68 65 20 61 63  74 75 61 6c 20 73 61 76  |s the actual sav|
00016c00  65 20 6f 70 65 72 61 74  69 6f 6e 20 61 66 74 65  |e operation afte|
00016c10  72 20 74 68 65 20 57 69  6d 70 20 70 72 6f 74 6f  |r the Wimp proto|
00016c20  63 6f 6c 0d 60 40 19 3b  20 68 61 73 20 62 65 65  |col.`@.; has bee|
00016c30  6e 20 70 65 72 66 6f 72  6d 65 64 2e 0d 60 4a 04  |n performed..`J.|
00016c40  0d 60 54 0e 2e 53 61 76  65 49 73 73 75 65 0d 60  |.`T..SaveIssue.`|
00016c50  5e 04 0d 60 68 1e 53 54  4d 46 44 20 20 20 20 52  |^..`h.STMFD    R|
00016c60  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
00016c70  0d 60 72 04 0d 60 7c 51  20 4d 4f 56 20 20 20 20  |.`r..`|Q MOV    |
00016c80  20 20 52 30 2c 23 31 31  20 20 20 20 20 20 20 20  |  R0,#11        |
00016c90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00016ca0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 72 65  |This section cre|
00016cb0  61 74 65 73 20 61 6e 20  65 6d 70 74 79 20 66 69  |ates an empty fi|
00016cc0  6c 65 20 6f 66 0d 60 86  42 20 4d 4f 56 20 20 20  |le of.`.B MOV   |
00016cd0  20 20 20 52 31 2c 52 39  20 20 20 20 20 20 20 20  |   R1,R9        |
00016ce0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00016cf0  3b 74 79 70 65 20 26 30  41 43 20 28 49 6e 64 65  |;type &0AC (Inde|
00016d00  78 46 69 6c 65 29 2e 0d  60 90 16 20 4d 4f 56 20  |xFile)..`.. MOV |
00016d10  20 20 20 20 20 52 32 2c  23 26 30 41 43 0d 60 9a  |     R2,#&0AC.`.|
00016d20  13 20 4d 4f 56 20 20 20  20 20 20 52 34 2c 23 30  |. MOV      R4,#0|
00016d30  0d 60 a4 13 20 4d 4f 56  20 20 20 20 20 20 52 35  |.`.. MOV      R5|
00016d40  2c 23 30 0d 60 ae 18 20  53 57 49 20 20 20 20 20  |,#0.`.. SWI     |
00016d50  20 22 58 4f 53 5f 46 69  6c 65 22 0d 60 b8 1e 20  | "XOS_File".`.. |
00016d60  20 42 56 53 20 20 20 20  20 20 4e 6f 6e 53 65 72  | BVS      NonSer|
00016d70  69 6f 75 73 45 72 72 6f  72 0d 60 c2 04 0d 60 cc  |iousError.`...`.|
00016d80  4f 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 26  |O MOV      R0,#&|
00016d90  43 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |CF              |
00016da0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00016db0  63 74 69 6f 6e 20 6f 70  65 6e 73 20 74 68 65 20  |ction opens the |
00016dc0  6e 65 77 20 66 69 6c 65  20 66 6f 72 0d 60 d6 3e  |new file for.`.>|
00016dd0  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 39 20  | MOV      R1,R9 |
00016de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00016df0  20 20 20 20 20 20 20 3b  72 65 61 64 2f 77 72 69  |       ;read/wri|
00016e00  74 65 20 61 63 63 65 73  73 2e 0d 60 e0 18 20 53  |te access..`.. S|
00016e10  57 49 20 20 20 20 20 20  22 58 4f 53 5f 46 69 6e  |WI      "XOS_Fin|
00016e20  64 22 0d 60 ea 1e 20 20  42 56 53 20 20 20 20 20  |d".`..  BVS     |
00016e30  20 4e 6f 6e 53 65 72 69  6f 75 73 45 72 72 6f 72  | NonSeriousError|
00016e40  0d 60 f4 25 20 53 54 52  20 20 20 20 20 20 52 30  |.`.% STR      R0|
00016e50  2c 5b 52 31 30 2c 23 73  65 61 72 63 68 68 61 6e  |,[R10,#searchhan|
00016e60  64 6c 65 25 5d 0d 60 fe  04 0d 61 08 51 20 4d 4f  |dle%].`...a.Q MO|
00016e70  56 20 20 20 20 20 20 52  30 2c 23 26 34 46 20 20  |V      R0,#&4F  |
00016e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00016e90  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00016ea0  6e 20 6f 70 65 6e 73 20  74 68 65 20 49 6e 64 65  |n opens the Inde|
00016eb0  78 20 66 6f 72 20 72 65  61 64 0d 61 12 33 20 41  |x for read.a.3 A|
00016ec0  44 44 20 20 20 20 20 20  52 31 2c 52 31 30 2c 23  |DD      R1,R10,#|
00016ed0  69 6e 64 65 78 66 69 6c  65 20 20 20 20 20 20 20  |indexfile       |
00016ee0  20 20 20 20 20 3b 61 63  63 65 73 73 2e 0d 61 1c  |     ;access..a.|
00016ef0  18 20 53 57 49 20 20 20  20 20 20 22 58 4f 53 5f  |. SWI      "XOS_|
00016f00  46 69 6e 64 22 0d 61 26  16 20 20 42 56 53 20 20  |Find".a&.  BVS  |
00016f10  20 20 20 20 6e 6f 69 6e  64 65 78 0d 61 30 23 20  |    noindex.a0# |
00016f20  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 31 30  |STR      R0,[R10|
00016f30  2c 23 66 69 6c 65 68 61  6e 64 6c 65 25 5d 0d 61  |,#filehandle%].a|
00016f40  3a 04 0d 61 44 4c 20 4c  44 52 20 20 20 20 20 20  |:..aDL LDR      |
00016f50  52 30 2c 5b 52 31 30 2c  23 72 65 63 6f 72 64 25  |R0,[R10,#record%|
00016f60  5d 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |]            ;Th|
00016f70  69 73 20 73 65 63 74 69  6f 6e 20 75 70 64 61 74  |is section updat|
00016f80  65 73 20 74 68 65 20 63  75 72 72 65 6e 74 0d 61  |es the current.a|
00016f90  4e 51 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |NQ LDR      R1,[|
00016fa0  52 31 30 2c 23 73 68 6f  77 25 5d 20 20 20 20 20  |R10,#show%]     |
00016fb0  20 20 20 20 20 20 20 20  20 3b 72 65 63 6f 72 64  |         ;record|
00016fc0  20 6e 75 6d 62 65 72 20  66 6f 72 20 74 68 65 20  | number for the |
00016fd0  63 75 72 72 65 6e 74 20  64 69 73 70 6c 61 79 0d  |current display.|
00016fe0  61 58 31 20 43 4d 50 20  20 20 20 20 20 52 31 2c  |aX1 CMP      R1,|
00016ff0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00017000  20 20 20 20 20 20 20 20  20 20 3b 6d 6f 64 65 2e  |          ;mode.|
00017010  0d 61 62 25 20 20 53 54  52 45 51 20 20 20 20 52  |.ab%  STREQ    R|
00017020  30 2c 5b 52 31 30 2c 23  69 6e 64 65 78 72 65 63  |0,[R10,#indexrec|
00017030  6f 72 64 25 5d 0d 61 6c  26 20 20 53 54 52 4e 45  |ord%].al&  STRNE|
00017040  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 73 65 61  |    R0,[R10,#sea|
00017050  72 63 68 72 65 63 6f 72  64 25 5d 0d 61 76 04 0d  |rchrecord%].av..|
00017060  61 80 4f 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |a.O LDR      R0,|
00017070  5b 52 31 32 2c 23 73 61  76 65 25 5d 20 20 20 20  |[R12,#save%]    |
00017080  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00017090  73 65 63 74 69 6f 6e 20  66 69 6e 64 73 20 74 68  |section finds th|
000170a0  65 20 76 61 6c 75 65 20  6f 66 20 74 68 65 0d 61  |e value of the.a|
000170b0  8a 38 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 23  |.8 MOV      R1,#|
000170c0  37 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |7               |
000170d0  20 20 20 20 20 20 20 20  20 3b 73 74 61 72 74 20  |         ;start |
000170e0  69 73 73 75 65 2e 0d 61  94 13 20 4d 4f 56 20 20  |issue..a.. MOV  |
000170f0  20 20 20 20 52 32 2c 52  39 0d 61 9e 16 20 42 4c  |    R2,R9.a.. BL|
00017100  20 20 20 20 20 20 20 52  65 61 64 49 63 6f 6e 0d  |       ReadIcon.|
00017110  61 a8 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |a.. MOV      R0,|
00017120  52 39 0d 61 b2 14 20 4d  4f 56 20 20 20 20 20 20  |R9.a.. MOV      |
00017130  52 31 2c 23 31 33 0d 61  bc 1a 20 53 57 49 20 20  |R1,#13.a.. SWI  |
00017140  20 20 20 20 22 53 74 72  69 6e 67 5f 56 61 6c 22  |    "String_Val"|
00017150  0d 61 c6 13 20 4d 4f 56  20 20 20 20 20 20 52 37  |.a.. MOV      R7|
00017160  2c 52 31 0d 61 d0 04 0d  61 da 4f 20 4c 44 52 20  |,R1.a...a.O LDR |
00017170  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 73 61  |     R0,[R12,#sa|
00017180  76 65 25 5d 20 20 20 20  20 20 20 20 20 20 20 20  |ve%]            |
00017190  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
000171a0  66 69 6e 64 73 20 74 68  65 20 76 61 6c 75 65 20  |finds the value |
000171b0  6f 66 20 74 68 65 0d 61  e4 4f 20 4d 4f 56 20 20  |of the.a.O MOV  |
000171c0  20 20 20 20 52 31 2c 23  31 30 20 20 20 20 20 20  |    R1,#10      |
000171d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000171e0  20 3b 65 6e 64 20 69 73  73 75 65 2e 20 41 6c 6c  | ;end issue. All|
000171f0  20 72 65 63 6f 72 64 73  20 62 65 6c 6f 6e 67 69  | records belongi|
00017200  6e 67 20 74 6f 0d 61 ee  47 20 4d 4f 56 20 20 20  |ng to.a.G MOV   |
00017210  20 20 20 52 32 2c 52 39  20 20 20 20 20 20 20 20  |   R2,R9        |
00017220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017230  3b 74 68 65 73 65 20 69  73 73 75 65 73 20 77 69  |;these issues wi|
00017240  6c 6c 20 62 65 20 73 61  76 65 64 2e 0d 61 f8 16  |ll be saved..a..|
00017250  20 42 4c 20 20 20 20 20  20 20 52 65 61 64 49 63  | BL       ReadIc|
00017260  6f 6e 0d 62 02 13 20 4d  4f 56 20 20 20 20 20 20  |on.b.. MOV      |
00017270  52 30 2c 52 39 0d 62 0c  14 20 4d 4f 56 20 20 20  |R0,R9.b.. MOV   |
00017280  20 20 20 52 31 2c 23 31  33 0d 62 16 1a 20 53 57  |   R1,#13.b.. SW|
00017290  49 20 20 20 20 20 20 22  53 74 72 69 6e 67 5f 56  |I      "String_V|
000172a0  61 6c 22 0d 62 20 13 20  4d 4f 56 20 20 20 20 20  |al".b . MOV     |
000172b0  20 52 36 2c 52 31 0d 62  2a 13 20 43 4d 50 20 20  | R6,R1.b*. CMP  |
000172c0  20 20 20 20 52 36 2c 52  37 0d 62 34 14 20 20 4d  |    R6,R7.b4.  M|
000172d0  4f 56 4c 54 20 20 20 20  52 36 2c 52 37 0d 62 3e  |OVLT    R6,R7.b>|
000172e0  16 20 41 44 44 20 20 20  20 20 20 52 36 2c 52 36  |. ADD      R6,R6|
000172f0  2c 23 31 0d 62 48 04 0d  62 52 13 20 4d 4f 56 20  |,#1.bH..bR. MOV |
00017300  20 20 20 20 20 52 35 2c  23 31 0d 62 5c 04 0d 62  |     R5,#1.b\..b|
00017310  66 51 20 2e 73 74 61 72  74 6c 6f 6f 70 20 20 20  |fQ .startloop   |
00017320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017330  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00017340  65 63 74 69 6f 6e 20 63  68 65 63 6b 73 20 69 66  |ection checks if|
00017350  20 74 68 65 20 65 6e 64  20 6f 66 20 74 68 65 0d  | the end of the.|
00017360  62 70 42 20 20 4c 44 52  20 20 20 20 52 30 2c 5b  |bpB  LDR    R0,[|
00017370  52 31 30 2c 23 69 6e 64  65 78 6d 61 78 25 5d 20  |R10,#indexmax%] |
00017380  20 20 20 20 20 20 20 20  20 20 3b 66 69 6c 65 20  |          ;file |
00017390  68 61 73 20 62 65 65 6e  20 72 65 61 63 68 65 64  |has been reached|
000173a0  2e 0d 62 7a 12 20 20 43  4d 50 20 20 20 20 52 35  |..bz.  CMP    R5|
000173b0  2c 52 30 0d 62 84 1f 20  20 20 4c 44 52 47 54 20  |,R0.b..   LDRGT |
000173c0  20 52 37 2c 5b 52 31 30  2c 23 72 65 63 6f 72 64  | R7,[R10,#record|
000173d0  25 5d 0d 62 8e 1a 20 20  20 42 47 54 20 20 20 20  |%].b..   BGT    |
000173e0  73 74 61 72 74 6c 6f 6f  70 65 6e 64 0d 62 98 4a  |startloopend.b.J|
000173f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00017410  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00017420  74 69 6f 6e 20 72 65 61  64 73 20 69 6e 20 61 20  |tion reads in a |
00017430  72 65 63 6f 72 64 0d 62  a2 12 20 20 4d 4f 56 20  |record.b..  MOV |
00017440  20 20 20 52 30 2c 52 35  0d 62 ac 12 20 20 4d 4f  |   R0,R5.b..  MO|
00017450  56 20 20 20 20 52 31 2c  23 32 0d 62 b6 17 20 20  |V    R1,#2.b..  |
00017460  42 4c 20 20 20 20 20 47  65 74 52 65 63 6f 72 64  |BL     GetRecord|
00017470  73 0d 62 c0 04 0d 62 ca  51 20 20 41 44 44 20 20  |s.b...b.Q  ADD  |
00017480  20 20 20 52 30 2c 52 31  30 2c 23 72 65 63 6f 72  |   R0,R10,#recor|
00017490  64 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |d               |
000174a0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 65 78  |;This section ex|
000174b0  74 72 61 63 74 20 74 68  65 20 69 73 73 75 65 20  |tract the issue |
000174c0  6e 75 6d 62 65 72 0d 62  d4 43 20 20 41 44 44 20  |number.b.C  ADD |
000174d0  20 20 20 20 52 31 2c 52  31 30 2c 23 62 61 63 6b  |    R1,R10,#back|
000174e0  73 6c 61 73 68 20 20 20  20 20 20 20 20 20 20 20  |slash           |
000174f0  20 3b 66 72 6f 6d 20 74  68 65 20 72 65 63 6f 72  | ;from the recor|
00017500  64 20 73 74 72 69 6e 67  2e 0d 62 de 14 20 20 4d  |d string..b..  M|
00017510  4f 56 20 20 20 20 20 52  32 2c 23 31 33 0d 62 e8  |OV     R2,#13.b.|
00017520  13 20 20 4d 4f 56 20 20  20 20 20 52 33 2c 23 30  |.  MOV     R3,#0|
00017530  0d 62 f2 1c 20 20 53 57  49 20 20 20 20 20 22 53  |.b..  SWI     "S|
00017540  74 72 69 6e 67 5f 49 6e  73 74 72 22 0d 62 fc 16  |tring_Instr".b..|
00017550  20 20 41 44 44 20 20 20  20 20 52 33 2c 52 33 2c  |  ADD     R3,R3,|
00017560  23 31 0d 63 06 1c 20 20  53 57 49 20 20 20 20 20  |#1.c..  SWI     |
00017570  22 53 74 72 69 6e 67 5f  49 6e 73 74 72 22 0d 63  |"String_Instr".c|
00017580  10 04 0d 63 1a 16 20 20  41 44 44 20 20 20 20 20  |...c..  ADD     |
00017590  52 30 2c 52 30 2c 52 33  0d 63 24 16 20 20 41 44  |R0,R0,R3.c$.  AD|
000175a0  44 20 20 20 20 20 52 30  2c 52 30 2c 23 31 0d 63  |D     R0,R0,#1.c|
000175b0  2e 18 20 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |..  MOV     R1,#|
000175c0  97 28 22 5c 22 29 0d 63  38 1a 20 20 53 57 49 20  |.("\").c8.  SWI |
000175d0  20 20 20 20 22 53 74 72  69 6e 67 5f 56 61 6c 22  |    "String_Val"|
000175e0  0d 63 42 04 0d 63 4c 51  20 20 43 4d 50 20 20 20  |.cB..cLQ  CMP   |
000175f0  20 20 52 31 2c 52 37 20  20 20 20 20 20 20 20 20  |  R1,R7         |
00017600  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00017610  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 6f 6d  |This section com|
00017620  70 61 72 65 73 20 74 68  65 20 53 74 61 72 74 20  |pares the Start |
00017630  69 73 73 75 65 0d 63 56  49 20 20 20 41 44 44 4c  |issue.cVI   ADDL|
00017640  54 20 20 20 52 35 2c 52  35 2c 23 31 20 20 20 20  |T   R5,R5,#1    |
00017650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017660  3b 77 69 74 68 20 74 68  65 20 69 73 73 75 65 20  |;with the issue |
00017670  6f 66 20 74 68 65 20 72  65 63 6f 72 64 2e 0d 63  |of the record..c|
00017680  60 18 20 20 20 42 4c 54  20 20 20 20 20 73 74 61  |`.   BLT     sta|
00017690  72 74 6c 6f 6f 70 0d 63  6a 1f 20 20 20 4c 44 52  |rtloop.cj.   LDR|
000176a0  20 20 20 20 52 37 2c 5b  52 31 30 2c 23 72 65 63  |    R7,[R10,#rec|
000176b0  6f 72 64 25 5d 0d 63 74  17 20 20 20 53 55 42 47  |ord%].ct.   SUBG|
000176c0  54 20 20 20 52 37 2c 52  37 2c 23 31 0d 63 7e 12  |T   R7,R7,#1.c~.|
000176d0  20 2e 73 74 61 72 74 6c  6f 6f 70 65 6e 64 0d 63  | .startloopend.c|
000176e0  88 04 0d 63 92 0d 20 2e  65 6e 64 6c 6f 6f 70 0d  |...c.. .endloop.|
000176f0  63 9c 51 20 20 4c 44 52  20 20 20 20 52 30 2c 5b  |c.Q  LDR    R0,[|
00017700  52 31 30 2c 23 69 6e 64  65 78 6d 61 78 25 5d 20  |R10,#indexmax%] |
00017710  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00017720  73 65 63 74 69 6f 6e 20  63 68 65 63 6b 73 20 69  |section checks i|
00017730  66 20 74 68 65 20 65 6e  64 20 6f 66 20 74 68 65  |f the end of the|
00017740  0d 63 a6 42 20 20 43 4d  50 20 20 20 20 52 35 2c  |.c.B  CMP    R5,|
00017750  52 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R0              |
00017760  20 20 20 20 20 20 20 20  20 20 20 3b 66 69 6c 65  |           ;file|
00017770  20 68 61 73 20 62 65 65  6e 20 72 65 61 63 68 65  | has been reache|
00017780  64 2e 0d 63 b0 18 20 20  20 42 47 54 20 20 20 20  |d..c..   BGT    |
00017790  65 6e 64 6c 6f 6f 70 65  6e 64 0d 63 ba 04 0d 63  |endloopend.c...c|
000177a0  c4 4b 20 20 4d 4f 56 20  20 20 20 52 30 2c 52 35  |.K  MOV    R0,R5|
000177b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000177c0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
000177d0  65 63 74 69 6f 6e 20 72  65 61 64 73 20 69 6e 20  |ection reads in |
000177e0  61 20 72 65 63 6f 72 64  2e 0d 63 ce 12 20 20 4d  |a record..c..  M|
000177f0  4f 56 20 20 20 20 52 31  2c 23 32 0d 63 d8 17 20  |OV    R1,#2.c.. |
00017800  20 42 4c 20 20 20 20 20  47 65 74 52 65 63 6f 72  | BL     GetRecor|
00017810  64 73 0d 63 e2 04 0d 63  ec 52 20 20 41 44 44 20  |ds.c...c.R  ADD |
00017820  20 20 20 20 52 30 2c 52  31 30 2c 23 72 65 63 6f  |    R0,R10,#reco|
00017830  72 64 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |rd              |
00017840  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 65  | ;This section e|
00017850  78 74 72 61 63 74 73 20  74 68 65 20 69 73 73 75  |xtracts the issu|
00017860  65 20 6e 75 6d 62 65 72  0d 63 f6 43 20 20 41 44  |e number.c.C  AD|
00017870  44 20 20 20 20 20 52 31  2c 52 31 30 2c 23 62 61  |D     R1,R10,#ba|
00017880  63 6b 73 6c 61 73 68 20  20 20 20 20 20 20 20 20  |ckslash         |
00017890  20 20 20 3b 66 72 6f 6d  20 74 68 65 20 72 65 63  |   ;from the rec|
000178a0  6f 72 64 20 73 74 72 69  6e 67 2e 0d 64 00 14 20  |ord string..d.. |
000178b0  20 4d 4f 56 20 20 20 20  20 52 32 2c 23 31 33 0d  | MOV     R2,#13.|
000178c0  64 0a 13 20 20 4d 4f 56  20 20 20 20 20 52 33 2c  |d..  MOV     R3,|
000178d0  23 30 0d 64 14 1c 20 20  53 57 49 20 20 20 20 20  |#0.d..  SWI     |
000178e0  22 53 74 72 69 6e 67 5f  49 6e 73 74 72 22 0d 64  |"String_Instr".d|
000178f0  1e 16 20 20 41 44 44 20  20 20 20 20 52 33 2c 52  |..  ADD     R3,R|
00017900  33 2c 23 31 0d 64 28 1c  20 20 53 57 49 20 20 20  |3,#1.d(.  SWI   |
00017910  20 20 22 53 74 72 69 6e  67 5f 49 6e 73 74 72 22  |  "String_Instr"|
00017920  0d 64 32 04 0d 64 3c 16  20 20 41 44 44 20 20 20  |.d2..d<.  ADD   |
00017930  20 20 52 30 2c 52 30 2c  52 33 0d 64 46 16 20 20  |  R0,R0,R3.dF.  |
00017940  41 44 44 20 20 20 20 20  52 30 2c 52 30 2c 23 31  |ADD     R0,R0,#1|
00017950  0d 64 50 18 20 20 4d 4f  56 20 20 20 20 20 52 31  |.dP.  MOV     R1|
00017960  2c 23 97 28 22 5c 22 29  0d 64 5a 1a 20 20 53 57  |,#.("\").dZ.  SW|
00017970  49 20 20 20 20 20 22 53  74 72 69 6e 67 5f 56 61  |I     "String_Va|
00017980  6c 22 0d 64 64 04 0d 64  6e 4f 20 20 43 4d 50 20  |l".dd..dnO  CMP |
00017990  20 20 20 20 52 31 2c 52  36 20 20 20 20 20 20 20  |    R1,R6       |
000179a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000179b0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
000179c0  6f 6d 70 61 72 65 73 20  74 68 65 20 65 6e 64 20  |ompares the end |
000179d0  69 73 73 75 65 0d 64 78  4f 20 20 20 41 44 44 4c  |issue.dxO   ADDL|
000179e0  54 20 20 20 52 35 2c 52  35 2c 23 31 20 20 20 20  |T   R5,R5,#1    |
000179f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017a00  3b 6e 75 6d 62 65 72 20  77 69 74 68 20 74 68 65  |;number with the|
00017a10  20 69 73 73 75 65 20 6e  75 6d 62 65 72 20 6f 66  | issue number of|
00017a20  20 74 68 65 0d 64 82 33  20 20 20 42 4c 54 20 20  | the.d.3   BLT  |
00017a30  20 20 20 65 6e 64 6c 6f  6f 70 20 20 20 20 20 20  |   endloop      |
00017a40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00017a50  72 65 63 6f 72 64 2e 0d  64 8c 04 0d 64 96 10 20  |record..d...d.. |
00017a60  2e 65 6e 64 6c 6f 6f 70  65 6e 64 0d 64 a0 1f 20  |.endloopend.d.. |
00017a70  20 4c 44 52 20 20 20 20  20 52 36 2c 5b 52 31 30  | LDR     R6,[R10|
00017a80  2c 23 72 65 63 6f 72 64  25 5d 0d 64 aa 04 0d 64  |,#record%].d...d|
00017a90  b4 52 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 20  |.R MOV      R0, |
00017aa0  20 20 52 37 2c 20 4c 53  4c 20 23 33 20 20 20 20  |  R7, LSL #3    |
00017ab0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00017ac0  65 63 74 69 6f 6e 20 6d  75 6c 74 69 70 6c 69 65  |ection multiplie|
00017ad0  73 20 74 68 65 20 72 65  63 6f 72 64 20 6e 6f 2e  |s the record no.|
00017ae0  0d 64 be 50 20 41 44 44  20 20 20 20 20 20 52 30  |.d.P ADD      R0|
00017af0  2c 52 30 2c 52 37 2c 20  4c 53 4c 20 23 34 20 20  |,R0,R7, LSL #4  |
00017b00  20 20 20 20 20 20 20 20  20 20 20 3b 6f 66 20 74  |           ;of t|
00017b10  68 65 20 53 74 61 72 74  20 72 65 63 6f 72 64 20  |he Start record |
00017b20  62 79 20 38 38 20 74 6f  20 67 65 74 20 69 74 73  |by 88 to get its|
00017b30  0d 64 c8 41 20 41 44 44  20 20 20 20 20 20 52 30  |.d.A ADD      R0|
00017b40  2c 52 30 2c 52 37 2c 20  4c 53 4c 20 23 36 20 20  |,R0,R7, LSL #6  |
00017b50  20 20 20 20 20 20 20 20  20 20 20 3b 70 6f 73 69  |           ;posi|
00017b60  74 69 6f 6e 20 69 6e 20  74 68 65 20 66 69 6c 65  |tion in the file|
00017b70  2e 0d 64 d2 13 20 4d 4f  56 20 20 20 20 20 20 52  |..d.. MOV      R|
00017b80  37 2c 52 30 0d 64 dc 04  0d 64 e6 52 20 4d 4f 56  |7,R0.d...d.R MOV|
00017b90  20 20 20 20 20 20 52 30  2c 20 20 20 52 36 2c 20  |      R0,   R6, |
00017ba0  4c 53 4c 20 23 33 20 20  20 20 20 20 20 20 20 20  |LSL #3          |
00017bb0  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00017bc0  20 6d 75 6c 74 69 70 6c  69 65 73 20 74 68 65 20  | multiplies the |
00017bd0  72 65 63 6f 72 64 20 6e  6f 2e 0d 64 f0 4e 20 41  |record no..d.N A|
00017be0  44 44 20 20 20 20 20 20  52 30 2c 52 30 2c 52 36  |DD      R0,R0,R6|
00017bf0  2c 20 4c 53 4c 20 23 34  20 20 20 20 20 20 20 20  |, LSL #4        |
00017c00  20 20 20 20 20 3b 6f 66  20 74 68 65 20 45 6e 64  |     ;of the End|
00017c10  20 72 65 63 6f 72 64 20  62 79 20 38 38 20 74 6f  | record by 88 to|
00017c20  20 67 65 74 20 69 74 73  0d 64 fa 41 20 41 44 44  | get its.d.A ADD|
00017c30  20 20 20 20 20 20 52 30  2c 52 30 2c 52 36 2c 20  |      R0,R0,R6, |
00017c40  4c 53 4c 20 23 36 20 20  20 20 20 20 20 20 20 20  |LSL #6          |
00017c50  20 20 20 3b 70 6f 73 69  74 69 6f 6e 20 69 6e 20  |   ;position in |
00017c60  74 68 65 20 66 69 6c 65  2e 0d 65 04 13 20 4d 4f  |the file..e.. MO|
00017c70  56 20 20 20 20 20 20 52  36 2c 52 30 0d 65 0e 50  |V      R6,R0.e.P|
00017c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00017ca0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00017cb0  74 69 6f 6e 20 63 6c 61  69 6d 73 20 65 6e 6f 75  |tion claims enou|
00017cc0  67 68 20 6d 65 6d 6f 72  79 20 74 6f 0d 65 18 4c  |gh memory to.e.L|
00017cd0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 32 20  | MOV      R0,#2 |
00017ce0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017cf0  20 20 20 20 20 20 20 3b  6c 6f 61 64 20 69 6e 20  |       ;load in |
00017d00  74 68 65 20 72 65 63 6f  72 64 73 20 74 6f 20 62  |the records to b|
00017d10  65 20 73 61 76 65 64 2e  0d 65 22 18 20 a4 4c 6f  |e saved..e". .Lo|
00017d20  6e 67 41 64 72 28 22 22  2c 31 2c 68 65 61 70 29  |ngAdr("",1,heap)|
00017d30  0d 65 2c 15 20 53 55 42  53 20 20 20 20 52 33 2c  |.e,. SUBS    R3,|
00017d40  52 36 2c 52 37 0d 65 36  11 20 20 ec 51 20 20 20  |R6,R7.e6.  .Q   |
00017d50  20 52 33 2c 23 31 0d 65  40 18 20 53 57 49 20 20  | R3,#1.e@. SWI  |
00017d60  20 20 20 20 22 58 4f 53  5f 48 65 61 70 22 0d 65  |    "XOS_Heap".e|
00017d70  4a 15 20 20 42 56 53 20  20 20 20 20 20 6e 6f 72  |J.  BVS      nor|
00017d80  6f 6f 6d 0d 65 54 13 20  4d 4f 56 20 20 20 20 20  |oom.eT. MOV     |
00017d90  20 52 35 2c 52 32 0d 65  5e 04 0d 65 68 4d 20 4d  | R5,R2.e^..ehM M|
00017da0  4f 56 20 20 20 20 20 20  52 30 2c 23 33 20 20 20  |OV      R0,#3   |
00017db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00017dc0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00017dd0  6f 6e 20 6c 6f 61 64 73  20 69 6e 20 74 68 65 20  |on loads in the |
00017de0  72 65 63 6f 72 64 73 0d  65 72 42 20 4c 44 52 20  |records.erB LDR |
00017df0  20 20 20 20 20 52 31 2c  5b 52 31 30 2c 23 66 69  |     R1,[R10,#fi|
00017e00  6c 65 68 61 6e 64 6c 65  25 5d 20 20 20 20 20 20  |lehandle%]      |
00017e10  20 20 3b 77 68 69 63 68  20 61 72 65 20 74 6f 20  |  ;which are to |
00017e20  62 65 20 73 61 76 65 64  2e 0d 65 7c 16 20 53 55  |be saved..e|. SU|
00017e30  42 20 20 20 20 20 20 52  33 2c 52 36 2c 52 37 0d  |B      R3,R6,R7.|
00017e40  65 86 13 20 4d 4f 56 20  20 20 20 20 20 52 34 2c  |e.. MOV      R4,|
00017e50  52 37 0d 65 90 18 20 53  57 49 20 20 20 20 20 20  |R7.e.. SWI      |
00017e60  22 58 4f 53 5f 47 42 50  42 22 0d 65 9a 16 20 20  |"XOS_GBPB".e..  |
00017e70  42 56 53 20 20 20 20 20  20 6e 6f 69 6e 64 65 78  |BVS      noindex|
00017e80  0d 65 a4 04 0d 65 ae 4f  20 4d 4f 56 20 20 20 20  |.e...e.O MOV    |
00017e90  20 20 52 30 2c 23 30 20  20 20 20 20 20 20 20 20  |  R0,#0         |
00017ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00017eb0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 63 6c 6f  |This section clo|
00017ec0  73 65 73 20 74 68 65 20  69 6e 64 65 78 20 66 69  |ses the index fi|
00017ed0  6c 65 2e 0d 65 b8 18 20  53 57 49 20 20 20 20 20  |le..e.. SWI     |
00017ee0  20 22 58 4f 53 5f 46 69  6e 64 22 0d 65 c2 04 0d  | "XOS_Find".e...|
00017ef0  65 cc 52 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |e.R MOV      R0,|
00017f00  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00017f10  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00017f20  73 65 63 74 69 6f 6e 20  73 61 76 65 73 20 74 68  |section saves th|
00017f30  65 20 72 65 63 6f 72 64  66 73 20 74 6f 20 74 68  |e recordfs to th|
00017f40  65 0d 65 d6 3b 20 4c 44  52 20 20 20 20 20 20 52  |e.e.; LDR      R|
00017f50  31 2c 5b 52 31 30 2c 23  73 65 61 72 63 68 68 61  |1,[R10,#searchha|
00017f60  6e 64 6c 65 25 5d 20 20  20 20 20 20 3b 73 70 65  |ndle%]      ;spe|
00017f70  63 69 66 69 65 64 20 66  69 6c 65 2e 0d 65 e0 13  |cified file..e..|
00017f80  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 52 35 0d  | MOV      R2,R5.|
00017f90  65 ea 16 20 53 55 42 20  20 20 20 20 20 52 33 2c  |e.. SUB      R3,|
00017fa0  52 36 2c 52 37 0d 65 f4  13 20 4d 4f 56 20 20 20  |R6,R7.e.. MOV   |
00017fb0  20 20 20 52 34 2c 23 30  0d 65 fe 18 20 53 57 49  |   R4,#0.e.. SWI|
00017fc0  20 20 20 20 20 20 22 58  4f 53 5f 47 42 50 42 22  |      "XOS_GBPB"|
00017fd0  0d 66 08 1e 20 20 42 56  53 20 20 20 20 20 20 4e  |.f..  BVS      N|
00017fe0  6f 6e 53 65 72 69 6f 75  73 45 72 72 6f 72 0d 66  |onSeriousError.f|
00017ff0  12 04 0d 66 1c 4d 20 4d  4f 56 20 20 20 20 20 20  |...f.M MOV      |
00018000  52 30 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R0,#0           |
00018010  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00018020  69 73 20 73 65 63 74 69  6f 6e 20 63 6c 6f 73 65  |is section close|
00018030  73 20 74 68 65 20 6e 65  77 20 66 69 6c 65 2e 0d  |s the new file..|
00018040  66 26 18 20 53 57 49 20  20 20 20 20 20 22 58 4f  |f&. SWI      "XO|
00018050  53 5f 46 69 6e 64 22 0d  66 30 04 0d 66 3a 1e 4c  |S_Find".f0..f:.L|
00018060  44 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |DMFD    R13!,{R0|
00018070  2d 52 31 32 2c 50 43 7d  5e 0d 66 44 04 0d 66 4e  |-R12,PC}^.fD..fN|
00018080  53 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S;--------------|
00018090  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000180d0  0d 66 58 3c 3b 20 20 20  20 20 20 20 20 20 20 20  |.fX<;           |
000180e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000180f0  20 2a 2a 2a 20 55 73 65  72 4d 65 73 73 61 67 65  | *** UserMessage|
00018100  52 65 63 69 65 76 65 64  20 2a 2a 2a 0d 66 62 50  |Recieved ***.fbP|
00018110  3b 20 54 68 69 73 20 73  75 62 72 6f 75 74 69 6e  |; This subroutin|
00018120  65 20 64 65 61 6c 73 20  77 69 74 68 20 61 6c 6c  |e deals with all|
00018130  20 55 73 65 72 20 4d 65  73 73 61 67 65 73 20 77  | User Messages w|
00018140  68 69 63 68 20 61 72 65  20 73 65 6e 74 20 62 79  |hich are sent by|
00018150  20 6f 74 68 65 72 20 74  61 73 6b 73 0d 66 6c 0c  | other tasks.fl.|
00018160  3b 20 74 6f 20 75 73 2e  0d 66 76 04 0d 66 80 0f  |; to us..fv..f..|
00018170  2e 62 72 65 61 6b 70 6f  69 6e 74 0d 66 8a 0e 4d  |.breakpoint.f..M|
00018180  4f 56 20 50 43 2c 52 31  34 0d 66 94 04 0d 66 9e  |OV PC,R14.f...f.|
00018190  18 2e 55 73 65 72 4d 65  73 73 61 67 65 52 65 63  |..UserMessageRec|
000181a0  65 69 76 65 64 0d 66 a8  04 0d 66 b2 1e 53 54 4d  |eived.f...f..STM|
000181b0  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
000181c0  31 32 2c 52 31 34 7d 0d  66 bc 04 0d 66 c6 4e 20  |12,R14}.f...f.N |
000181d0  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
000181e0  2c 23 62 6c 6f 63 6b 25  2b 31 36 5d 20 20 20 20  |,#block%+16]    |
000181f0  20 20 20 20 20 20 3b 54  68 69 73 20 67 65 74 73  |      ;This gets|
00018200  20 74 68 65 20 6d 65 73  73 61 67 65 20 52 65 61  | the message Rea|
00018210  73 6f 6e 20 63 6f 64 65  2e 0d 66 d0 04 0d 66 da  |son code..f...f.|
00018220  4f 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 30  |O CMP      R0,#0|
00018230  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018240  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 6d 65  |        ;This me|
00018250  73 73 61 67 65 20 74 65  6c 6c 73 20 75 73 20 74  |ssage tells us t|
00018260  6f 20 63 6c 6f 73 65 20  64 6f 77 6e 0d 66 e4 39  |o close down.f.9|
00018270  20 20 ec 51 20 20 20 20  52 30 2c 23 31 20 20 20  |  .Q    R0,#1   |
00018280  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018290  20 20 20 20 3b 6f 75 72  20 61 70 70 6c 69 63 61  |    ;our applica|
000182a0  74 69 6f 6e 2e 0d 66 ee  1e 20 20 53 54 52 45 51  |tion..f..  STREQ|
000182b0  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 71 75 69  |    R0,[R12,#qui|
000182c0  74 25 5d 0d 66 f8 04 0d  67 02 51 20 43 4d 50 20  |t%].f...g.Q CMP |
000182d0  20 20 20 20 20 52 30 2c  23 31 20 20 20 20 20 20  |     R0,#1      |
000182e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000182f0  20 20 3b 41 6e 6f 74 68  65 72 20 61 70 70 6c 69  |  ;Another appli|
00018300  63 61 74 69 6f 6e 20 69  73 20 74 72 79 69 6e 67  |cation is trying|
00018310  20 74 6f 20 73 61 76 65  0d 67 0c 4b 20 20 42 4c  | to save.g.K  BL|
00018320  45 51 20 20 20 20 20 44  61 74 61 53 61 76 65 20  |EQ     DataSave |
00018330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018340  20 20 20 3b 64 61 74 61  20 61 6e 64 20 77 61 6e  |   ;data and wan|
00018350  74 73 20 75 73 20 74 6f  20 69 6d 70 6f 72 74 20  |ts us to import |
00018360  69 74 2e 0d 67 16 04 0d  67 20 52 20 43 4d 50 20  |it..g...g R CMP |
00018370  20 20 20 20 20 52 30 2c  23 32 20 20 20 20 20 20  |     R0,#2      |
00018380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018390  20 20 3b 41 6e 6f 74 68  65 72 20 74 61 73 6b 20  |  ;Another task |
000183a0  69 73 20 67 69 76 69 6e  67 20 75 73 20 74 68 65  |is giving us the|
000183b0  20 67 6f 20 61 68 65 61  64 0d 67 2a 3d 20 20 42  | go ahead.g*=  B|
000183c0  4c 45 51 20 20 20 20 44  61 74 61 53 61 76 65 41  |LEQ    DataSaveA|
000183d0  63 6b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ck              |
000183e0  20 20 20 20 3b 74 6f 20  73 61 76 65 20 6f 75 72  |    ;to save our|
000183f0  20 64 61 74 61 2e 0d 67  34 04 0d 67 3e 4e 20 43  | data..g4..g>N C|
00018400  4d 50 20 20 20 20 20 20  52 30 2c 23 33 20 20 20  |MP      R0,#3   |
00018410  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018420  20 20 20 20 20 3b 54 68  65 20 66 69 6c 65 72 20  |     ;The filer |
00018430  77 61 6e 74 73 20 75 73  20 74 6f 20 6c 6f 61 64  |wants us to load|
00018440  20 61 20 66 69 6c 65 2e  0d 67 48 17 20 20 42 4c  | a file..gH.  BL|
00018450  45 51 20 20 20 20 20 44  61 74 61 4c 6f 61 64 0d  |EQ     DataLoad.|
00018460  67 52 1a 3b 20 20 42 4c  45 51 20 20 20 20 20 62  |gR.;  BLEQ     b|
00018470  72 65 61 6b 70 6f 69 6e  74 0d 67 5c 04 0d 67 66  |reakpoint.g\..gf|
00018480  51 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 20 20  |Q MOV      R1,  |
00018490  20 23 26 35 30 30 20 20  20 20 20 20 20 20 20 20  | #&500          |
000184a0  20 20 20 20 20 20 20 20  3b 41 20 74 61 73 6b 20  |        ;A task |
000184b0  69 73 20 72 65 71 75 65  73 74 69 6e 67 20 69 6e  |is requesting in|
000184c0  74 65 72 61 63 74 69 76  65 20 68 65 6c 70 0d 67  |teractive help.g|
000184d0  70 34 20 41 44 44 20 20  20 20 20 20 52 31 2c 52  |p4 ADD      R1,R|
000184e0  31 2c 23 26 30 30 32 20  20 20 20 20 20 20 20 20  |1,#&002         |
000184f0  20 20 20 20 20 20 20 20  20 3b 66 72 6f 6d 20 75  |         ;from u|
00018500  73 2e 0d 67 7a 13 20 43  4d 50 20 20 20 20 20 20  |s..gz. CMP      |
00018510  52 30 2c 52 31 0d 67 84  17 20 20 42 4c 45 51 20  |R0,R1.g..  BLEQ |
00018520  20 20 20 20 73 65 6e 64  68 65 6c 70 0d 67 8e 04  |    sendhelp.g..|
00018530  0d 67 98 4e 20 4d 4f 56  20 20 20 20 20 20 52 31  |.g.N MOV      R1|
00018540  2c 20 20 20 23 26 34 30  30 30 30 20 20 20 20 20  |,   #&40000     |
00018550  20 20 20 20 20 20 20 20  20 20 20 3b 4f 75 72 20  |           ;Our |
00018560  61 70 70 6c 69 63 61 74  69 6f 6e 20 75 70 64 61  |application upda|
00018570  74 65 73 20 66 69 6c 65  73 20 66 72 6f 6d 0d 67  |tes files from.g|
00018580  a2 4e 20 41 44 44 20 20  20 20 20 20 52 31 2c 52  |.N ADD      R1,R|
00018590  31 2c 23 26 30 30 30 43  32 20 20 20 20 20 20 20  |1,#&000C2       |
000185a0  20 20 20 20 20 20 20 20  20 3b 77 69 74 68 69 6e  |         ;within|
000185b0  20 6f 75 72 20 72 65 73  6f 75 72 63 65 73 20 64  | our resources d|
000185c0  69 72 65 63 74 6f 72 79  2e 20 49 66 0d 67 ac 4d  |irectory. If.g.M|
000185d0  20 43 4d 50 20 20 20 20  20 20 52 30 2c 52 31 20  | CMP      R0,R1 |
000185e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000185f0  20 20 20 20 20 20 20 3b  74 77 6f 20 63 6f 70 69  |       ;two copi|
00018600  65 73 20 6f 66 20 6f 75  72 20 61 70 70 6c 69 63  |es of our applic|
00018610  61 74 69 6f 6e 20 61 72  65 0d 67 b6 52 20 20 41  |ation are.g.R  A|
00018620  44 44 45 51 20 20 20 20  52 30 2c 52 31 32 2c 23  |DDEQ    R0,R12,#|
00018630  62 6c 6f 63 6b 25 2b 32  38 20 20 20 20 20 20 20  |block%+28       |
00018640  20 20 20 20 3b 72 75 6e  6e 69 6e 67 20 74 68 65  |    ;running the|
00018650  6e 20 74 68 69 73 20 63  6f 75 6c 64 20 63 61 75  |n this could cau|
00018660  73 65 20 6f 6e 65 20 63  6f 70 79 0d 67 c0 52 20  |se one copy.g.R |
00018670  20 41 44 44 45 51 20 20  20 20 52 31 2c 52 31 32  | ADDEQ    R1,R12|
00018680  2c 23 61 70 70 6e 61 6d  65 20 20 20 20 20 20 20  |,#appname       |
00018690  20 20 20 20 20 20 3b 74  6f 20 63 72 61 73 68 20  |      ;to crash |
000186a0  77 68 65 6e 20 74 68 65  20 66 69 72 73 74 20 63  |when the first c|
000186b0  6f 70 79 20 75 70 64 61  74 65 64 20 61 0d 67 ca  |opy updated a.g.|
000186c0  47 20 20 ec 51 20 20 20  20 52 32 2c 23 31 33 20  |G  .Q    R2,#13 |
000186d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000186e0  20 20 20 20 20 3b 61 20  66 69 6c 65 20 74 68 61  |     ;a file tha|
000186f0  74 20 77 61 73 20 65 78  70 65 63 74 65 64 20 74  |t was expected t|
00018700  6f 20 62 65 0d 67 d4 33  20 20 ec 51 20 20 20 20  |o be.g.3  .Q    |
00018710  52 33 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R3,#0           |
00018720  20 20 20 20 20 20 20 20  20 20 20 20 3b 75 6e 63  |            ;unc|
00018730  68 61 6e 67 65 64 2e 0d  67 de 50 20 20 53 57 49  |hanged..g.P  SWI|
00018740  45 51 20 20 20 20 22 53  74 72 69 6e 67 5f 49 6e  |EQ    "String_In|
00018750  73 74 72 22 20 20 20 20  20 20 20 20 20 20 20 20  |str"            |
00018760  20 20 3b 54 68 69 73 20  6d 65 73 73 61 67 65 20  |  ;This message |
00018770  69 73 20 62 72 6f 61 64  63 61 73 74 20 65 76 65  |is broadcast eve|
00018780  72 79 20 74 69 6d 65 0d  67 e8 50 20 20 43 4d 50  |ry time.g.P  CMP|
00018790  45 51 20 20 20 20 52 33  2c 23 30 20 20 20 20 20  |EQ    R3,#0     |
000187a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000187b0  20 20 3b 61 20 6e 65 77  20 61 70 70 6c 69 63 61  |  ;a new applica|
000187c0  74 69 6f 6e 20 69 73 20  72 65 67 69 73 74 65 72  |tion is register|
000187d0  65 64 20 77 69 74 68 0d  67 f2 4f 20 20 20 ec 51  |ed with.g.O   .Q|
000187e0  20 20 20 20 52 30 2c 23  31 20 20 20 20 20 20 20  |    R0,#1       |
000187f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00018800  74 68 65 20 57 69 6d 70  2e 20 57 65 20 65 78 61  |the Wimp. We exa|
00018810  6d 69 6e 65 20 74 68 65  20 6e 65 77 20 74 61 73  |mine the new tas|
00018820  6b 20 6e 61 6d 65 0d 67  fc 52 20 20 20 53 54 52  |k name.g.R   STR|
00018830  45 51 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 71  |EQ    R0,[R12,#q|
00018840  75 69 74 25 5d 20 20 20  20 20 20 20 20 20 20 20  |uit%]           |
00018850  20 3b 61 6e 64 20 69 66  20 69 74 20 69 73 20 69  | ;and if it is i|
00018860  64 65 6e 74 69 63 61 6c  20 74 6f 20 6f 75 72 20  |dentical to our |
00018870  6f 77 6e 20 74 68 65 6e  0d 68 06 3e 20 20 20 4c  |own then.h.>   L|
00018880  44 52 45 51 20 20 20 20  52 30 2c 5b 52 31 32 2c  |DREQ    R0,[R12,|
00018890  23 74 61 73 6b 25 5d 20  20 20 20 20 20 20 20 20  |#task%]         |
000188a0  20 20 20 3b 77 65 20 6d  75 73 74 20 74 65 72 6d  |   ;we must term|
000188b0  69 6e 61 74 65 2e 0d 68  10 22 20 20 20 4c 44 52  |inate..h."   LDR|
000188c0  45 51 20 20 20 20 52 31  2c 5b 52 31 32 2c 23 62  |EQ    R1,[R12,#b|
000188d0  6c 6f 63 6b 25 2b 34 5d  0d 68 1a 15 20 20 20 43  |lock%+4].h..   C|
000188e0  4d 50 45 51 20 20 20 20  52 30 2c 52 31 0d 68 24  |MPEQ    R0,R1.h$|
000188f0  13 20 20 20 20 ec 51 20  20 20 20 52 30 2c 23 30  |.    .Q    R0,#0|
00018900  0d 68 2e 20 20 20 20 20  53 54 52 45 51 20 20 20  |.h.     STREQ   |
00018910  20 52 30 2c 5b 52 31 32  2c 23 71 75 69 74 25 5d  | R0,[R12,#quit%]|
00018920  0d 68 38 04 0d 68 42 1e  4c 44 4d 46 44 20 20 20  |.h8..hB.LDMFD   |
00018930  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
00018940  7d 5e 0d 68 4c 04 0d 68  56 52 3b 2d 2d 2d 2d 2d  |}^.hL..hVR;-----|
00018950  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00018990  2d 2d 2d 2d 2d 2d 2d 2d  0d 68 60 32 3b 20 20 20  |--------.h`2;   |
000189a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000189b0  20 20 20 20 20 20 20 20  20 20 2a 2a 2a 20 53 65  |          *** Se|
000189c0  6e 64 48 65 6c 70 20 2a  2a 2a 0d 68 6a 51 3b 20  |ndHelp ***.hjQ; |
000189d0  54 68 69 73 20 73 75 62  72 6f 75 74 69 6e 65 20  |This subroutine |
000189e0  69 73 20 63 61 6c 6c 65  64 20 77 68 65 6e 20 61  |is called when a|
000189f0  6e 20 49 6e 74 65 72 61  63 74 69 76 65 20 48 65  |n Interactive He|
00018a00  6c 70 20 61 70 70 6c 69  63 61 74 69 6f 6e 20 72  |lp application r|
00018a10  65 71 75 65 73 74 20 68  65 6c 70 0d 68 74 28 3b  |equest help.ht(;|
00018a20  20 69 6e 66 6f 72 6d 61  74 69 6f 6e 20 61 62 6f  | information abo|
00018a30  75 74 20 6f 75 72 20 61  70 70 6c 69 63 61 74 69  |ut our applicati|
00018a40  6f 6e 2e 0d 68 7e 04 0d  68 88 0d 2e 73 65 6e 64  |on..h~..h...send|
00018a50  68 65 6c 70 0d 68 92 04  0d 68 9c 1e 53 54 4d 46  |help.h...h..STMF|
00018a60  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
00018a70  32 2c 52 31 34 7d 0d 68  a6 04 0d 68 b0 50 20 4c  |2,R14}.h...h.P L|
00018a80  44 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |DR      R0,[R12,|
00018a90  23 62 6c 6f 63 6b 25 2b  33 32 5d 20 20 20 20 20  |#block%+32]     |
00018aa0  20 20 20 20 20 3b 54 68  69 73 20 69 73 20 68 61  |     ;This is ha|
00018ab0  6e 64 6c 65 20 6f 66 20  74 68 65 20 77 69 6e 64  |ndle of the wind|
00018ac0  6f 77 20 6e 65 65 64 69  6e 67 0d 68 ba 30 20 20  |ow needing.h.0  |
00018ad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00018af0  20 20 20 20 20 3b 68 65  6c 70 0d 68 c4 04 0d 68  |     ;help.h...h|
00018b00  ce 4e 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |.N LDR      R1,[|
00018b10  52 31 32 2c 23 64 69 73  70 6c 61 79 25 5d 20 20  |R12,#display%]  |
00018b20  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00018b30  65 63 74 69 6f 6e 20 64  65 61 6c 73 20 77 69 74  |ection deals wit|
00018b40  68 20 68 65 6c 70 20 61  62 6f 75 74 0d 68 d8 3f  |h help about.h.?|
00018b50  20 43 4d 50 20 20 20 20  20 20 52 30 2c 52 31 20  | CMP      R0,R1 |
00018b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018b70  20 20 20 20 20 20 20 3b  74 68 65 20 44 69 73 70  |       ;the Disp|
00018b80  6c 61 79 20 77 69 6e 64  6f 77 2e 0d 68 e2 1a 20  |lay window..h.. |
00018b90  20 42 4c 45 51 20 20 20  20 20 64 69 73 70 6c 61  | BLEQ     displa|
00018ba0  79 68 65 6c 70 0d 68 ec  20 20 20 4c 44 4d 45 51  |yhelp.h.   LDMEQ|
00018bb0  46 44 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |FD  R13!,{R0-R12|
00018bc0  2c 50 43 7d 5e 0d 68 f6  04 0d 69 00 4e 20 4c 44  |,PC}^.h...i.N LD|
00018bd0  52 20 20 20 20 20 20 52  31 2c 5b 52 31 32 2c 23  |R      R1,[R12,#|
00018be0  65 64 69 74 25 5d 20 20  20 20 20 20 20 20 20 20  |edit%]          |
00018bf0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00018c00  6e 20 64 65 61 6c 73 20  77 69 74 68 20 68 65 6c  |n deals with hel|
00018c10  70 20 61 62 6f 75 74 0d  69 0a 3c 20 43 4d 50 20  |p about.i.< CMP |
00018c20  20 20 20 20 20 52 30 2c  52 31 20 20 20 20 20 20  |     R0,R1      |
00018c30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018c40  20 20 3b 74 68 65 20 45  64 69 74 20 77 69 6e 64  |  ;the Edit wind|
00018c50  6f 77 2e 0d 69 14 17 20  20 42 4c 45 51 20 20 20  |ow..i..  BLEQ   |
00018c60  20 20 65 64 69 74 68 65  6c 70 0d 69 1e 20 20 20  |  edithelp.i.   |
00018c70  4c 44 4d 45 51 46 44 20  20 52 31 33 21 2c 7b 52  |LDMEQFD  R13!,{R|
00018c80  30 2d 52 31 32 2c 50 43  7d 5e 0d 69 28 04 0d 69  |0-R12,PC}^.i(..i|
00018c90  32 4e 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |2N LDR      R1,[|
00018ca0  52 31 32 2c 23 73 65 61  72 63 68 25 5d 20 20 20  |R12,#search%]   |
00018cb0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00018cc0  65 63 74 69 6f 6e 20 64  65 61 6c 73 20 77 69 74  |ection deals wit|
00018cd0  68 20 68 65 6c 70 20 61  62 6f 75 74 0d 69 3c 3e  |h help about.i<>|
00018ce0  20 43 4d 50 20 20 20 20  20 20 52 30 2c 52 31 20  | CMP      R0,R1 |
00018cf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018d00  20 20 20 20 20 20 20 3b  74 68 65 20 53 65 61 72  |       ;the Sear|
00018d10  63 68 20 77 69 6e 64 6f  77 2e 0d 69 46 19 20 20  |ch window..iF.  |
00018d20  42 4c 45 51 20 20 20 20  20 73 65 61 72 63 68 68  |BLEQ     searchh|
00018d30  65 6c 70 0d 69 50 04 0d  69 5a 1e 4c 44 4d 46 44  |elp.iP..iZ.LDMFD|
00018d40  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
00018d50  2c 50 43 7d 5e 0d 69 64  04 0d 69 6e 52 3b 2d 2d  |,PC}^.id..inR;--|
00018d60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00018da0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 69 78 34 3b  |-----------.ix4;|
00018db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018dc0  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
00018dd0  44 69 73 70 6c 61 79 48  65 6c 70 20 2a 2a 2a 0d  |DisplayHelp ***.|
00018de0  69 82 4f 3b 54 68 69 73  20 73 75 62 72 6f 75 74  |i.O;This subrout|
00018df0  69 6e 65 20 73 65 6e 64  73 20 68 65 6c 70 20 6d  |ine sends help m|
00018e00  65 73 73 61 67 65 73 20  61 62 6f 75 74 20 69 63  |essages about ic|
00018e10  6f 6e 73 20 77 69 74 68  69 6e 20 74 68 65 20 44  |ons within the D|
00018e20  69 73 70 6c 61 79 20 77  69 6e 64 6f 77 2e 0d 69  |isplay window..i|
00018e30  8c 04 0d 69 96 10 2e 64  69 73 70 6c 61 79 68 65  |...i...displayhe|
00018e40  6c 70 0d 69 a0 04 0d 69  aa 1e 53 54 4d 46 44 20  |lp.i...i..STMFD |
00018e50  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
00018e60  52 31 34 7d 0d 69 b4 04  0d 69 be 21 20 4c 44 52  |R14}.i...i.! LDR|
00018e70  20 20 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 62  |      R0,[R12,#b|
00018e80  6c 6f 63 6b 25 2b 33 36  5d 0d 69 c8 1b 20 41 44  |lock%+36].i.. AD|
00018e90  52 20 20 20 20 20 20 52  31 2c 64 69 73 70 6e 6f  |R      R1,dispno|
00018ea0  69 63 6f 6e 0d 69 d2 04  0d 69 dc 4f 20 43 4d 50  |icon.i...i.O CMP|
00018eb0  20 20 20 20 20 20 52 30  2c 23 32 30 20 20 20 20  |      R0,#20    |
00018ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018ed0  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00018ee0  20 63 68 65 63 6b 73 20  74 68 65 20 69 63 6f 6e  | checks the icon|
00018ef0  20 6e 75 6d 62 65 72 0d  69 e6 50 20 20 41 44 52  | number.i.P  ADR|
00018f00  45 51 20 20 20 52 31 2c  64 69 73 70 32 30 68 65  |EQ   R1,disp20he|
00018f10  6c 70 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |lp              |
00018f20  20 20 3b 6f 66 20 74 68  65 20 69 63 6f 6e 20 74  |  ;of the icon t|
00018f30  68 61 74 20 74 68 65 20  70 6f 69 6e 74 65 72 20  |hat the pointer |
00018f40  69 73 20 6f 76 65 72 0d  69 f0 4d 20 43 4d 50 20  |is over.i.M CMP |
00018f50  20 20 20 20 20 52 30 2c  23 32 31 20 20 20 20 20  |     R0,#21     |
00018f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00018f70  20 20 3b 61 6e 64 20 73  65 74 73 20 52 31 20 74  |  ;and sets R1 t|
00018f80  6f 20 70 6f 69 6e 74 20  74 6f 20 61 20 6d 65 73  |o point to a mes|
00018f90  73 61 67 65 0d 69 fa 32  20 20 41 44 52 45 51 20  |sage.i.2  ADREQ |
00018fa0  20 20 52 31 2c 64 69 73  70 32 31 68 65 6c 70 20  |  R1,disp21help |
00018fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00018fc0  74 6f 6b 65 6e 2e 0d 6a  04 14 20 43 4d 50 20 20  |token..j.. CMP  |
00018fd0  20 20 20 20 52 30 2c 23  32 32 0d 6a 0e 1b 20 20  |    R0,#22.j..  |
00018fe0  41 44 52 45 51 20 20 20  52 31 2c 64 69 73 70 32  |ADREQ   R1,disp2|
00018ff0  32 68 65 6c 70 0d 6a 18  14 20 43 4d 50 20 20 20  |2help.j.. CMP   |
00019000  20 20 20 52 30 2c 23 32  33 0d 6a 22 1b 20 20 41  |   R0,#23.j".  A|
00019010  44 52 45 51 20 20 20 52  31 2c 64 69 73 70 32 33  |DREQ   R1,disp23|
00019020  68 65 6c 70 0d 6a 2c 14  20 43 4d 50 20 20 20 20  |help.j,. CMP    |
00019030  20 20 52 30 2c 23 32 34  0d 6a 36 1b 20 20 41 44  |  R0,#24.j6.  AD|
00019040  52 45 51 20 20 20 52 31  2c 64 69 73 70 32 34 68  |REQ   R1,disp24h|
00019050  65 6c 70 0d 6a 40 14 20  43 4d 50 20 20 20 20 20  |elp.j@. CMP     |
00019060  20 52 30 2c 23 32 35 0d  6a 4a 1b 20 20 41 44 52  | R0,#25.jJ.  ADR|
00019070  45 51 20 20 20 52 31 2c  64 69 73 70 32 35 68 65  |EQ   R1,disp25he|
00019080  6c 70 0d 6a 54 14 20 43  4d 50 20 20 20 20 20 20  |lp.jT. CMP      |
00019090  52 30 2c 23 32 36 0d 6a  5e 1b 20 20 41 44 52 45  |R0,#26.j^.  ADRE|
000190a0  51 20 20 20 52 31 2c 64  69 73 70 32 36 68 65 6c  |Q   R1,disp26hel|
000190b0  70 0d 6a 68 14 20 43 4d  50 20 20 20 20 20 20 52  |p.jh. CMP      R|
000190c0  30 2c 23 32 37 0d 6a 72  1b 20 20 41 44 52 45 51  |0,#27.jr.  ADREQ|
000190d0  20 20 20 52 31 2c 64 69  73 70 32 37 68 65 6c 70  |   R1,disp27help|
000190e0  0d 6a 7c 14 20 43 4d 50  20 20 20 20 20 20 52 30  |.j|. CMP      R0|
000190f0  2c 23 32 38 0d 6a 86 1b  20 20 41 44 52 45 51 20  |,#28.j..  ADREQ |
00019100  20 20 52 31 2c 64 69 73  70 32 38 68 65 6c 70 0d  |  R1,disp28help.|
00019110  6a 90 14 20 43 4d 50 20  20 20 20 20 20 52 30 2c  |j.. CMP      R0,|
00019120  23 32 39 0d 6a 9a 1b 20  20 41 44 52 45 51 20 20  |#29.j..  ADREQ  |
00019130  20 52 31 2c 64 69 73 70  32 39 68 65 6c 70 0d 6a  | R1,disp29help.j|
00019140  a4 14 20 43 4d 50 20 20  20 20 20 20 52 30 2c 23  |.. CMP      R0,#|
00019150  33 30 0d 6a ae 1b 20 20  41 44 52 45 51 20 20 20  |30.j..  ADREQ   |
00019160  52 31 2c 64 69 73 70 33  30 68 65 6c 70 0d 6a b8  |R1,disp30help.j.|
00019170  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 33  |. CMP      R0,#3|
00019180  31 0d 6a c2 1b 20 20 41  44 52 45 51 20 20 20 52  |1.j..  ADREQ   R|
00019190  31 2c 64 69 73 70 33 31  68 65 6c 70 0d 6a cc 14  |1,disp31help.j..|
000191a0  20 43 4d 50 20 20 20 20  20 20 52 30 2c 23 33 32  | CMP      R0,#32|
000191b0  0d 6a d6 1b 20 20 41 44  52 45 51 20 20 20 52 31  |.j..  ADREQ   R1|
000191c0  2c 64 69 73 70 33 32 68  65 6c 70 0d 6a e0 14 20  |,disp32help.j.. |
000191d0  43 4d 50 20 20 20 20 20  20 52 30 2c 23 33 33 0d  |CMP      R0,#33.|
000191e0  6a ea 1b 20 20 41 44 52  45 51 20 20 20 52 31 2c  |j..  ADREQ   R1,|
000191f0  64 69 73 70 33 33 68 65  6c 70 0d 6a f4 14 20 43  |disp33help.j.. C|
00019200  4d 50 20 20 20 20 20 20  52 30 2c 23 33 34 0d 6a  |MP      R0,#34.j|
00019210  fe 1b 20 20 41 44 52 45  51 20 20 20 52 31 2c 64  |..  ADREQ   R1,d|
00019220  69 73 70 33 34 68 65 6c  70 0d 6b 08 14 20 43 4d  |isp34help.k.. CM|
00019230  50 20 20 20 20 20 20 52  30 2c 23 33 35 0d 6b 12  |P      R0,#35.k.|
00019240  1b 20 20 41 44 52 45 51  20 20 20 52 31 2c 64 69  |.  ADREQ   R1,di|
00019250  73 70 33 35 68 65 6c 70  0d 6b 1c 14 20 43 4d 50  |sp35help.k.. CMP|
00019260  20 20 20 20 20 20 52 30  2c 23 33 37 0d 6b 26 1b  |      R0,#37.k&.|
00019270  20 20 41 44 52 45 51 20  20 20 52 31 2c 64 69 73  |  ADREQ   R1,dis|
00019280  70 33 37 68 65 6c 70 0d  6b 30 14 20 43 4d 50 20  |p37help.k0. CMP |
00019290  20 20 20 20 20 52 30 2c  23 33 38 0d 6b 3a 1b 20  |     R0,#38.k:. |
000192a0  20 41 44 52 45 51 20 20  20 52 31 2c 64 69 73 70  | ADREQ   R1,disp|
000192b0  33 38 68 65 6c 70 0d 6b  44 14 20 43 4d 50 20 20  |38help.kD. CMP  |
000192c0  20 20 20 20 52 30 2c 23  33 39 0d 6b 4e 1b 20 20  |    R0,#39.kN.  |
000192d0  41 44 52 45 51 20 20 20  52 31 2c 64 69 73 70 33  |ADREQ   R1,disp3|
000192e0  39 68 65 6c 70 0d 6b 58  14 20 43 4d 50 20 20 20  |9help.kX. CMP   |
000192f0  20 20 20 52 30 2c 23 34  30 0d 6b 62 1b 20 20 41  |   R0,#40.kb.  A|
00019300  44 52 45 51 20 20 20 52  31 2c 64 69 73 70 34 30  |DREQ   R1,disp40|
00019310  68 65 6c 70 0d 6b 6c 14  20 43 4d 50 20 20 20 20  |help.kl. CMP    |
00019320  20 20 52 30 2c 23 34 31  0d 6b 76 1b 20 20 41 44  |  R0,#41.kv.  AD|
00019330  52 45 51 20 20 20 52 31  2c 64 69 73 70 34 31 68  |REQ   R1,disp41h|
00019340  65 6c 70 0d 6b 80 14 20  43 4d 50 20 20 20 20 20  |elp.k.. CMP     |
00019350  20 52 30 2c 23 34 32 0d  6b 8a 1b 20 20 41 44 52  | R0,#42.k..  ADR|
00019360  45 51 20 20 20 52 31 2c  64 69 73 70 34 32 68 65  |EQ   R1,disp42he|
00019370  6c 70 0d 6b 94 14 20 43  4d 50 20 20 20 20 20 20  |lp.k.. CMP      |
00019380  52 30 2c 23 34 33 0d 6b  9e 1b 20 20 41 44 52 45  |R0,#43.k..  ADRE|
00019390  51 20 20 20 52 31 2c 64  69 73 70 34 33 68 65 6c  |Q   R1,disp43hel|
000193a0  70 0d 6b a8 04 0d 6b b2  1d 20 42 4c 20 20 20 20  |p.k...k.. BL    |
000193b0  20 20 20 73 65 6e 64 68  65 6c 70 6d 65 73 73 61  |   sendhelpmessa|
000193c0  67 65 0d 6b bc 04 0d 6b  c6 1e 4c 44 4d 46 44 20  |ge.k...k..LDMFD |
000193d0  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
000193e0  50 43 7d 5e 0d 6b d0 04  0d 6b da 52 3b 2d 2d 2d  |PC}^.k...k.R;---|
000193f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00019430  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 6b e4 51 3b 20  |----------.k.Q; |
00019440  54 68 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 73 65  |The following se|
00019450  63 74 69 6f 6e 20 63 6f  6e 74 61 69 6e 73 20 6d  |ction contains m|
00019460  65 73 73 61 67 65 20 74  6f 6b 65 6e 73 20 77 68  |essage tokens wh|
00019470  69 63 68 20 61 72 65 20  74 6f 20 62 65 20 6c 6f  |ich are to be lo|
00019480  6f 6b 65 64 20 75 70 20  61 6e 64 0d 6b ee 22 3b  |oked up and.k.";|
00019490  20 73 65 6e 74 20 74 6f  20 74 68 65 20 72 65 71  | sent to the req|
000194a0  75 65 73 74 69 6e 67 20  74 61 73 6b 2e 0d 6b f8  |uesting task..k.|
000194b0  04 0d 6c 02 04 0d 6c 0c  23 2e 64 69 73 70 6e 6f  |..l...l.#.dispno|
000194c0  69 63 6f 6e 20 3a 45 51  55 53 20 22 48 44 4e 6f  |icon :EQUS "HDNo|
000194d0  49 63 6f 6e 22 2b bd 30  0d 6c 16 22 2e 64 69 73  |Icon"+.0.l.".dis|
000194e0  70 32 30 68 65 6c 70 20  3a 45 51 55 53 20 22 48  |p20help :EQUS "H|
000194f0  44 42 61 63 6b 31 22 2b  bd 30 0d 6c 20 23 2e 64  |DBack1"+.0.l #.d|
00019500  69 73 70 32 31 68 65 6c  70 20 3a 45 51 55 53 20  |isp21help :EQUS |
00019510  22 48 44 42 61 63 6b 31  30 22 2b bd 30 0d 6c 2a  |"HDBack10"+.0.l*|
00019520  24 2e 64 69 73 70 32 32  68 65 6c 70 20 3a 45 51  |$.disp22help :EQ|
00019530  55 53 20 22 48 44 42 61  63 6b 31 30 30 22 2b bd  |US "HDBack100"+.|
00019540  30 0d 6c 34 25 2e 64 69  73 70 32 33 68 65 6c 70  |0.l4%.disp23help|
00019550  20 3a 45 51 55 53 20 22  48 44 46 6f 72 77 61 72  | :EQUS "HDForwar|
00019560  64 31 22 2b bd 30 0d 6c  3e 26 2e 64 69 73 70 32  |d1"+.0.l>&.disp2|
00019570  34 68 65 6c 70 20 3a 45  51 55 53 20 22 48 44 46  |4help :EQUS "HDF|
00019580  6f 72 77 61 72 64 31 30  22 2b bd 30 0d 6c 48 27  |orward10"+.0.lH'|
00019590  2e 64 69 73 70 32 35 68  65 6c 70 20 3a 45 51 55  |.disp25help :EQU|
000195a0  53 20 22 48 44 46 6f 72  77 61 72 64 31 30 30 22  |S "HDForward100"|
000195b0  2b bd 30 0d 6c 52 22 2e  64 69 73 70 32 36 68 65  |+.0.lR".disp26he|
000195c0  6c 70 20 3a 45 51 55 53  20 22 48 44 49 6e 64 65  |lp :EQUS "HDInde|
000195d0  78 22 2b bd 30 0d 6c 5c  23 2e 64 69 73 70 32 37  |x"+.0.l\#.disp27|
000195e0  68 65 6c 70 20 3a 45 51  55 53 20 22 48 44 53 65  |help :EQUS "HDSe|
000195f0  61 72 63 68 22 2b bd 30  0d 6c 66 23 2e 64 69 73  |arch"+.0.lf#.dis|
00019600  70 32 38 68 65 6c 70 20  3a 45 51 55 53 20 22 48  |p28help :EQUS "H|
00019610  44 52 65 63 6f 72 64 22  2b bd 30 0d 6c 70 20 2e  |DRecord"+.0.lp .|
00019620  64 69 73 70 32 39 68 65  6c 70 20 3a 45 51 55 53  |disp29help :EQUS|
00019630  20 22 48 44 4d 61 78 22  2b bd 30 0d 6c 7a 22 2e  | "HDMax"+.0.lz".|
00019640  64 69 73 70 33 30 68 65  6c 70 20 3a 45 51 55 53  |disp30help :EQUS|
00019650  20 22 48 44 54 6f 70 69  63 22 2b bd 30 0d 6c 84  | "HDTopic"+.0.l.|
00019660  24 2e 64 69 73 70 33 31  68 65 6c 70 20 3a 45 51  |$.disp31help :EQ|
00019670  55 53 20 22 48 44 44 65  74 61 69 6c 73 22 2b bd  |US "HDDetails"+.|
00019680  30 0d 6c 8e 22 2e 64 69  73 70 33 32 68 65 6c 70  |0.l.".disp32help|
00019690  20 3a 45 51 55 53 20 22  48 44 4d 6f 6e 74 68 22  | :EQUS "HDMonth"|
000196a0  2b bd 30 0d 6c 98 21 2e  64 69 73 70 33 33 68 65  |+.0.l.!.disp33he|
000196b0  6c 70 20 3a 45 51 55 53  20 22 48 44 59 65 61 72  |lp :EQUS "HDYear|
000196c0  22 2b bd 30 0d 6c a2 22  2e 64 69 73 70 33 34 68  |"+.0.l.".disp34h|
000196d0  65 6c 70 20 3a 45 51 55  53 20 22 48 44 49 73 73  |elp :EQUS "HDIss|
000196e0  75 65 22 2b bd 30 0d 6c  ac 21 2e 64 69 73 70 33  |ue"+.0.l.!.disp3|
000196f0  35 68 65 6c 70 20 3a 45  51 55 53 20 22 48 44 50  |5help :EQUS "HDP|
00019700  61 67 65 22 2b bd 30 0d  6c b6 21 2e 64 69 73 70  |age"+.0.l.!.disp|
00019710  33 37 68 65 6c 70 20 3a  45 51 55 53 20 22 48 44  |37help :EQUS "HD|
00019720  45 64 69 74 22 2b bd 30  0d 6c c0 25 2e 64 69 73  |Edit"+.0.l.%.dis|
00019730  70 33 38 68 65 6c 70 20  3a 45 51 55 53 20 22 48  |p38help :EQUS "H|
00019740  44 4e 6f 74 46 6f 75 6e  64 22 2b bd 30 0d 6c ca  |DNotFound"+.0.l.|
00019750  22 2e 64 69 73 70 33 39  68 65 6c 70 20 3a 45 51  |".disp39help :EQ|
00019760  55 53 20 22 48 44 42 61  63 6b 4d 22 2b bd 30 0d  |US "HDBackM"+.0.|
00019770  6c d4 25 2e 64 69 73 70  34 30 68 65 6c 70 20 3a  |l.%.disp40help :|
00019780  45 51 55 53 20 22 48 44  46 6f 72 77 61 72 64 4d  |EQUS "HDForwardM|
00019790  22 2b bd 30 0d 6c de 22  2e 64 69 73 70 34 31 68  |"+.0.l.".disp41h|
000197a0  65 6c 70 20 3a 45 51 55  53 20 22 48 44 42 61 63  |elp :EQUS "HDBac|
000197b0  6b 59 22 2b bd 30 0d 6c  e8 25 2e 64 69 73 70 34  |kY"+.0.l.%.disp4|
000197c0  32 68 65 6c 70 20 3a 45  51 55 53 20 22 48 44 46  |2help :EQUS "HDF|
000197d0  6f 72 77 61 72 64 59 22  2b bd 30 0d 6c f2 26 2e  |orwardY"+.0.l.&.|
000197e0  64 69 73 70 34 33 68 65  6c 70 20 3a 45 51 55 53  |disp43help :EQUS|
000197f0  20 22 48 44 54 6f 70 69  63 4d 65 6e 75 22 2b bd  | "HDTopicMenu"+.|
00019800  30 0d 6c fc 04 0d 6d 06  09 41 4c 49 47 4e 0d 6d  |0.l...m..ALIGN.m|
00019810  10 04 0d 6d 1a 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...m.R;---------|
00019820  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00019860  2d 2d 2d 2d 0d 6d 24 32  3b 20 20 20 20 20 20 20  |----.m$2;       |
00019870  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00019880  20 20 20 20 20 20 2a 2a  2a 20 45 64 69 74 48 65  |      *** EditHe|
00019890  6c 70 20 2a 2a 2a 0d 6d  2e 4c 3b 54 68 69 73 20  |lp ***.m.L;This |
000198a0  73 75 62 72 6f 75 74 69  6e 65 20 73 65 6e 64 73  |subroutine sends|
000198b0  20 68 65 6c 70 20 6d 65  73 73 61 67 65 73 20 61  | help messages a|
000198c0  62 6f 75 74 20 69 63 6f  6e 73 20 77 69 74 68 69  |bout icons withi|
000198d0  6e 20 74 68 65 20 45 64  69 74 20 77 69 6e 64 6f  |n the Edit windo|
000198e0  77 2e 0d 6d 38 04 0d 6d  42 0d 2e 65 64 69 74 68  |w..m8..mB..edith|
000198f0  65 6c 70 0d 6d 4c 04 0d  6d 56 1f 53 54 4d 46 44  |elp.mL..mV.STMFD|
00019900  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
00019910  2c 52 31 34 7d 5e 0d 6d  60 04 0d 6d 6a 21 20 4c  |,R14}^.m`..mj! L|
00019920  44 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |DR      R0,[R12,|
00019930  23 62 6c 6f 63 6b 25 2b  33 36 5d 0d 6d 74 04 0d  |#block%+36].mt..|
00019940  6d 7e 52 20 41 44 52 20  20 20 20 20 20 52 31 2c  |m~R ADR      R1,|
00019950  65 64 69 74 6e 6f 69 63  6f 6e 20 20 20 20 20 20  |editnoicon      |
00019960  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00019970  73 63 65 74 69 6f 6e 20  63 68 65 63 6b 73 20 74  |scetion checks t|
00019980  68 65 20 69 63 6f 6e 20  6e 75 6d 62 65 72 20 6f  |he icon number o|
00019990  66 0d 6d 88 51 20 43 4d  50 20 20 20 20 20 20 52  |f.m.Q CMP      R|
000199a0  30 2c 23 39 20 20 20 20  20 20 20 20 20 20 20 20  |0,#9            |
000199b0  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 68 65  |            ;the|
000199c0  20 69 63 6f 6e 20 74 68  65 20 70 6f 69 6e 74 65  | icon the pointe|
000199d0  72 20 69 73 20 6f 76 65  72 20 61 6e 64 20 73 65  |r is over and se|
000199e0  74 73 0d 6d 92 4b 20 20  41 44 52 45 51 20 20 20  |ts.m.K  ADREQ   |
000199f0  20 52 31 2c 65 64 69 74  39 68 65 6c 70 20 20 20  | R1,edit9help   |
00019a00  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 52 31  |             ;R1|
00019a10  20 74 6f 20 70 6f 69 6e  74 20 74 6f 20 61 20 6d  | to point to a m|
00019a20  65 73 73 61 67 65 20 74  6f 6b 65 6e 2e 0d 6d 9c  |essage token..m.|
00019a30  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019a40  30 0d 6d a6 1c 20 20 41  44 52 45 51 20 20 20 20  |0.m..  ADREQ    |
00019a50  52 31 2c 65 64 69 74 31  30 68 65 6c 70 0d 6d b0  |R1,edit10help.m.|
00019a60  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019a70  31 0d 6d ba 1c 20 20 41  44 52 45 51 20 20 20 20  |1.m..  ADREQ    |
00019a80  52 31 2c 65 64 69 74 31  31 68 65 6c 70 0d 6d c4  |R1,edit11help.m.|
00019a90  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019aa0  32 0d 6d ce 1c 20 20 41  44 52 45 51 20 20 20 20  |2.m..  ADREQ    |
00019ab0  52 31 2c 65 64 69 74 31  32 68 65 6c 70 0d 6d d8  |R1,edit12help.m.|
00019ac0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019ad0  33 0d 6d e2 1c 20 20 41  44 52 45 51 20 20 20 20  |3.m..  ADREQ    |
00019ae0  52 31 2c 65 64 69 74 31  33 68 65 6c 70 0d 6d ec  |R1,edit13help.m.|
00019af0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019b00  34 0d 6d f6 1c 20 20 41  44 52 45 51 20 20 20 20  |4.m..  ADREQ    |
00019b10  52 31 2c 65 64 69 74 31  34 68 65 6c 70 0d 6e 00  |R1,edit14help.n.|
00019b20  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019b30  35 0d 6e 0a 1c 20 20 41  44 52 45 51 20 20 20 20  |5.n..  ADREQ    |
00019b40  52 31 2c 65 64 69 74 31  35 68 65 6c 70 0d 6e 14  |R1,edit15help.n.|
00019b50  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019b60  36 0d 6e 1e 1c 20 20 41  44 52 45 51 20 20 20 20  |6.n..  ADREQ    |
00019b70  52 31 2c 65 64 69 74 31  36 68 65 6c 70 0d 6e 28  |R1,edit16help.n(|
00019b80  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019b90  37 0d 6e 32 1c 20 20 41  44 52 45 51 20 20 20 20  |7.n2.  ADREQ    |
00019ba0  52 31 2c 65 64 69 74 31  37 68 65 6c 70 0d 6e 3c  |R1,edit17help.n<|
00019bb0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019bc0  38 0d 6e 46 1c 20 20 41  44 52 45 51 20 20 20 20  |8.nF.  ADREQ    |
00019bd0  52 31 2c 65 64 69 74 31  38 68 65 6c 70 0d 6e 50  |R1,edit18help.nP|
00019be0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 31  |. CMP      R0,#1|
00019bf0  39 0d 6e 5a 1c 20 20 41  44 52 45 51 20 20 20 20  |9.nZ.  ADREQ    |
00019c00  52 31 2c 65 64 69 74 31  39 68 65 6c 70 0d 6e 64  |R1,edit19help.nd|
00019c10  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019c20  30 0d 6e 6e 1c 20 20 41  44 52 45 51 20 20 20 20  |0.nn.  ADREQ    |
00019c30  52 31 2c 65 64 69 74 32  30 68 65 6c 70 0d 6e 78  |R1,edit20help.nx|
00019c40  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019c50  31 0d 6e 82 1c 20 20 41  44 52 45 51 20 20 20 20  |1.n..  ADREQ    |
00019c60  52 31 2c 65 64 69 74 32  31 68 65 6c 70 0d 6e 8c  |R1,edit21help.n.|
00019c70  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019c80  32 0d 6e 96 1c 20 20 41  44 52 45 51 20 20 20 20  |2.n..  ADREQ    |
00019c90  52 31 2c 65 64 69 74 32  32 68 65 6c 70 0d 6e a0  |R1,edit22help.n.|
00019ca0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019cb0  33 0d 6e aa 1c 20 20 41  44 52 45 51 20 20 20 20  |3.n..  ADREQ    |
00019cc0  52 31 2c 65 64 69 74 32  33 68 65 6c 70 0d 6e b4  |R1,edit23help.n.|
00019cd0  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019ce0  34 0d 6e be 1c 20 20 41  44 52 45 51 20 20 20 20  |4.n..  ADREQ    |
00019cf0  52 31 2c 65 64 69 74 32  34 68 65 6c 70 0d 6e c8  |R1,edit24help.n.|
00019d00  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019d10  35 0d 6e d2 1c 20 20 41  44 52 45 51 20 20 20 20  |5.n..  ADREQ    |
00019d20  52 31 2c 65 64 69 74 32  35 68 65 6c 70 0d 6e dc  |R1,edit25help.n.|
00019d30  14 20 43 4d 50 20 20 20  20 20 20 52 30 2c 23 32  |. CMP      R0,#2|
00019d40  36 0d 6e e6 1c 20 20 41  44 52 45 51 20 20 20 20  |6.n..  ADREQ    |
00019d50  52 31 2c 65 64 69 74 32  36 68 65 6c 70 0d 6e f0  |R1,edit26help.n.|
00019d60  04 0d 6e fa 1d 20 42 4c  20 20 20 20 20 20 20 73  |..n.. BL       s|
00019d70  65 6e 64 68 65 6c 70 6d  65 73 73 61 67 65 0d 6f  |endhelpmessage.o|
00019d80  04 04 0d 6f 0e 1e 4c 44  4d 46 44 20 20 20 20 52  |...o..LDMFD    R|
00019d90  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
00019da0  0d 6f 18 04 0d 6f 22 53  3b 2d 2d 2d 2d 2d 2d 2d  |.o...o"S;-------|
00019db0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00019df0  2d 2d 2d 2d 2d 2d 2d 0d  6f 2c 4f 3b 20 54 68 69  |-------.o,O; Thi|
00019e00  73 20 73 65 63 74 69 6f  6e 20 63 6f 6e 74 69 6e  |s section contin|
00019e10  73 20 6d 65 73 73 61 67  65 20 74 6f 6b 65 6e 73  |s message tokens|
00019e20  20 77 68 69 63 68 20 61  72 65 20 74 6f 20 62 65  | which are to be|
00019e30  20 6c 6f 6f 6b 65 64 20  75 70 20 61 6e 64 20 73  | looked up and s|
00019e40  65 6e 74 20 74 6f 0d 6f  36 1a 3b 20 74 68 65 20  |ent to.o6.; the |
00019e50  72 65 71 75 65 73 74 69  6e 67 20 74 61 73 6b 2e  |requesting task.|
00019e60  0d 6f 40 04 0d 6f 4a 25  2e 65 64 69 74 6e 6f 69  |.o@..oJ%.editnoi|
00019e70  63 6f 6e 20 3a 45 51 55  53 20 22 48 45 4e 6f 49  |con :EQUS "HENoI|
00019e80  63 6f 6e 22 2b bd 28 30  29 0d 6f 54 24 2e 65 64  |con"+.(0).oT$.ed|
00019e90  69 74 39 68 65 6c 70 20  20 3a 45 51 55 53 20 22  |it9help  :EQUS "|
00019ea0  48 45 42 61 63 6b 4d 22  2b bd 28 30 29 0d 6f 5e  |HEBackM"+.(0).o^|
00019eb0  27 2e 65 64 69 74 31 30  68 65 6c 70 20 3a 45 51  |'.edit10help :EQ|
00019ec0  55 53 20 22 48 45 46 6f  72 77 61 72 64 4d 22 2b  |US "HEForwardM"+|
00019ed0  bd 28 30 29 0d 6f 68 24  2e 65 64 69 74 31 31 68  |.(0).oh$.edit11h|
00019ee0  65 6c 70 20 3a 45 51 55  53 20 22 48 45 42 61 63  |elp :EQUS "HEBac|
00019ef0  6b 59 22 2b bd 28 30 29  0d 6f 72 27 2e 65 64 69  |kY"+.(0).or'.edi|
00019f00  74 31 32 68 65 6c 70 20  3a 45 51 55 53 20 22 48  |t12help :EQUS "H|
00019f10  45 46 6f 72 77 61 72 64  59 22 2b bd 28 30 29 0d  |EForwardY"+.(0).|
00019f20  6f 7c 24 2e 65 64 69 74  31 33 68 65 6c 70 20 3a  |o|$.edit13help :|
00019f30  45 51 55 53 20 22 48 45  42 61 63 6b 49 22 2b bd  |EQUS "HEBackI"+.|
00019f40  28 30 29 0d 6f 86 27 2e  65 64 69 74 31 34 68 65  |(0).o.'.edit14he|
00019f50  6c 70 20 3a 45 51 55 53  20 22 48 45 46 6f 72 77  |lp :EQUS "HEForw|
00019f60  61 72 64 49 22 2b bd 28  30 29 0d 6f 90 24 2e 65  |ardI"+.(0).o.$.e|
00019f70  64 69 74 31 35 68 65 6c  70 20 3a 45 51 55 53 20  |dit15help :EQUS |
00019f80  22 48 45 42 61 63 6b 50  22 2b bd 28 30 29 0d 6f  |"HEBackP"+.(0).o|
00019f90  9a 27 2e 65 64 69 74 31  36 68 65 6c 70 20 3a 45  |.'.edit16help :E|
00019fa0  51 55 53 20 22 48 45 46  6f 72 77 61 72 64 50 22  |QUS "HEForwardP"|
00019fb0  2b bd 28 30 29 0d 6f a4  24 2e 65 64 69 74 31 37  |+.(0).o.$.edit17|
00019fc0  68 65 6c 70 20 3a 45 51  55 53 20 22 48 45 4d 6f  |help :EQUS "HEMo|
00019fd0  6e 74 68 22 2b bd 28 30  29 0d 6f ae 23 2e 65 64  |nth"+.(0).o.#.ed|
00019fe0  69 74 31 38 68 65 6c 70  20 3a 45 51 55 53 20 22  |it18help :EQUS "|
00019ff0  48 45 59 65 61 72 22 2b  bd 28 30 29 0d 6f b8 24  |HEYear"+.(0).o.$|
0001a000  2e 65 64 69 74 31 39 68  65 6c 70 20 3a 45 51 55  |.edit19help :EQU|
0001a010  53 20 22 48 45 49 73 73  75 65 22 2b bd 28 30 29  |S "HEIssue"+.(0)|
0001a020  0d 6f c2 23 2e 65 64 69  74 32 30 68 65 6c 70 20  |.o.#.edit20help |
0001a030  3a 45 51 55 53 20 22 48  45 50 61 67 65 22 2b bd  |:EQUS "HEPage"+.|
0001a040  28 30 29 0d 6f cc 24 2e  65 64 69 74 32 31 68 65  |(0).o.$.edit21he|
0001a050  6c 70 20 3a 45 51 55 53  20 22 48 45 54 6f 70 69  |lp :EQUS "HETopi|
0001a060  63 22 2b bd 28 30 29 0d  6f d6 26 2e 65 64 69 74  |c"+.(0).o.&.edit|
0001a070  32 32 68 65 6c 70 20 3a  45 51 55 53 20 22 48 45  |22help :EQUS "HE|
0001a080  44 65 74 61 69 6c 73 22  2b bd 28 30 29 0d 6f e0  |Details"+.(0).o.|
0001a090  21 2e 65 64 69 74 32 33  68 65 6c 70 20 3a 45 51  |!.edit23help :EQ|
0001a0a0  55 53 20 22 48 45 4f 4b  22 2b bd 28 30 29 0d 6f  |US "HEOK"+.(0).o|
0001a0b0  ea 25 2e 65 64 69 74 32  34 68 65 6c 70 20 3a 45  |.%.edit24help :E|
0001a0c0  51 55 53 20 22 48 45 43  61 6e 63 65 6c 22 2b bd  |QUS "HECancel"+.|
0001a0d0  28 30 29 0d 6f f4 28 2e  65 64 69 74 32 35 68 65  |(0).o.(.edit25he|
0001a0e0  6c 70 20 3a 45 51 55 53  20 22 48 45 54 6f 70 69  |lp :EQUS "HETopi|
0001a0f0  63 4d 65 6e 75 22 2b bd  28 30 29 0d 6f fe 25 2e  |cMenu"+.(0).o.%.|
0001a100  65 64 69 74 32 36 68 65  6c 70 20 3a 45 51 55 53  |edit26help :EQUS|
0001a110  20 22 48 45 44 65 6c 65  74 65 22 2b bd 28 30 29  | "HEDelete"+.(0)|
0001a120  0d 70 08 09 41 4c 49 47  4e 0d 70 12 04 0d 70 1c  |.p..ALIGN.p...p.|
0001a130  53 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |S;--------------|
0001a140  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001a180  0d 70 26 36 3b 20 20 20  20 20 20 20 20 20 20 20  |.p&6;           |
0001a190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001a1a0  20 20 20 20 2a 2a 2a 20  53 65 61 72 63 68 48 65  |    *** SearchHe|
0001a1b0  6c 70 20 2a 2a 2a 0d 70  30 51 3b 20 54 68 69 73  |lp ***.p0Q; This|
0001a1c0  20 73 75 62 72 6f 75 74  69 6e 65 20 73 65 6e 64  | subroutine send|
0001a1d0  73 20 68 65 6c 70 20 6d  65 73 73 61 67 65 73 20  |s help messages |
0001a1e0  61 62 6f 75 74 20 69 63  6f 6e 73 20 69 6e 20 74  |about icons in t|
0001a1f0  68 65 20 53 65 61 72 63  68 20 64 69 61 6c 6f 67  |he Search dialog|
0001a200  75 65 20 62 6f 78 2e 0d  70 3a 04 0d 70 44 0f 2e  |ue box..p:..pD..|
0001a210  73 65 61 72 63 68 68 65  6c 70 0d 70 4e 04 0d 70  |searchhelp.pN..p|
0001a220  58 1f 53 54 4d 46 44 20  20 20 20 52 31 33 21 2c  |X.STMFD    R13!,|
0001a230  7b 52 30 2d 52 31 32 2c  52 31 34 7d 5e 0d 70 62  |{R0-R12,R14}^.pb|
0001a240  04 0d 70 6c 21 20 4c 44  52 20 20 20 20 20 20 52  |..pl! LDR      R|
0001a250  30 2c 5b 52 31 32 2c 23  62 6c 6f 63 6b 25 2b 33  |0,[R12,#block%+3|
0001a260  36 5d 0d 70 76 1d 20 41  44 52 20 20 20 20 20 20  |6].pv. ADR      |
0001a270  52 31 2c 73 65 61 72 63  68 6e 6f 69 63 6f 6e 0d  |R1,searchnoicon.|
0001a280  70 80 13 20 43 4d 50 20  20 20 20 20 20 52 30 2c  |p.. CMP      R0,|
0001a290  23 31 0d 70 8a 1d 20 20  41 44 52 45 51 20 20 20  |#1.p..  ADREQ   |
0001a2a0  20 52 31 2c 73 65 61 72  63 68 31 68 65 6c 70 0d  | R1,search1help.|
0001a2b0  70 94 13 20 43 4d 50 20  20 20 20 20 20 52 30 2c  |p.. CMP      R0,|
0001a2c0  23 32 0d 70 9e 1d 20 20  41 44 52 45 51 20 20 20  |#2.p..  ADREQ   |
0001a2d0  20 52 31 2c 73 65 61 72  63 68 32 68 65 6c 70 0d  | R1,search2help.|
0001a2e0  70 a8 1d 20 42 4c 20 20  20 20 20 20 20 73 65 6e  |p.. BL       sen|
0001a2f0  64 68 65 6c 70 6d 65 73  73 61 67 65 0d 70 b2 04  |dhelpmessage.p..|
0001a300  0d 70 bc 1e 4c 44 4d 46  44 20 20 20 20 52 31 33  |.p..LDMFD    R13|
0001a310  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 70  |!,{R0-R12,PC}^.p|
0001a320  c6 04 0d 70 d0 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...p.R;---------|
0001a330  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001a370  2d 2d 2d 2d 0d 70 da 50  3b 20 54 68 69 73 20 73  |----.p.P; This s|
0001a380  65 63 74 69 6f 6e 20 63  6f 6e 74 61 69 6e 73 20  |ection contains |
0001a390  6d 65 73 73 61 67 65 20  74 6f 6b 65 6e 73 20 77  |message tokens w|
0001a3a0  68 69 63 68 20 61 72 65  20 74 6f 20 62 65 20 6c  |hich are to be l|
0001a3b0  6f 6f 6b 65 64 20 75 70  20 61 6e 64 20 73 65 6e  |ooked up and sen|
0001a3c0  74 20 74 6f 0d 70 e4 1a  3b 20 74 68 65 20 72 65  |t to.p..; the re|
0001a3d0  71 75 65 73 74 69 6e 67  20 74 61 73 6b 2e 0d 70  |questing task..p|
0001a3e0  ee 04 0d 70 f8 26 2e 73  65 61 72 63 68 6e 6f 69  |...p.&.searchnoi|
0001a3f0  63 6f 6e 3a 45 51 55 53  20 22 48 53 4e 6f 49 63  |con:EQUS "HSNoIc|
0001a400  6f 6e 22 2b bd 28 30 29  0d 71 02 29 2e 73 65 61  |on"+.(0).q.).sea|
0001a410  72 63 68 31 68 65 6c 70  20 3a 45 51 55 53 20 22  |rch1help :EQUS "|
0001a420  48 53 57 72 69 74 65 61  62 6c 65 22 2b bd 28 30  |HSWriteable"+.(0|
0001a430  29 0d 71 0c 22 2e 73 65  61 72 63 68 32 68 65 6c  |).q.".search2hel|
0001a440  70 20 3a 45 51 55 53 20  22 48 53 4f 4b 22 2b bd  |p :EQUS "HSOK"+.|
0001a450  28 30 29 0d 71 16 09 41  4c 49 47 4e 0d 71 20 04  |(0).q..ALIGN.q .|
0001a460  0d 71 2a 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.q*R;-----------|
0001a470  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001a4b0  2d 2d 0d 71 34 37 3b 20  20 20 20 20 20 20 20 20  |--.q47;         |
0001a4c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001a4d0  20 20 2a 2a 2a 20 53 65  6e 64 48 65 6c 70 4d 65  |  *** SendHelpMe|
0001a4e0  73 73 61 67 65 20 2a 2a  2a 0d 71 3e 51 3b 20 54  |ssage ***.q>Q; T|
0001a4f0  68 69 73 20 73 75 62 72  6f 75 74 69 6e 65 20 6c  |his subroutine l|
0001a500  6f 6f 6b 73 20 75 70 20  74 68 65 20 6d 65 73 73  |ooks up the mess|
0001a510  61 67 65 20 74 6f 6b 65  6e 20 70 6f 69 6e 74 65  |age token pointe|
0001a520  64 20 74 6f 20 62 79 20  52 31 20 69 6e 20 74 68  |d to by R1 in th|
0001a530  65 20 4d 65 73 73 61 67  65 73 0d 71 48 47 3b 20  |e Messages.qHG; |
0001a540  66 69 6c 65 20 61 6e 64  20 73 65 6e 64 73 20 74  |file and sends t|
0001a550  68 65 20 48 65 6c 70 20  54 65 78 74 20 62 61 63  |he Help Text bac|
0001a560  6b 20 74 6f 20 74 68 65  20 54 61 73 6b 20 77 68  |k to the Task wh|
0001a570  69 63 68 20 72 65 71 75  65 73 74 65 64 20 69 74  |ich requested it|
0001a580  2e 0d 71 52 04 0d 71 5c  14 2e 73 65 6e 64 68 65  |..qR..q\..sendhe|
0001a590  6c 70 6d 65 73 73 61 67  65 0d 71 66 04 0d 71 70  |lpmessage.qf..qp|
0001a5a0  1e 53 54 4d 46 44 20 20  20 20 52 31 33 21 2c 7b  |.STMFD    R13!,{|
0001a5b0  52 30 2d 52 31 32 2c 52  31 34 7d 0d 71 7a 04 0d  |R0-R12,R14}.qz..|
0001a5c0  71 84 4c 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |q.L LDR      R0,|
0001a5d0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 38 5d 20  |[R12,#block%+8] |
0001a5e0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001a5f0  63 6f 70 69 65 73 20 74  68 65 20 54 61 73 6b 20  |copies the Task |
0001a600  68 61 6e 64 6c 65 20 66  72 6f 6d 0d 71 8e 52 20  |handle from.q.R |
0001a610  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |STR      R0,[R12|
0001a620  2c 23 62 6c 6f 63 6b 25  2b 31 32 5d 20 20 20 20  |,#block%+12]    |
0001a630  20 20 20 20 20 20 3b 53  65 6e 64 65 72 20 66 69  |      ;Sender fi|
0001a640  65 6c 64 20 74 6f 20 74  68 65 20 44 65 73 74 69  |eld to the Desti|
0001a650  6e 61 74 69 6f 6e 20 66  69 65 6c 64 2e 0d 71 98  |nation field..q.|
0001a660  04 0d 71 a2 51 20 4d 4f  56 20 20 20 20 20 20 52  |..q.Q MOV      R|
0001a670  30 2c 20 20 20 23 26 35  30 30 20 20 20 20 20 20  |0,   #&500      |
0001a680  20 20 20 20 20 20 20 20  20 20 20 20 3b 26 35 30  |            ;&50|
0001a690  33 20 69 73 20 74 68 65  20 6d 65 73 73 61 67 65  |3 is the message|
0001a6a0  20 6e 75 6d 62 65 72 20  6f 66 20 61 20 72 65 70  | number of a rep|
0001a6b0  6c 79 0d 71 ac 3e 20 41  44 44 20 20 20 20 20 20  |ly.q.> ADD      |
0001a6c0  52 30 2c 52 30 2c 23 26  30 30 33 20 20 20 20 20  |R0,R0,#&003     |
0001a6d0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 74 6f  |             ;to|
0001a6e0  20 61 20 68 65 6c 70 20  72 65 71 75 65 73 74 2e  | a help request.|
0001a6f0  0d 71 b6 21 20 53 54 52  20 20 20 20 20 20 52 30  |.q.! STR      R0|
0001a700  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 31 36  |,[R12,#block%+16|
0001a710  5d 0d 71 c0 04 0d 71 ca  50 20 a4 4c 6f 6e 67 41  |].q...q.P .LongA|
0001a720  64 72 28 22 22 2c 30 2c  6d 65 73 73 61 67 65 73  |dr("",0,messages|
0001a730  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |)              ;|
0001a740  54 68 69 73 20 73 65 63  74 69 6f 6e 20 6c 6f 6f  |This section loo|
0001a750  6b 73 20 75 70 20 74 68  65 20 61 63 74 75 61 6c  |ks up the actual|
0001a760  20 74 65 78 74 0d 71 d4  41 20 41 44 44 20 20 20  | text.q.A ADD   |
0001a770  20 20 20 52 32 2c 52 31  32 2c 23 62 6c 6f 63 6b  |   R2,R12,#block|
0001a780  25 2b 32 30 20 20 20 20  20 20 20 20 20 20 20 20  |%+20            |
0001a790  3b 69 6e 20 6f 75 72 20  4d 65 73 73 61 67 65 73  |;in our Messages|
0001a7a0  20 66 69 6c 65 2e 0d 71  de 18 20 4d 4f 56 20 20  | file..q.. MOV  |
0001a7b0  20 20 20 20 52 33 2c 23  32 35 36 2d 32 30 0d 71  |    R3,#256-20.q|
0001a7c0  e8 23 20 53 57 49 20 20  20 20 20 20 22 4d 65 73  |.# SWI      "Mes|
0001a7d0  73 61 67 65 54 72 61 6e  73 5f 4c 6f 6f 6b 75 70  |sageTrans_Lookup|
0001a7e0  22 0d 71 f2 04 0d 71 fc  4c 20 41 44 44 20 20 20  |".q...q.L ADD   |
0001a7f0  20 20 20 52 31 2c 52 33  2c 23 32 34 20 20 20 20  |   R1,R3,#24    |
0001a800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001a810  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 73 65  |;This section se|
0001a820  6e 64 73 20 74 68 65 20  48 65 6c 70 20 74 65 78  |nds the Help tex|
0001a830  74 0d 72 06 52 20 42 49  43 20 20 20 20 20 20 52  |t.r.R BIC      R|
0001a840  31 2c 52 31 2c 23 25 31  31 20 20 20 20 20 20 20  |1,R1,#%11       |
0001a850  20 20 20 20 20 20 20 20  20 20 20 20 3b 6d 65 73  |            ;mes|
0001a860  73 61 67 65 20 74 6f 20  74 68 65 20 54 61 73 6b  |sage to the Task|
0001a870  20 74 68 61 74 20 72 65  71 75 65 73 74 65 64 20  | that requested |
0001a880  69 74 2e 0d 72 10 20 20  53 54 52 20 20 20 20 20  |it..r.  STR     |
0001a890  20 52 31 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R1,[R12,#block%|
0001a8a0  2b 30 5d 0d 72 1a 14 20  4d 4f 56 20 20 20 20 20  |+0].r.. MOV     |
0001a8b0  20 52 30 2c 23 31 37 0d  72 24 1c 20 41 44 44 20  | R0,#17.r$. ADD |
0001a8c0  20 20 20 20 20 52 31 2c  52 31 32 2c 23 62 6c 6f  |     R1,R12,#blo|
0001a8d0  63 6b 25 0d 72 2e 20 20  4c 44 52 20 20 20 20 20  |ck%.r.  LDR     |
0001a8e0  20 52 32 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R2,[R12,#block%|
0001a8f0  2b 34 5d 0d 72 38 20 20  53 57 49 20 20 20 20 20  |+4].r8  SWI     |
0001a900  20 22 57 69 6d 70 5f 53  65 6e 64 4d 65 73 73 61  | "Wimp_SendMessa|
0001a910  67 65 22 0d 72 42 04 0d  72 4c 1e 4c 44 4d 46 44  |ge".rB..rL.LDMFD|
0001a920  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
0001a930  2c 50 43 7d 5e 0d 72 56  04 0d 72 60 52 3b 2d 2d  |,PC}^.rV..r`R;--|
0001a940  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001a980  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 72 6a 30 3b  |-----------.rj0;|
0001a990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001a9a0  20 20 20 20 20 20 20 20  20 20 20 2a 2a 2a 20 44  |           *** D|
0001a9b0  61 74 61 4c 6f 61 64 20  2a 2a 2a 0d 72 74 50 3b  |ataLoad ***.rtP;|
0001a9c0  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
0001a9d0  20 69 73 20 63 61 6c 6c  65 64 20 77 68 65 6e 20  | is called when |
0001a9e0  61 20 66 69 6c 65 20 69  63 6f 6e 20 69 73 20 64  |a file icon is d|
0001a9f0  72 61 67 67 65 64 20 74  6f 20 6f 75 72 20 69 63  |ragged to our ic|
0001aa00  6f 6e 62 61 72 20 69 63  6f 6e 2e 0d 72 7e 4d 3b  |onbar icon..r~M;|
0001aa10  20 49 66 20 74 68 65 20  66 69 6c 65 20 69 73 20  | If the file is |
0001aa20  6f 66 20 61 20 66 69 6c  65 74 79 70 65 20 77 65  |of a filetype we|
0001aa30  20 75 6e 64 65 72 73 74  61 6e 64 20 74 68 65 6e  | understand then|
0001aa40  20 77 65 20 6d 75 73 74  20 74 72 79 20 74 6f 20  | we must try to |
0001aa50  6c 6f 61 64 20 69 74 2e  0d 72 88 4f 3b 20 49 6e  |load it..r.O; In|
0001aa60  20 6f 75 72 20 63 61 73  65 20 61 20 75 73 65 72  | our case a user|
0001aa70  20 77 69 6c 6c 20 64 72  61 67 20 61 20 66 69 6c  | will drag a fil|
0001aa80  65 20 74 6f 20 6f 75 72  20 69 63 6f 6e 20 77 68  |e to our icon wh|
0001aa90  65 6e 20 74 68 65 79 20  77 61 6e 74 20 74 6f 20  |en they want to |
0001aaa0  61 64 64 20 69 74 73 0d  72 92 1c 3b 20 63 6f 6e  |add its.r..; con|
0001aab0  74 65 6e 74 73 20 74 6f  20 74 68 65 20 49 6e 64  |tents to the Ind|
0001aac0  65 78 2e 0d 72 9c 04 0d  72 a6 0d 2e 44 61 74 61  |ex..r...r...Data|
0001aad0  4c 6f 61 64 0d 72 b0 04  0d 72 ba 1e 53 54 4d 46  |Load.r...r..STMF|
0001aae0  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
0001aaf0  32 2c 52 31 34 7d 0d 72  c4 04 0d 72 ce 04 0d 72  |2,R14}.r...r...r|
0001ab00  d8 51 20 4c 44 52 20 20  20 20 20 20 52 30 2c 5b  |.Q LDR      R0,[|
0001ab10  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 34 30 5d 20  |R12,#block%+40] |
0001ab20  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0001ab30  65 63 74 69 6f 6e 20 65  6e 73 75 72 65 73 20 74  |ection ensures t|
0001ab40  68 61 74 20 74 68 65 20  66 69 6c 65 20 69 73 0d  |hat the file is.|
0001ab50  72 e2 49 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |r.I MOV      R1,|
0001ab60  20 20 20 23 26 30 41 43  20 20 20 20 20 20 20 20  |   #&0AC        |
0001ab70  20 20 20 20 20 20 20 20  20 20 3b 6f 66 20 46 69  |          ;of Fi|
0001ab80  6c 65 74 79 70 65 20 26  30 41 43 20 28 49 6e 64  |letype &0AC (Ind|
0001ab90  65 78 46 69 6c 65 29 2e  0d 72 ec 13 20 43 4d 50  |exFile)..r.. CMP|
0001aba0  20 20 20 20 20 20 52 30  2c 52 31 0d 72 f6 20 20  |      R0,R1.r.  |
0001abb0  20 4c 44 4d 4e 45 46 44  20 20 52 31 33 21 2c 7b  | LDMNEFD  R13!,{|
0001abc0  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 73 00 04 0d  |R0-R12,PC}^.s...|
0001abd0  73 0a 1c 20 53 57 49 20  20 20 20 20 20 22 48 6f  |s.. SWI      "Ho|
0001abe0  75 72 67 6c 61 73 73 5f  4f 6e 22 0d 73 14 04 0d  |urglass_On".s...|
0001abf0  73 1e 51 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |s.Q MOV      R0,|
0001ac00  23 26 34 46 20 20 20 20  20 20 20 20 20 20 20 20  |#&4F            |
0001ac10  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001ac20  73 65 63 74 69 6f 6e 20  6f 70 65 6e 73 20 74 68  |section opens th|
0001ac30  65 20 75 73 65 72 73 20  66 69 6c 65 20 66 6f 72  |e users file for|
0001ac40  0d 73 28 3d 20 41 44 44  20 20 20 20 20 20 52 31  |.s(= ADD      R1|
0001ac50  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 34 34 20  |,R12,#block%+44 |
0001ac60  20 20 20 20 20 20 20 20  20 20 20 3b 72 65 61 64  |           ;read|
0001ac70  20 61 63 63 65 73 73 20  6f 6e 6c 79 2e 0d 73 32  | access only..s2|
0001ac80  18 20 53 57 49 20 20 20  20 20 20 22 58 4f 53 5f  |. SWI      "XOS_|
0001ac90  46 69 6e 64 22 0d 73 3c  16 20 20 42 4c 56 53 20  |Find".s<.  BLVS |
0001aca0  20 20 20 20 6e 6f 69 6e  70 75 74 0d 73 46 20 20  |    noinput.sF  |
0001acb0  20 4c 44 4d 56 53 46 44  20 20 52 31 33 21 2c 7b  | LDMVSFD  R13!,{|
0001acc0  52 30 2d 52 31 32 2c 50  43 7d 5e 0d 73 50 14 20  |R0-R12,PC}^.sP. |
0001acd0  4d 4f 56 20 20 20 20 20  20 20 52 37 2c 52 30 0d  |MOV       R7,R0.|
0001ace0  73 5a 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |sZR             |
0001acf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ad00  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001ad10  73 65 63 74 69 6f 6e 20  6c 6f 61 64 73 20 74 68  |section loads th|
0001ad20  65 20 66 69 72 73 74 20  72 65 63 6f 72 64 20 6f  |e first record o|
0001ad30  66 0d 73 64 3b 20 20 4d  4f 56 20 20 20 20 20 20  |f.sd;  MOV      |
0001ad40  52 30 2c 23 33 20 20 20  20 20 20 20 20 20 20 20  |R0,#3           |
0001ad50  20 20 20 20 20 20 20 20  20 20 20 20 3b 74 68 65  |            ;the|
0001ad60  20 75 73 65 72 73 20 66  69 6c 65 2e 0d 73 6e 14  | users file..sn.|
0001ad70  20 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 52 37  |  MOV      R1,R7|
0001ad80  0d 73 78 1d 20 20 41 44  44 20 20 20 20 20 20 52  |.sx.  ADD      R|
0001ad90  32 2c 52 31 30 2c 23 72  65 63 6f 72 64 0d 73 82  |2,R10,#record.s.|
0001ada0  15 20 20 4d 4f 56 20 20  20 20 20 20 52 33 2c 23  |.  MOV      R3,#|
0001adb0  38 38 0d 73 8c 14 20 20  4d 4f 56 20 20 20 20 20  |88.s..  MOV     |
0001adc0  20 52 34 2c 23 30 0d 73  96 19 20 20 53 57 49 20  | R4,#0.s..  SWI |
0001add0  20 20 20 20 20 22 58 4f  53 5f 47 42 50 42 22 0d  |     "XOS_GBPB".|
0001ade0  73 a0 17 20 20 20 42 4c  56 53 20 20 20 20 20 6e  |s..   BLVS     n|
0001adf0  6f 69 6e 70 75 74 0d 73  aa 21 20 20 20 4c 44 4d  |oinput.s.!   LDM|
0001ae00  56 53 46 44 20 20 52 31  33 21 2c 7b 52 30 2d 52  |VSFD  R13!,{R0-R|
0001ae10  31 32 2c 50 43 7d 5e 0d  73 b4 04 0d 73 be 4f 20  |12,PC}^.s...s.O |
0001ae20  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 30 20 20  |MOV      R0,#0  |
0001ae30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ae40  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
0001ae50  69 6f 6e 20 63 6c 6f 73  65 73 20 74 68 65 20 75  |ion closes the u|
0001ae60  73 65 72 73 20 66 69 6c  65 2e 0d 73 c8 13 20 4d  |sers file..s.. M|
0001ae70  4f 56 20 20 20 20 20 20  52 31 2c 52 37 0d 73 d2  |OV      R1,R7.s.|
0001ae80  18 20 53 57 49 20 20 20  20 20 20 22 58 4f 53 5f  |. SWI      "XOS_|
0001ae90  46 69 6e 64 22 0d 73 dc  04 0d 73 e6 51 20 4d 4f  |Find".s...s.Q MO|
0001aea0  56 20 20 20 20 20 20 52  30 2c 23 26 34 46 20 20  |V      R0,#&4F  |
0001aeb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001aec0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0001aed0  6e 20 6f 70 65 6e 73 20  74 68 65 20 69 6e 64 65  |n opens the inde|
0001aee0  78 20 66 69 6c 65 20 66  6f 72 0d 73 f0 3d 20 41  |x file for.s.= A|
0001aef0  44 44 20 20 20 20 20 20  52 31 2c 52 31 30 2c 23  |DD      R1,R10,#|
0001af00  69 6e 64 65 78 66 69 6c  65 20 20 20 20 20 20 20  |indexfile       |
0001af10  20 20 20 20 20 3b 72 65  61 64 20 61 63 63 65 73  |     ;read acces|
0001af20  73 20 6f 6e 6c 79 2e 0d  73 fa 18 20 53 57 49 20  |s only..s.. SWI |
0001af30  20 20 20 20 20 22 58 4f  53 5f 46 69 6e 64 22 0d  |     "XOS_Find".|
0001af40  74 04 16 20 20 42 4c 56  53 20 20 20 20 20 6e 6f  |t..  BLVS     no|
0001af50  69 6e 64 65 78 0d 74 0e  20 20 20 4c 44 4d 56 53  |index.t.   LDMVS|
0001af60  46 44 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |FD  R13!,{R0-R12|
0001af70  2c 50 43 7d 5e 0d 74 18  24 20 53 54 52 20 20 20  |,PC}^.t.$ STR   |
0001af80  20 20 20 52 30 2c 5b 52  31 30 2c 23 69 6e 64 65  |   R0,[R10,#inde|
0001af90  78 68 61 6e 64 6c 65 25  5d 0d 74 22 04 0d 74 2c  |xhandle%].t"..t,|
0001afa0  12 20 4d 4f 56 20 20 20  20 20 52 38 2c 23 30 0d  |. MOV     R8,#0.|
0001afb0  74 36 16 20 42 4c 20 20  20 20 20 20 66 69 6e 64  |t6. BL      find|
0001afc0  70 6c 61 63 65 0d 74 40  04 0d 74 4a 4f 20 4d 4f  |place.t@..tJO MO|
0001afd0  56 20 20 20 20 20 20 52  30 2c 23 30 20 20 20 20  |V      R0,#0    |
0001afe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001aff0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0001b000  6e 20 63 6c 6f 73 65 73  20 74 68 65 20 69 6e 64  |n closes the ind|
0001b010  65 78 20 66 69 6c 65 2e  0d 74 54 24 20 4c 44 52  |ex file..tT$ LDR|
0001b020  20 20 20 20 20 20 52 31  2c 5b 52 31 30 2c 23 69  |      R1,[R10,#i|
0001b030  6e 64 65 78 68 61 6e 64  6c 65 25 5d 0d 74 5e 18  |ndexhandle%].t^.|
0001b040  20 53 57 49 20 20 20 20  20 20 22 58 4f 53 5f 46  | SWI      "XOS_F|
0001b050  69 6e 64 22 0d 74 68 16  20 20 42 56 53 20 20 20  |ind".th.  BVS   |
0001b060  20 20 20 6e 6f 69 6e 64  65 78 0d 74 72 04 0d 74  |   noindex.tr..t|
0001b070  7c 1c 20 53 57 49 20 20  20 20 20 22 48 6f 75 72  ||. SWI     "Hour|
0001b080  67 6c 61 73 73 5f 4f 66  66 22 0d 74 86 04 0d 74  |glass_Off".t...t|
0001b090  90 20 20 4c 44 52 20 20  20 20 20 52 30 2c 5b 52  |.  LDR     R0,[R|
0001b0a0  31 30 2c 23 69 6e 64 65  78 6d 61 78 25 5d 0d 74  |10,#indexmax%].t|
0001b0b0  9a 1c 20 4d 4f 56 20 20  20 20 20 52 31 2c 20 20  |.. MOV     R1,  |
0001b0c0  20 52 30 2c 4c 53 4c 20  23 36 0d 74 a4 1c 20 41  | R0,LSL #6.t.. A|
0001b0d0  44 44 20 20 20 20 20 52  31 2c 52 31 2c 52 30 2c  |DD     R1,R1,R0,|
0001b0e0  4c 53 4c 20 23 34 0d 74  ae 1c 20 41 44 44 20 20  |LSL #4.t.. ADD  |
0001b0f0  20 20 20 52 31 2c 52 31  2c 52 30 2c 4c 53 4c 20  |   R1,R1,R0,LSL |
0001b100  23 33 0d 74 b8 12 20 43  4d 50 20 20 20 20 20 52  |#3.t.. CMP     R|
0001b110  38 2c 52 31 0d 74 c2 10  20 20 ec 51 20 20 20 52  |8,R1.t..  .Q   R|
0001b120  30 2c 23 31 0d 74 cc 13  20 20 4d 4f 56 4e 45 20  |0,#1.t..  MOVNE |
0001b130  20 20 52 30 2c 23 30 0d  74 d6 1a 20 53 54 52 20  |  R0,#0.t.. STR |
0001b140  20 20 20 20 52 30 2c 55  70 64 61 74 65 54 79 70  |    R0,UpdateTyp|
0001b150  65 0d 74 e0 04 0d 74 ea  1f 20 4c 44 52 20 20 20  |e.t...t.. LDR   |
0001b160  20 20 20 52 30 2c 5b 52  31 32 2c 23 75 70 64 61  |   R0,[R12,#upda|
0001b170  74 65 25 5d 0d 74 f4 13  20 4d 4f 56 20 20 20 20  |te%].t.. MOV    |
0001b180  20 20 52 31 2c 23 32 0d  74 fe 1f 20 41 44 44 20  |  R1,#2.t.. ADD |
0001b190  20 20 20 20 20 52 32 2c  52 31 32 2c 23 62 6c 6f  |     R2,R12,#blo|
0001b1a0  63 6b 25 2b 34 34 0d 75  08 17 20 42 4c 20 20 20  |ck%+44.u.. BL   |
0001b1b0  20 20 20 20 57 72 69 74  65 49 63 6f 6e 0d 75 12  |    WriteIcon.u.|
0001b1c0  04 0d 75 1c 1f 20 4c 44  52 20 20 20 20 20 20 52  |..u.. LDR      R|
0001b1d0  30 2c 5b 52 31 32 2c 23  75 70 64 61 74 65 25 5d  |0,[R12,#update%]|
0001b1e0  0d 75 26 13 20 4d 4f 56  20 20 20 20 20 20 52 31  |.u&. MOV      R1|
0001b1f0  2c 23 33 0d 75 30 13 20  4d 4f 56 20 20 20 20 20  |,#3.u0. MOV     |
0001b200  20 52 32 2c 23 30 0d 75  3a 19 20 42 4c 20 20 20  | R2,#0.u:. BL   |
0001b210  20 20 20 20 57 72 69 74  65 49 63 6f 6e 4e 6f 0d  |    WriteIconNo.|
0001b220  75 44 04 0d 75 4e 20 20  53 54 52 20 20 20 20 20  |uD..uN  STR     |
0001b230  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
0001b240  2b 30 5d 0d 75 58 1c 20  41 44 44 20 20 20 20 20  |+0].uX. ADD     |
0001b250  20 52 31 2c 52 31 32 2c  23 62 6c 6f 63 6b 25 0d  | R1,R12,#block%.|
0001b260  75 62 23 20 53 57 49 20  20 20 20 20 20 22 57 69  |ub# SWI      "Wi|
0001b270  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
0001b280  65 22 0d 75 6c 1f 20 42  4c 20 20 20 20 20 20 20  |e".ul. BL       |
0001b290  4f 70 65 6e 57 69 6e 64  6f 77 52 65 71 75 65 73  |OpenWindowReques|
0001b2a0  74 0d 75 76 04 0d 75 80  13 20 4d 4f 56 20 20 20  |t.uv..u.. MOV   |
0001b2b0  20 20 20 52 30 2c 23 30  0d 75 8a 1e 20 53 54 52  |   R0,#0.u.. STR|
0001b2c0  20 20 20 20 20 20 52 30  2c 55 70 64 61 74 65 50  |      R0,UpdateP|
0001b2d0  6f 69 6e 74 65 72 0d 75  94 1d 20 53 54 52 20 20  |ointer.u.. STR  |
0001b2e0  20 20 20 20 52 30 2c 63  75 72 72 65 6e 74 70 6c  |    R0,currentpl|
0001b2f0  61 63 65 0d 75 9e 04 0d  75 a8 1e 4c 44 4d 46 44  |ace.u...u..LDMFD|
0001b300  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |    R13!,{R0-R12|
0001b310  2c 50 43 7d 5e 0d 75 b2  04 0d 75 bc 52 3b 2d 2d  |,PC}^.u...u.R;--|
0001b320  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001b360  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 75 c6 04 0d  |-----------.u...|
0001b370  75 d0 11 2e 43 6f 6e 74  55 70 64 61 74 69 6e 67  |u...ContUpdating|
0001b380  0d 75 da 04 0d 75 e4 20  4c 44 52 20 20 20 20 20  |.u...u. LDR     |
0001b390  20 52 38 2c 5b 52 31 30  2c 23 75 70 64 61 74 69  | R8,[R10,#updati|
0001b3a0  6e 67 25 5d 0d 75 ee 12  43 4d 50 20 20 20 20 20  |ng%].u..CMP     |
0001b3b0  20 52 38 2c 23 30 0d 75  f8 11 20 ec 51 53 20 20  | R8,#0.u.. .QS  |
0001b3c0  20 50 43 2c 52 31 34 0d  76 02 04 0d 76 0c 1e 53  | PC,R14.v...v..S|
0001b3d0  54 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |TMFD    R13!,{R0|
0001b3e0  2d 52 31 32 2c 52 31 34  7d 0d 76 16 04 0d 76 20  |-R12,R14}.v...v |
0001b3f0  1b 20 4c 44 52 20 20 20  20 20 20 52 30 2c 55 70  |. LDR      R0,Up|
0001b400  64 61 74 65 54 79 70 65  0d 76 2a 13 20 43 4d 50  |dateType.v*. CMP|
0001b410  20 20 20 20 20 20 52 30  2c 23 30 0d 76 34 19 20  |      R0,#0.v4. |
0001b420  20 42 4c 4e 45 20 20 20  20 20 41 70 70 65 6e 64  | BLNE     Append|
0001b430  46 69 6c 65 0d 76 3e 20  20 20 4c 44 4d 4e 45 46  |File.v>   LDMNEF|
0001b440  44 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |D  R13!,{R0-R12,|
0001b450  50 43 7d 5e 0d 76 48 04  0d 76 52 50 20 4d 4f 56  |PC}^.vH..vRP MOV|
0001b460  20 20 20 20 20 20 52 30  2c 23 26 43 46 20 20 20  |      R0,#&CF   |
0001b470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001b480  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
0001b490  20 6f 70 65 6e 73 20 6f  75 72 20 69 6e 64 65 78  | opens our index|
0001b4a0  66 69 6c 65 20 66 6f 72  0d 76 5c 33 20 41 44 44  |file for.v\3 ADD|
0001b4b0  20 20 20 20 20 20 52 31  2c 52 31 30 2c 23 69 6e  |      R1,R10,#in|
0001b4c0  64 65 78 66 69 6c 65 20  20 20 20 20 20 20 20 20  |dexfile         |
0001b4d0  20 20 20 3b 75 70 64 61  74 65 2e 0d 76 66 18 20  |   ;update..vf. |
0001b4e0  53 57 49 20 20 20 20 20  20 22 58 4f 53 5f 46 69  |SWI      "XOS_Fi|
0001b4f0  6e 64 22 0d 76 70 24 20  53 54 52 20 20 20 20 20  |nd".vp$ STR     |
0001b500  20 52 30 2c 5b 52 31 30  2c 23 69 6e 64 65 78 68  | R0,[R10,#indexh|
0001b510  61 6e 64 6c 65 25 5d 0d  76 7a 13 20 4d 4f 56 20  |andle%].vz. MOV |
0001b520  20 20 20 20 20 52 31 2c  52 30 0d 76 84 15 20 4d  |     R1,R0.v.. M|
0001b530  4f 56 20 20 20 20 20 20  52 30 2c 23 32 35 34 0d  |OV      R0,#254.|
0001b540  76 8e 17 20 53 57 49 20  20 20 20 20 20 22 4f 53  |v.. SWI      "OS|
0001b550  5f 41 72 67 73 22 0d 76  98 17 20 54 53 54 20 20  |_Args".v.. TST  |
0001b560  20 20 20 20 52 30 2c 23  25 31 3c 3c 37 0d 76 a2  |    R0,#%1<<7.v.|
0001b570  19 20 20 42 4c 45 51 20  20 20 20 20 63 61 6e 74  |.  BLEQ     cant|
0001b580  75 70 64 61 74 65 0d 76  ac 04 0d 76 b6 51 20 4d  |update.v...v.Q M|
0001b590  4f 56 20 20 20 20 20 20  52 30 2c 23 26 34 46 20  |OV      R0,#&4F |
0001b5a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001b5b0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0001b5c0  6f 6e 20 6f 70 65 6e 73  20 74 68 65 20 75 73 65  |on opens the use|
0001b5d0  72 73 20 66 69 6c 65 20  66 6f 72 0d 76 c0 3d 20  |rs file for.v.= |
0001b5e0  41 44 44 20 20 20 20 20  20 52 31 2c 52 31 32 2c  |ADD      R1,R12,|
0001b5f0  23 62 6c 6f 63 6b 25 2b  34 34 20 20 20 20 20 20  |#block%+44      |
0001b600  20 20 20 20 20 20 3b 72  65 61 64 20 61 63 63 65  |      ;read acce|
0001b610  73 73 20 6f 6e 6c 79 2e  0d 76 ca 18 20 53 57 49  |ss only..v.. SWI|
0001b620  20 20 20 20 20 20 22 58  4f 53 5f 46 69 6e 64 22  |      "XOS_Find"|
0001b630  0d 76 d4 16 20 20 42 4c  56 53 20 20 20 20 20 6e  |.v..  BLVS     n|
0001b640  6f 69 6e 70 75 74 0d 76  de 20 20 20 4c 44 4d 56  |oinput.v.   LDMV|
0001b650  53 46 44 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |SFD  R13!,{R0-R1|
0001b660  32 2c 50 43 7d 5e 0d 76  e8 13 20 4d 4f 56 20 20  |2,PC}^.v.. MOV  |
0001b670  20 20 20 20 52 37 2c 52  30 0d 76 f2 04 0d 76 fc  |    R7,R0.v...v.|
0001b680  51 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |Q               |
0001b690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001b6a0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0001b6b0  63 74 69 6f 6e 20 6c 6f  61 64 73 20 65 61 63 68  |ction loads each|
0001b6c0  20 72 65 63 6f 72 64 20  6f 66 20 74 68 65 0d 77  | record of the.w|
0001b6d0  06 4c 20 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |.L  MOV      R0,|
0001b6e0  23 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#3              |
0001b6f0  20 20 20 20 20 20 20 20  20 3b 75 73 65 72 73 20  |         ;users |
0001b700  66 69 6c 65 20 61 6e 64  20 75 73 65 73 20 74 68  |file and uses th|
0001b710  65 20 27 69 6e 73 65 72  74 27 0d 77 10 50 20 20  |e 'insert'.w.P  |
0001b720  4d 4f 56 20 20 20 20 20  20 52 31 2c 52 37 20 20  |MOV      R1,R7  |
0001b730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001b740  20 20 20 20 20 3b 74 6f  20 61 64 64 20 69 74 20  |     ;to add it |
0001b750  69 6e 20 74 68 65 20 63  6f 72 72 65 63 74 20 70  |in the correct p|
0001b760  6f 73 69 74 69 6f 6e 20  69 6e 0d 77 1a 3b 20 20  |osition in.w.;  |
0001b770  41 44 44 20 20 20 20 20  20 52 32 2c 52 31 30 2c  |ADD      R2,R10,|
0001b780  23 72 65 63 6f 72 64 20  20 20 20 20 20 20 20 20  |#record         |
0001b790  20 20 20 20 20 3b 74 68  65 20 49 6e 64 65 78 20  |     ;the Index |
0001b7a0  66 69 6c 65 2e 0d 77 24  15 20 20 4d 4f 56 20 20  |file..w$.  MOV  |
0001b7b0  20 20 20 20 52 33 2c 23  38 38 0d 77 2e 1f 20 20  |    R3,#88.w..  |
0001b7c0  4c 44 52 20 20 20 20 20  20 52 34 2c 55 70 64 61  |LDR      R4,Upda|
0001b7d0  74 65 50 6f 69 6e 74 65  72 0d 77 38 19 20 20 53  |tePointer.w8.  S|
0001b7e0  57 49 20 20 20 20 20 20  22 58 4f 53 5f 47 42 50  |WI      "XOS_GBP|
0001b7f0  42 22 0d 77 42 17 20 20  20 42 4c 56 53 20 20 20  |B".wB.   BLVS   |
0001b800  20 20 6e 6f 69 6e 70 75  74 0d 77 4c 21 20 20 20  |  noinput.wL!   |
0001b810  4c 44 4d 56 53 46 44 20  20 52 31 33 21 2c 7b 52  |LDMVSFD  R13!,{R|
0001b820  30 2d 52 31 32 2c 50 43  7d 5e 0d 77 56 1e 20 20  |0-R12,PC}^.wV.  |
0001b830  4c 44 52 43 43 20 20 20  20 52 38 2c 63 75 72 72  |LDRCC    R8,curr|
0001b840  65 6e 74 70 6c 61 63 65  0d 77 60 18 20 20 42 4c  |entplace.w`.  BL|
0001b850  43 43 20 20 20 20 20 66  69 6e 64 70 6c 61 63 65  |CC     findplace|
0001b860  0d 77 6a 1e 20 20 53 54  52 43 43 20 20 20 20 52  |.wj.  STRCC    R|
0001b870  38 2c 63 75 72 72 65 6e  74 70 6c 61 63 65 0d 77  |8,currentplace.w|
0001b880  74 15 20 20 42 4c 43 43  20 20 20 20 20 69 6e 73  |t.  BLCC     ins|
0001b890  65 72 74 0d 77 7e 1d 20  20 42 4c 43 53 20 20 20  |ert.w~.  BLCS   |
0001b8a0  20 20 46 69 6e 69 73 68  55 70 64 61 74 69 6e 67  |  FinishUpdating|
0001b8b0  0d 77 88 1f 20 20 53 54  52 20 20 20 20 20 20 52  |.w..  STR      R|
0001b8c0  34 2c 55 70 64 61 74 65  50 6f 69 6e 74 65 72 0d  |4,UpdatePointer.|
0001b8d0  77 92 04 0d 77 9c 1f 20  4c 44 52 20 20 20 20 20  |w...w.. LDR     |
0001b8e0  20 52 30 2c 5b 52 31 32  2c 23 75 70 64 61 74 65  | R0,[R12,#update|
0001b8f0  25 5d 0d 77 a6 13 20 4d  4f 56 20 20 20 20 20 20  |%].w.. MOV      |
0001b900  52 31 2c 23 33 0d 77 b0  18 20 42 4c 20 20 20 20  |R1,#3.w.. BL    |
0001b910  20 20 20 52 65 61 64 49  63 6f 6e 4e 6f 0d 77 ba  |   ReadIconNo.w.|
0001b920  16 20 41 44 44 20 20 20  20 20 20 52 32 2c 52 32  |. ADD      R2,R2|
0001b930  2c 23 31 0d 77 c4 19 20  42 4c 20 20 20 20 20 20  |,#1.w.. BL      |
0001b940  20 57 72 69 74 65 49 63  6f 6e 4e 6f 0d 77 ce 04  | WriteIconNo.w..|
0001b950  0d 77 d8 4f 20 4d 4f 56  20 20 20 20 20 20 52 30  |.w.O MOV      R0|
0001b960  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
0001b970  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001b980  20 73 65 63 74 69 6f 6e  20 63 6c 6f 73 65 73 20  | section closes |
0001b990  74 68 65 20 49 6e 64 65  78 20 66 69 6c 65 2e 0d  |the Index file..|
0001b9a0  77 e2 24 20 4c 44 52 20  20 20 20 20 20 52 31 2c  |w.$ LDR      R1,|
0001b9b0  5b 52 31 30 2c 23 69 6e  64 65 78 68 61 6e 64 6c  |[R10,#indexhandl|
0001b9c0  65 25 5d 0d 77 ec 18 20  53 57 49 20 20 20 20 20  |e%].w.. SWI     |
0001b9d0  20 22 58 4f 53 5f 46 69  6e 64 22 0d 77 f6 04 0d  | "XOS_Find".w...|
0001b9e0  78 00 4f 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |x.O MOV      R0,|
0001b9f0  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
0001ba00  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001ba10  73 65 63 74 69 6f 6e 20  63 6c 6f 73 65 73 20 74  |section closes t|
0001ba20  68 65 20 75 73 65 72 73  20 66 69 6c 65 2e 0d 78  |he users file..x|
0001ba30  0a 13 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 52  |.. MOV      R1,R|
0001ba40  37 0d 78 14 18 20 53 57  49 20 20 20 20 20 20 22  |7.x.. SWI      "|
0001ba50  58 4f 53 5f 46 69 6e 64  22 0d 78 1e 04 0d 78 28  |XOS_Find".x...x(|
0001ba60  1f 4c 44 4d 46 44 20 20  20 20 20 52 31 33 21 2c  |.LDMFD     R13!,|
0001ba70  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 78 32 04  |{R0-R12,PC}^.x2.|
0001ba80  0d 78 3c 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.x<R;-----------|
0001ba90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001bad0  2d 2d 0d 78 46 11 2e 63  75 72 72 65 6e 74 70 6c  |--.xF..currentpl|
0001bae0  61 63 65 0d 78 50 0e 45  51 55 44 20 20 20 20 20  |ace.xP.EQUD     |
0001baf0  30 0d 78 5a 0f 2e 55 70  64 61 74 65 54 79 70 65  |0.xZ..UpdateType|
0001bb00  0d 78 64 0e 45 51 55 44  20 20 20 20 20 30 0d 78  |.xd.EQUD     0.x|
0001bb10  6e 04 0d 78 78 13 2e 46  69 6e 69 73 68 55 70 64  |n..xx..FinishUpd|
0001bb20  61 74 69 6e 67 0d 78 82  04 0d 78 8c 1e 53 54 4d  |ating.x...x..STM|
0001bb30  46 44 20 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |FD    R13!,{R0-R|
0001bb40  31 32 2c 52 31 34 7d 0d  78 96 04 0d 78 a0 04 0d  |12,R14}.x...x...|
0001bb50  78 aa 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |x.. MOV      R0,|
0001bb60  23 30 0d 78 b4 21 20 53  54 52 20 20 20 20 20 20  |#0.x.! STR      |
0001bb70  52 30 2c 5b 52 31 30 2c  23 75 70 64 61 74 69 6e  |R0,[R10,#updatin|
0001bb80  67 25 5d 0d 78 be 04 0d  78 c8 1f 20 4c 44 52 20  |g%].x...x.. LDR |
0001bb90  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 75 70  |     R0,[R12,#up|
0001bba0  64 61 74 65 25 5d 0d 78  d2 20 20 53 54 52 20 20  |date%].x.  STR  |
0001bbb0  20 20 20 20 52 30 2c 5b  52 31 32 2c 23 62 6c 6f  |    R0,[R12,#blo|
0001bbc0  63 6b 25 2b 30 5d 0d 78  dc 1c 20 41 44 44 20 20  |ck%+0].x.. ADD  |
0001bbd0  20 20 20 20 52 31 2c 52  31 32 2c 23 62 6c 6f 63  |    R1,R12,#bloc|
0001bbe0  6b 25 0d 78 e6 20 20 53  57 49 20 20 20 20 20 20  |k%.x.  SWI      |
0001bbf0  22 57 69 6d 70 5f 43 6c  6f 73 65 57 69 6e 64 6f  |"Wimp_CloseWindo|
0001bc00  77 22 0d 78 f0 04 0d 78  fa 51 20 4c 44 52 20 20  |w".x...x.Q LDR  |
0001bc10  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 73 68 6f  |    R0,[R10,#sho|
0001bc20  77 25 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |w%]             |
0001bc30  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 65  | ;This section e|
0001bc40  6e 73 75 72 65 73 20 74  68 61 74 20 74 68 65 20  |nsures that the |
0001bc50  70 72 6f 67 72 61 6d 0d  79 04 4c 20 43 4d 50 20  |program.y.L CMP |
0001bc60  20 20 20 20 20 52 30 2c  23 31 20 20 20 20 20 20  |     R0,#1      |
0001bc70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001bc80  20 20 3b 69 73 20 69 6e  20 45 6e 74 69 72 65 20  |  ;is in Entire |
0001bc90  49 6e 64 65 78 20 6d 6f  64 65 20 77 68 65 6e 20  |Index mode when |
0001bca0  74 68 65 0d 79 0e 4f 20  20 4c 44 52 45 51 20 20  |the.y.O  LDREQ  |
0001bcb0  20 20 52 30 2c 5b 52 31  30 2c 23 69 6e 64 65 78  |  R0,[R10,#index|
0001bcc0  68 61 6e 64 6c 65 25 5d  20 20 20 20 20 20 3b 73  |handle%]      ;s|
0001bcd0  75 62 72 6f 75 74 69 6e  65 20 65 6e 64 73 2e 20  |ubroutine ends. |
0001bce0  4f 74 68 65 72 77 69 73  65 20 70 72 6f 62 6c 65  |Otherwise proble|
0001bcf0  6d 73 0d 79 18 4e 20 20  53 54 52 45 51 20 20 20  |ms.y.N  STREQ   |
0001bd00  20 52 30 2c 5b 52 31 30  2c 23 66 69 6c 65 68 61  | R0,[R10,#fileha|
0001bd10  6e 64 6c 65 25 5d 20 20  20 20 20 20 20 3b 6f 63  |ndle%]       ;oc|
0001bd20  63 75 72 20 69 66 20 74  68 65 20 75 73 65 72 20  |cur if the user |
0001bd30  73 77 69 74 63 68 65 73  20 62 61 63 6b 20 74 6f  |switches back to|
0001bd40  0d 79 22 4e 20 20 4c 44  52 45 51 20 20 20 20 52  |.y"N  LDREQ    R|
0001bd50  30 2c 5b 52 31 30 2c 23  69 6e 64 65 78 6d 61 78  |0,[R10,#indexmax|
0001bd60  25 5d 20 20 20 20 20 20  20 20 20 3b 64 69 73 70  |%]         ;disp|
0001bd70  6c 61 79 20 74 68 65 20  45 6e 74 69 72 65 20 49  |lay the Entire I|
0001bd80  6e 64 65 78 20 6c 61 74  65 72 20 6f 6e 2e 0d 79  |ndex later on..y|
0001bd90  2c 1d 20 20 53 54 52 45  51 20 20 20 20 52 30 2c  |,.  STREQ    R0,|
0001bda0  5b 52 31 30 2c 23 6d 61  78 25 5d 0d 79 36 20 20  |[R10,#max%].y6  |
0001bdb0  20 4c 44 52 45 51 20 20  20 20 52 30 2c 5b 52 31  | LDREQ    R0,[R1|
0001bdc0  30 2c 23 72 65 63 6f 72  64 25 5d 0d 79 40 11 20  |0,#record%].y@. |
0001bdd0  20 ec 51 20 20 20 20 52  31 2c 23 32 0d 79 4a 19  | .Q    R1,#2.yJ.|
0001bde0  20 20 42 4c 45 51 20 20  20 20 20 47 65 74 52 65  |  BLEQ     GetRe|
0001bdf0  63 6f 72 64 73 0d 79 54  04 0d 79 5e 14 20 42 4c  |cords.yT..y^. BL|
0001be00  20 20 20 20 20 20 20 55  70 64 61 74 65 0d 79 68  |       Update.yh|
0001be10  04 0d 79 72 1e 4c 44 4d  46 44 20 20 20 20 52 31  |..yr.LDMFD    R1|
0001be20  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
0001be30  79 7c 04 0d 79 86 04 0d  79 90 12 2e 55 70 64 61  |y|..y...y...Upda|
0001be40  74 65 50 6f 69 6e 74 65  72 0d 79 9a 0d 45 51 55  |tePointer.y..EQU|
0001be50  44 20 20 20 20 30 0d 79  a4 04 0d 79 ae 52 3b 2d  |D    0.y...y.R;-|
0001be60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001bea0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 79 b8 04  |------------.y..|
0001beb0  0d 79 c2 0f 2e 41 70 70  65 6e 64 46 69 6c 65 0d  |.y...AppendFile.|
0001bec0  79 cc 04 0d 79 d6 1d 53  54 4d 46 44 20 20 20 52  |y...y..STMFD   R|
0001bed0  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
0001bee0  0d 79 e0 04 0d 79 ea 1c  20 53 57 49 20 20 20 20  |.y...y.. SWI    |
0001bef0  20 20 22 48 6f 75 72 67  6c 61 73 73 5f 4f 6e 22  |  "Hourglass_On"|
0001bf00  0d 79 f4 04 0d 79 fe 13  20 4d 4f 56 20 20 20 20  |.y...y.. MOV    |
0001bf10  20 20 52 30 2c 23 35 0d  7a 08 1f 20 41 44 44 20  |  R0,#5.z.. ADD |
0001bf20  20 20 20 20 20 52 31 2c  52 31 32 2c 23 62 6c 6f  |     R1,R12,#blo|
0001bf30  63 6b 25 2b 34 34 0d 7a  12 18 20 53 57 49 20 20  |ck%+44.z.. SWI  |
0001bf40  20 20 20 20 22 58 4f 53  5f 46 69 6c 65 22 0d 7a  |    "XOS_File".z|
0001bf50  1c 16 20 20 42 4c 56 53  20 20 20 20 20 6e 6f 69  |..  BLVS     noi|
0001bf60  6e 70 75 74 0d 7a 26 04  0d 7a 30 13 20 4d 4f 56  |nput.z&..z0. MOV|
0001bf70  20 20 20 20 20 20 52 33  2c 52 34 0d 7a 3a 13 20  |      R3,R4.z:. |
0001bf80  4d 4f 56 20 20 20 20 20  20 52 37 2c 52 34 0d 7a  |MOV      R7,R4.z|
0001bf90  44 13 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 23  |D. MOV      R0,#|
0001bfa0  36 0d 7a 4e 1a 20 53 57  49 20 20 20 20 20 20 22  |6.zN. SWI      "|
0001bfb0  58 4f 53 5f 4d 6f 64 75  6c 65 22 0d 7a 58 14 20  |XOS_Module".zX. |
0001bfc0  42 56 53 20 20 20 20 20  20 6e 6f 72 6f 6f 6d 0d  |BVS      noroom.|
0001bfd0  7a 62 04 0d 7a 6c 13 20  4d 4f 56 20 20 20 20 20  |zb..zl. MOV     |
0001bfe0  20 52 38 2c 52 32 0d 7a  76 15 20 4d 4f 56 20 20  | R8,R2.zv. MOV  |
0001bff0  20 20 20 20 52 30 2c 23  26 46 46 0d 7a 80 1f 20  |    R0,#&FF.z.. |
0001c000  41 44 44 20 20 20 20 20  20 52 31 2c 52 31 32 2c  |ADD      R1,R12,|
0001c010  23 62 6c 6f 63 6b 25 2b  34 34 0d 7a 8a 13 20 4d  |#block%+44.z.. M|
0001c020  4f 56 20 20 20 20 20 20  52 32 2c 52 38 0d 7a 94  |OV      R2,R8.z.|
0001c030  13 20 4d 4f 56 20 20 20  20 20 20 52 33 2c 23 30  |. MOV      R3,#0|
0001c040  0d 7a 9e 18 20 53 57 49  20 20 20 20 20 20 22 58  |.z.. SWI      "X|
0001c050  4f 53 5f 46 69 6c 65 22  0d 7a a8 16 20 20 42 4c  |OS_File".z..  BL|
0001c060  56 53 20 20 20 20 20 6e  6f 69 6e 70 75 74 0d 7a  |VS     noinput.z|
0001c070  b2 04 0d 7a bc 15 20 4d  4f 56 20 20 20 20 20 20  |...z.. MOV      |
0001c080  52 30 2c 23 26 43 46 0d  7a c6 1f 20 41 44 44 20  |R0,#&CF.z.. ADD |
0001c090  20 20 20 20 20 52 31 2c  52 31 30 2c 23 69 6e 64  |     R1,R10,#ind|
0001c0a0  65 78 66 69 6c 65 0d 7a  d0 18 20 53 57 49 20 20  |exfile.z.. SWI  |
0001c0b0  20 20 20 20 22 58 4f 53  5f 46 69 6e 64 22 0d 7a  |    "XOS_Find".z|
0001c0c0  da 1a 20 20 42 4c 56 53  20 20 20 20 20 20 63 61  |..  BLVS      ca|
0001c0d0  6e 74 75 70 64 61 74 65  0d 7a e4 24 20 53 54 52  |ntupdate.z.$ STR|
0001c0e0  20 20 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 69  |      R0,[R10,#i|
0001c0f0  6e 64 65 78 68 61 6e 64  6c 65 25 5d 0d 7a ee 04  |ndexhandle%].z..|
0001c100  0d 7a f8 13 20 4d 4f 56  20 20 20 20 20 20 52 31  |.z.. MOV      R1|
0001c110  2c 52 30 0d 7b 02 13 20  4d 4f 56 20 20 20 20 20  |,R0.{.. MOV     |
0001c120  20 52 30 2c 23 32 0d 7b  0c 18 20 53 57 49 20 20  | R0,#2.{.. SWI  |
0001c130  20 20 20 20 22 58 4f 53  5f 41 72 67 73 22 0d 7b  |    "XOS_Args".{|
0001c140  16 16 20 20 42 56 53 20  20 20 20 20 20 6e 6f 69  |..  BVS      noi|
0001c150  6e 64 65 78 0d 7b 20 04  0d 7b 2a 13 20 4d 4f 56  |ndex.{ ..{*. MOV|
0001c160  20 20 20 20 20 20 52 34  2c 52 32 0d 7b 34 13 20  |      R4,R2.{4. |
0001c170  4d 4f 56 20 20 20 20 20  20 52 32 2c 52 38 0d 7b  |MOV      R2,R8.{|
0001c180  3e 13 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 23  |>. MOV      R0,#|
0001c190  31 0d 7b 48 13 20 4d 4f  56 20 20 20 20 20 20 52  |1.{H. MOV      R|
0001c1a0  33 2c 52 37 0d 7b 52 18  20 53 57 49 20 20 20 20  |3,R7.{R. SWI    |
0001c1b0  20 20 22 58 4f 53 5f 47  42 50 42 22 0d 7b 5c 19  |  "XOS_GBPB".{\.|
0001c1c0  20 20 42 4c 56 53 20 20  20 20 20 63 61 6e 74 75  |  BLVS     cantu|
0001c1d0  70 64 61 74 65 0d 7b 66  04 0d 7b 70 21 20 4c 44  |pdate.{f..{p! LD|
0001c1e0  52 20 20 20 20 20 20 52  31 2c 5b 52 31 30 2c 23  |R      R1,[R10,#|
0001c1f0  69 6e 64 65 78 6d 61 78  25 5d 0d 7b 7a 24 20 4c  |indexmax%].{z$ L|
0001c200  44 52 20 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |DR      R0,[R10,|
0001c210  23 69 6e 64 65 78 68 61  6e 64 6c 65 25 5d 0d 7b  |#indexhandle%].{|
0001c220  84 1a 20 42 4c 20 20 20  20 20 20 20 43 6f 75 6e  |.. BL       Coun|
0001c230  74 52 65 63 6f 72 64 73  0d 7b 8e 21 20 53 54 52  |tRecords.{.! STR|
0001c240  20 20 20 20 20 20 52 30  2c 5b 52 31 30 2c 23 69  |      R0,[R10,#i|
0001c250  6e 64 65 78 6d 61 78 25  5d 0d 7b 98 04 0d 7b a2  |ndexmax%].{...{.|
0001c260  16 20 53 55 42 20 20 20  20 20 20 52 32 2c 52 30  |. SUB      R2,R0|
0001c270  2c 52 31 0d 7b ac 1f 20  4c 44 52 20 20 20 20 20  |,R1.{.. LDR     |
0001c280  20 52 30 2c 5b 52 31 32  2c 23 75 70 64 61 74 65  | R0,[R12,#update|
0001c290  25 5d 0d 7b b6 13 20 4d  4f 56 20 20 20 20 20 20  |%].{.. MOV      |
0001c2a0  52 31 2c 23 33 0d 7b c0  19 20 42 4c 20 20 20 20  |R1,#3.{.. BL    |
0001c2b0  20 20 20 57 72 69 74 65  49 63 6f 6e 4e 6f 0d 7b  |   WriteIconNo.{|
0001c2c0  ca 04 0d 7b d4 1d 20 53  57 49 20 20 20 20 20 20  |...{.. SWI      |
0001c2d0  22 48 6f 75 72 67 6c 61  73 73 5f 4f 66 66 22 0d  |"Hourglass_Off".|
0001c2e0  7b de 1c 20 42 4c 20 20  20 20 20 20 20 46 69 6e  |{.. BL       Fin|
0001c2f0  69 73 68 55 70 64 61 74  69 6e 67 0d 7b e8 04 0d  |ishUpdating.{...|
0001c300  7b f2 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |{.. MOV      R0,|
0001c310  23 30 0d 7b fc 24 20 4c  44 52 20 20 20 20 20 20  |#0.{.$ LDR      |
0001c320  52 31 2c 5b 52 31 30 2c  23 69 6e 64 65 78 68 61  |R1,[R10,#indexha|
0001c330  6e 64 6c 65 25 5d 0d 7c  06 18 20 53 57 49 20 20  |ndle%].|.. SWI  |
0001c340  20 20 20 20 22 58 4f 53  5f 46 69 6e 64 22 0d 7c  |    "XOS_Find".||
0001c350  10 04 0d 7c 1a 13 20 4d  4f 56 20 20 20 20 20 20  |...|.. MOV      |
0001c360  52 30 2c 23 37 0d 7c 24  13 20 4d 4f 56 20 20 20  |R0,#7.|$. MOV   |
0001c370  20 20 20 52 32 2c 52 38  0d 7c 2e 1a 20 53 57 49  |   R2,R8.|.. SWI|
0001c380  20 20 20 20 20 20 22 58  4f 53 5f 4d 6f 64 75 6c  |      "XOS_Modul|
0001c390  65 22 0d 7c 38 04 0d 7c  42 04 0d 7c 4c 1d 4c 44  |e".|8..|B..|L.LD|
0001c3a0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 30 2d 52  |MFD   R13!,{R0-R|
0001c3b0  31 32 2c 50 43 7d 5e 0d  7c 56 04 0d 7c 60 52 3b  |12,PC}^.|V..|`R;|
0001c3c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001c400  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 7c 6a  |-------------.|j|
0001c410  30 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0;              |
0001c420  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2a 2a  |             ***|
0001c430  20 44 61 74 61 53 61 76  65 20 2a 2a 2a 0d 7c 74  | DataSave ***.|t|
0001c440  4f 3b 20 54 68 69 73 20  73 75 62 72 6f 75 74 69  |O; This subrouti|
0001c450  6e 65 20 69 73 20 63 61  6c 6c 65 64 20 77 68 65  |ne is called whe|
0001c460  6e 20 61 6e 20 65 78 74  65 72 6e 61 6c 20 74 61  |n an external ta|
0001c470  73 6b 20 77 61 6e 74 73  20 74 6f 20 73 61 76 65  |sk wants to save|
0001c480  20 64 61 74 61 20 74 6f  20 6f 75 72 0d 7c 7e 4c  | data to our.|~L|
0001c490  3b 20 61 70 70 6c 69 63  61 74 69 6f 6e 2e 20 54  |; application. T|
0001c4a0  68 69 73 20 77 6f 75 6c  64 20 62 65 20 69 66 20  |his would be if |
0001c4b0  74 68 65 20 75 73 65 72  20 64 72 61 67 67 65 64  |the user dragged|
0001c4c0  20 61 20 66 69 6c 65 20  69 63 6f 6e 20 66 72 6f  | a file icon fro|
0001c4d0  6d 20 61 20 73 61 76 65  0d 7c 88 21 3b 20 64 69  |m a save.|.!; di|
0001c4e0  61 6c 6f 67 75 65 20 62  6f 78 20 6f 6e 74 6f 20  |alogue box onto |
0001c4f0  6f 75 72 20 69 63 6f 6e  2e 0d 7c 92 04 0d 7c 9c  |our icon..|...|.|
0001c500  0d 2e 44 61 74 61 53 61  76 65 0d 7c a6 04 0d 7c  |..DataSave.|...||
0001c510  b0 1e 53 54 4d 46 44 20  20 20 20 52 31 33 21 2c  |..STMFD    R13!,|
0001c520  7b 52 30 2d 52 31 32 2c  52 31 34 7d 0d 7c ba 04  |{R0-R12,R14}.|..|
0001c530  0d 7c c4 50 20 4c 44 52  20 20 20 20 20 20 52 30  |.|.P LDR      R0|
0001c540  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 34 5d  |,[R12,#block%+4]|
0001c550  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001c560  20 73 65 63 74 69 6f 6e  20 65 6e 73 75 72 65 73  | section ensures|
0001c570  20 74 68 61 74 20 77 65  20 61 72 65 20 6e 6f 74  | that we are not|
0001c580  0d 7c ce 4f 20 4c 44 52  20 20 20 20 20 20 52 31  |.|.O LDR      R1|
0001c590  2c 5b 52 31 32 2c 23 74  61 73 6b 25 5d 20 20 20  |,[R12,#task%]   |
0001c5a0  20 20 20 20 20 20 20 20  20 20 20 3b 74 72 79 69  |           ;tryi|
0001c5b0  6e 67 20 74 6f 20 6c 6f  61 64 20 6f 75 72 20 6f  |ng to load our o|
0001c5c0  77 6e 20 64 61 74 61 2e  20 69 65 20 74 68 65 0d  |wn data. ie the.|
0001c5d0  7c d8 51 20 43 4d 50 20  20 20 20 20 20 52 30 2c  ||.Q CMP      R0,|
0001c5e0  52 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R1              |
0001c5f0  20 20 20 20 20 20 20 20  20 20 3b 6d 65 73 73 61  |          ;messa|
0001c600  67 65 20 77 61 73 20 73  65 6e 74 20 62 79 20 61  |ge was sent by a|
0001c610  20 74 61 73 6b 20 6f 74  68 65 72 20 74 68 61 6e  | task other than|
0001c620  0d 7c e2 36 20 20 4c 44  4d 45 51 46 44 20 20 52  |.|.6  LDMEQFD  R|
0001c630  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
0001c640  20 20 20 20 20 20 20 20  20 20 20 3b 6f 75 72 73  |           ;ours|
0001c650  65 6c 76 65 73 2e 0d 7c  ec 04 0d 7c f6 52 20 41  |elves..|...|.R A|
0001c660  44 52 20 20 20 20 20 20  52 30 2c 73 63 72 61 70  |DR      R0,scrap|
0001c670  66 69 6c 65 6e 61 6d 65  20 20 20 20 20 20 20 20  |filename        |
0001c680  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0001c690  6f 6e 20 65 6e 73 75 72  65 73 20 74 68 61 74 20  |on ensures that |
0001c6a0  3c 57 69 6d 70 24 53 63  72 61 70 3e 0d 7d 00 45  |<Wimp$Scrap>.}.E|
0001c6b0  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 39 20  | MOV      R1,R9 |
0001c6c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001c6d0  20 20 20 20 20 20 20 3b  68 61 73 20 62 65 65 6e  |       ;has been|
0001c6e0  20 61 73 69 67 6e 65 64  20 61 20 76 61 6c 75 65  | asigned a value|
0001c6f0  2e 0d 7d 0a 13 20 4d 56  4e 20 20 20 20 20 20 52  |..}.. MVN      R|
0001c700  32 2c 23 30 0d 7d 14 13  20 4d 4f 56 20 20 20 20  |2,#0.}.. MOV    |
0001c710  20 20 52 33 2c 23 30 0d  7d 1e 1e 20 53 57 49 20  |  R3,#0.}.. SWI |
0001c720  20 20 20 20 20 22 58 4f  53 5f 52 65 61 64 56 61  |     "XOS_ReadVa|
0001c730  72 56 61 6c 22 0d 7d 28  13 20 43 4d 50 20 20 20  |rVal".}(. CMP   |
0001c740  20 20 20 52 32 2c 23 30  0d 7d 32 19 20 20 42 4c  |   R2,#0.}2.  BL|
0001c750  45 51 20 20 20 20 6e 6f  73 63 72 61 70 66 69 6c  |EQ    noscrapfil|
0001c760  65 0d 7d 3c 1f 20 20 4c  44 4d 45 51 46 44 20 52  |e.}<.  LDMEQFD R|
0001c770  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
0001c780  0d 7d 46 04 0d 7d 50 3b  20 4d 4f 56 20 20 20 20  |.}F..}P; MOV    |
0001c790  20 20 52 31 2c 23 36 30  20 20 20 20 20 20 20 20  |  R1,#60        |
0001c7a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0001c7b0  4c 65 6e 67 74 68 20 4f  66 20 42 6c 6f 63 6b 0d  |Length Of Block.|
0001c7c0  7d 5a 20 20 53 54 52 20  20 20 20 20 20 52 31 2c  |}Z  STR      R1,|
0001c7d0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 30 5d 0d  |[R12,#block%+0].|
0001c7e0  7d 64 04 0d 7d 6e 4a 20  4c 44 52 20 20 20 20 20  |}d..}nJ LDR     |
0001c7f0  20 52 31 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R1,[R12,#block%|
0001c800  2b 38 5d 20 20 20 20 20  20 20 20 20 20 20 3b 54  |+8]           ;T|
0001c810  68 69 73 20 69 73 20 74  68 65 20 73 65 6e 64 65  |his is the sende|
0001c820  72 73 20 72 65 66 65 72  65 6e 63 65 2e 0d 7d 78  |rs reference..}x|
0001c830  21 20 53 54 52 20 20 20  20 20 20 52 31 2c 5b 52  |! STR      R1,[R|
0001c840  31 30 2c 23 73 63 72 61  70 72 65 66 25 5d 0d 7d  |10,#scrapref%].}|
0001c850  82 21 20 53 54 52 20 20  20 20 20 20 52 31 2c 5b  |.! STR      R1,[|
0001c860  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 31 32 5d 0d  |R12,#block%+12].|
0001c870  7d 8c 04 0d 7d 96 4a 20  4d 4f 56 20 20 20 20 20  |}...}.J MOV     |
0001c880  20 52 31 2c 23 32 20 20  20 20 20 20 20 20 20 20  | R1,#2          |
0001c890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4d  |              ;M|
0001c8a0  65 73 73 61 67 65 20 6e  75 6d 62 65 72 20 2d 20  |essage number - |
0001c8b0  32 20 44 61 74 61 53 61  76 65 41 63 6b 0d 7d a0  |2 DataSaveAck.}.|
0001c8c0  21 20 53 54 52 20 20 20  20 20 20 52 31 2c 5b 52  |! STR      R1,[R|
0001c8d0  31 32 2c 23 62 6c 6f 63  6b 25 2b 31 36 5d 0d 7d  |12,#block%+16].}|
0001c8e0  aa 04 0d 7d b4 4a 20 41  44 52 20 20 20 20 20 20  |...}.J ADR      |
0001c8f0  52 30 2c 73 63 72 61 70  66 69 6c 65 20 20 20 20  |R0,scrapfile    |
0001c900  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
0001c910  69 73 20 73 65 63 74 69  6f 6e 20 74 61 67 73 20  |is section tags |
0001c920  74 68 65 20 66 69 6c 65  6e 61 6d 65 0d 7d be 52  |the filename.}.R|
0001c930  20 41 44 44 20 20 20 20  20 20 52 31 2c 52 31 32  | ADD      R1,R12|
0001c940  2c 23 62 6c 6f 63 6b 25  2b 34 34 20 20 20 20 20  |,#block%+44     |
0001c950  20 20 20 20 20 20 20 3b  3c 57 69 6d 70 24 53 63  |       ;<Wimp$Sc|
0001c960  72 61 70 3e 20 74 6f 20  74 68 65 20 65 6e 64 20  |rap> to the end |
0001c970  6f 66 20 74 68 65 20 6d  65 73 73 61 67 65 0d 7d  |of the message.}|
0001c980  c8 13 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |.. MOV      R2,#|
0001c990  30 0d 7d d2 1c 20 53 57  49 20 20 20 20 20 20 22  |0.}.. SWI      "|
0001c9a0  53 74 72 69 6e 67 5f 4d  6f 76 65 24 22 0d 7d dc  |String_Move$".}.|
0001c9b0  04 0d 7d e6 52 20 4d 56  4e 20 20 20 20 20 20 52  |..}.R MVN      R|
0001c9c0  31 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 20  |1,#0            |
0001c9d0  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
0001c9e0  73 20 74 65 6c 6c 73 20  74 68 65 20 73 61 76 69  |s tells the savi|
0001c9f0  6e 67 20 61 70 70 6c 69  63 61 74 69 6f 6e 20 74  |ng application t|
0001ca00  68 61 74 0d 7d f0 53 20  53 54 52 20 20 20 20 20  |hat.}.S STR     |
0001ca10  20 52 31 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R1,[R12,#block%|
0001ca20  2b 33 36 5d 20 20 20 20  20 20 20 20 20 20 3b 74  |+36]          ;t|
0001ca30  68 65 20 73 61 76 65 64  20 64 61 74 61 20 69 73  |he saved data is|
0001ca40  20 6e 6f 74 20 27 73 61  66 65 27 20 69 65 20 6f  | not 'safe' ie o|
0001ca50  6e 20 64 69 73 63 0d 7d  fa 04 0d 7e 04 4e 20 4d  |n disc.}...~.N M|
0001ca60  4f 56 20 20 20 20 20 20  52 30 2c 23 31 37 20 20  |OV      R0,#17  |
0001ca70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ca80  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0001ca90  6f 6e 20 73 65 6e 64 73  20 74 68 65 20 44 61 74  |on sends the Dat|
0001caa0  61 53 61 76 65 41 63 6b  0d 7e 0e 47 20 41 44 44  |aSaveAck.~.G ADD|
0001cab0  20 20 20 20 20 20 52 31  2c 52 31 32 2c 23 62 6c  |      R1,R12,#bl|
0001cac0  6f 63 6b 25 20 20 20 20  20 20 20 20 20 20 20 20  |ock%            |
0001cad0  20 20 20 3b 6d 65 73 73  61 67 65 20 74 6f 20 74  |   ;message to t|
0001cae0  68 65 20 73 61 76 69 6e  67 20 74 61 73 6b 2e 0d  |he saving task..|
0001caf0  7e 18 20 20 4c 44 52 20  20 20 20 20 20 52 32 2c  |~.  LDR      R2,|
0001cb00  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 34 5d 0d  |[R12,#block%+4].|
0001cb10  7e 22 20 20 53 57 49 20  20 20 20 20 20 22 57 69  |~"  SWI      "Wi|
0001cb20  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 0d  |mp_SendMessage".|
0001cb30  7e 2c 04 0d 7e 36 1e 4c  44 4d 46 44 20 20 20 20  |~,..~6.LDMFD    |
0001cb40  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
0001cb50  5e 0d 7e 40 04 0d 7e 4a  52 3b 2d 2d 2d 2d 2d 2d  |^.~@..~JR;------|
0001cb60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001cba0  2d 2d 2d 2d 2d 2d 2d 0d  7e 54 4c 3b 20 54 68 69  |-------.~TL; Thi|
0001cbb0  73 20 73 65 63 74 69 6f  6e 20 63 6f 6e 74 61 69  |s section contai|
0001cbc0  6e 73 20 73 74 72 69 6e  67 73 20 77 68 69 63 68  |ns strings which|
0001cbd0  20 61 72 65 20 75 73 65  64 20 62 79 20 74 68 65  | are used by the|
0001cbe0  20 61 62 6f 76 65 20 73  75 62 72 6f 75 74 69 6e  | above subroutin|
0001cbf0  65 73 2e 0d 7e 5e 04 0d  7e 68 0e 2e 73 63 72 61  |es..~^..~h..scra|
0001cc00  70 66 69 6c 65 0d 7e 72  04 0d 7e 7c 1b 45 51 55  |pfile.~r..~|.EQU|
0001cc10  53 20 20 20 20 20 22 3c  57 69 6d 70 24 53 63 72  |S     "<Wimp$Scr|
0001cc20  61 70 3e 22 0d 7e 86 0e  45 51 55 42 20 20 20 20  |ap>".~..EQUB    |
0001cc30  20 30 0d 7e 90 09 41 4c  49 47 4e 0d 7e 9a 04 0d  | 0.~..ALIGN.~...|
0001cc40  7e a4 12 2e 73 63 72 61  70 66 69 6c 65 6e 61 6d  |~...scrapfilenam|
0001cc50  65 0d 7e ae 04 0d 7e b8  19 45 51 55 53 20 20 20  |e.~...~..EQUS   |
0001cc60  20 20 22 57 69 6d 70 24  53 63 72 61 70 22 0d 7e  |  "Wimp$Scrap".~|
0001cc70  c2 0e 45 51 55 42 20 20  20 20 20 30 0d 7e cc 09  |..EQUB     0.~..|
0001cc80  41 4c 49 47 4e 0d 7e d6  04 0d 7e e0 52 3b 2d 2d  |ALIGN.~...~.R;--|
0001cc90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001ccd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 7e ea 47 3b  |-----------.~.G;|
0001cce0  20 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6f  | This section co|
0001ccf0  6e 74 61 69 6e 73 20 74  77 6f 20 77 6f 72 64 73  |ntains two words|
0001cd00  20 6f 66 20 6d 65 6d 6f  72 79 20 77 68 69 63 68  | of memory which|
0001cd10  20 61 72 65 20 75 73 65  64 20 74 6f 20 73 74 6f  | are used to sto|
0001cd20  72 65 0d 7e f4 3a 3b 20  69 6e 66 6f 72 6d 61 74  |re.~.:; informat|
0001cd30  69 6f 6e 20 61 62 6f 75  74 20 74 68 65 20 63 75  |ion about the cu|
0001cd40  72 72 65 6e 74 6c 79 20  6f 70 65 6e 20 6d 65 6e  |rrently open men|
0001cd50  75 20 73 74 72 75 63 74  75 72 65 2e 0d 7e fe 04  |u structure..~..|
0001cd60  0d 7f 08 0d 2e 6d 65 6e  75 69 6e 66 6f 0d 7f 12  |.....menuinfo...|
0001cd70  0e 45 51 55 44 20 20 20  20 20 30 0d 7f 1c 0e 45  |.EQUD     0....E|
0001cd80  51 55 44 20 20 20 20 20  30 0d 7f 26 09 41 4c 49  |QUD     0..&.ALI|
0001cd90  47 4e 0d 7f 30 04 0d 7f  3a 52 3b 2d 2d 2d 2d 2d  |GN..0...:R;-----|
0001cda0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001cde0  2d 2d 2d 2d 2d 2d 2d 2d  0d 7f 44 39 3b 20 20 20  |--------..D9;   |
0001cdf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ce00  20 20 20 20 20 20 20 2a  2a 2a 20 4d 65 6e 75 4f  |       *** MenuO|
0001ce10  70 74 69 6f 6e 53 65 6c  65 63 74 65 64 20 2a 2a  |ptionSelected **|
0001ce20  2a 0d 7f 4e 4f 3b 20 54  68 69 73 20 73 75 62 72  |*..NO; This subr|
0001ce30  6f 75 74 69 6e 65 20 69  73 20 63 61 6c 6c 65 64  |outine is called|
0001ce40  20 77 68 65 6e 20 74 68  65 20 75 73 65 72 20 73  | when the user s|
0001ce50  65 6c 65 63 74 73 20 61  20 6d 65 6e 75 20 6f 70  |elects a menu op|
0001ce60  74 69 6f 6e 20 66 72 6f  6d 20 6f 6e 65 20 6f 66  |tion from one of|
0001ce70  0d 7f 58 10 3b 20 6f 75  72 20 6d 65 6e 75 73 2e  |..X.; our menus.|
0001ce80  0d 7f 62 04 0d 7f 6c 17  2e 4d 65 6e 75 4f 70 74  |..b...l..MenuOpt|
0001ce90  69 6f 6e 53 65 6c 65 63  74 65 64 0d 7f 76 04 0d  |ionSelected..v..|
0001cea0  7f 80 1e 53 54 4d 46 44  20 20 20 20 52 31 33 21  |...STMFD    R13!|
0001ceb0  2c 7b 52 30 2d 52 31 32  2c 52 31 34 7d 0d 7f 8a  |,{R0-R12,R14}...|
0001cec0  04 0d 7f 94 4e 20 41 44  52 20 20 20 20 20 20 52  |....N ADR      R|
0001ced0  37 2c 6d 65 6e 75 69 6e  66 6f 20 20 20 20 20 20  |7,menuinfo      |
0001cee0  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
0001cef0  73 20 73 65 63 74 69 6f  6e 20 66 69 6e 64 73 20  |s section finds |
0001cf00  6f 75 74 20 77 68 69 63  68 20 6d 6f 75 73 65 0d  |out which mouse.|
0001cf10  7f 9e 51 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |..Q MOV      R1,|
0001cf20  52 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R9              |
0001cf30  20 20 20 20 20 20 20 20  20 20 3b 62 75 74 74 6f  |          ;butto|
0001cf40  6e 20 77 61 73 20 75 73  65 64 20 74 6f 20 6d 61  |n was used to ma|
0001cf50  6b 65 20 74 68 65 20 73  65 6c 65 63 74 69 6f 6e  |ke the selection|
0001cf60  0d 7f a8 4e 20 53 57 49  20 20 20 20 20 20 22 57  |...N SWI      "W|
0001cf70  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
0001cf80  66 6f 22 20 20 20 20 20  20 20 20 3b 49 66 20 41  |fo"        ;If A|
0001cf90  64 6a 75 73 74 20 77 61  73 20 75 73 65 64 20 74  |djust was used t|
0001cfa0  68 65 20 6d 65 6e 75 20  73 68 6f 75 6c 64 0d 7f  |he menu should..|
0001cfb0  b2 3d 20 4c 44 52 20 20  20 20 20 20 52 30 2c 5b  |.= LDR      R0,[|
0001cfc0  52 39 2c 23 38 5d 20 20  20 20 20 20 20 20 20 20  |R9,#8]          |
0001cfd0  20 20 20 20 20 20 20 20  20 3b 72 65 6d 61 69 6e  |         ;remain|
0001cfe0  20 6f 6e 20 73 63 72 65  65 6e 2e 0d 7f bc 15 20  | on screen..... |
0001cff0  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 37 5d  |STR      R0,[R7]|
0001d000  0d 7f c6 04 0d 7f d0 4e  20 a4 4c 6f 6e 67 41 64  |.......N .LongAd|
0001d010  72 28 22 22 2c 38 2c 6d  65 6e 75 6c 69 73 74 29  |r("",8,menulist)|
0001d020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0001d030  68 69 73 20 73 65 63 74  69 6f 6e 20 6c 6f 61 64  |his section load|
0001d040  73 20 74 68 65 20 61 64  64 72 65 73 73 65 73 20  |s the addresses |
0001d050  6f 66 0d 7f da 4c 20 4c  44 52 20 20 20 20 20 20  |of...L LDR      |
0001d060  52 30 2c 5b 52 31 32 2c  23 63 75 72 72 65 6e 74  |R0,[R12,#current|
0001d070  6d 65 6e 75 25 5d 20 20  20 20 20 20 20 3b 65 61  |menu%]       ;ea|
0001d080  63 68 20 6f 66 20 74 68  65 20 74 68 72 65 65 20  |ch of the three |
0001d090  70 6f 73 73 69 62 6c 65  20 6d 65 6e 75 73 0d 7f  |possible menus..|
0001d0a0  e4 18 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |.. LDR      R1,[|
0001d0b0  52 38 2c 23 30 5d 0d 7f  ee 18 20 4c 44 52 20 20  |R8,#0].... LDR  |
0001d0c0  20 20 20 20 52 32 2c 5b  52 38 2c 23 34 5d 0d 7f  |    R2,[R8,#4]..|
0001d0d0  f8 18 20 4c 44 52 20 20  20 20 20 20 52 33 2c 5b  |.. LDR      R3,[|
0001d0e0  52 38 2c 23 38 5d 0d 80  02 04 0d 80 0c 04 0d 80  |R8,#8]..........|
0001d0f0  16 50 20 43 4d 50 20 20  20 20 20 20 52 30 2c 52  |.P CMP      R0,R|
0001d100  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
0001d110  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0001d120  65 63 74 69 6f 6e 20 64  65 61 6c 73 20 77 69 74  |ection deals wit|
0001d130  68 20 74 68 65 20 49 63  6f 6e 20 42 61 72 0d 80  |h the Icon Bar..|
0001d140  20 31 20 20 42 4c 45 51  20 20 20 20 20 44 65 63  | 1  BLEQ     Dec|
0001d150  6f 64 65 49 42 4d 65 6e  75 20 20 20 20 20 20 20  |odeIBMenu       |
0001d160  20 20 20 20 20 20 20 20  20 3b 6d 65 6e 75 2e 0d  |         ;menu..|
0001d170  80 2a 04 0d 80 34 51 20  43 4d 50 20 20 20 20 20  |.*...4Q CMP     |
0001d180  20 52 30 2c 52 32 20 20  20 20 20 20 20 20 20 20  | R0,R2          |
0001d190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0001d1a0  68 69 73 20 73 65 63 74  69 6f 6e 20 64 65 61 6c  |his section deal|
0001d1b0  73 20 77 69 74 68 20 74  68 65 20 4d 61 69 6e 20  |s with the Main |
0001d1c0  6d 65 6e 75 0d 80 3e 44  20 20 42 4c 45 51 20 20  |menu..>D  BLEQ  |
0001d1d0  20 20 20 44 65 63 6f 64  65 4d 61 69 6e 4d 65 6e  |   DecodeMainMen|
0001d1e0  75 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |u              ;|
0001d1f0  6f 76 65 72 20 74 68 65  20 44 69 73 70 6c 61 79  |over the Display|
0001d200  20 77 69 6e 64 6f 77 2e  0d 80 48 04 0d 80 52 52  | window...H...RR|
0001d210  20 43 4d 50 20 20 20 20  20 20 52 30 2c 52 33 20  | CMP      R0,R3 |
0001d220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001d230  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
0001d240  74 69 6f 6e 20 64 65 61  6c 73 20 77 69 74 68 20  |tion deals with |
0001d250  74 68 65 20 54 6f 70 69  63 20 6d 65 6e 75 0d 80  |the Topic menu..|
0001d260  5c 47 20 20 42 4c 45 51  20 20 20 20 20 44 65 63  |\G  BLEQ     Dec|
0001d270  6f 64 65 54 6f 70 69 63  4d 65 6e 75 20 20 20 20  |odeTopicMenu    |
0001d280  20 20 20 20 20 20 20 20  20 3b 6f 76 65 72 20 74  |         ;over t|
0001d290  68 65 20 70 6f 70 2d 75  70 20 6d 65 6e 75 20 69  |he pop-up menu i|
0001d2a0  63 6f 6e 73 2e 0d 80 66  04 0d 80 70 52 20 4c 44  |cons...f...pR LD|
0001d2b0  52 20 20 20 20 20 20 52  31 2c 5b 52 37 5d 20 20  |R      R1,[R7]  |
0001d2c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001d2d0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0001d2e0  6e 20 63 68 65 63 6b 73  20 77 68 69 63 68 20 6d  |n checks which m|
0001d2f0  6f 75 73 65 20 62 75 74  74 6f 6e 0d 80 7a 4b 20  |ouse button..zK |
0001d300  54 53 54 20 20 20 20 20  20 52 31 2c 23 28 ac 20  |TST      R1,#(. |
0001d310  31 29 20 80 20 32 35 35  20 20 20 20 20 20 20 20  |1) . 255        |
0001d320  20 20 3b 77 61 73 20 75  73 65 64 20 74 6f 20 73  |  ;was used to s|
0001d330  65 6c 65 63 74 20 74 68  65 20 6d 65 6e 75 20 6f  |elect the menu o|
0001d340  70 74 69 6f 6e 2e 0d 80  84 4f 20 20 4c 44 52 45  |ption....O  LDRE|
0001d350  51 20 20 20 20 52 31 2c  5b 52 31 32 2c 23 63 75  |Q    R1,[R12,#cu|
0001d360  72 72 65 6e 74 6d 65 6e  75 25 5d 20 20 20 20 20  |rrentmenu%]     |
0001d370  20 3b 49 66 20 41 64 6a  75 73 74 20 77 61 73 20  | ;If Adjust was |
0001d380  75 73 65 64 20 74 68 65  20 6d 65 6e 75 20 69 73  |used the menu is|
0001d390  20 6b 65 70 74 0d 80 8e  31 20 20 53 57 49 45 51  | kept...1  SWIEQ|
0001d3a0  20 20 20 20 22 57 69 6d  70 5f 43 72 65 61 74 65  |    "Wimp_Create|
0001d3b0  4d 65 6e 75 22 20 20 20  20 20 20 20 20 20 20 20  |Menu"           |
0001d3c0  3b 6f 70 65 6e 2e 0d 80  98 04 0d 80 a2 1e 4c 44  |;open.........LD|
0001d3d0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
0001d3e0  52 31 32 2c 50 43 7d 5e  0d 80 ac 04 0d 80 b6 52  |R12,PC}^.......R|
0001d3f0  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
0001d400  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001d430  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 80  |--------------..|
0001d440  c0 39 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |.9;             |
0001d450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001d460  20 2a 2a 2a 20 44 65 63  6f 64 65 4d 61 69 6e 4d  | *** DecodeMainM|
0001d470  65 6e 75 20 2a 2a 2a 0d  80 ca 41 3b 54 68 69 73  |enu ***...A;This|
0001d480  20 73 65 63 74 69 6f 6e  20 64 65 61 6c 73 20 77  | section deals w|
0001d490  69 74 68 20 6f 70 74 69  6f 6e 73 20 73 65 6c 65  |ith options sele|
0001d4a0  63 74 65 64 20 66 72 6f  6d 20 74 68 65 20 4d 61  |cted from the Ma|
0001d4b0  69 6e 20 6d 65 6e 75 2e  0d 80 d4 04 0d 80 de 13  |in menu.........|
0001d4c0  2e 44 65 63 6f 64 65 4d  61 69 6e 4d 65 6e 75 0d  |.DecodeMainMenu.|
0001d4d0  80 e8 04 0d 80 f2 1e 53  54 4d 46 44 20 20 20 20  |.......STMFD    |
0001d4e0  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 52 31 34  |R13!,{R0-R12,R14|
0001d4f0  7d 0d 80 fc 04 0d 81 06  4f 20 4c 44 52 20 20 20  |}.......O LDR   |
0001d500  20 20 20 52 31 2c 5b 52  31 32 2c 23 62 6c 6f 63  |   R1,[R12,#bloc|
0001d510  6b 25 2b 30 5d 20 20 20  20 20 20 20 20 20 20 20  |k%+0]           |
0001d520  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 73 74  |;This section st|
0001d530  61 72 74 73 20 61 20 73  65 61 72 63 68 20 69 66  |arts a search if|
0001d540  20 74 68 65 0d 81 10 4e  20 43 4d 50 20 20 20 20  | the...N CMP    |
0001d550  20 20 52 31 2c 23 31 20  20 20 20 20 20 20 20 20  |  R1,#1         |
0001d560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0001d570  75 73 65 72 20 73 65 6c  65 63 74 73 20 53 65 61  |user selects Sea|
0001d580  72 63 68 20 66 72 6f 6d  20 74 68 65 20 6d 65 6e  |rch from the men|
0001d590  75 2e 0d 81 1a 1a 20 20  42 4c 45 51 20 20 20 20  |u.....  BLEQ    |
0001d5a0  20 53 74 61 72 74 53 65  61 72 63 68 0d 81 24 04  | StartSearch..$.|
0001d5b0  0d 81 2e 51 20 43 4d 50  20 20 20 20 20 20 52 31  |...Q CMP      R1|
0001d5c0  2c 23 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#2             |
0001d5d0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001d5e0  20 73 65 63 74 69 6f 6e  20 6f 70 65 6e 73 20 74  | section opens t|
0001d5f0  68 65 20 45 64 69 74 20  77 69 6e 64 6f 77 20 74  |he Edit window t|
0001d600  6f 0d 81 38 47 20 20 ec  51 20 20 20 20 52 30 2c  |o..8G  .Q    R0,|
0001d610  23 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#0              |
0001d620  20 20 20 20 20 20 20 20  20 3b 61 6c 6c 6f 77 20  |         ;allow |
0001d630  74 68 65 20 49 6e 64 65  78 20 74 6f 20 62 65 20  |the Index to be |
0001d640  55 70 64 61 74 65 64 2e  0d 81 42 4e 20 20 53 54  |Updated...BN  ST|
0001d650  52 45 51 20 20 20 20 52  30 2c 5b 52 31 30 2c 23  |REQ    R0,[R10,#|
0001d660  65 64 69 74 72 65 63 6f  72 64 25 5d 20 20 20 20  |editrecord%]    |
0001d670  20 20 20 3b 49 74 20 61  6c 73 6f 20 70 6f 73 69  |   ;It also posi|
0001d680  74 69 6f 6e 73 20 74 68  65 20 63 61 72 65 74 20  |tions the caret |
0001d690  69 6e 20 74 68 65 0d 81  4c 3d 20 20 42 4c 45 51  |in the..L=  BLEQ|
0001d6a0  20 20 20 20 20 67 65 74  63 75 72 72 65 6e 74 69  |     getcurrenti|
0001d6b0  73 73 75 65 20 20 20 20  20 20 20 20 20 20 20 20  |ssue            |
0001d6c0  20 3b 70 61 67 65 20 6e  75 6d 62 65 72 20 69 63  | ;page number ic|
0001d6d0  6f 6e 2e 0d 81 56 1e 20  20 4c 44 52 45 51 20 20  |on...V.  LDREQ  |
0001d6e0  20 20 52 30 2c 5b 52 31  32 2c 23 65 64 69 74 25  |  R0,[R12,#edit%|
0001d6f0  5d 0d 81 60 1d 20 20 41  44 44 45 51 20 20 20 20  |]..`.  ADDEQ    |
0001d700  52 31 2c 52 31 32 2c 23  62 6c 6f 63 6b 25 0d 81  |R1,R12,#block%..|
0001d710  6a 1f 20 20 53 54 52 45  51 20 20 20 20 52 30 2c  |j.  STREQ    R0,|
0001d720  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 5d 0d 81 74  |[R12,#block%]..t|
0001d730  24 20 20 53 57 49 45 51  20 20 20 20 22 57 69 6d  |$  SWIEQ    "Wim|
0001d740  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
0001d750  22 0d 81 7e 20 20 20 53  57 49 45 51 20 20 20 20  |"..~   SWIEQ    |
0001d760  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
0001d770  22 0d 81 88 1e 20 20 4c  44 52 45 51 20 20 20 20  |"....  LDREQ    |
0001d780  52 30 2c 5b 52 31 32 2c  23 65 64 69 74 25 5d 0d  |R0,[R12,#edit%].|
0001d790  81 92 12 20 20 ec 51 20  20 20 20 52 31 2c 23 32  |...  .Q    R1,#2|
0001d7a0  30 0d 81 9c 14 20 20 4d  56 4e 45 51 20 20 20 20  |0....  MVNEQ    |
0001d7b0  52 34 2c 23 30 0d 81 a6  11 20 20 ec 51 20 20 20  |R4,#0....  .Q   |
0001d7c0  20 52 35 2c 23 30 0d 81  b0 26 20 20 53 57 49 45  | R5,#0...&  SWIE|
0001d7d0  51 20 20 20 20 22 57 69  6d 70 5f 53 65 74 43 61  |Q    "Wimp_SetCa|
0001d7e0  72 65 74 50 6f 73 69 74  69 6f 6e 22 0d 81 ba 04  |retPosition"....|
0001d7f0  0d 81 c4 4f 20 43 4d 50  20 20 20 20 20 20 52 31  |...O CMP      R1|
0001d800  2c 23 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#4             |
0001d810  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001d820  20 73 73 65 63 74 69 6f  6e 20 73 65 74 73 20 6f  | ssection sets o|
0001d830  75 72 20 51 75 69 74 20  66 6c 61 67 20 74 6f 0d  |ur Quit flag to.|
0001d840  81 ce 4f 20 20 ec 51 20  20 20 20 52 31 2c 23 31  |..O  .Q    R1,#1|
0001d850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001d860  20 20 20 20 20 20 20 3b  31 20 74 6f 20 69 6e 64  |       ;1 to ind|
0001d870  69 63 61 74 65 20 74 68  61 74 20 77 65 20 73 68  |icate that we sh|
0001d880  6f 75 6c 64 20 71 75 69  74 20 77 68 65 6e 0d 81  |ould quit when..|
0001d890  d8 4c 20 20 53 54 52 45  51 20 20 20 20 52 31 2c  |.L  STREQ    R1,|
0001d8a0  5b 52 31 32 2c 23 71 75  69 74 25 5d 20 20 20 20  |[R12,#quit%]    |
0001d8b0  20 20 20 20 20 20 20 20  20 3b 77 65 20 72 65 74  |         ;we ret|
0001d8c0  75 72 6e 20 74 6f 20 6f  75 72 20 57 69 6d 70 5f  |urn to our Wimp_|
0001d8d0  50 6f 6c 6c 20 6c 6f 6f  70 2e 0d 81 e2 04 0d 81  |Poll loop.......|
0001d8e0  ec 1e 4c 44 4d 46 44 20  20 20 20 52 31 33 21 2c  |..LDMFD    R13!,|
0001d8f0  7b 52 30 2d 52 31 32 2c  50 43 7d 5e 0d 81 f6 04  |{R0-R12,PC}^....|
0001d900  0d 82 00 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...R;-----------|
0001d910  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001d950  2d 2d 0d 82 0a 50 3b 20  54 68 69 73 20 73 65 63  |--...P; This sec|
0001d960  74 69 6f 6e 20 63 6f 6e  74 61 69 6e 73 20 73 74  |tion contains st|
0001d970  72 69 6e 67 73 20 74 68  61 74 20 61 72 65 20 75  |rings that are u|
0001d980  73 65 64 20 74 6f 20 67  65 74 20 74 68 65 20 4d  |sed to get the M|
0001d990  6f 6e 74 68 20 61 6e 64  20 59 65 61 72 20 66 72  |onth and Year fr|
0001d9a0  6f 6d 0d 82 14 50 3b 20  74 68 65 20 55 54 43 20  |om...P; the UTC |
0001d9b0  66 6f 72 6d 61 74 20 74  68 61 74 20 74 68 65 20  |format that the |
0001d9c0  69 6e 74 65 72 6e 61 6c  20 73 79 73 74 65 6d 20  |internal system |
0001d9d0  63 6c 6f 63 6b 20 67 69  76 65 73 20 69 6e 74 6f  |clock gives into|
0001d9e0  20 61 20 73 75 69 74 61  62 6c 65 20 66 6f 72 6d  | a suitable form|
0001d9f0  61 74 0d 82 1e 21 3b 20  66 6f 72 20 75 73 65 20  |at...!; for use |
0001da00  62 79 20 6f 75 72 20 61  70 70 6c 69 63 61 74 69  |by our applicati|
0001da10  6f 6e 2e 0d 82 28 04 0d  82 32 10 2e 6d 6f 6e 74  |on...(...2..mont|
0001da20  68 73 74 72 69 6e 67 0d  82 3c 04 0d 82 46 3e 45  |hstring..<...F>E|
0001da30  51 55 53 20 20 20 20 20  22 25 4d 4e 22 20 20 20  |QUS     "%MN"   |
0001da40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001da50  20 20 20 20 20 20 3b 4d  6f 6e 74 68 20 61 73 20  |      ;Month as |
0001da60  61 20 6e 75 6d 62 65 72  2e 0d 82 50 0e 45 51 55  |a number...P.EQU|
0001da70  42 20 20 20 20 20 30 0d  82 5a 04 0d 82 64 04 0d  |B     0..Z...d..|
0001da80  82 6e 0f 2e 79 65 61 72  73 74 72 69 6e 67 0d 82  |.n..yearstring..|
0001da90  78 04 0d 82 82 4b 45 51  55 53 20 20 20 20 20 22  |x....KEQUS     "|
0001daa0  25 43 45 25 59 52 22 20  20 20 20 20 20 20 20 20  |%CE%YR"         |
0001dab0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 43 65  |             ;Ce|
0001dac0  6e 74 75 72 79 20 6e 75  6d 62 65 72 20 61 6e 64  |ntury number and|
0001dad0  20 79 65 61 72 20 6e 75  6d 62 65 72 2e 0d 82 8c  | year number....|
0001dae0  0e 45 51 55 42 20 20 20  20 20 30 0d 82 96 04 0d  |.EQUB     0.....|
0001daf0  82 a0 52 3b 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..R;------------|
0001db00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001db40  2d 0d 82 aa 4f 3b 20 54  68 69 73 20 73 65 63 74  |-...O; This sect|
0001db50  69 6f 6e 20 63 6f 6e 74  61 69 6e 73 20 61 20 66  |ion contains a f|
0001db60  69 76 65 2d 62 79 74 65  20 64 61 74 61 20 62 6c  |ive-byte data bl|
0001db70  6f 63 6b 20 77 68 69 63  68 20 69 73 20 66 69 6c  |ock which is fil|
0001db80  6c 65 64 20 77 69 74 68  20 74 68 65 20 55 54 43  |led with the UTC|
0001db90  0d 82 b4 38 3b 20 28 55  6e 69 76 65 72 73 61 6c  |...8; (Universal|
0001dba0  20 54 69 6d 65 20 43 6f  6f 72 64 69 6e 61 74 65  | Time Coordinate|
0001dbb0  29 20 66 72 6f 6d 20 74  68 65 20 53 79 73 74 65  |) from the Syste|
0001dbc0  6d 20 63 6c 6f 63 6b 2e  0d 82 be 04 0d 82 c8 09  |m clock.........|
0001dbd0  2e 74 69 6d 65 0d 82 d2  04 0d 82 dc 0e 45 51 55  |.time........EQU|
0001dbe0  42 20 20 20 20 20 33 0d  82 e6 0e 45 51 55 42 20  |B     3....EQUB |
0001dbf0  20 20 20 20 30 0d 82 f0  0e 45 51 55 42 20 20 20  |    0....EQUB   |
0001dc00  20 20 30 0d 82 fa 0e 45  51 55 42 20 20 20 20 20  |  0....EQUB     |
0001dc10  30 0d 83 04 0e 45 51 55  42 20 20 20 20 20 30 0d  |0....EQUB     0.|
0001dc20  83 0e 09 41 4c 49 47 4e  0d 83 18 04 0d 83 22 52  |...ALIGN......"R|
0001dc30  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
0001dc40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001dc70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 83  |--------------..|
0001dc80  2c 36 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |,6;             |
0001dc90  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2a 2a  |             ***|
0001dca0  20 47 65 74 43 75 72 72  65 6e 74 49 73 73 75 65  | GetCurrentIssue|
0001dcb0  20 2a 2a 2a 0d 83 36 50  3b 20 54 68 69 73 20 73  | ***..6P; This s|
0001dcc0  65 63 74 69 6f 6e 20 72  65 61 64 73 20 74 68 65  |ection reads the|
0001dcd0  20 74 69 6d 65 20 66 72  6f 6d 20 74 68 65 20 73  | time from the s|
0001dce0  79 73 74 65 6d 20 63 6c  6f 63 6b 20 61 6e 64 20  |ystem clock and |
0001dcf0  75 73 65 73 20 69 74 20  74 6f 20 63 61 6c 63 75  |uses it to calcu|
0001dd00  6c 61 74 65 0d 83 40 50  3b 20 76 61 6c 75 65 73  |late..@P; values|
0001dd10  20 66 6f 72 20 74 68 65  20 63 75 72 72 65 6e 74  | for the current|
0001dd20  20 4d 6f 6e 74 68 2c 20  59 65 61 72 20 61 6e 64  | Month, Year and|
0001dd30  20 49 73 73 75 65 20 4e  75 6d 62 65 72 2e 20 54  | Issue Number. T|
0001dd40  68 69 73 20 61 73 73 69  73 74 73 20 74 68 65 20  |his assists the |
0001dd50  75 73 65 72 0d 83 4a 3a  3b 20 77 68 65 6e 20 74  |user..J:; when t|
0001dd60  68 65 79 20 63 6f 6d 65  20 74 6f 20 75 70 64 61  |hey come to upda|
0001dd70  74 65 20 74 68 65 20 69  6e 64 65 78 20 77 69 74  |te the index wit|
0001dd80  68 20 61 20 6e 65 77 20  69 73 73 75 65 2e 0d 83  |h a new issue...|
0001dd90  54 04 0d 83 5e 14 2e 67  65 74 63 75 72 72 65 6e  |T...^..getcurren|
0001dda0  74 69 73 73 75 65 0d 83  68 04 0d 83 72 1e 53 54  |tissue..h...r.ST|
0001ddb0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
0001ddc0  52 31 32 2c 52 31 34 7d  0d 83 7c 04 0d 83 86 3b  |R12,R14}..|....;|
0001ddd0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 31 34  | MOV      R0,#14|
0001dde0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ddf0  20 20 20 20 20 20 20 3b  52 65 61 64 20 43 4d 4f  |       ;Read CMO|
0001de00  53 20 43 6c 6f 63 6b 0d  83 90 15 20 41 44 52 20  |S Clock.... ADR |
0001de10  20 20 20 20 20 52 31 2c  74 69 6d 65 0d 83 9a 17  |     R1,time....|
0001de20  20 53 57 49 20 20 20 20  20 20 22 4f 53 5f 57 6f  | SWI      "OS_Wo|
0001de30  72 64 22 0d 83 a4 04 0d  83 ae 50 20 4d 4f 56 20  |rd".......P MOV |
0001de40  20 20 20 20 20 52 30 2c  52 31 20 20 20 20 20 20  |     R0,R1      |
0001de50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001de60  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0001de70  63 6f 6e 76 65 72 74 73  20 74 68 65 20 35 2d 62  |converts the 5-b|
0001de80  79 74 65 20 55 54 43 0d  83 b8 4c 20 4d 4f 56 20  |yte UTC...L MOV |
0001de90  20 20 20 20 20 52 31 2c  52 39 20 20 20 20 20 20  |     R1,R9      |
0001dea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001deb0  20 20 3b 69 6e 74 6f 20  61 20 4d 6f 6e 74 68 20  |  ;into a Month |
0001dec0  6e 75 6d 62 65 72 20 61  73 20 61 20 73 74 72 69  |number as a stri|
0001ded0  6e 67 2e 0d 83 c2 16 20  4d 4f 56 20 20 20 20 20  |ng..... MOV     |
0001dee0  20 52 32 2c 23 26 31 30  30 0d 83 cc 1c 20 41 44  | R2,#&100.... AD|
0001def0  52 20 20 20 20 20 20 52  33 2c 6d 6f 6e 74 68 73  |R      R3,months|
0001df00  74 72 69 6e 67 0d 83 d6  25 20 53 57 49 20 20 20  |tring...% SWI   |
0001df10  20 20 20 22 4f 53 5f 43  6f 6e 76 65 72 74 44 61  |   "OS_ConvertDa|
0001df20  74 65 41 6e 64 54 69 6d  65 22 0d 83 e0 04 0d 83  |teAndTime"......|
0001df30  ea 4e 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 23  |.N MOV      R1,#|
0001df40  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
0001df50  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 67  |         ;This g|
0001df60  65 74 73 20 74 68 65 20  76 61 6c 75 65 20 6f 66  |ets the value of|
0001df70  20 74 68 65 20 63 75 72  72 65 6e 74 0d 83 f4 50  | the current...P|
0001df80  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
0001df90  67 5f 56 61 6c 22 20 20  20 20 20 20 20 20 20 20  |g_Val"          |
0001dfa0  20 20 20 20 20 20 20 3b  6d 6f 6e 74 68 20 6e 75  |       ;month nu|
0001dfb0  6d 62 65 72 20 61 6e 64  20 73 74 6f 72 65 73 20  |mber and stores |
0001dfc0  69 74 20 66 6f 72 20 6c  61 74 65 72 0d 83 fe 51  |it for later...Q|
0001dfd0  20 41 44 44 20 20 20 20  20 20 52 38 2c 52 31 2c  | ADD      R8,R1,|
0001dfe0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
0001dff0  20 20 20 20 20 20 20 3b  72 65 66 65 72 65 6e 63  |       ;referenc|
0001e000  65 20 74 6f 20 74 68 65  20 6d 6f 6e 74 68 20 6c  |e to the month l|
0001e010  6f 6f 6b 2d 75 70 20 74  61 62 6c 65 2e 0d 84 08  |ook-up table....|
0001e020  22 20 53 54 52 20 20 20  20 20 20 52 38 2c 5b 52  |" STR      R8,[R|
0001e030  31 30 2c 23 65 64 69 74  6d 6f 6e 74 68 25 5d 0d  |10,#editmonth%].|
0001e040  84 12 04 0d 84 1c 52 20  4d 4f 56 20 20 20 20 20  |......R MOV     |
0001e050  20 52 32 2c 23 6d 6f 6e  74 68 73 25 2d 26 31 30  | R2,#months%-&10|
0001e060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0001e070  68 69 73 20 73 65 63 74  69 6f 6e 20 6c 6f 6f 6b  |his section look|
0001e080  73 20 75 70 20 74 68 65  20 6d 6f 6e 74 68 20 6e  |s up the month n|
0001e090  75 6d 62 65 72 0d 84 26  51 20 41 44 44 20 20 20  |umber..&Q ADD   |
0001e0a0  20 20 20 52 32 2c 52 32  2c 52 38 2c 4c 53 4c 20  |   R2,R2,R8,LSL |
0001e0b0  23 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#4              |
0001e0c0  3b 69 6e 20 74 68 65 20  6c 6f 6f 6b 2d 75 70 20  |;in the look-up |
0001e0d0  74 61 62 6c 65 20 61 6e  64 20 66 69 6c 6c 73 20  |table and fills |
0001e0e0  69 6e 20 74 68 65 0d 84  30 4a 20 41 44 44 20 20  |in the..0J ADD  |
0001e0f0  20 20 20 20 52 32 2c 52  31 30 2c 52 32 20 20 20  |    R2,R10,R2   |
0001e100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001e110  20 3b 4d 6f 6e 74 68 20  69 63 6f 6e 20 69 6e 20  | ;Month icon in |
0001e120  74 68 65 20 45 64 69 74  20 77 69 6e 64 6f 77 2e  |the Edit window.|
0001e130  0d 84 3a 14 20 4d 4f 56  20 20 20 20 20 20 52 31  |..:. MOV      R1|
0001e140  2c 23 31 37 0d 84 44 1d  20 4c 44 52 20 20 20 20  |,#17..D. LDR    |
0001e150  20 20 52 30 2c 5b 52 31  32 2c 23 65 64 69 74 25  |  R0,[R12,#edit%|
0001e160  5d 0d 84 4e 17 20 42 4c  20 20 20 20 20 20 20 57  |]..N. BL       W|
0001e170  72 69 74 65 49 63 6f 6e  0d 84 58 04 0d 84 62 50  |riteIcon..X...bP|
0001e180  20 41 44 52 20 20 20 20  20 20 52 30 2c 74 69 6d  | ADR      R0,tim|
0001e190  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e               |
0001e1a0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
0001e1b0  74 69 6f 6e 20 63 6f 6e  76 65 72 74 73 20 74 68  |tion converts th|
0001e1c0  65 20 35 2d 62 79 74 65  20 55 54 43 0d 84 6c 49  |e 5-byte UTC..lI|
0001e1d0  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 52 39 20  | MOV      R1,R9 |
0001e1e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001e1f0  20 20 20 20 20 20 20 3b  74 6f 20 61 20 59 65 61  |       ;to a Yea|
0001e200  72 20 6e 75 6d 62 65 72  20 61 73 20 61 20 73 74  |r number as a st|
0001e210  72 69 6e 67 2e 0d 84 76  16 20 4d 4f 56 20 20 20  |ring...v. MOV   |
0001e220  20 20 20 52 32 2c 23 26  31 30 30 0d 84 80 1b 20  |   R2,#&100.... |
0001e230  41 44 52 20 20 20 20 20  20 52 33 2c 79 65 61 72  |ADR      R3,year|
0001e240  73 74 72 69 6e 67 0d 84  8a 25 20 53 57 49 20 20  |string...% SWI  |
0001e250  20 20 20 20 22 4f 53 5f  43 6f 6e 76 65 72 74 44  |    "OS_ConvertD|
0001e260  61 74 65 41 6e 64 54 69  6d 65 22 0d 84 94 04 0d  |ateAndTime".....|
0001e270  84 9e 4e 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |..N MOV      R0,|
0001e280  23 31 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |#13             |
0001e290  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001e2a0  73 65 63 74 69 6f 6e 20  67 65 74 73 20 74 68 65  |section gets the|
0001e2b0  20 76 61 6c 75 65 20 6f  66 20 74 68 65 0d 84 a8  | value of the...|
0001e2c0  38 20 53 54 52 42 20 20  20 20 20 52 30 2c 5b 52  |8 STRB     R0,[R|
0001e2d0  31 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1]              |
0001e2e0  20 20 20 20 20 20 20 20  3b 59 65 61 72 20 6e 75  |        ;Year nu|
0001e2f0  6d 62 65 72 2e 0d 84 b2  13 20 4d 4f 56 20 20 20  |mber..... MOV   |
0001e300  20 20 20 52 30 2c 52 39  0d 84 bc 14 20 4d 4f 56  |   R0,R9.... MOV|
0001e310  20 20 20 20 20 20 52 31  2c 23 31 33 0d 84 c6 1a  |      R1,#13....|
0001e320  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
0001e330  67 5f 56 61 6c 22 0d 84  d0 13 20 4d 4f 56 20 20  |g_Val".... MOV  |
0001e340  20 20 20 20 52 37 2c 52  31 0d 84 da 04 0d 84 e4  |    R7,R1.......|
0001e350  51 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 23 31  |Q MOV      R1,#1|
0001e360  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
0001e370  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0001e380  63 74 69 6f 6e 20 77 72  69 74 65 73 20 74 68 65  |ction writes the|
0001e390  20 73 74 72 69 6e 67 20  6f 66 20 74 68 65 0d 84  | string of the..|
0001e3a0  ee 51 20 4c 44 52 20 20  20 20 20 20 52 30 2c 5b  |.Q LDR      R0,[|
0001e3b0  52 31 32 2c 23 65 64 69  74 25 5d 20 20 20 20 20  |R12,#edit%]     |
0001e3c0  20 20 20 20 20 20 20 20  20 3b 79 65 61 72 20 6e  |         ;year n|
0001e3d0  75 6d 62 65 72 20 69 6e  74 6f 20 74 68 65 20 59  |umber into the Y|
0001e3e0  65 61 72 20 69 63 6f 6e  20 69 6e 20 74 68 65 0d  |ear icon in the.|
0001e3f0  84 f8 38 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |..8 MOV      R2,|
0001e400  52 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R9              |
0001e410  20 20 20 20 20 20 20 20  20 20 3b 45 64 69 74 20  |          ;Edit |
0001e420  77 69 6e 64 6f 77 2e 0d  85 02 17 20 42 4c 20 20  |window..... BL  |
0001e430  20 20 20 20 20 57 72 69  74 65 49 63 6f 6e 0d 85  |     WriteIcon..|
0001e440  0c 04 0d 85 16 04 0d 85  20 4d 20 4d 4f 56 20 20  |........ M MOV  |
0001e450  20 20 20 20 52 30 2c 20  20 20 23 26 37 43 30 20  |    R0,   #&7C0 |
0001e460  20 20 20 20 20 3b 20 31  39 39 34 20 20 20 20 20  |     ; 1994     |
0001e470  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
0001e480  61 6c 63 75 6c 61 74 65  73 20 74 68 65 20 49 73  |alculates the Is|
0001e490  73 75 65 0d 85 2a 48 20  41 44 44 20 20 20 20 20  |sue..*H ADD     |
0001e4a0  20 52 30 2c 52 30 2c 23  26 30 30 41 20 20 20 20  | R0,R0,#&00A    |
0001e4b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 6e  |              ;n|
0001e4c0  75 6d 62 65 72 20 6f 66  20 74 68 65 20 63 75 72  |umber of the cur|
0001e4d0  72 65 6e 74 20 69 73 73  75 65 2e 0d 85 34 16 20  |rent issue...4. |
0001e4e0  53 55 42 20 20 20 20 20  20 52 37 2c 52 37 2c 52  |SUB      R7,R7,R|
0001e4f0  30 0d 85 3e 24 20 4d 4f  56 20 20 20 20 20 20 52  |0..>$ MOV      R|
0001e500  30 2c 20 20 20 52 37 2c  20 4c 53 4c 20 23 33 20  |0,   R7, LSL #3 |
0001e510  3b 20 2a 31 33 0d 85 48  1e 20 41 44 44 20 20 20  |; *13..H. ADD   |
0001e520  20 20 20 52 30 2c 52 30  2c 52 37 2c 20 4c 53 4c  |   R0,R0,R7, LSL|
0001e530  20 23 32 0d 85 52 16 20  41 44 44 20 20 20 20 20  | #2..R. ADD     |
0001e540  20 52 30 2c 52 30 2c 52  37 0d 85 5c 16 20 41 44  | R0,R0,R7..\. AD|
0001e550  44 20 20 20 20 20 20 52  30 2c 52 30 2c 52 38 0d  |D      R0,R0,R8.|
0001e560  85 66 18 20 41 44 44 20  20 20 20 20 20 52 30 2c  |.f. ADD      R0,|
0001e570  52 30 2c 23 31 33 37 0d  85 70 13 20 4d 4f 56 20  |R0,#137..p. MOV |
0001e580  20 20 20 20 20 52 31 2c  52 39 0d 85 7a 16 20 4d  |     R1,R9..z. M|
0001e590  4f 56 20 20 20 20 20 20  52 32 2c 23 26 31 30 30  |OV      R2,#&100|
0001e5a0  0d 85 84 22 20 53 57 49  20 20 20 20 20 20 22 4f  |..." SWI      "O|
0001e5b0  53 5f 43 6f 6e 76 65 72  74 49 6e 74 65 67 65 72  |S_ConvertInteger|
0001e5c0  32 22 0d 85 8e 14 20 4d  4f 56 20 20 20 20 20 20  |2".... MOV      |
0001e5d0  52 30 2c 23 31 33 0d 85  98 15 20 53 54 52 42 20  |R0,#13.... STRB |
0001e5e0  20 20 20 20 52 30 2c 5b  52 31 5d 0d 85 a2 04 0d  |    R0,[R1].....|
0001e5f0  85 ac 50 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |..P MOV      R1,|
0001e600  23 31 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |#19             |
0001e610  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
0001e620  73 65 63 74 69 6f 6e 20  77 72 69 74 65 73 20 74  |section writes t|
0001e630  68 65 20 49 73 73 75 65  20 6e 75 6d 62 65 72 0d  |he Issue number.|
0001e640  85 b6 46 20 4c 44 52 20  20 20 20 20 20 52 30 2c  |..F LDR      R0,|
0001e650  5b 52 31 32 2c 23 65 64  69 74 25 5d 20 20 20 20  |[R12,#edit%]    |
0001e660  20 20 20 20 20 20 20 20  20 20 3b 69 6e 74 6f 20  |          ;into |
0001e670  74 68 65 20 61 70 70 72  6f 70 72 69 61 74 65 20  |the appropriate |
0001e680  69 63 6f 6e 2e 0d 85 c0  13 20 4d 4f 56 20 20 20  |icon..... MOV   |
0001e690  20 20 20 52 32 2c 52 39  0d 85 ca 17 20 42 4c 20  |   R2,R9.... BL |
0001e6a0  20 20 20 20 20 20 57 72  69 74 65 49 63 6f 6e 0d  |      WriteIcon.|
0001e6b0  85 d4 04 0d 85 de 50 20  4d 4f 56 20 20 20 20 20  |......P MOV     |
0001e6c0  20 52 30 2c 23 31 33 20  20 20 20 20 20 20 20 20  | R0,#13         |
0001e6d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
0001e6e0  68 69 73 20 73 65 63 74  69 6f 6e 20 62 6c 61 6e  |his section blan|
0001e6f0  6b 73 20 74 68 65 20 70  61 67 65 20 6e 75 6d 62  |ks the page numb|
0001e700  65 72 2c 0d 85 e8 48 20  53 54 52 20 20 20 20 20  |er,...H STR     |
0001e710  20 52 30 2c 5b 52 39 5d  20 20 20 20 20 20 20 20  | R0,[R9]        |
0001e720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
0001e730  6f 70 69 63 20 61 6e 64  20 64 65 73 63 72 69 70  |opic and descrip|
0001e740  74 69 6f 6e 20 69 63 6f  6e 73 2e 0d 85 f2 1d 20  |tion icons..... |
0001e750  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
0001e760  2c 23 65 64 69 74 25 5d  0d 85 fc 13 20 4d 4f 56  |,#edit%].... MOV|
0001e770  20 20 20 20 20 20 52 32  2c 52 39 0d 86 06 14 20  |      R2,R9.... |
0001e780  4d 4f 56 20 20 20 20 20  20 52 31 2c 23 32 30 0d  |MOV      R1,#20.|
0001e790  86 10 17 20 42 4c 20 20  20 20 20 20 20 57 72 69  |... BL       Wri|
0001e7a0  74 65 49 63 6f 6e 0d 86  1a 14 20 4d 4f 56 20 20  |teIcon.... MOV  |
0001e7b0  20 20 20 20 52 31 2c 23  32 31 0d 86 24 17 20 42  |    R1,#21..$. B|
0001e7c0  4c 20 20 20 20 20 20 20  57 72 69 74 65 49 63 6f  |L       WriteIco|
0001e7d0  6e 0d 86 2e 14 20 4d 4f  56 20 20 20 20 20 20 52  |n.... MOV      R|
0001e7e0  31 2c 23 32 32 0d 86 38  17 20 42 4c 20 20 20 20  |1,#22..8. BL    |
0001e7f0  20 20 20 57 72 69 74 65  49 63 6f 6e 0d 86 42 04  |   WriteIcon..B.|
0001e800  0d 86 4c 38 20 53 54 52  20 20 20 20 20 20 52 30  |..L8 STR      R0|
0001e810  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 30 5d  |,[R12,#block%+0]|
0001e820  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001e830  20 73 65 63 74 69 6f 6e  0d 86 56 14 20 4d 4f 56  | section..V. MOV|
0001e840  20 20 20 20 20 20 52 30  2c 23 32 36 0d 86 60 20  |      R0,#26..` |
0001e850  20 53 54 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | STR      R0,[R1|
0001e860  32 2c 23 62 6c 6f 63 6b  25 2b 34 5d 0d 86 6a 18  |2,#block%+4]..j.|
0001e870  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 25 31  | MOV      R0,#%1|
0001e880  3c 3c 32 33 0d 86 74 20  20 53 54 52 20 20 20 20  |<<23..t  STR    |
0001e890  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
0001e8a0  25 2b 38 5d 0d 86 7e 21  20 53 54 52 20 20 20 20  |%+8]..~! STR    |
0001e8b0  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
0001e8c0  25 2b 31 32 5d 0d 86 88  1c 20 41 44 44 20 20 20  |%+12].... ADD   |
0001e8d0  20 20 20 52 31 2c 52 31  32 2c 23 62 6c 6f 63 6b  |   R1,R12,#block|
0001e8e0  25 0d 86 92 21 20 53 57  49 20 20 20 20 20 20 22  |%...! SWI      "|
0001e8f0  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
0001e900  65 22 0d 86 9c 04 0d 86  a6 1e 4c 44 4d 46 44 20  |e"........LDMFD |
0001e910  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
0001e920  50 43 7d 5e 0d 86 b0 04  0d 86 ba 52 3b 2d 2d 2d  |PC}^.......R;---|
0001e930  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001e970  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 86 c4 38 3b 20  |----------...8; |
0001e980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001e990  20 20 20 20 20 20 20 20  20 20 20 20 2a 2a 2a 20  |            *** |
0001e9a0  55 70 64 61 74 65 4c 65  61 66 4e 61 6d 65 20 2a  |UpdateLeafName *|
0001e9b0  2a 2a 0d 86 ce 4a 3b 20  54 68 69 73 20 73 65 63  |**...J; This sec|
0001e9c0  74 69 6f 6e 20 63 68 61  6e 67 65 73 20 74 68 65  |tion changes the|
0001e9d0  20 64 65 66 61 75 6c 74  20 6c 65 61 66 6e 61 6d  | default leafnam|
0001e9e0  65 2c 20 77 68 69 63 68  20 69 73 20 77 72 69 74  |e, which is writ|
0001e9f0  74 65 6e 20 69 6e 74 6f  20 74 68 65 0d 86 d8 51  |ten into the...Q|
0001ea00  3b 20 66 69 6c 65 6e 61  6d 65 20 69 63 6f 6e 20  |; filename icon |
0001ea10  69 6e 20 74 68 65 20 73  61 76 65 20 77 69 6e 64  |in the save wind|
0001ea20  6f 77 2c 20 77 68 65 6e  20 74 68 65 20 75 73 65  |ow, when the use|
0001ea30  72 20 63 68 61 6e 67 65  73 20 74 68 65 20 49 73  |r changes the Is|
0001ea40  73 75 65 20 74 68 61 74  20 74 68 65 79 0d 86 e2  |sue that they...|
0001ea50  13 3b 20 77 69 73 68 20  74 6f 20 73 61 76 65 2e  |.; wish to save.|
0001ea60  0d 86 ec 04 0d 86 f6 13  2e 55 70 64 61 74 65 4c  |.........UpdateL|
0001ea70  65 61 66 4e 61 6d 65 0d  87 00 04 0d 87 0a 1e 53  |eafName........S|
0001ea80  54 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |TMFD    R13!,{R0|
0001ea90  2d 52 31 32 2c 52 31 34  7d 0d 87 14 04 0d 87 1e  |-R12,R14}.......|
0001eaa0  4c 20 4c 44 52 20 20 20  20 20 20 20 52 30 2c 5b  |L LDR       R0,[|
0001eab0  52 31 30 2c 23 6d 75 6c  74 69 70 6c 65 25 5d 20  |R10,#multiple%] |
0001eac0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0001ead0  63 74 69 6f 6e 20 73 68  61 64 65 73 20 74 68 65  |ction shades the|
0001eae0  20 6d 75 6c 74 69 70 6c  65 0d 87 28 4f 20 43 4d  | multiple..(O CM|
0001eaf0  50 20 20 20 20 20 20 20  52 30 2c 23 30 20 20 20  |P       R0,#0   |
0001eb00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001eb10  20 20 20 20 3b 69 73 73  75 65 73 20 73 65 63 74  |    ;issues sect|
0001eb20  69 6f 6e 20 6f 66 20 74  68 65 20 77 69 6e 64 6f  |ion of the windo|
0001eb30  77 20 69 66 20 74 68 65  0d 87 32 4c 20 20 4c 44  |w if the..2L  LD|
0001eb40  52 4e 45 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |RNE    R0,[R12,#|
0001eb50  73 61 76 65 25 5d 20 20  20 20 20 20 20 20 20 20  |save%]          |
0001eb60  20 20 20 3b 4d 75 6c 74  69 70 6c 65 20 6f 70 74  |   ;Multiple opt|
0001eb70  69 6f 6e 20 69 73 20 6e  6f 74 20 73 65 6c 65 63  |ion is not selec|
0001eb80  74 65 64 2e 0d 87 3c 51  20 20 4d 4f 56 4e 45 20  |ted...<Q  MOVNE |
0001eb90  20 20 20 52 31 2c 23 32  20 20 20 20 20 20 20 20  |   R1,#2        |
0001eba0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0001ebb0  49 66 20 69 74 20 69 73  20 73 65 6c 65 63 74 65  |If it is selecte|
0001ebc0  64 20 74 68 65 6e 20 61  20 64 65 66 61 75 6c 74  |d then a default|
0001ebd0  20 6e 61 6d 65 0d 87 46  42 20 20 41 44 52 4e 45  | name..FB  ADRNE|
0001ebe0  20 20 20 20 52 32 2c 6d  75 6c 74 69 70 6c 65 20  |    R2,multiple |
0001ebf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001ec00  3b 6f 66 20 27 4d 75 6c  74 69 70 6c 65 27 20 69  |;of 'Multiple' i|
0001ec10  73 20 75 73 65 64 2e 0d  87 50 18 20 20 42 4c 4e  |s used...P.  BLN|
0001ec20  45 20 20 20 20 20 57 72  69 74 65 49 63 6f 6e 0d  |E     WriteIcon.|
0001ec30  87 5a 1a 20 20 42 4c 4e  45 20 20 20 20 20 55 6e  |.Z.  BLNE     Un|
0001ec40  73 68 61 64 65 53 61 76  65 0d 87 64 18 20 20 42  |shadeSave..d.  B|
0001ec50  4c 45 51 20 20 20 20 20  53 68 61 64 65 53 61 76  |LEQ     ShadeSav|
0001ec60  65 0d 87 6e 20 20 20 4c  44 4d 4e 45 46 44 20 20  |e..n   LDMNEFD  |
0001ec70  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 50 43 7d  |R13!,{R0-R12,PC}|
0001ec80  5e 0d 87 78 04 0d 87 82  4e 20 4c 44 52 20 20 20  |^..x....N LDR   |
0001ec90  20 20 20 52 30 2c 5b 52  31 32 2c 23 73 61 76 65  |   R0,[R12,#save|
0001eca0  25 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%]              |
0001ecb0  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
0001ecc0  61 64 73 20 74 68 65 20  63 6f 6e 74 65 6e 74 73  |ads the contents|
0001ecd0  20 6f 66 0d 87 8c 4c 20  4d 4f 56 20 20 20 20 20  | of...L MOV     |
0001ece0  20 52 31 2c 23 37 20 20  20 20 20 20 20 20 20 20  | R1,#7          |
0001ecf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 73  |              ;s|
0001ed00  74 61 72 74 20 69 73 73  75 65 20 6e 75 6d 62 65  |tart issue numbe|
0001ed10  72 20 61 6e 64 20 66 69  6e 64 73 20 69 74 73 0d  |r and finds its.|
0001ed20  87 96 32 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |..2 MOV      R2,|
0001ed30  52 39 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R9              |
0001ed40  20 20 20 20 20 20 20 20  20 20 3b 76 61 6c 75 65  |          ;value|
0001ed50  2e 0d 87 a0 16 20 42 4c  20 20 20 20 20 20 20 52  |..... BL       R|
0001ed60  65 61 64 49 63 6f 6e 0d  87 aa 13 20 4d 4f 56 20  |eadIcon.... MOV |
0001ed70  20 20 20 20 20 52 30 2c  52 39 0d 87 b4 14 20 4d  |     R0,R9.... M|
0001ed80  4f 56 20 20 20 20 20 20  52 31 2c 23 31 33 0d 87  |OV      R1,#13..|
0001ed90  be 1a 20 53 57 49 20 20  20 20 20 20 22 53 74 72  |.. SWI      "Str|
0001eda0  69 6e 67 5f 56 61 6c 22  0d 87 c8 04 0d 87 d2 15  |ing_Val"........|
0001edb0  20 43 4d 50 20 20 20 20  20 20 52 31 2c 23 31 33  | CMP      R1,#13|
0001edc0  37 0d 87 dc 18 20 42 47  54 20 20 20 20 20 20 41  |7.... BGT      A|
0001edd0  66 74 65 72 44 65 63 39  33 0d 87 e6 04 0d 87 f0  |fterDec93.......|
0001ede0  51 20 41 44 44 20 20 20  20 20 20 52 30 2c 52 31  |Q ADD      R0,R1|
0001edf0  2c 23 36 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#6             |
0001ee00  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
0001ee10  63 74 69 6f 6e 20 67 65  74 73 20 74 68 65 20 66  |ction gets the f|
0001ee20  69 72 73 74 20 33 20 6c  65 74 74 65 72 73 0d 87  |irst 3 letters..|
0001ee30  fa 42 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 23  |.B MOV      R1,#|
0001ee40  31 32 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |12              |
0001ee50  20 20 20 20 20 20 20 20  20 3b 6f 66 20 74 68 65  |         ;of the|
0001ee60  20 4d 6f 6e 74 68 20 6f  66 20 69 73 73 75 65 2e  | Month of issue.|
0001ee70  0d 88 04 14 20 42 4c 20  20 20 20 20 20 20 44 69  |.... BL       Di|
0001ee80  76 69 64 65 0d 88 0e 13  20 4d 4f 56 20 20 20 20  |vide.... MOV    |
0001ee90  20 20 52 38 2c 52 32 0d  88 18 19 20 4d 4f 56 20  |  R8,R2.... MOV |
0001eea0  20 20 20 20 20 52 30 2c  23 6d 6f 6e 74 68 73 25  |     R0,#months%|
0001eeb0  0d 88 22 1d 20 41 44 44  20 20 20 20 20 20 52 30  |..". ADD      R0|
0001eec0  2c 52 30 2c 52 33 2c 4c  53 4c 20 23 34 0d 88 2c  |,R0,R3,LSL #4..,|
0001eed0  17 20 41 44 44 20 20 20  20 20 20 52 30 2c 52 31  |. ADD      R0,R1|
0001eee0  30 2c 52 30 0d 88 36 13  20 4d 4f 56 20 20 20 20  |0,R0..6. MOV    |
0001eef0  20 20 52 31 2c 52 39 0d  88 40 14 20 4d 4f 56 20  |  R1,R9..@. MOV |
0001ef00  20 20 20 20 20 52 32 2c  23 31 33 0d 88 4a 13 20  |     R2,#13..J. |
0001ef10  4d 4f 56 20 20 20 20 20  20 52 33 2c 23 33 0d 88  |MOV      R3,#3..|
0001ef20  54 1c 20 53 57 49 20 20  20 20 20 20 22 53 74 72  |T. SWI      "Str|
0001ef30  69 6e 67 5f 4c 65 66 74  24 22 0d 88 5e 04 0d 88  |ing_Left$"..^...|
0001ef40  68 04 0d 88 72 4f 20 41  44 44 20 20 20 20 20 20  |h...rO ADD      |
0001ef50  52 30 2c 52 38 2c 23 38  32 20 20 20 20 20 20 20  |R0,R8,#82       |
0001ef60  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
0001ef70  69 73 20 73 65 63 74 69  6f 6e 20 67 65 74 73 20  |is section gets |
0001ef80  74 68 65 20 73 74 72 69  6e 67 20 6f 66 20 74 68  |the string of th|
0001ef90  65 0d 88 7c 4c 20 41 44  44 20 20 20 20 20 20 52  |e..|L ADD      R|
0001efa0  31 2c 52 39 2c 23 33 20  20 20 20 20 20 20 20 20  |1,R9,#3         |
0001efb0  20 20 20 20 20 20 20 20  20 20 20 20 3b 79 65 61  |            ;yea|
0001efc0  72 20 6f 66 20 69 73 73  75 65 20 61 6e 64 20 61  |r of issue and a|
0001efd0  64 64 73 20 69 74 20 74  6f 20 74 68 65 0d 88 86  |dds it to the...|
0001efe0  44 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 23 32  |D MOV      R2,#2|
0001eff0  35 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |53              |
0001f000  20 20 20 20 20 20 20 20  3b 6d 6f 6e 74 68 20 6e  |        ;month n|
0001f010  61 6d 65 20 28 65 67 20  27 41 70 72 39 35 27 29  |ame (eg 'Apr95')|
0001f020  2e 0d 88 90 22 20 53 57  49 20 20 20 20 20 20 22  |...." SWI      "|
0001f030  4f 53 5f 43 6f 6e 76 65  72 74 49 6e 74 65 67 65  |OS_ConvertIntege|
0001f040  72 31 22 0d 88 9a 14 20  4d 4f 56 20 20 20 20 20  |r1".... MOV     |
0001f050  20 52 30 2c 23 31 33 0d  88 a4 15 20 53 54 52 42  | R0,#13.... STRB|
0001f060  20 20 20 20 20 52 30 2c  5b 52 31 5d 0d 88 ae 1d  |     R0,[R1]....|
0001f070  20 4c 44 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | LDR      R0,[R1|
0001f080  32 2c 23 73 61 76 65 25  5d 0d 88 b8 13 20 4d 4f  |2,#save%].... MO|
0001f090  56 20 20 20 20 20 20 52  31 2c 23 32 0d 88 c2 13  |V      R1,#2....|
0001f0a0  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 52 39 0d  | MOV      R2,R9.|
0001f0b0  88 cc 17 20 42 4c 20 20  20 20 20 20 20 57 72 69  |... BL       Wri|
0001f0c0  74 65 49 63 6f 6e 0d 88  d6 04 0d 88 e0 1e 4c 44  |teIcon........LD|
0001f0d0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
0001f0e0  52 31 32 2c 50 43 7d 5e  0d 88 ea 04 0d 88 f4 04  |R12,PC}^........|
0001f0f0  0d 88 fe 0f 2e 41 66 74  65 72 44 65 63 39 33 0d  |.....AfterDec93.|
0001f100  89 08 18 20 53 55 42 20  20 20 20 20 20 52 30 2c  |... SUB      R0,|
0001f110  52 31 2c 23 31 33 38 0d  89 12 14 20 4d 4f 56 20  |R1,#138.... MOV |
0001f120  20 20 20 20 20 52 31 2c  23 31 33 0d 89 1c 14 20  |     R1,#13.... |
0001f130  42 4c 20 20 20 20 20 20  20 44 69 76 69 64 65 0d  |BL       Divide.|
0001f140  89 26 13 20 4d 4f 56 20  20 20 20 20 20 52 38 2c  |.&. MOV      R8,|
0001f150  52 32 0d 89 30 19 20 4d  4f 56 20 20 20 20 20 20  |R2..0. MOV      |
0001f160  52 30 2c 23 6d 6f 6e 74  68 73 25 0d 89 3a 1d 20  |R0,#months%..:. |
0001f170  41 44 44 20 20 20 20 20  20 52 30 2c 52 30 2c 52  |ADD      R0,R0,R|
0001f180  33 2c 4c 53 4c 20 23 34  0d 89 44 17 20 41 44 44  |3,LSL #4..D. ADD|
0001f190  20 20 20 20 20 20 52 30  2c 52 31 30 2c 52 30 0d  |      R0,R10,R0.|
0001f1a0  89 4e 13 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |.N. MOV      R1,|
0001f1b0  52 39 0d 89 58 14 20 4d  4f 56 20 20 20 20 20 20  |R9..X. MOV      |
0001f1c0  52 32 2c 23 31 33 0d 89  62 13 20 4d 4f 56 20 20  |R2,#13..b. MOV  |
0001f1d0  20 20 20 20 52 33 2c 23  33 0d 89 6c 1c 20 53 57  |    R3,#3..l. SW|
0001f1e0  49 20 20 20 20 20 20 22  53 74 72 69 6e 67 5f 4c  |I      "String_L|
0001f1f0  65 66 74 24 22 0d 89 76  04 0d 89 80 4f 20 41 44  |eft$"..v....O AD|
0001f200  44 20 20 20 20 20 20 52  30 2c 52 38 2c 23 39 34  |D      R0,R8,#94|
0001f210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f220  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0001f230  6e 20 67 65 74 73 20 74  68 65 20 73 74 72 69 6e  |n gets the strin|
0001f240  67 20 6f 66 20 74 68 65  0d 89 8a 4c 20 41 44 44  |g of the...L ADD|
0001f250  20 20 20 20 20 20 52 31  2c 52 39 2c 23 33 20 20  |      R1,R9,#3  |
0001f260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f270  20 20 20 3b 79 65 61 72  20 6f 66 20 69 73 73 75  |   ;year of issu|
0001f280  65 20 61 6e 64 20 61 64  64 73 20 69 74 20 74 6f  |e and adds it to|
0001f290  20 74 68 65 0d 89 94 44  20 4d 4f 56 20 20 20 20  | the...D MOV    |
0001f2a0  20 20 52 32 2c 23 32 35  33 20 20 20 20 20 20 20  |  R2,#253       |
0001f2b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0001f2c0  6d 6f 6e 74 68 20 6e 61  6d 65 20 28 65 67 20 27  |month name (eg '|
0001f2d0  41 70 72 39 35 27 29 2e  0d 89 9e 22 20 53 57 49  |Apr95')...." SWI|
0001f2e0  20 20 20 20 20 20 22 4f  53 5f 43 6f 6e 76 65 72  |      "OS_Conver|
0001f2f0  74 49 6e 74 65 67 65 72  31 22 0d 89 a8 14 20 4d  |tInteger1".... M|
0001f300  4f 56 20 20 20 20 20 20  52 30 2c 23 31 33 0d 89  |OV      R0,#13..|
0001f310  b2 15 20 53 54 52 42 20  20 20 20 20 52 30 2c 5b  |.. STRB     R0,[|
0001f320  52 31 5d 0d 89 bc 1d 20  4c 44 52 20 20 20 20 20  |R1].... LDR     |
0001f330  20 52 30 2c 5b 52 31 32  2c 23 73 61 76 65 25 5d  | R0,[R12,#save%]|
0001f340  0d 89 c6 13 20 4d 4f 56  20 20 20 20 20 20 52 31  |.... MOV      R1|
0001f350  2c 23 32 0d 89 d0 13 20  4d 4f 56 20 20 20 20 20  |,#2.... MOV     |
0001f360  20 52 32 2c 52 39 0d 89  da 17 20 42 4c 20 20 20  | R2,R9.... BL   |
0001f370  20 20 20 20 57 72 69 74  65 49 63 6f 6e 0d 89 e4  |    WriteIcon...|
0001f380  04 0d 89 ee 1e 4c 44 4d  46 44 20 20 20 20 52 31  |.....LDMFD    R1|
0001f390  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
0001f3a0  89 f8 04 0d 8a 02 04 0d  8a 0c 52 3b 2d 2d 2d 2d  |..........R;----|
0001f3b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001f3f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 8a 16 38 3b 20 20  |---------...8;  |
0001f400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f410  20 20 20 20 20 20 20 20  20 20 20 2a 2a 2a 20 55  |           *** U|
0001f420  70 64 61 74 65 53 74 61  72 74 45 6e 64 20 2a 2a  |pdateStartEnd **|
0001f430  2a 0d 8a 20 50 3b 20 54  68 69 73 20 73 65 63 74  |*.. P; This sect|
0001f440  69 6f 6e 20 66 69 6c 6c  73 20 74 68 65 20 53 74  |ion fills the St|
0001f450  61 72 74 20 61 6e 64 20  45 6e 64 20 69 63 6f 6e  |art and End icon|
0001f460  73 20 69 6e 20 77 69 74  68 20 74 68 65 20 49 73  |s in with the Is|
0001f470  73 75 65 20 6e 75 6d 62  65 72 20 6f 66 20 74 68  |sue number of th|
0001f480  65 0d 8a 2a 1c 3b 20 52  65 63 6f 72 64 20 62 65  |e..*.; Record be|
0001f490  69 6e 67 20 64 69 73 70  6c 79 65 64 2e 0d 8a 34  |ing displyed...4|
0001f4a0  04 0d 8a 3e 13 2e 55 70  64 61 74 65 53 74 61 72  |...>..UpdateStar|
0001f4b0  74 45 6e 64 0d 8a 48 04  0d 8a 52 1e 53 54 4d 46  |tEnd..H...R.STMF|
0001f4c0  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
0001f4d0  32 2c 52 31 34 7d 0d 8a  5c 04 0d 8a 66 4f 20 4c  |2,R14}..\...fO L|
0001f4e0  44 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |DR      R0,[R12,|
0001f4f0  23 64 69 73 70 6c 61 79  25 5d 20 20 20 20 20 20  |#display%]      |
0001f500  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0001f510  6f 6e 20 72 65 61 64 73  20 74 68 65 20 49 73 73  |on reads the Iss|
0001f520  75 65 20 6e 75 6d 62 65  72 0d 8a 70 44 20 4d 4f  |ue number..pD MO|
0001f530  56 20 20 20 20 20 20 52  31 2c 23 33 34 20 20 20  |V      R1,#34   |
0001f540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f550  20 20 20 20 3b 66 72 6f  6d 20 74 68 65 20 44 69  |    ;from the Di|
0001f560  73 70 6c 61 79 20 77 69  6e 64 6f 77 2e 0d 8a 7a  |splay window...z|
0001f570  13 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 52 39  |. MOV      R2,R9|
0001f580  0d 8a 84 16 20 42 4c 20  20 20 20 20 20 20 52 65  |.... BL       Re|
0001f590  61 64 49 63 6f 6e 0d 8a  8e 04 0d 8a 98 50 20 4c  |adIcon.......P L|
0001f5a0  44 52 20 20 20 20 20 20  52 30 2c 5b 52 31 32 2c  |DR      R0,[R12,|
0001f5b0  23 73 61 76 65 25 5d 20  20 20 20 20 20 20 20 20  |#save%]         |
0001f5c0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
0001f5d0  6f 6e 20 77 72 69 74 65  73 20 74 68 65 20 49 73  |on writes the Is|
0001f5e0  73 75 65 20 6e 75 6d 62  65 72 0d 8a a2 4f 20 4d  |sue number...O M|
0001f5f0  4f 56 20 20 20 20 20 20  52 31 2c 23 37 20 20 20  |OV      R1,#7   |
0001f600  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f610  20 20 20 20 20 3b 69 6e  74 6f 20 74 68 65 20 53  |     ;into the S|
0001f620  74 61 72 74 20 61 6e 64  20 45 6e 64 20 69 63 6f  |tart and End ico|
0001f630  6e 73 20 69 6e 20 74 68  65 0d 8a ac 38 20 42 4c  |ns in the...8 BL|
0001f640  20 20 20 20 20 20 20 57  72 69 74 65 49 63 6f 6e  |       WriteIcon|
0001f650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f660  20 20 20 20 3b 53 61 76  65 20 77 69 6e 64 6f 77  |    ;Save window|
0001f670  2e 0d 8a b6 14 20 4d 4f  56 20 20 20 20 20 20 52  |..... MOV      R|
0001f680  31 2c 23 31 30 0d 8a c0  17 20 42 4c 20 20 20 20  |1,#10.... BL    |
0001f690  20 20 20 57 72 69 74 65  49 63 6f 6e 0d 8a ca 04  |   WriteIcon....|
0001f6a0  0d 8a d4 1e 4c 44 4d 46  44 20 20 20 20 52 31 33  |....LDMFD    R13|
0001f6b0  21 2c 7b 52 30 2d 52 31  32 2c 50 43 7d 5e 0d 8a  |!,{R0-R12,PC}^..|
0001f6c0  de 04 0d 8a e8 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.....R;---------|
0001f6d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001f710  2d 2d 2d 2d 0d 8a f2 4a  3b 20 54 68 69 73 20 73  |----...J; This s|
0001f720  65 63 74 69 6f 6e 20 63  6f 6e 74 61 69 6e 73 20  |ection contains |
0001f730  74 68 65 20 73 74 72 69  6e 67 20 27 4d 75 6c 74  |the string 'Mult|
0001f740  69 70 6c 65 27 20 77 68  69 63 68 20 69 73 20 63  |iple' which is c|
0001f750  6f 70 69 65 64 20 69 6e  74 6f 20 74 68 65 0d 8a  |opied into the..|
0001f760  fc 52 3b 20 66 69 6c 65  6e 61 6d 65 20 69 63 6f  |.R; filename ico|
0001f770  6e 20 61 73 20 74 68 65  20 64 65 66 61 75 6c 74  |n as the default|
0001f780  20 66 69 6c 65 6e 61 6d  65 20 69 66 20 6d 6f 72  | filename if mor|
0001f790  65 20 74 68 61 6e 20 6f  6e 65 20 69 73 73 75 65  |e than one issue|
0001f7a0  20 69 73 20 74 6f 20 62  65 20 73 61 76 65 64 2e  | is to be saved.|
0001f7b0  0d 8b 06 04 0d 8b 10 0d  2e 6d 75 6c 74 69 70 6c  |.........multipl|
0001f7c0  65 0d 8b 1a 04 0d 8b 24  17 45 51 55 53 20 20 20  |e......$.EQUS   |
0001f7d0  20 20 22 4d 75 6c 74 69  70 6c 65 22 0d 8b 2e 0e  |  "Multiple"....|
0001f7e0  45 51 55 42 20 20 20 20  20 30 0d 8b 38 09 41 4c  |EQUB     0..8.AL|
0001f7f0  49 47 4e 0d 8b 42 04 0d  8b 4c 52 3b 2d 2d 2d 2d  |IGN..B...LR;----|
0001f800  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001f840  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 8b 56 36 3b 20 20  |---------..V6;  |
0001f850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f860  20 20 20 20 20 20 20 20  20 20 20 2a 2a 2a 20 44  |           *** D|
0001f870  65 63 6f 64 65 49 42 4d  65 6e 75 20 2a 2a 2a 0d  |ecodeIBMenu ***.|
0001f880  8b 60 44 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |.`D;This section|
0001f890  20 64 65 61 6c 73 20 77  69 74 68 20 6f 70 74 69  | deals with opti|
0001f8a0  6f 6e 73 20 73 65 6c 65  63 74 65 64 20 66 72 6f  |ons selected fro|
0001f8b0  6d 20 74 68 65 20 49 63  6f 6e 42 61 72 20 6d 65  |m the IconBar me|
0001f8c0  6e 75 2e 0d 8b 6a 04 0d  8b 74 11 2e 44 65 63 6f  |nu...j...t..Deco|
0001f8d0  64 65 49 42 4d 65 6e 75  0d 8b 7e 04 0d 8b 88 1e  |deIBMenu..~.....|
0001f8e0  53 54 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |STMFD    R13!,{R|
0001f8f0  30 2d 52 31 32 2c 52 31  34 7d 0d 8b 92 04 0d 8b  |0-R12,R14}......|
0001f900  9c 4e 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |.N LDR      R1,[|
0001f910  52 31 32 2c 23 62 6c 6f  63 6b 25 2b 30 5d 20 20  |R12,#block%+0]  |
0001f920  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0001f930  65 63 74 69 6f 6e 20 73  65 74 73 20 6f 75 72 20  |ection sets our |
0001f940  51 75 69 74 20 66 6c 61  67 20 74 6f 0d 8b a6 50  |Quit flag to...P|
0001f950  20 43 4d 50 20 20 20 20  20 20 52 31 2c 23 31 20  | CMP      R1,#1 |
0001f960  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f970  20 20 20 20 20 20 20 3b  74 6f 20 31 20 74 6f 20  |       ;to 1 to |
0001f980  69 6e 64 69 63 61 74 65  20 74 68 61 74 20 77 65  |indicate that we|
0001f990  20 73 68 6f 75 6c 64 20  71 75 69 74 0d 8b b0 4e  | should quit...N|
0001f9a0  20 20 ec 51 20 20 20 20  52 31 2c 23 31 20 20 20  |  .Q    R1,#1   |
0001f9b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001f9c0  20 20 20 20 3b 77 68 65  6e 20 77 65 20 72 65 74  |    ;when we ret|
0001f9d0  75 72 6e 20 74 6f 20 6f  75 72 20 57 69 6d 70 5f  |urn to our Wimp_|
0001f9e0  50 6f 6c 6c 20 6c 6f 6f  70 2e 0d 8b ba 1e 20 20  |Poll loop.....  |
0001f9f0  53 54 52 45 51 20 20 20  20 52 31 2c 5b 52 31 32  |STREQ    R1,[R12|
0001fa00  2c 23 71 75 69 74 25 5d  0d 8b c4 04 0d 8b ce 1e  |,#quit%]........|
0001fa10  4c 44 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |LDMFD    R13!,{R|
0001fa20  30 2d 52 31 32 2c 50 43  7d 5e 0d 8b d8 04 0d 8b  |0-R12,PC}^......|
0001fa30  e2 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.R;-------------|
0001fa40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001fa80  0d 8b ec 38 3b 20 20 20  20 20 20 20 20 20 20 20  |...8;           |
0001fa90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001faa0  20 2a 2a 2a 20 44 65 63  6f 64 65 54 6f 70 69 63  | *** DecodeTopic|
0001fab0  4d 65 6e 75 20 2a 2a 2a  0d 8b f6 04 0d 8c 00 14  |Menu ***........|
0001fac0  2e 44 65 63 6f 64 65 54  6f 70 69 63 4d 65 6e 75  |.DecodeTopicMenu|
0001fad0  0d 8c 0a 04 0d 8c 14 1e  53 54 4d 46 44 20 20 20  |........STMFD   |
0001fae0  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 52 31  | R13!,{R0-R12,R1|
0001faf0  34 7d 0d 8c 1e 04 0d 8c  28 1b 20 53 57 49 20 20  |4}......(. SWI  |
0001fb00  20 20 20 22 48 6f 75 72  67 6c 61 73 73 5f 4f 6e  |   "Hourglass_On|
0001fb10  22 0d 8c 32 04 0d 8c 3c  4f 20 a4 4c 6f 6e 67 41  |"..2...<O .LongA|
0001fb20  64 72 28 22 22 2c 31 2c  6d 65 6e 75 6c 69 73 74  |dr("",1,menulist|
0001fb30  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |)              ;|
0001fb40  54 68 69 73 20 73 65 63  74 69 6f 6e 20 67 65 74  |This section get|
0001fb50  73 20 74 68 65 20 61 64  64 72 65 73 73 20 6f 66  |s the address of|
0001fb60  20 74 68 65 0d 8c 46 51  20 4c 44 52 20 20 20 20  | the..FQ LDR    |
0001fb70  20 52 31 2c 5b 52 31 2c  23 38 5d 20 20 20 20 20  | R1,[R1,#8]     |
0001fb80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
0001fb90  6d 65 6e 75 20 73 74 72  75 63 74 75 72 65 20 61  |menu structure a|
0001fba0  6e 64 20 63 6f 6e 76 65  72 74 73 20 69 74 20 74  |nd converts it t|
0001fbb0  6f 20 69 74 73 0d 8c 50  3f 20 41 44 44 20 20 20  |o its..P? ADD   |
0001fbc0  20 20 52 32 2c 52 31 32  2c 23 62 6c 6f 63 6b 25  |  R2,R12,#block%|
0001fbd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001fbe0  3b 74 65 78 74 75 61 6c  20 65 71 75 69 76 69 6c  |;textual equivil|
0001fbf0  65 6e 74 2e 0d 8c 5a 12  20 4d 4f 56 20 20 20 20  |ent...Z. MOV    |
0001fc00  20 52 33 2c 52 39 0d 8c  64 1e 20 53 57 49 20 20  | R3,R9..d. SWI  |
0001fc10  20 20 20 22 57 69 6d 70  5f 44 65 63 6f 64 65 4d  |   "Wimp_DecodeM|
0001fc20  65 6e 75 22 0d 8c 6e 04  0d 8c 78 4b 20 a4 4c 6f  |enu"..n...xK .Lo|
0001fc30  6e 67 41 64 72 28 22 22  2c 30 2c 6d 65 6e 75 69  |ngAdr("",0,menui|
0001fc40  6e 66 6f 29 20 20 20 20  20 20 20 20 20 20 20 20  |nfo)            |
0001fc50  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
0001fc60  63 68 65 63 6b 73 20 77  68 69 63 68 20 77 69 6e  |checks which win|
0001fc70  64 6f 77 0d 8c 82 48 20  4c 44 52 20 20 20 20 20  |dow...H LDR     |
0001fc80  52 30 2c 5b 52 30 2c 23  34 5d 20 20 20 20 20 20  |R0,[R0,#4]      |
0001fc90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 77  |              ;w|
0001fca0  61 73 20 75 73 65 64 20  74 6f 20 69 6e 76 6f 6b  |as used to invok|
0001fcb0  65 20 74 68 65 20 6d 65  6e 75 2e 0d 8c 8c 12 20  |e the menu..... |
0001fcc0  43 4d 4e 20 20 20 20 20  52 30 2c 23 31 0d 8c 96  |CMN     R0,#1...|
0001fcd0  04 0d 8c a0 52 20 20 4c  44 52 45 51 20 20 20 52  |....R  LDREQ   R|
0001fce0  30 2c 5b 52 31 32 2c 23  65 64 69 74 25 5d 20 20  |0,[R12,#edit%]  |
0001fcf0  20 20 20 20 20 20 20 20  20 20 20 20 3b 49 66 20  |            ;If |
0001fd00  74 68 65 20 45 64 69 74  20 6d 65 6e 75 20 77 61  |the Edit menu wa|
0001fd10  73 20 75 73 65 64 20 74  68 69 73 20 73 65 63 74  |s used this sect|
0001fd20  69 6f 6e 0d 8c aa 4e 20  20 ec 51 20 20 20 52 31  |ion...N  .Q   R1|
0001fd30  2c 23 32 31 20 20 20 20  20 20 20 20 20 20 20 20  |,#21            |
0001fd40  20 20 20 20 20 20 20 20  20 20 20 3b 63 6f 70 69  |           ;copi|
0001fd50  65 73 20 74 68 65 20 6d  65 6e 75 20 6f 70 74 69  |es the menu opti|
0001fd60  6f 6e 20 69 6e 74 6f 20  74 68 65 20 54 6f 70 69  |on into the Topi|
0001fd70  63 0d 8c b4 41 20 20 ec  51 20 20 20 52 32 2c 52  |c...A  .Q   R2,R|
0001fd80  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
0001fd90  20 20 20 20 20 20 20 20  20 3b 69 63 6f 6e 20 69  |         ;icon i|
0001fda0  6e 20 74 68 65 20 65 64  69 74 20 77 69 6e 64 6f  |n the edit windo|
0001fdb0  77 2e 0d 8c be 17 20 20  42 4c 45 51 20 20 20 20  |w.....  BLEQ    |
0001fdc0  57 72 69 74 65 49 63 6f  6e 0d 8c c8 1d 20 20 53  |WriteIcon....  S|
0001fdd0  57 49 45 51 20 20 20 22  48 6f 75 72 67 6c 61 73  |WIEQ   "Hourglas|
0001fde0  73 5f 4f 66 66 22 0d 8c  d2 1f 20 20 4c 44 4d 45  |s_Off"....  LDME|
0001fdf0  51 46 44 20 52 31 33 21  2c 7b 52 30 2d 52 31 32  |QFD R13!,{R0-R12|
0001fe00  2c 50 43 7d 5e 0d 8c dc  04 0d 8c e6 52 20 4d 4f  |,PC}^.......R MO|
0001fe10  56 20 20 20 20 20 52 30  2c 52 39 20 20 20 20 20  |V     R0,R9     |
0001fe20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001fe30  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
0001fe40  6e 20 63 6f 6e 76 65 72  74 73 20 74 68 65 20 54  |n converts the T|
0001fe50  6f 70 69 63 20 74 6f 20  61 6c 6c 0d 8c f0 3e 20  |opic to all...> |
0001fe60  4d 4f 56 20 20 20 20 20  52 31 2c 23 31 33 20 20  |MOV     R1,#13  |
0001fe70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001fe80  20 20 20 20 20 20 3b 6c  6f 77 65 72 63 61 73 65  |      ;lowercase|
0001fe90  20 6c 65 74 74 65 72 73  2e 0d 8c fa 21 20 53 57  | letters....! SW|
0001fea0  49 20 20 20 20 20 22 53  74 72 69 6e 67 5f 54 6f  |I     "String_To|
0001feb0  4c 6f 77 65 72 43 61 73  65 22 0d 8d 04 04 0d 8d  |LowerCase"......|
0001fec0  0e 51 20 4c 44 52 20 20  20 20 20 52 38 2c 5b 52  |.Q LDR     R8,[R|
0001fed0  31 30 2c 23 72 65 63 6f  72 64 25 5d 20 20 20 20  |10,#record%]    |
0001fee0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
0001fef0  65 63 74 69 6f 6e 20 6e  6f 74 65 73 20 74 68 65  |ection notes the|
0001ff00  20 72 65 63 6f 72 64 20  74 6f 20 73 74 6f 70 0d  | record to stop.|
0001ff10  8d 18 52 20 53 55 42 53  20 20 20 20 52 38 2c 52  |..R SUBS    R8,R|
0001ff20  38 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |8,#1            |
0001ff30  20 20 20 20 20 20 20 20  20 20 3b 61 74 20 69 66  |          ;at if|
0001ff40  20 61 20 6d 61 74 63 68  69 6e 67 20 74 6f 70 69  | a matching topi|
0001ff50  63 20 69 73 20 6e 6f 74  20 6c 6f 63 61 74 65 64  |c is not located|
0001ff60  2e 0d 8d 22 1b 20 4c 44  52 45 51 20 20 20 52 38  |...". LDREQ   R8|
0001ff70  2c 5b 52 31 30 2c 23 6d  61 78 25 5d 0d 8d 2c 04  |,[R10,#max%]..,.|
0001ff80  0d 8d 36 4c 20 4c 44 52  20 20 20 20 20 52 30 2c  |..6L LDR     R0,|
0001ff90  5b 52 31 30 2c 23 73 68  6f 77 25 5d 20 20 20 20  |[R10,#show%]    |
0001ffa0  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
0001ffb0  20 73 65 63 74 69 6f 6e  20 6f 70 65 6e 73 20 74  | section opens t|
0001ffc0  68 65 20 63 75 72 72 65  6e 74 6c 79 0d 8d 40 38  |he currently..@8|
0001ffd0  20 43 4d 50 20 20 20 20  20 52 30 2c 23 31 20 20  | CMP     R0,#1  |
0001ffe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0001fff0  20 20 20 20 20 20 20 3b  61 63 74 69 76 65 20 66  |       ;active f|
00020000  69 6c 65 2e 0d 8d 4a 14  20 4d 4f 56 20 20 20 20  |ile...J. MOV    |
00020010  20 52 30 2c 23 26 34 46  0d 8d 54 1e 20 41 44 44  | R0,#&4F..T. ADD|
00020020  45 51 20 20 20 52 31 2c  52 31 30 2c 23 69 6e 64  |EQ   R1,R10,#ind|
00020030  65 78 66 69 6c 65 0d 8d  5e 1f 20 41 44 44 4e 45  |exfile..^. ADDNE|
00020040  20 20 20 52 31 2c 52 31  30 2c 23 73 65 61 72 63  |   R1,R10,#searc|
00020050  68 66 69 6c 65 0d 8d 68  17 20 53 57 49 20 20 20  |hfile..h. SWI   |
00020060  20 20 22 58 4f 53 5f 46  69 6e 64 22 0d 8d 72 17  |  "XOS_Find"..r.|
00020070  20 20 42 56 53 20 20 20  20 20 6e 6f 72 65 63 6f  |  BVS     noreco|
00020080  72 64 73 0d 8d 7c 22 20  53 54 52 20 20 20 20 20  |rds..|" STR     |
00020090  52 30 2c 5b 52 31 30 2c  23 66 69 6c 65 68 61 6e  |R0,[R10,#filehan|
000200a0  64 6c 65 25 5d 0d 8d 86  04 0d 8d 90 4f 20 2e 74  |dle%].......O .t|
000200b0  6f 70 69 63 6d 65 6e 75  6c 6f 6f 70 20 20 20 20  |opicmenuloop    |
000200c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000200d0  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
000200e0  6e 20 72 65 61 64 73 20  69 6e 20 72 65 63 6f 72  |n reads in recor|
000200f0  64 73 20 75 6e 74 69 6c  0d 8d 9a 51 20 20 20 20  |ds until...Q    |
00020100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00020120  20 20 20 3b 6f 6e 65 20  69 73 20 66 6f 75 6e 64  |   ;one is found|
00020130  20 77 68 69 63 68 20 6d  61 74 63 68 65 73 20 74  | which matches t|
00020140  68 65 20 63 68 6f 73 65  6e 0d 8d a4 32 20 20 20  |he chosen...2   |
00020150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00020170  20 20 20 20 3b 74 6f 70  69 63 2e 0d 8d ae 1b 20  |    ;topic..... |
00020180  4c 44 52 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |LDR     R0,[R10,|
00020190  23 6d 61 78 25 5d 0d 8d  b8 1e 20 4c 44 52 20 20  |#max%].... LDR  |
000201a0  20 20 20 52 31 2c 5b 52  31 30 2c 23 72 65 63 6f  |   R1,[R10,#reco|
000201b0  72 64 25 5d 0d 8d c2 04  0d 8d cc 4f 20 43 4d 50  |rd%].......O CMP|
000201c0  20 20 20 20 20 52 31 2c  52 38 20 20 20 20 20 20  |     R1,R8      |
000201d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000201e0  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
000201f0  20 63 68 65 63 6b 73 20  69 66 20 77 65 20 68 61  | checks if we ha|
00020200  76 65 20 67 6f 6e 65 0d  8d d6 48 20 20 ec 51 20  |ve gone...H  .Q |
00020210  20 20 52 30 2c 23 31 20  20 20 20 20 20 20 20 20  |  R0,#1         |
00020220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00020230  74 68 72 6f 75 67 68 20  74 68 65 20 65 6e 74 69  |through the enti|
00020240  72 65 20 66 69 6c 65 20  77 69 74 68 6f 75 74 0d  |re file without.|
00020250  8d e0 39 20 20 ec 51 20  20 20 52 31 2c 23 30 20  |..9  .Q   R1,#0 |
00020260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020270  20 20 20 20 20 20 20 3b  66 69 6e 64 69 6e 67 20  |       ;finding |
00020280  61 20 6d 61 74 63 68 2e  0d 8d ea 18 20 20 42 4c  |a match.....  BL|
00020290  45 51 20 20 20 20 47 65  74 52 65 63 6f 72 64 73  |EQ    GetRecords|
000202a0  0d 8d f4 14 20 20 42 4c  45 51 20 20 20 20 55 70  |....  BLEQ    Up|
000202b0  64 61 74 65 0d 8d fe 1d  20 20 53 57 49 45 51 20  |date....  SWIEQ |
000202c0  20 20 22 48 6f 75 72 67  6c 61 73 73 5f 4f 66 66  |  "Hourglass_Off|
000202d0  22 0d 8e 08 1e 20 20 42  45 51 20 20 20 20 20 74  |"....  BEQ     t|
000202e0  6f 70 69 63 6d 65 6e 75  6c 6f 6f 70 65 6e 64 0d  |opicmenuloopend.|
000202f0  8e 12 04 0d 8e 1c 4e 20  4d 4f 56 20 20 20 20 20  |......N MOV     |
00020300  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
00020310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00020320  68 69 73 20 73 65 63 74  69 6f 6e 20 72 65 61 64  |his section read|
00020330  73 20 69 6e 20 61 20 72  65 63 6f 72 64 20 61 6e  |s in a record an|
00020340  64 0d 8e 26 4a 20 4d 4f  56 20 20 20 20 20 52 31  |d..&J MOV     R1|
00020350  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00020360  20 20 20 20 20 20 20 20  20 20 20 20 3b 63 6f 70  |            ;cop|
00020370  69 65 73 20 69 74 20 69  6e 74 6f 20 61 6e 6f 74  |ies it into anot|
00020380  68 65 72 20 62 75 66 66  65 72 2e 0d 8e 30 17 20  |her buffer...0. |
00020390  42 4c 20 20 20 20 20 20  47 65 74 52 65 63 6f 72  |BL      GetRecor|
000203a0  64 73 0d 8e 3a 1b 20 41  44 44 20 20 20 20 20 52  |ds..:. ADD     R|
000203b0  30 2c 52 31 30 2c 23 72  65 63 6f 72 64 0d 8e 44  |0,R10,#record..D|
000203c0  1b 20 41 44 44 20 20 20  20 20 52 31 2c 52 31 32  |. ADD     R1,R12|
000203d0  2c 23 62 6c 6f 63 6b 25  0d 8e 4e 13 20 4d 4f 56  |,#block%..N. MOV|
000203e0  20 20 20 20 20 52 32 2c  23 31 33 0d 8e 58 1b 20  |     R2,#13..X. |
000203f0  53 57 49 20 20 20 20 20  22 53 74 72 69 6e 67 5f  |SWI     "String_|
00020400  4d 6f 76 65 24 22 0d 8e  62 04 0d 8e 6c 4e 20 4d  |Move$"..b...lN M|
00020410  4f 56 20 20 20 20 20 52  30 2c 52 31 20 20 20 20  |OV     R0,R1    |
00020420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020430  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00020440  6f 6e 20 63 68 61 6e 67  65 73 20 74 68 65 20 72  |on changes the r|
00020450  65 63 6f 72 64 20 74 6f  0d 8e 76 3e 20 4d 4f 56  |ecord to..v> MOV|
00020460  20 20 20 20 20 52 31 2c  52 32 20 20 20 20 20 20  |     R1,R2      |
00020470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020480  20 20 20 3b 6c 6f 77 65  72 63 61 73 65 20 6c 65  |   ;lowercase le|
00020490  74 74 65 72 73 2e 0d 8e  80 21 20 53 57 49 20 20  |tters....! SWI  |
000204a0  20 20 20 22 53 74 72 69  6e 67 5f 54 6f 4c 6f 77  |   "String_ToLow|
000204b0  65 72 43 61 73 65 22 0d  8e 8a 04 0d 8e 94 4b 20  |erCase".......K |
000204c0  41 44 44 20 20 20 20 20  52 31 2c 52 31 30 2c 23  |ADD     R1,R10,#|
000204d0  62 61 63 6b 73 6c 61 73  68 20 20 20 20 20 20 20  |backslash       |
000204e0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
000204f0  69 6f 6e 20 69 73 6f 6c  61 74 65 73 20 74 68 65  |ion isolates the|
00020500  20 54 6f 70 69 63 0d 8e  9e 32 20 4d 4f 56 20 20  | Topic...2 MOV  |
00020510  20 20 20 52 32 2c 23 31  33 20 20 20 20 20 20 20  |   R2,#13       |
00020520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020530  20 3b 66 69 65 6c 64 2e  0d 8e a8 12 20 4d 4f 56  | ;field..... MOV|
00020540  20 20 20 20 20 52 33 2c  23 30 0d 8e b2 1b 20 53  |     R3,#0.... S|
00020550  57 49 20 20 20 20 20 22  53 74 72 69 6e 67 5f 49  |WI     "String_I|
00020560  6e 73 74 72 22 0d 8e bc  15 20 41 44 44 20 20 20  |nstr".... ADD   |
00020570  20 20 52 33 2c 52 33 2c  23 31 0d 8e c6 1b 20 53  |  R3,R3,#1.... S|
00020580  57 49 20 20 20 20 20 22  53 74 72 69 6e 67 5f 49  |WI     "String_I|
00020590  6e 73 74 72 22 0d 8e d0  15 20 41 44 44 20 20 20  |nstr".... ADD   |
000205a0  20 20 52 33 2c 52 33 2c  23 31 0d 8e da 1b 20 53  |  R3,R3,#1.... S|
000205b0  57 49 20 20 20 20 20 22  53 74 72 69 6e 67 5f 49  |WI     "String_I|
000205c0  6e 73 74 72 22 0d 8e e4  15 20 41 44 44 20 20 20  |nstr".... ADD   |
000205d0  20 20 52 33 2c 52 33 2c  23 31 0d 8e ee 1b 20 53  |  R3,R3,#1.... S|
000205e0  57 49 20 20 20 20 20 22  53 74 72 69 6e 67 5f 49  |WI     "String_I|
000205f0  6e 73 74 72 22 0d 8e f8  04 0d 8f 02 50 20 41 44  |nstr".......P AD|
00020600  44 20 20 20 20 20 52 35  2c 52 33 2c 23 31 20 20  |D     R5,R3,#1  |
00020610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020620  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00020630  6e 20 63 6f 6d 70 61 72  65 73 20 74 68 65 20 74  |n compares the t|
00020640  77 6f 20 74 6f 70 69 63  73 0d 8f 0c 12 20 4d 4f  |wo topics.... MO|
00020650  56 20 20 20 20 20 52 31  2c 52 39 0d 8f 16 1b 20  |V     R1,R9.... |
00020660  53 57 49 20 20 20 20 20  22 53 74 72 69 6e 67 5f  |SWI     "String_|
00020670  49 6e 73 74 72 22 0d 8f  20 04 0d 8f 2a 4f 20 43  |Instr".. ...*O C|
00020680  4d 50 20 20 20 20 20 52  33 2c 52 35 20 20 20 20  |MP     R3,R5    |
00020690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000206a0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
000206b0  6f 6e 20 6c 6f 6f 70 73  20 62 61 63 6b 20 69 66  |on loops back if|
000206c0  20 74 68 65 79 20 61 72  65 0d 8f 34 39 20 20 42  | they are..49  B|
000206d0  4e 45 20 20 20 20 20 74  6f 70 69 63 6d 65 6e 75  |NE     topicmenu|
000206e0  6c 6f 6f 70 20 20 20 20  20 20 20 20 20 20 20 20  |loop            |
000206f0  20 20 20 20 3b 6e 6f 74  20 74 68 65 20 73 61 6d  |    ;not the sam|
00020700  65 2e 0d 8f 3e 04 0d 8f  48 16 20 2e 74 6f 70 69  |e...>...H. .topi|
00020710  63 6d 65 6e 75 6c 6f 6f  70 65 6e 64 0d 8f 52 49  |cmenuloopend..RI|
00020720  20 4d 4f 56 20 20 20 20  20 52 30 2c 23 30 20 20  | MOV     R0,#0  |
00020730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020740  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00020750  74 69 6f 6e 20 63 6c 6f  73 65 73 20 74 68 65 20  |tion closes the |
00020760  66 69 6c 65 2e 0d 8f 5c  22 20 4c 44 52 20 20 20  |file...\" LDR   |
00020770  20 20 52 31 2c 5b 52 31  30 2c 23 66 69 6c 65 68  |  R1,[R10,#fileh|
00020780  61 6e 64 6c 65 25 5d 0d  8f 66 17 20 53 57 49 20  |andle%]..f. SWI |
00020790  20 20 20 20 22 58 4f 53  5f 46 69 6e 64 22 0d 8f  |    "XOS_Find"..|
000207a0  70 04 0d 8f 7a 13 20 42  4c 20 20 20 20 20 20 55  |p...z. BL      U|
000207b0  70 64 61 74 65 0d 8f 84  1c 20 53 57 49 20 20 20  |pdate.... SWI   |
000207c0  20 20 22 48 6f 75 72 67  6c 61 73 73 5f 4f 66 66  |  "Hourglass_Off|
000207d0  22 0d 8f 8e 04 0d 8f 98  1e 4c 44 4d 46 44 20 20  |"........LDMFD  |
000207e0  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 50  |  R13!,{R0-R12,P|
000207f0  43 7d 5e 0d 8f a2 04 0d  8f ac 52 3b 2d 2d 2d 2d  |C}^.......R;----|
00020800  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00020840  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 8f b6 32 3b 20 20  |---------...2;  |
00020850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020860  20 20 20 20 20 20 20 20  2a 2a 2a 20 53 74 61 72  |        *** Star|
00020870  74 53 65 61 72 63 68 20  2a 2a 2a 0d 8f c0 50 3b  |tSearch ***...P;|
00020880  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
00020890  20 70 65 72 66 6f 72 6d  73 20 61 20 73 65 61 72  | performs a sear|
000208a0  63 68 20 6f 6e 20 74 68  65 20 69 6e 64 65 78 20  |ch on the index |
000208b0  66 69 6c 65 20 75 73 69  6e 67 20 74 68 65 20 73  |file using the s|
000208c0  74 72 69 6e 67 20 67 69  76 65 6e 0d 8f ca 1b 3b  |tring given....;|
000208d0  20 69 6e 20 74 68 65 20  53 65 61 72 63 68 20 77  | in the Search w|
000208e0  69 6e 64 6f 77 2e 0d 8f  d4 04 0d 8f de 10 2e 53  |indow..........S|
000208f0  74 61 72 74 53 65 61 72  63 68 0d 8f e8 04 0d 8f  |tartSearch......|
00020900  f2 1e 53 54 4d 46 44 20  20 20 20 52 31 33 21 2c  |..STMFD    R13!,|
00020910  7b 52 30 2d 52 31 32 2c  52 31 34 7d 0d 8f fc 04  |{R0-R12,R14}....|
00020920  0d 90 06 1c 20 53 57 49  20 20 20 20 20 20 22 48  |.... SWI      "H|
00020930  6f 75 72 67 6c 61 73 73  5f 4f 6e 22 0d 90 10 04  |ourglass_On"....|
00020940  0d 90 1a 4f 20 4c 44 52  20 20 20 20 20 20 52 30  |...O LDR      R0|
00020950  2c 5b 52 31 32 2c 23 73  65 61 72 63 68 25 5d 20  |,[R12,#search%] |
00020960  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00020970  20 73 65 63 74 69 6f 6e  20 72 65 61 64 73 20 69  | section reads i|
00020980  6e 20 74 68 65 20 73 74  72 69 6e 67 20 74 6f 0d  |n the string to.|
00020990  90 24 37 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |.$7 MOV      R1,|
000209a0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
000209b0  20 20 20 20 20 20 20 20  20 20 3b 73 65 61 72 63  |          ;searc|
000209c0  68 20 66 6f 72 2e 0d 90  2e 13 20 4d 4f 56 20 20  |h for..... MOV  |
000209d0  20 20 20 20 52 32 2c 52  39 0d 90 38 16 20 42 4c  |    R2,R9..8. BL|
000209e0  20 20 20 20 20 20 20 52  65 61 64 49 63 6f 6e 0d  |       ReadIcon.|
000209f0  90 42 04 0d 90 4c 52 20  4d 4f 56 20 20 20 20 20  |.B...LR MOV     |
00020a00  20 52 30 2c 52 39 20 20  20 20 20 20 20 20 20 20  | R0,R9          |
00020a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |              ;T|
00020a20  68 69 73 20 73 65 63 74  69 6f 6e 20 63 6f 6e 76  |his section conv|
00020a30  65 72 74 73 20 69 74 20  74 6f 20 6c 6f 77 65 72  |erts it to lower|
00020a40  20 63 61 73 65 0d 90 56  14 20 4d 4f 56 20 20 20  | case..V. MOV   |
00020a50  20 20 20 52 31 2c 23 31  33 0d 90 60 22 20 53 57  |   R1,#13..`" SW|
00020a60  49 20 20 20 20 20 20 22  53 74 72 69 6e 67 5f 54  |I      "String_T|
00020a70  6f 4c 6f 77 65 72 43 61  73 65 22 0d 90 6a 04 0d  |oLowerCase"..j..|
00020a80  90 74 52 20 4c 44 52 20  20 20 20 20 20 52 31 2c  |.tR LDR      R1,|
00020a90  5b 52 31 30 2c 23 73 68  6f 77 25 5d 20 20 20 20  |[R10,#show%]    |
00020aa0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00020ab0  73 65 63 74 69 6f 6e 20  73 74 6f 72 65 73 20 74  |section stores t|
00020ac0  68 65 20 63 75 72 72 65  6e 74 20 72 65 63 6f 72  |he current recor|
00020ad0  64 0d 90 7e 50 20 43 4d  50 20 20 20 20 20 20 52  |d..~P CMP      R|
00020ae0  31 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |1,#1            |
00020af0  20 20 20 20 20 20 20 20  20 20 20 20 3b 69 66 20  |            ;if |
00020b00  74 68 65 20 49 6e 64 65  78 66 69 6c 65 20 69 73  |the Indexfile is|
00020b10  20 62 65 69 6e 67 20 64  69 73 70 6c 61 79 65 64  | being displayed|
00020b20  2e 0d 90 88 20 20 20 4c  44 52 45 51 20 20 20 20  |....   LDREQ    |
00020b30  52 30 2c 5b 52 31 30 2c  23 72 65 63 6f 72 64 25  |R0,[R10,#record%|
00020b40  5d 0d 90 92 25 20 20 53  54 52 45 51 20 20 20 20  |]...%  STREQ    |
00020b50  52 30 2c 5b 52 31 30 2c  23 69 6e 64 65 78 72 65  |R0,[R10,#indexre|
00020b60  63 6f 72 64 25 5d 0d 90  9c 04 0d 90 a6 4e 20 4d  |cord%].......N M|
00020b70  4f 56 20 20 20 20 20 20  52 30 2c 23 26 38 46 20  |OV      R0,#&8F |
00020b80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020b90  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00020ba0  6f 6e 20 6f 70 65 6e 73  20 74 68 65 20 53 65 61  |on opens the Sea|
00020bb0  72 63 68 20 66 69 6c 65  0d 90 b0 3d 20 41 44 44  |rch file...= ADD|
00020bc0  20 20 20 20 20 20 52 31  2c 52 31 30 2c 23 73 65  |      R1,R10,#se|
00020bd0  61 72 63 68 66 69 6c 65  20 20 20 20 20 20 20 20  |archfile        |
00020be0  20 20 20 3b 66 6f 72 20  77 72 69 74 65 20 61 63  |   ;for write ac|
00020bf0  63 65 73 73 2e 0d 90 ba  18 20 53 57 49 20 20 20  |cess..... SWI   |
00020c00  20 20 20 22 58 4f 53 5f  46 69 6e 64 22 0d 90 c4  |   "XOS_Find"...|
00020c10  17 20 20 42 56 53 20 20  20 20 20 20 6e 6f 73 65  |.  BVS      nose|
00020c20  61 72 63 68 0d 90 ce 25  20 53 54 52 20 20 20 20  |arch...% STR    |
00020c30  20 20 52 30 2c 5b 52 31  30 2c 23 73 65 61 72 63  |  R0,[R10,#searc|
00020c40  68 68 61 6e 64 6c 65 25  5d 0d 90 d8 04 0d 90 e2  |hhandle%].......|
00020c50  50 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 26  |P MOV      R0,#&|
00020c60  34 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4F              |
00020c70  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00020c80  63 74 69 6f 6e 20 6f 70  65 6e 73 20 74 68 65 20  |ction opens the |
00020c90  49 6e 64 65 78 66 69 6c  65 20 66 6f 72 0d 90 ec  |Indexfile for...|
00020ca0  38 20 41 44 44 20 20 20  20 20 20 52 31 2c 52 31  |8 ADD      R1,R1|
00020cb0  30 2c 23 69 6e 64 65 78  66 69 6c 65 20 20 20 20  |0,#indexfile    |
00020cc0  20 20 20 20 20 20 20 20  3b 72 65 61 64 20 61 63  |        ;read ac|
00020cd0  63 65 73 73 2e 0d 90 f6  18 20 53 57 49 20 20 20  |cess..... SWI   |
00020ce0  20 20 20 22 58 4f 53 5f  46 69 6e 64 22 0d 91 00  |   "XOS_Find"...|
00020cf0  16 20 20 42 56 53 20 20  20 20 20 20 6e 6f 69 6e  |.  BVS      noin|
00020d00  64 65 78 0d 91 0a 24 20  53 54 52 20 20 20 20 20  |dex...$ STR     |
00020d10  20 52 30 2c 5b 52 31 30  2c 23 69 6e 64 65 78 68  | R0,[R10,#indexh|
00020d20  61 6e 64 6c 65 25 5d 0d  91 14 23 20 53 54 52 20  |andle%]...# STR |
00020d30  20 20 20 20 20 52 30 2c  5b 52 31 30 2c 23 66 69  |     R0,[R10,#fi|
00020d40  6c 65 68 61 6e 64 6c 65  25 5d 0d 91 1e 04 0d 91  |lehandle%]......|
00020d50  28 13 20 4d 4f 56 20 20  20 20 20 20 52 38 2c 23  |(. MOV      R8,#|
00020d60  31 0d 91 32 04 0d 91 3c  0f 2e 73 65 61 72 63 68  |1..2...<..search|
00020d70  6c 6f 6f 70 0d 91 46 4c  20 42 4c 20 20 20 20 20  |loop..FL BL     |
00020d80  20 20 70 65 72 63 65 6e  74 61 67 65 20 20 20 20  |  percentage    |
00020d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00020da0  54 68 69 73 20 73 68 6f  77 73 20 70 65 72 63 65  |This shows perce|
00020db0  6e 74 61 67 65 20 63 6f  6d 70 6c 65 74 69 6f 6e  |ntage completion|
00020dc0  0d 91 50 45 20 20 20 20  20 20 20 20 20 20 20 20  |..PE            |
00020dd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020de0  20 20 20 20 20 20 20 20  20 20 20 3b 75 6e 64 65  |           ;unde|
00020df0  72 6e 65 61 74 68 20 74  68 65 20 48 6f 75 72 67  |rneath the Hourg|
00020e00  6c 61 73 73 2e 0d 91 5a  4b 20 4d 4f 56 20 20 20  |lass...ZK MOV   |
00020e10  20 20 20 52 30 2c 52 38  20 20 20 20 20 20 20 20  |   R0,R8        |
00020e20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020e30  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 72 65  |;This section re|
00020e40  61 64 73 20 69 6e 20 61  20 72 65 63 6f 72 64 2e  |ads in a record.|
00020e50  0d 91 64 13 20 4d 4f 56  20 20 20 20 20 20 52 31  |..d. MOV      R1|
00020e60  2c 23 32 0d 91 6e 18 20  42 4c 20 20 20 20 20 20  |,#2..n. BL      |
00020e70  20 47 65 74 52 65 63 6f  72 64 73 0d 91 78 04 0d  | GetRecords..x..|
00020e80  91 82 4e 20 41 44 44 20  20 20 20 20 20 52 30 2c  |..N ADD      R0,|
00020e90  52 31 30 2c 23 72 65 63  6f 72 64 20 20 20 20 20  |R10,#record     |
00020ea0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00020eb0  73 65 63 74 69 6f 6e 20  63 6f 70 69 65 73 20 74  |section copies t|
00020ec0  68 65 20 73 74 72 69 6e  67 20 61 6e 64 0d 91 8c  |he string and...|
00020ed0  46 20 41 44 44 20 20 20  20 20 20 52 31 2c 52 39  |F ADD      R1,R9|
00020ee0  2c 23 39 30 20 20 20 20  20 20 20 20 20 20 20 20  |,#90            |
00020ef0  20 20 20 20 20 20 20 20  3b 63 6f 6e 76 65 72 74  |        ;convert|
00020f00  73 20 69 74 20 74 6f 20  6c 6f 77 65 72 20 63 61  |s it to lower ca|
00020f10  73 65 2e 0d 91 96 14 20  4d 4f 56 20 20 20 20 20  |se..... MOV     |
00020f20  20 52 32 2c 23 31 33 0d  91 a0 1c 20 53 57 49 20  | R2,#13.... SWI |
00020f30  20 20 20 20 20 22 53 74  72 69 6e 67 5f 4d 6f 76  |     "String_Mov|
00020f40  65 24 22 0d 91 aa 14 20  4d 4f 56 20 20 20 20 20  |e$".... MOV     |
00020f50  20 52 31 2c 23 31 33 0d  91 b4 22 20 53 57 49 20  | R1,#13..." SWI |
00020f60  20 20 20 20 20 22 53 74  72 69 6e 67 5f 54 6f 4c  |     "String_ToL|
00020f70  6f 77 65 72 43 61 73 65  22 0d 91 be 04 0d 91 c8  |owerCase".......|
00020f80  4f 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 52 39  |O MOV      R1,R9|
00020f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020fa0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 63 68  |        ;This ch|
00020fb0  65 63 6b 73 20 69 66 20  74 68 65 20 73 65 61 72  |ecks if the sear|
00020fc0  63 68 20 73 74 72 69 6e  67 20 69 73 0d 91 d2 44  |ch string is...D|
00020fd0  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 23 31 33  | MOV      R2,#13|
00020fe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00020ff0  20 20 20 20 20 20 20 3b  63 6f 6e 74 61 69 6e 65  |       ;containe|
00021000  64 20 69 6e 20 74 68 65  20 72 65 63 6f 72 64 2e  |d in the record.|
00021010  0d 91 dc 13 20 4d 4f 56  20 20 20 20 20 20 52 33  |.... MOV      R3|
00021020  2c 23 30 0d 91 e6 1c 20  53 57 49 20 20 20 20 20  |,#0.... SWI     |
00021030  20 22 53 74 72 69 6e 67  5f 49 6e 73 74 72 22 0d  | "String_Instr".|
00021040  91 f0 04 0d 91 fa 13 20  43 4d 4e 20 20 20 20 20  |....... CMN     |
00021050  20 52 33 2c 23 31 0d 92  04 1c 20 20 42 45 51 20  | R3,#1....  BEQ |
00021060  20 20 20 20 20 73 65 61  72 63 68 6c 6f 6f 70 65  |     searchloope|
00021070  6e 64 0d 92 0e 04 0d 92  18 4e 20 4d 4f 56 20 20  |nd.......N MOV  |
00021080  20 20 20 20 52 30 2c 23  30 20 20 20 20 20 20 20  |    R0,#0       |
00021090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000210a0  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 66  | ;This section f|
000210b0  69 6e 64 73 20 74 68 65  20 70 6f 73 69 74 69 6f  |inds the positio|
000210c0  6e 20 69 6e 0d 92 22 4a  20 4c 44 52 20 20 20 20  |n in.."J LDR    |
000210d0  20 20 52 31 2c 5b 52 31  30 2c 23 73 65 61 72 63  |  R1,[R10,#searc|
000210e0  68 68 61 6e 64 6c 65 25  5d 20 20 20 20 20 20 3b  |hhandle%]      ;|
000210f0  69 6e 20 74 68 65 20 73  65 61 72 63 68 20 66 69  |in the search fi|
00021100  6c 65 20 6f 66 20 74 68  65 20 66 69 6c 65 0d 92  |le of the file..|
00021110  2c 34 20 53 57 49 20 20  20 20 20 20 22 58 4f 53  |,4 SWI      "XOS|
00021120  5f 41 72 67 73 22 20 20  20 20 20 20 20 20 20 20  |_Args"          |
00021130  20 20 20 20 20 20 20 20  20 3b 70 6f 69 6e 74 65  |         ;pointe|
00021140  72 2e 0d 92 36 17 20 20  42 56 53 20 20 20 20 20  |r...6.  BVS     |
00021150  20 6e 6f 73 65 61 72 63  68 0d 92 40 13 20 4d 4f  | nosearch..@. MO|
00021160  56 20 20 20 20 20 20 52  37 2c 52 32 0d 92 4a 04  |V      R7,R2..J.|
00021170  0d 92 54 4e 20 41 44 44  20 20 20 20 20 20 52 30  |..TN ADD      R0|
00021180  2c 52 39 2c 23 39 30 20  20 20 20 20 20 20 20 20  |,R9,#90         |
00021190  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
000211a0  20 73 63 65 74 69 6f 6e  20 73 61 76 65 73 20 74  | scetion saves t|
000211b0  68 65 20 72 65 63 6f 72  64 20 69 6e 74 6f 0d 92  |he record into..|
000211c0  5e 3b 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |^; MOV      R2,#|
000211d0  31 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |13              |
000211e0  20 20 20 20 20 20 20 20  20 3b 74 68 65 20 53 65  |         ;the Se|
000211f0  61 72 63 68 66 69 6c 65  2e 0d 92 68 1d 20 53 57  |archfile...h. SW|
00021200  49 20 20 20 20 20 20 22  58 53 74 72 69 6e 67 5f  |I      "XString_|
00021210  50 75 74 24 23 22 0d 92  72 18 20 20 42 56 53 20  |Put$#"..r.  BVS |
00021220  20 20 20 20 20 20 6e 6f  73 65 61 72 63 68 0d 92  |      nosearch..|
00021230  7c 04 0d 92 86 4f 20 41  44 44 20 20 20 20 20 20  ||....O ADD      |
00021240  52 32 2c 52 37 2c 23 38  38 20 20 20 20 20 20 20  |R2,R7,#88       |
00021250  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00021260  69 73 20 73 65 63 74 69  6f 6e 20 6d 6f 76 65 73  |is section moves|
00021270  20 74 68 65 20 66 69 6c  65 20 70 6f 69 6e 74 65  | the file pointe|
00021280  72 0d 92 90 48 20 4d 4f  56 20 20 20 20 20 20 52  |r...H MOV      R|
00021290  30 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |0,#1            |
000212a0  20 20 20 20 20 20 20 20  20 20 20 20 3b 6f 6e 20  |            ;on |
000212b0  62 79 20 38 38 20 62 79  74 65 73 20 28 6f 6e 65  |by 88 bytes (one|
000212c0  20 72 65 63 6f 72 64 29  2e 0d 92 9a 18 20 53 57  | record)..... SW|
000212d0  49 20 20 20 20 20 20 22  58 4f 53 5f 41 72 67 73  |I      "XOS_Args|
000212e0  22 0d 92 a4 17 20 20 42  56 53 20 20 20 20 20 20  |"....  BVS      |
000212f0  6e 6f 73 65 61 72 63 68  0d 92 ae 04 0d 92 b8 13  |nosearch........|
00021300  20 2e 73 65 61 72 63 68  6c 6f 6f 70 65 6e 64 0d  | .searchloopend.|
00021310  92 c2 4e 20 4c 44 52 20  20 20 20 20 20 52 31 2c  |..N LDR      R1,|
00021320  5b 52 31 30 2c 23 69 6e  64 65 78 6d 61 78 25 5d  |[R10,#indexmax%]|
00021330  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00021340  73 65 63 74 69 6f 6e 20  6c 6f 6f 70 73 20 62 61  |section loops ba|
00021350  63 6b 20 69 66 20 77 65  20 68 61 76 65 0d 92 cc  |ck if we have...|
00021360  4c 20 43 4d 50 20 20 20  20 20 20 52 38 2c 52 31  |L CMP      R8,R1|
00021370  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021380  20 20 20 20 20 20 20 20  3b 6e 6f 74 20 72 65 61  |        ;not rea|
00021390  63 68 65 64 20 74 68 65  20 65 6e 64 20 6f 66 20  |ched the end of |
000213a0  74 68 65 20 66 69 6c 65  2e 0d 92 d6 17 20 20 41  |the file.....  A|
000213b0  44 44 4e 45 20 20 20 20  52 38 2c 52 38 2c 23 31  |DDNE    R8,R8,#1|
000213c0  0d 92 e0 19 20 20 42 4e  45 20 20 20 20 20 20 73  |....  BNE      s|
000213d0  65 61 72 63 68 6c 6f 6f  70 0d 92 ea 04 0d 92 f4  |earchloop.......|
000213e0  52 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 31  |R MOV      R0,#1|
000213f0  30 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |00              |
00021400  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 74 75  |        ;This tu|
00021410  72 6e 73 20 6f 66 20 74  68 65 20 70 65 72 63 65  |rns of the perce|
00021420  6e 74 61 67 65 20 69 6e  64 69 63 61 74 6f 72 0d  |ntage indicator.|
00021430  92 fe 24 20 53 57 49 20  20 20 20 20 20 22 48 6f  |..$ SWI      "Ho|
00021440  75 72 67 6c 61 73 73 5f  50 65 72 63 65 6e 74 61  |urglass_Percenta|
00021450  67 65 22 0d 93 08 04 0d  93 12 4d 20 4c 44 52 20  |ge".......M LDR |
00021460  20 20 20 20 20 52 30 2c  5b 52 31 30 2c 23 73 65  |     R0,[R10,#se|
00021470  61 72 63 68 68 61 6e 64  6c 65 25 5d 20 20 20 20  |archhandle%]    |
00021480  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00021490  63 6f 75 6e 74 73 20 74  68 65 20 6e 75 6d 62 65  |counts the numbe|
000214a0  72 20 6f 66 0d 93 1c 46  20 42 4c 20 20 20 20 20  |r of...F BL     |
000214b0  20 20 43 6f 75 6e 74 52  65 63 6f 72 64 73 20 20  |  CountRecords  |
000214c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000214d0  72 65 63 6f 72 64 73 20  69 6e 20 74 68 65 20 53  |records in the S|
000214e0  65 61 72 63 68 66 69 6c  65 2e 0d 93 26 22 20 53  |earchfile...&" S|
000214f0  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |TR      R0,[R10,|
00021500  23 73 65 61 72 63 68 6d  61 78 25 5d 0d 93 30 04  |#searchmax%]..0.|
00021510  0d 93 3a 50 20 43 4d 50  20 20 20 20 20 20 52 30  |..:P CMP      R0|
00021520  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00021530  20 20 20 20 20 20 20 20  20 20 3b 49 66 20 6e 6f  |          ;If no|
00021540  20 6d 61 74 63 68 65 73  20 77 65 65 20 66 6f 75  | matches wee fou|
00021550  6e 64 20 74 68 69 73 20  73 6f 75 6e 64 73 20 61  |nd this sounds a|
00021560  0d 93 44 50 20 20 42 4c  45 51 20 20 20 20 20 73  |..DP  BLEQ     s|
00021570  68 61 64 65 73 65 61 72  63 68 20 20 20 20 20 20  |hadesearch      |
00021580  20 20 20 20 20 20 20 20  20 20 3b 73 68 6f 72 74  |          ;short|
00021590  20 62 6c 65 65 70 20 61  6e 64 20 65 6e 73 75 72  | bleep and ensur|
000215a0  65 73 20 74 68 61 74 20  74 68 65 20 75 73 65 72  |es that the user|
000215b0  0d 93 4e 52 20 20 53 57  49 45 51 20 20 20 20 26  |..NR  SWIEQ    &|
000215c0  31 30 30 2b 37 20 3b 20  42 6c 65 65 70 20 20 20  |100+7 ; Bleep   |
000215d0  20 20 20 20 20 20 20 20  20 20 3b 63 61 6e 6e 6f  |          ;canno|
000215e0  74 20 73 77 69 74 63 68  20 74 6f 20 64 69 73 70  |t switch to disp|
000215f0  6c 61 79 20 74 68 65 20  53 65 61 72 63 68 66 69  |lay the Searchfi|
00021600  6c 65 0d 93 58 1c 20 20  42 4c 4e 45 20 20 20 20  |le..X.  BLNE    |
00021610  20 75 6e 73 68 61 64 65  73 65 61 72 63 68 0d 93  | unshadesearch..|
00021620  62 04 0d 93 6c 50 20 4d  4f 56 20 20 20 20 20 20  |b...lP MOV      |
00021630  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
00021640  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00021650  69 73 20 73 65 63 74 69  6f 6e 20 73 65 74 73 20  |is section sets |
00021660  74 68 65 20 63 75 72 72  65 6e 74 20 72 65 63 6f  |the current reco|
00021670  72 64 0d 93 76 46 20 53  54 52 20 20 20 20 20 20  |rd..vF STR      |
00021680  52 30 2c 5b 52 31 30 2c  23 73 65 61 72 63 68 72  |R0,[R10,#searchr|
00021690  65 63 6f 72 64 25 5d 20  20 20 20 20 20 3b 69 6e  |ecord%]      ;in|
000216a0  20 74 68 65 20 53 65 61  72 63 68 20 66 69 6c 65  | the Search file|
000216b0  20 74 6f 20 6e 6f 2e 31  0d 93 80 04 0d 93 8a 4e  | to no.1.......N|
000216c0  20 4c 44 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | LDR      R0,[R1|
000216d0  30 2c 23 73 68 6f 77 25  5d 20 20 20 20 20 20 20  |0,#show%]       |
000216e0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000216f0  74 69 6f 6e 20 6c 6f 61  64 73 20 62 61 63 6b 20  |tion loads back |
00021700  74 68 65 20 72 65 63 6f  72 64 0d 93 94 4e 20 43  |the record...N C|
00021710  4d 50 20 20 20 20 20 20  52 30 2c 23 31 20 20 20  |MP      R0,#1   |
00021720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021730  20 20 20 20 20 3b 74 68  61 74 20 77 61 73 20 73  |     ;that was s|
00021740  68 6f 77 69 6e 67 20 62  65 66 6f 72 65 20 74 68  |howing before th|
00021750  65 20 73 65 61 72 63 68  0d 93 9e 38 20 20 4c 44  |e search...8  LD|
00021760  52 45 51 20 20 20 20 52  30 2c 5b 52 31 30 2c 23  |REQ    R0,[R10,#|
00021770  69 6e 64 65 78 72 65 63  6f 72 64 25 5d 20 20 20  |indexrecord%]   |
00021780  20 20 20 3b 77 61 73 20  73 74 61 72 74 65 64 2e  |   ;was started.|
00021790  0d 93 a8 11 20 20 ec 51  20 20 20 20 52 31 2c 23  |....  .Q    R1,#|
000217a0  32 0d 93 b2 19 20 20 42  4c 45 51 20 20 20 20 20  |2....  BLEQ     |
000217b0  47 65 74 52 65 63 6f 72  64 73 0d 93 bc 04 0d 93  |GetRecords......|
000217c0  c6 50 20 20 4c 44 52 4e  45 20 20 20 20 52 30 2c  |.P  LDRNE    R0,|
000217d0  5b 52 31 30 2c 23 73 65  61 72 63 68 68 61 6e 64  |[R10,#searchhand|
000217e0  6c 65 25 5d 20 20 20 20  20 3b 54 68 69 73 20 73  |le%]     ;This s|
000217f0  65 63 74 69 6f 6e 20 73  77 69 74 63 68 65 73 20  |ection switches |
00021800  74 6f 20 73 68 6f 77 69  6e 67 20 74 68 65 0d 93  |to showing the..|
00021810  d0 37 20 20 53 54 52 4e  45 20 20 20 20 52 30 2c  |.7  STRNE    R0,|
00021820  5b 52 31 30 2c 23 66 69  6c 65 68 61 6e 64 6c 65  |[R10,#filehandle|
00021830  25 5d 20 20 20 20 20 20  20 3b 73 65 61 72 63 68  |%]       ;search|
00021840  66 69 6c 65 2e 0d 93 da  23 20 20 4c 44 52 4e 45  |file....#  LDRNE|
00021850  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 73 65 61  |    R0,[R10,#sea|
00021860  72 63 68 6d 61 78 25 5d  0d 93 e4 1d 20 20 53 54  |rchmax%]....  ST|
00021870  52 4e 45 20 20 20 20 52  30 2c 5b 52 31 30 2c 23  |RNE    R0,[R10,#|
00021880  6d 61 78 25 5d 0d 93 ee  26 20 20 4c 44 52 4e 45  |max%]...&  LDRNE|
00021890  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 73 65 61  |    R0,[R10,#sea|
000218a0  72 63 68 72 65 63 6f 72  64 25 5d 0d 93 f8 14 20  |rchrecord%].... |
000218b0  20 4d 4f 56 4e 45 20 20  20 20 52 31 2c 23 32 0d  | MOVNE    R1,#2.|
000218c0  94 02 19 20 20 42 4c 4e  45 20 20 20 20 20 47 65  |...  BLNE     Ge|
000218d0  74 52 65 63 6f 72 64 73  0d 94 0c 04 0d 94 16 50  |tRecords.......P|
000218e0  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 23 30 20  |  MOV     R0,#0 |
000218f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021900  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
00021910  74 69 6f 6e 20 63 6c 6f  73 65 73 20 74 68 65 20  |tion closes the |
00021920  73 65 61 72 63 68 20 66  69 6c 65 2e 0d 94 20 25  |search file... %|
00021930  20 20 4c 44 52 20 20 20  20 20 52 31 2c 5b 52 31  |  LDR     R1,[R1|
00021940  30 2c 23 73 65 61 72 63  68 68 61 6e 64 6c 65 25  |0,#searchhandle%|
00021950  5d 0d 94 2a 18 20 20 53  57 49 20 20 20 20 20 22  |]..*.  SWI     "|
00021960  58 4f 53 5f 46 69 6e 64  22 0d 94 34 04 0d 94 3e  |XOS_Find"..4...>|
00021970  4e 20 20 4d 4f 56 20 20  20 20 20 52 30 2c 23 30  |N  MOV     R0,#0|
00021980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021990  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
000219a0  63 74 69 6f 6e 20 63 6c  6f 73 65 73 20 74 68 65  |ction closes the|
000219b0  20 49 6e 64 65 78 66 69  6c 65 2e 0d 94 48 24 20  | Indexfile...H$ |
000219c0  20 4c 44 52 20 20 20 20  20 52 31 2c 5b 52 31 30  | LDR     R1,[R10|
000219d0  2c 23 69 6e 64 65 78 68  61 6e 64 6c 65 25 5d 0d  |,#indexhandle%].|
000219e0  94 52 18 20 20 53 57 49  20 20 20 20 20 22 58 4f  |.R.  SWI     "XO|
000219f0  53 5f 46 69 6e 64 22 0d  94 5c 04 0d 94 66 15 20  |S_Find"..\...f. |
00021a00  20 42 4c 20 20 20 20 20  20 20 55 70 64 61 74 65  | BL       Update|
00021a10  0d 94 70 1d 20 53 57 49  20 20 20 20 20 20 22 48  |..p. SWI      "H|
00021a20  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 94 7a  |ourglass_Off"..z|
00021a30  04 0d 94 84 1e 4c 44 4d  46 44 20 20 20 20 52 31  |.....LDMFD    R1|
00021a40  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
00021a50  94 8e 04 0d 94 98 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |......R;--------|
00021a60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00021aa0  2d 2d 2d 2d 2d 0d 94 a2  33 3b 20 20 20 20 20 20  |-----...3;      |
00021ab0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021ac0  20 20 20 20 20 20 2a 2a  2a 20 50 65 72 63 65 6e  |      *** Percen|
00021ad0  74 61 67 65 20 2a 2a 2a  0d 94 ac 51 3b 20 54 68  |tage ***...Q; Th|
00021ae0  69 73 20 73 65 63 74 69  6f 6e 20 73 68 6f 77 73  |is section shows|
00021af0  20 61 20 70 65 72 63 65  6e 74 61 67 65 20 69 6e  | a percentage in|
00021b00  64 69 63 61 74 6f 72 20  75 6e 64 65 72 6e 65 61  |dicator undernea|
00021b10  74 68 20 74 68 65 20 68  6f 75 72 67 6c 61 73 73  |th the hourglass|
00021b20  2c 20 73 68 6f 77 69 6e  67 0d 94 b6 2d 3b 20 74  |, showing...-; t|
00021b30  68 65 20 70 65 72 63 65  6e 74 61 67 65 20 6f 66  |he percentage of|
00021b40  20 74 68 65 20 73 65 61  72 63 68 20 63 6f 6d 70  | the search comp|
00021b50  6c 65 74 65 64 2e 0d 94  c0 04 0d 94 ca 0f 2e 70  |leted..........p|
00021b60  65 72 63 65 6e 74 61 67  65 0d 94 d4 04 0d 94 de  |ercentage.......|
00021b70  1e 53 54 4d 46 44 20 20  20 20 52 31 33 21 2c 7b  |.STMFD    R13!,{|
00021b80  52 30 2d 52 31 32 2c 52  31 34 7d 0d 94 e8 04 0d  |R0-R12,R14}.....|
00021b90  94 f2 4e 20 4d 4f 56 20  20 20 20 20 52 30 2c 23  |..N MOV     R0,#|
00021ba0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00021bb0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00021bc0  66 69 6e 64 73 20 74 68  65 20 63 75 72 72 65 6e  |finds the curren|
00021bd0  74 20 70 6f 73 69 74 69  6f 6e 20 69 6e 0d 94 fc  |t position in...|
00021be0  36 20 4c 44 52 20 20 20  20 20 52 31 2c 5b 52 31  |6 LDR     R1,[R1|
00021bf0  30 2c 23 69 6e 64 65 78  68 61 6e 64 6c 65 25 5d  |0,#indexhandle%]|
00021c00  20 20 20 20 20 20 20 20  3b 49 6e 64 65 78 66 69  |        ;Indexfi|
00021c10  6c 65 2e 0d 95 06 16 20  53 57 49 20 20 20 20 20  |le..... SWI     |
00021c20  22 4f 53 5f 41 72 67 73  22 0d 95 10 04 0d 95 1a  |"OS_Args".......|
00021c30  50 20 4d 4f 56 20 20 20  20 20 52 34 2c 52 32 2c  |P MOV     R4,R2,|
00021c40  4c 53 4c 20 23 33 20 20  20 20 20 20 20 20 20 20  |LSL #3          |
00021c50  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00021c60  63 74 69 6f 6e 20 6d 75  6c 74 69 70 6c 69 65 73  |ction multiplies|
00021c70  20 74 68 65 20 70 6f 73  69 74 69 6f 6e 0d 95 24  | the position..$|
00021c80  32 20 41 44 44 20 20 20  20 20 52 34 2c 52 34 2c  |2 ADD     R4,R4,|
00021c90  52 32 2c 4c 53 4c 20 23  31 20 20 20 20 20 20 20  |R2,LSL #1       |
00021ca0  20 20 20 20 20 20 20 20  3b 62 79 20 31 30 30 0d  |        ;by 100.|
00021cb0  95 2e 19 20 4d 4f 56 20  20 20 20 20 52 33 2c 52  |... MOV     R3,R|
00021cc0  34 2c 4c 53 4c 20 23 33  0d 95 38 1c 20 41 44 44  |4,LSL #3..8. ADD|
00021cd0  20 20 20 20 20 52 33 2c  52 33 2c 52 34 2c 4c 53  |     R3,R3,R4,LS|
00021ce0  4c 20 23 31 0d 95 42 04  0d 95 4c 4f 20 4d 4f 56  |L #1..B...LO MOV|
00021cf0  20 20 20 20 20 52 30 2c  23 32 20 20 20 20 20 20  |     R0,#2      |
00021d00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021d10  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00021d20  20 66 69 6e 64 73 20 74  68 65 20 74 6f 74 61 6c  | finds the total|
00021d30  20 65 78 74 65 6e 74 0d  95 56 38 20 53 57 49 20  | extent..V8 SWI |
00021d40  20 20 20 20 22 4f 53 5f  41 72 67 73 22 20 20 20  |    "OS_Args"   |
00021d50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021d60  20 20 3b 6f 66 20 74 68  65 20 66 69 6c 65 2e 0d  |  ;of the file..|
00021d70  95 60 12 20 4d 4f 56 20  20 20 20 20 52 31 2c 52  |.`. MOV     R1,R|
00021d80  32 0d 95 6a 12 20 4d 4f  56 20 20 20 20 20 52 30  |2..j. MOV     R0|
00021d90  2c 52 33 0d 95 74 04 0d  95 7e 51 20 42 4c 20 20  |,R3..t...~Q BL  |
00021da0  20 20 20 20 44 69 76 69  64 65 20 20 20 20 20 20  |    Divide      |
00021db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021dc0  20 20 3b 54 68 69 73 20  64 69 76 69 64 65 73 20  |  ;This divides |
00021dd0  6f 6e 65 20 62 79 20 74  68 65 20 6f 74 68 65 72  |one by the other|
00021de0  20 74 6f 20 66 69 6e 64  0d 95 88 44 20 20 20 20  | to find...D    |
00021df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00021e10  20 20 20 3b 74 68 65 20  70 65 72 63 65 6e 74 61  |   ;the percenta|
00021e20  67 65 20 63 6f 6d 70 6c  65 74 65 2e 0d 95 92 04  |ge complete.....|
00021e30  0d 95 9c 50 20 4d 4f 56  20 20 20 20 20 52 30 2c  |...P MOV     R0,|
00021e40  52 32 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R2              |
00021e50  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00021e60  20 73 65 63 74 69 6f 6e  20 64 69 73 70 6c 61 79  | section display|
00021e70  73 20 74 68 65 20 70 65  72 63 65 6e 74 61 67 65  |s the percentage|
00021e80  0d 95 a6 40 20 53 57 49  20 20 20 20 20 22 48 6f  |...@ SWI     "Ho|
00021e90  75 72 67 6c 61 73 73 5f  50 65 72 63 65 6e 74 61  |urglass_Percenta|
00021ea0  67 65 22 20 20 20 20 20  20 20 20 3b 75 6e 64 65  |ge"        ;unde|
00021eb0  72 20 74 68 65 20 68 6f  75 72 67 6c 61 73 73 2e  |r the hourglass.|
00021ec0  0d 95 b0 04 0d 95 ba 1e  4c 44 4d 46 44 20 20 20  |........LDMFD   |
00021ed0  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 50 43  | R13!,{R0-R12,PC|
00021ee0  7d 5e 0d 95 c4 04 0d 95  ce 52 3b 2d 2d 2d 2d 2d  |}^.......R;-----|
00021ef0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00021f30  2d 2d 2d 2d 2d 2d 2d 2d  0d 95 d8 33 3b 20 20 20  |--------...3;   |
00021f40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00021f50  20 20 20 20 20 20 20 20  2a 2a 2a 20 53 68 61 64  |        *** Shad|
00021f60  65 53 65 61 72 63 68 20  2a 2a 2a 0d 95 e2 4f 3b  |eSearch ***...O;|
00021f70  20 54 68 69 73 20 73 75  62 72 6f 75 74 69 6e 65  | This subroutine|
00021f80  20 67 72 65 79 73 20 6f  75 74 20 74 68 65 20 27  | greys out the '|
00021f90  4c 61 73 74 20 53 65 61  72 63 68 27 20 69 63 6f  |Last Search' ico|
00021fa0  6e 20 69 6e 20 74 68 65  20 44 69 73 70 6c 61 79  |n in the Display|
00021fb0  20 77 69 6e 64 6f 77 20  73 6f 0d 95 ec 52 3b 20  | window so...R; |
00021fc0  74 68 61 74 20 69 74 20  69 73 20 75 6e 73 65 6c  |that it is unsel|
00021fd0  65 63 74 61 62 6c 65 20  77 68 65 6e 20 6e 6f 20  |ectable when no |
00021fe0  6d 61 74 63 68 65 73 20  63 6f 75 6c 64 20 62 65  |matches could be|
00021ff0  20 66 6f 75 6e 64 20 77  69 74 68 20 74 68 65 20  | found with the |
00022000  6c 61 73 74 20 73 65 61  72 63 68 2e 0d 95 f6 04  |last search.....|
00022010  0d 96 00 10 2e 73 68 61  64 65 73 65 61 72 63 68  |.....shadesearch|
00022020  0d 96 0a 04 0d 96 14 1d  53 54 4d 46 44 20 20 20  |........STMFD   |
00022030  20 52 31 33 21 2c 7b 52  30 2d 52 31 2c 52 31 34  | R13!,{R0-R1,R14|
00022040  7d 0d 96 1e 04 0d 96 28  20 20 4c 44 52 20 20 20  |}......(  LDR   |
00022050  20 20 20 52 30 2c 5b 52  31 32 2c 23 64 69 73 70  |   R0,[R12,#disp|
00022060  6c 61 79 25 5d 0d 96 32  20 20 53 54 52 20 20 20  |lay%]..2  STR   |
00022070  20 20 20 52 30 2c 5b 52  31 32 2c 23 62 6c 6f 63  |   R0,[R12,#bloc|
00022080  6b 25 2b 30 5d 0d 96 3c  14 20 4d 4f 56 20 20 20  |k%+0]..<. MOV   |
00022090  20 20 20 52 30 2c 23 33  38 0d 96 46 20 20 53 54  |   R0,#38..F  ST|
000220a0  52 20 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |R      R0,[R12,#|
000220b0  62 6c 6f 63 6b 25 2b 34  5d 0d 96 50 13 20 4d 4f  |block%+4]..P. MO|
000220c0  56 20 20 20 20 20 20 52  30 2c 23 30 0d 96 5a 20  |V      R0,#0..Z |
000220d0  20 53 54 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | STR      R0,[R1|
000220e0  32 2c 23 62 6c 6f 63 6b  25 2b 38 5d 0d 96 64 18  |2,#block%+8]..d.|
000220f0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 25 31  | MOV      R0,#%1|
00022100  3c 3c 32 33 0d 96 6e 21  20 53 54 52 20 20 20 20  |<<23..n! STR    |
00022110  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00022120  25 2b 31 32 5d 0d 96 78  04 0d 96 82 1c 20 41 44  |%+12]..x..... AD|
00022130  44 20 20 20 20 20 20 52  31 2c 52 31 32 2c 23 62  |D      R1,R12,#b|
00022140  6c 6f 63 6b 25 0d 96 8c  21 20 53 57 49 20 20 20  |lock%...! SWI   |
00022150  20 20 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |   "Wimp_SetIcon|
00022160  53 74 61 74 65 22 0d 96  96 04 0d 96 a0 17 20 42  |State"........ B|
00022170  4c 20 20 20 20 20 20 20  53 68 6f 77 49 6e 64 65  |L       ShowInde|
00022180  78 0d 96 aa 04 0d 96 b4  1d 4c 44 4d 46 44 20 20  |x........LDMFD  |
00022190  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 2c 50 43  |  R13!,{R0-R1,PC|
000221a0  7d 5e 0d 96 be 04 0d 96  c8 52 3b 2d 2d 2d 2d 2d  |}^.......R;-----|
000221b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000221f0  2d 2d 2d 2d 2d 2d 2d 2d  0d 96 d2 33 3b 20 20 20  |--------...3;   |
00022200  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022210  20 20 20 20 20 20 2a 2a  2a 20 55 6e 73 68 61 64  |      *** Unshad|
00022220  65 53 65 61 63 72 68 20  2a 2a 2a 0d 96 dc 4c 3b  |eSeacrh ***...L;|
00022230  20 54 68 69 73 20 73 65  63 74 69 6f 6e 20 65 6e  | This section en|
00022240  73 75 72 65 73 20 74 68  61 74 20 74 68 65 20 27  |sures that the '|
00022250  4c 61 73 74 20 53 65 61  72 63 68 27 20 69 63 6f  |Last Search' ico|
00022260  6e 20 69 73 20 73 65 6c  65 63 74 61 62 6c 65 20  |n is selectable |
00022270  61 66 74 65 72 20 61 0d  96 e6 52 3b 20 73 65 61  |after a...R; sea|
00022280  72 63 68 20 68 61 73 20  66 6f 75 6e 64 20 73 6f  |rch has found so|
00022290  6d 65 20 6d 61 74 63 68  69 6e 67 20 72 65 63 6f  |me matching reco|
000222a0  72 64 73 2e 20 49 74 20  61 6c 73 6f 20 65 6e 73  |rds. It also ens|
000222b0  75 72 65 73 20 74 68 61  74 20 74 68 65 20 27 4e  |ures that the 'N|
000222c0  6f 74 20 46 6f 75 6e 64  27 0d 96 f0 3f 3b 20 69  |ot Found'...?; i|
000222d0  63 6f 6e 20 68 61 73 20  69 74 73 20 44 65 6c 65  |con has its Dele|
000222e0  74 65 64 20 62 69 74 20  73 65 74 20 73 6f 20 74  |ted bit set so t|
000222f0  68 61 74 20 69 74 20 69  73 20 6e 6f 74 20 64 69  |hat it is not di|
00022300  73 70 6c 61 79 65 64 2e  0d 96 fa 04 0d 97 04 12  |splayed.........|
00022310  2e 75 6e 73 68 61 64 65  73 65 61 72 63 68 0d 97  |.unshadesearch..|
00022320  0e 04 0d 97 18 1d 53 54  4d 46 44 20 20 20 20 52  |......STMFD    R|
00022330  31 33 21 2c 7b 52 30 2d  52 31 2c 52 31 34 7d 0d  |13!,{R0-R1,R14}.|
00022340  97 22 04 0d 97 2c 50 20  4c 44 52 20 20 20 20 20  |."...,P LDR     |
00022350  20 52 30 2c 5b 52 31 32  2c 23 64 69 73 70 6c 61  | R0,[R12,#displa|
00022360  79 25 5d 20 20 20 20 20  20 20 20 20 20 20 3b 54  |y%]           ;T|
00022370  68 69 73 20 73 65 63 74  69 6f 6e 20 64 65 6c 65  |his section dele|
00022380  74 65 73 20 74 68 65 20  27 4e 6f 74 20 46 6f 75  |tes the 'Not Fou|
00022390  6e 64 27 0d 97 36 31 20  53 54 52 20 20 20 20 20  |nd'..61 STR     |
000223a0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
000223b0  2b 30 5d 20 20 20 20 20  20 20 20 20 20 20 3b 69  |+0]           ;i|
000223c0  63 6f 6e 2e 0d 97 40 14  20 4d 4f 56 20 20 20 20  |con...@. MOV    |
000223d0  20 20 52 30 2c 23 33 38  0d 97 4a 20 20 53 54 52  |  R0,#38..J  STR|
000223e0  20 20 20 20 20 20 52 30  2c 5b 52 31 32 2c 23 62  |      R0,[R12,#b|
000223f0  6c 6f 63 6b 25 2b 34 5d  0d 97 54 18 20 4d 4f 56  |lock%+4]..T. MOV|
00022400  20 20 20 20 20 20 52 30  2c 23 25 31 3c 3c 32 33  |      R0,#%1<<23|
00022410  0d 97 5e 20 20 53 54 52  20 20 20 20 20 20 52 30  |..^  STR      R0|
00022420  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 38 5d  |,[R12,#block%+8]|
00022430  0d 97 68 21 20 53 54 52  20 20 20 20 20 20 52 30  |..h! STR      R0|
00022440  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 31 32  |,[R12,#block%+12|
00022450  5d 0d 97 72 1c 20 41 44  44 20 20 20 20 20 20 52  |]..r. ADD      R|
00022460  31 2c 52 31 32 2c 23 62  6c 6f 63 6b 25 0d 97 7c  |1,R12,#block%..||
00022470  21 20 53 57 49 20 20 20  20 20 20 22 57 69 6d 70  |! SWI      "Wimp|
00022480  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 0d 97  |_SetIconState"..|
00022490  86 04 0d 97 90 51 20 4d  4f 56 20 20 20 20 20 20  |.....Q MOV      |
000224a0  52 30 2c 23 32 37 20 20  20 20 20 20 20 20 20 20  |R0,#27          |
000224b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
000224c0  69 73 20 73 65 63 74 69  6f 6e 20 65 6e 73 75 72  |is section ensur|
000224d0  65 73 20 74 68 61 74 20  74 68 65 20 27 67 72 65  |es that the 'gre|
000224e0  79 65 64 0d 97 9a 4d 20  53 54 52 20 20 20 20 20  |yed...M STR     |
000224f0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00022500  2b 34 5d 20 20 20 20 20  20 20 20 20 20 20 3b 6f  |+4]           ;o|
00022510  75 74 27 20 62 69 74 20  69 73 20 6e 6f 74 20 73  |ut' bit is not s|
00022520  65 74 20 66 6f 72 20 74  68 65 20 27 4c 61 73 74  |et for the 'Last|
00022530  0d 97 a4 39 20 4d 4f 56  20 20 20 20 20 20 52 30  |...9 MOV      R0|
00022540  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00022550  20 20 20 20 20 20 20 20  20 20 20 3b 53 65 61 72  |           ;Sear|
00022560  63 68 27 20 69 63 6f 6e  2e 0d 97 ae 20 20 53 54  |ch' icon....  ST|
00022570  52 20 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |R      R0,[R12,#|
00022580  62 6c 6f 63 6b 25 2b 38  5d 0d 97 b8 17 20 4d 4f  |block%+8].... MO|
00022590  56 20 20 20 20 20 20 52  30 2c 23 31 3c 3c 32 32  |V      R0,#1<<22|
000225a0  0d 97 c2 21 20 53 54 52  20 20 20 20 20 20 52 30  |...! STR      R0|
000225b0  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 31 32  |,[R12,#block%+12|
000225c0  5d 0d 97 cc 04 0d 97 d6  1c 20 41 44 44 20 20 20  |]........ ADD   |
000225d0  20 20 20 52 31 2c 52 31  32 2c 23 62 6c 6f 63 6b  |   R1,R12,#block|
000225e0  25 0d 97 e0 21 20 53 57  49 20 20 20 20 20 20 22  |%...! SWI      "|
000225f0  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
00022600  65 22 0d 97 ea 04 0d 97  f4 18 20 42 4c 20 20 20  |e"........ BL   |
00022610  20 20 20 20 53 68 6f 77  53 65 61 72 63 68 0d 97  |    ShowSearch..|
00022620  fe 04 0d 98 08 1d 4c 44  4d 46 44 20 20 20 20 52  |......LDMFD    R|
00022630  31 33 21 2c 7b 52 30 2d  52 31 2c 50 43 7d 5e 0d  |13!,{R0-R1,PC}^.|
00022640  98 12 04 0d 98 1c 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |......R;--------|
00022650  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00022690  2d 2d 2d 2d 2d 0d 98 26  30 3b 20 20 20 20 20 20  |-----..&0;      |
000226a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000226b0  20 20 20 20 2a 2a 2a 20  53 68 61 64 65 53 61 76  |    *** ShadeSav|
000226c0  65 20 2a 2a 2a 0d 98 30  4c 3b 20 54 68 69 73 20  |e ***..0L; This |
000226d0  73 75 62 72 6f 75 74 69  6e 65 20 73 68 61 64 65  |subroutine shade|
000226e0  73 20 6f 75 74 20 74 68  65 20 69 63 6f 6e 73 20  |s out the icons |
000226f0  69 6e 20 74 68 65 20 62  6f 74 74 6f 6d 20 73 65  |in the bottom se|
00022700  63 74 69 6f 6e 20 6f 66  20 74 68 65 20 53 61 76  |ction of the Sav|
00022710  65 0d 98 3a 3c 3b 20 64  69 61 6c 6f 67 75 65 20  |e..:<; dialogue |
00022720  62 6f 78 20 77 68 65 6e  20 74 68 65 20 27 4d 75  |box when the 'Mu|
00022730  6c 74 69 70 6c 65 27 20  69 63 6f 6e 20 69 73 20  |ltiple' icon is |
00022740  6e 6f 74 20 73 65 6c 65  63 74 65 64 2e 0d 98 44  |not selected...D|
00022750  04 0d 98 4e 0e 2e 53 68  61 64 65 53 61 76 65 0d  |...N..ShadeSave.|
00022760  98 58 04 0d 98 62 1d 53  54 4d 46 44 20 20 20 20  |.X...b.STMFD    |
00022770  52 31 33 21 2c 7b 52 30  2d 52 31 2c 52 31 34 7d  |R13!,{R0-R1,R14}|
00022780  0d 98 6c 04 0d 98 76 51  20 4c 44 52 20 20 20 20  |..l...vQ LDR    |
00022790  20 20 52 30 2c 5b 52 31  32 2c 23 73 61 76 65 25  |  R0,[R12,#save%|
000227a0  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |]              ;|
000227b0  54 68 69 73 20 73 65 63  74 69 6f 6e 20 73 65 74  |This section set|
000227c0  73 20 75 70 20 74 68 65  20 64 65 74 61 69 6c 73  |s up the details|
000227d0  20 74 68 61 74 0d 98 80  43 20 53 54 52 20 20 20  | that...C STR   |
000227e0  20 20 20 52 30 2c 5b 52  31 32 2c 23 62 6c 6f 63  |   R0,[R12,#bloc|
000227f0  6b 25 2b 30 5d 20 20 20  20 20 20 20 20 20 20 20  |k%+0]           |
00022800  3b 61 70 70 6c 79 20 74  6f 20 61 6c 6c 20 74 68  |;apply to all th|
00022810  65 20 69 63 6f 6e 73 2e  0d 98 8a 18 20 4d 4f 56  |e icons..... MOV|
00022820  20 20 20 20 20 20 52 30  2c 23 25 31 3c 3c 32 32  |      R0,#%1<<22|
00022830  0d 98 94 20 20 53 54 52  20 20 20 20 20 20 52 30  |...  STR      R0|
00022840  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 38 5d  |,[R12,#block%+8]|
00022850  0d 98 9e 21 20 53 54 52  20 20 20 20 20 20 52 30  |...! STR      R0|
00022860  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 31 32  |,[R12,#block%+12|
00022870  5d 0d 98 a8 04 0d 98 b2  1c 20 41 44 44 20 20 20  |]........ ADD   |
00022880  20 20 20 52 31 2c 52 31  32 2c 23 62 6c 6f 63 6b  |   R1,R12,#block|
00022890  25 0d 98 bc 14 20 4d 4f  56 20 20 20 20 20 20 52  |%.... MOV      R|
000228a0  32 2c 23 31 30 0d 98 c6  04 0d 98 d0 52 2e 73 68  |2,#10.......R.sh|
000228b0  61 64 65 73 61 76 65 6c  6f 6f 70 20 20 20 20 20  |adesaveloop     |
000228c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000228d0  20 20 20 20 3b 54 68 69  73 20 6c 6f 6f 70 20 67  |    ;This loop g|
000228e0  72 65 79 73 20 6f 75 74  20 65 61 63 68 20 69 63  |reys out each ic|
000228f0  6f 6e 20 69 6e 20 74 75  72 6e 2e 0d 98 da 20 20  |on in turn....  |
00022900  53 54 52 20 20 20 20 20  20 52 32 2c 5b 52 31 32  |STR      R2,[R12|
00022910  2c 23 62 6c 6f 63 6b 25  2b 34 5d 0d 98 e4 21 20  |,#block%+4]...! |
00022920  53 57 49 20 20 20 20 20  20 22 57 69 6d 70 5f 53  |SWI      "Wimp_S|
00022930  65 74 49 63 6f 6e 53 74  61 74 65 22 0d 98 ee 14  |etIconState"....|
00022940  20 43 4d 50 20 20 20 20  20 20 52 32 2c 23 31 32  | CMP      R2,#12|
00022950  0d 98 f8 17 20 20 41 44  44 4e 45 20 20 20 20 52  |....  ADDNE    R|
00022960  32 2c 52 32 2c 23 31 0d  99 02 1c 20 20 42 4e 45  |2,R2,#1....  BNE|
00022970  20 20 20 20 20 20 73 68  61 64 65 73 61 76 65 6c  |      shadesavel|
00022980  6f 6f 70 0d 99 0c 04 0d  99 16 1d 4c 44 4d 46 44  |oop........LDMFD|
00022990  20 20 20 20 52 31 33 21  2c 7b 52 30 2d 52 31 2c  |    R13!,{R0-R1,|
000229a0  50 43 7d 5e 0d 99 20 04  0d 99 2a 52 3b 2d 2d 2d  |PC}^.. ...*R;---|
000229b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000229f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 99 34 33 3b 20  |----------..43; |
00022a00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022a10  20 20 20 20 20 20 20 20  20 20 2a 2a 2a 20 55 6e  |          *** Un|
00022a20  73 68 61 64 65 53 61 76  65 20 2a 2a 2a 0d 99 3e  |shadeSave ***..>|
00022a30  4b 3b 20 54 68 69 73 20  73 75 62 72 6f 75 74 69  |K; This subrouti|
00022a40  6e 65 20 65 6e 73 75 72  65 73 20 74 68 61 74 20  |ne ensures that |
00022a50  74 68 65 20 69 63 6f 6e  73 20 69 6e 20 74 68 65  |the icons in the|
00022a60  20 62 6f 74 74 6f 6d 20  70 61 72 74 20 6f 66 20  | bottom part of |
00022a70  74 68 65 20 53 61 76 65  0d 99 48 4b 3b 20 64 69  |the Save..HK; di|
00022a80  61 6c 6f 67 75 65 20 62  6f 78 20 61 72 65 20 75  |alogue box are u|
00022a90  6e 73 68 61 64 65 64 20  61 6e 64 20 73 65 6c 65  |nshaded and sele|
00022aa0  63 74 61 62 6c 65 2c 20  77 68 65 6e 20 74 68 65  |ctable, when the|
00022ab0  20 27 4d 75 6c 74 69 70  6c 65 27 20 69 63 6f 6e  | 'Multiple' icon|
00022ac0  20 69 73 0d 99 52 0f 3b  20 73 65 6c 65 63 74 65  | is..R.; selecte|
00022ad0  64 2e 0d 99 5c 04 0d 99  66 10 2e 55 6e 73 68 61  |d...\...f..Unsha|
00022ae0  64 65 53 61 76 65 0d 99  70 04 0d 99 7a 1d 53 54  |deSave..p...z.ST|
00022af0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00022b00  52 31 2c 52 31 34 7d 0d  99 84 04 0d 99 8e 51 20  |R1,R14}.......Q |
00022b10  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
00022b20  2c 23 73 61 76 65 25 5d  20 20 20 20 20 20 20 20  |,#save%]        |
00022b30  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00022b40  69 6f 6e 20 73 65 74 73  20 75 70 20 74 68 65 20  |ion sets up the |
00022b50  64 65 74 61 69 6c 73 20  74 68 61 74 0d 99 98 48  |details that...H|
00022b60  20 53 54 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | STR      R0,[R1|
00022b70  32 2c 23 62 6c 6f 63 6b  25 2b 30 5d 20 20 20 20  |2,#block%+0]    |
00022b80  20 20 20 20 20 20 20 3b  74 68 61 74 20 61 70 70  |       ;that app|
00022b90  6c 79 20 74 6f 20 61 6c  6c 20 74 68 65 20 69 63  |ly to all the ic|
00022ba0  6f 6e 73 2e 0d 99 a2 13  20 4d 4f 56 20 20 20 20  |ons..... MOV    |
00022bb0  20 20 52 30 2c 23 30 0d  99 ac 20 20 53 54 52 20  |  R0,#0...  STR |
00022bc0  20 20 20 20 20 52 30 2c  5b 52 31 32 2c 23 62 6c  |     R0,[R12,#bl|
00022bd0  6f 63 6b 25 2b 38 5d 0d  99 b6 18 20 4d 4f 56 20  |ock%+8].... MOV |
00022be0  20 20 20 20 20 52 30 2c  23 25 31 3c 3c 32 32 0d  |     R0,#%1<<22.|
00022bf0  99 c0 21 20 53 54 52 20  20 20 20 20 20 52 30 2c  |..! STR      R0,|
00022c00  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 31 32 5d  |[R12,#block%+12]|
00022c10  0d 99 ca 1c 20 41 44 44  20 20 20 20 20 20 52 31  |.... ADD      R1|
00022c20  2c 52 31 32 2c 23 62 6c  6f 63 6b 25 0d 99 d4 14  |,R12,#block%....|
00022c30  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 23 31 30  | MOV      R2,#10|
00022c40  0d 99 de 04 0d 99 e8 4e  2e 75 6e 73 68 61 64 65  |.......N.unshade|
00022c50  73 61 76 65 6c 6f 6f 70  20 20 20 20 20 20 20 20  |saveloop        |
00022c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00022c70  54 68 69 73 20 73 65 63  74 69 6f 6e 20 75 6e 73  |This section uns|
00022c80  68 61 64 65 73 20 65 61  63 68 20 69 63 6f 6e 20  |hades each icon |
00022c90  69 6e 0d 99 f2 31 20 53  54 52 20 20 20 20 20 20  |in...1 STR      |
00022ca0  52 32 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R2,[R12,#block%+|
00022cb0  34 5d 20 20 20 20 20 20  20 20 20 20 20 3b 74 75  |4]           ;tu|
00022cc0  72 6e 2e 0d 99 fc 21 20  53 57 49 20 20 20 20 20  |rn....! SWI     |
00022cd0  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
00022ce0  61 74 65 22 0d 9a 06 14  20 43 4d 50 20 20 20 20  |ate".... CMP    |
00022cf0  20 20 52 32 2c 23 31 32  0d 9a 10 17 20 20 41 44  |  R2,#12....  AD|
00022d00  44 4e 45 20 20 20 20 52  32 2c 52 32 2c 23 31 0d  |DNE    R2,R2,#1.|
00022d10  9a 1a 1e 20 20 42 4e 45  20 20 20 20 20 20 75 6e  |...  BNE      un|
00022d20  73 68 61 64 65 73 61 76  65 6c 6f 6f 70 0d 9a 24  |shadesaveloop..$|
00022d30  04 0d 9a 2e 1d 4c 44 4d  46 44 20 20 20 20 52 31  |.....LDMFD    R1|
00022d40  33 21 2c 7b 52 30 2d 52  31 2c 50 43 7d 5e 0d 9a  |3!,{R0-R1,PC}^..|
00022d50  38 04 0d 9a 42 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |8...BR;---------|
00022d60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00022da0  2d 2d 2d 2d 0d 9a 4c 33  3b 20 20 20 20 20 20 20  |----..L3;       |
00022db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022dc0  20 20 20 20 20 20 2a 2a  2a 20 57 72 69 74 65 49  |      *** WriteI|
00022dd0  63 6f 6e 20 2a 2a 2a 0d  9a 56 4b 3b 54 68 69 73  |con ***..VK;This|
00022de0  20 73 75 62 72 6f 75 74  69 6e 65 20 74 61 6b 65  | subroutine take|
00022df0  73 20 61 20 73 74 72 69  6e 67 20 70 6f 69 6e 74  |s a string point|
00022e00  65 64 20 74 6f 20 62 79  20 52 32 20 61 6e 64 20  |ed to by R2 and |
00022e10  63 6f 70 69 65 73 20 69  74 20 69 6e 74 6f 20 74  |copies it into t|
00022e20  68 65 0d 9a 60 37 3b 69  6e 64 69 72 65 63 74 69  |he..`7;indirecti|
00022e30  6f 6e 20 62 75 66 66 65  72 20 6f 66 20 74 68 65  |on buffer of the|
00022e40  20 69 63 6f 6e 20 73 70  65 63 69 66 69 65 64 20  | icon specified |
00022e50  62 79 20 52 30 2f 52 31  2e 0d 9a 6a 04 0d 9a 74  |by R0/R1...j...t|
00022e60  0e 2e 57 72 69 74 65 49  63 6f 6e 0d 9a 7e 14 3b  |..WriteIcon..~.;|
00022e70  52 30 3d 57 69 6e 64 6f  77 48 61 6e 64 6c 65 0d  |R0=WindowHandle.|
00022e80  9a 88 12 3b 52 31 3d 49  63 6f 6e 48 61 6e 64 6c  |...;R1=IconHandl|
00022e90  65 0d 9a 92 15 3b 52 32  3d 50 6f 69 6e 74 65 72  |e....;R2=Pointer|
00022ea0  54 6f 54 65 78 74 0d 9a  9c 04 0d 9a a6 1d 53 54  |ToText........ST|
00022eb0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00022ec0  52 38 2c 52 31 34 7d 0d  9a b0 04 0d 9a ba 4e 20  |R8,R14}.......N |
00022ed0  4d 4f 56 20 20 20 20 20  20 52 37 2c 52 30 20 20  |MOV      R7,R0  |
00022ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022ef0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00022f00  69 6f 6e 20 63 6f 70 69  65 73 20 74 68 65 20 70  |ion copies the p|
00022f10  61 72 61 6d 65 74 65 72  73 0d 9a c4 52 20 4d 4f  |arameters...R MO|
00022f20  56 20 20 20 20 20 20 52  36 2c 52 31 20 20 20 20  |V      R6,R1    |
00022f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022f40  20 20 20 20 3b 69 6e 74  6f 20 68 69 67 68 20 6e  |    ;into high n|
00022f50  75 6d 62 65 72 65 64 20  72 65 67 69 73 74 65 72  |umbered register|
00022f60  73 20 66 6f 72 20 6c 61  74 65 72 0d 9a ce 30 20  |s for later...0 |
00022f70  4d 4f 56 20 20 20 20 20  20 52 35 2c 52 32 20 20  |MOV      R5,R2  |
00022f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00022f90  20 20 20 20 20 20 3b 75  73 65 2e 0d 9a d8 04 0d  |      ;use......|
00022fa0  9a e2 50 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |..P MOV      R0,|
00022fb0  52 32 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R2              |
00022fc0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00022fd0  73 65 63 74 69 6f 6e 20  66 69 6e 64 73 20 74 68  |section finds th|
00022fe0  65 20 6c 65 6e 67 74 68  20 6f 66 20 74 68 65 0d  |e length of the.|
00022ff0  9a ec 38 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |..8 MOV      R1,|
00023000  23 31 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |#13             |
00023010  20 20 20 20 20 20 20 20  20 20 3b 74 65 78 74 20  |          ;text |
00023020  73 74 72 69 6e 67 2e 0d  9a f6 1a 20 53 57 49 20  |string..... SWI |
00023030  20 20 20 20 20 22 53 74  72 69 6e 67 5f 4c 65 6e  |     "String_Len|
00023040  22 0d 9b 00 13 20 4d 4f  56 20 20 20 20 20 20 52  |".... MOV      R|
00023050  38 2c 52 31 0d 9b 0a 04  0d 9b 14 4f 20 53 54 52  |8,R1.......O STR|
00023060  20 20 20 20 20 20 52 37  2c 5b 52 31 32 2c 23 62  |      R7,[R12,#b|
00023070  6c 6f 63 6b 25 2b 30 5d  20 20 20 20 20 20 20 20  |lock%+0]        |
00023080  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00023090  20 67 65 74 73 20 74 68  65 20 69 63 6f 6e 73 20  | gets the icons |
000230a0  64 65 74 61 69 6c 73 0d  9b 1e 4c 20 53 54 52 20  |details...L STR |
000230b0  20 20 20 20 20 52 36 2c  5b 52 31 32 2c 23 62 6c  |     R6,[R12,#bl|
000230c0  6f 63 6b 25 2b 34 5d 20  20 20 20 20 20 20 20 20  |ock%+4]         |
000230d0  20 20 3b 77 68 69 63 68  20 69 6e 63 6c 75 64 65  |  ;which include|
000230e0  20 74 68 65 20 61 64 64  72 65 73 73 20 6f 66 20  | the address of |
000230f0  69 74 73 0d 9b 28 3f 20  41 44 44 20 20 20 20 20  |its..(? ADD     |
00023100  20 52 31 2c 52 31 32 2c  23 62 6c 6f 63 6b 25 20  | R1,R12,#block% |
00023110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 69  |              ;i|
00023120  6e 64 69 72 65 63 74 69  6f 6e 20 62 75 66 66 65  |ndirection buffe|
00023130  72 2e 0d 9b 32 21 20 53  57 49 20 20 20 20 20 20  |r...2! SWI      |
00023140  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
00023150  74 65 22 0d 9b 3c 04 0d  9b 46 50 20 4c 44 52 20  |te"..<...FP LDR |
00023160  20 20 20 20 20 52 32 2c  5b 52 31 32 2c 23 62 6c  |     R2,[R12,#bl|
00023170  6f 63 6b 25 2b 33 36 5d  20 20 20 20 20 20 20 20  |ock%+36]        |
00023180  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00023190  65 6e 73 75 72 65 73 20  74 68 61 74 20 74 68 65  |ensures that the|
000231a0  20 73 74 72 69 6e 67 0d  9b 50 51 20 43 4d 50 20  | string..PQ CMP |
000231b0  20 20 20 20 20 52 38 2c  52 32 20 20 20 20 20 20  |     R8,R2      |
000231c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000231d0  20 20 3b 73 75 70 70 6c  69 65 64 20 69 73 20 6e  |  ;supplied is n|
000231e0  6f 74 20 6c 6f 6e 67 65  72 20 74 68 61 6e 20 74  |ot longer than t|
000231f0  68 65 20 69 63 6f 6e 73  0d 9b 5a 51 20 20 4d 4f  |he icons..ZQ  MO|
00023200  56 47 54 20 20 20 20 52  31 2c 23 31 33 20 20 20  |VGT    R1,#13   |
00023210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00023220  20 20 20 3b 69 6e 64 69  72 65 63 74 69 6f 6e 20  |   ;indirection |
00023230  62 75 66 66 65 72 2e 20  49 66 20 69 74 20 69 73  |buffer. If it is|
00023240  20 74 68 65 6e 20 74 68  65 0d 9b 64 40 20 20 53  | then the..d@  S|
00023250  54 52 47 54 20 20 20 20  52 31 2c 5b 52 35 2c 52  |TRGT    R1,[R5,R|
00023260  32 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2]              |
00023270  20 20 20 20 3b 73 74 72  69 6e 67 20 69 73 20 74  |    ;string is t|
00023280  72 75 6e 63 61 74 65 64  2e 0d 9b 6e 14 20 20 4d  |runcated...n.  M|
00023290  4f 56 47 54 20 20 20 20  52 38 2c 52 32 0d 9b 78  |OVGT    R8,R2..x|
000232a0  04 0d 9b 82 4f 20 4d 4f  56 20 20 20 20 20 20 52  |....O MOV      R|
000232b0  30 2c 52 35 20 20 20 20  20 20 20 20 20 20 20 20  |0,R5            |
000232c0  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
000232d0  73 20 73 65 63 74 69 6f  6e 20 63 6f 70 69 65 73  |s section copies|
000232e0  20 74 68 65 20 73 74 72  69 6e 67 20 69 6e 74 6f  | the string into|
000232f0  0d 9b 8c 49 20 4c 44 52  20 20 20 20 20 20 52 31  |...I LDR      R1|
00023300  2c 5b 52 31 32 2c 23 62  6c 6f 63 6b 25 2b 32 38  |,[R12,#block%+28|
00023310  5d 20 20 20 20 20 20 20  20 20 20 3b 74 68 65 20  |]          ;the |
00023320  69 63 6f 6e 73 20 69 6e  64 69 72 65 63 74 69 6f  |icons indirectio|
00023330  6e 20 62 75 66 66 65 72  2e 0d 9b 96 14 20 4d 4f  |n buffer..... MO|
00023340  56 20 20 20 20 20 20 52  32 2c 23 31 33 0d 9b a0  |V      R2,#13...|
00023350  1c 20 53 57 49 20 20 20  20 20 20 22 53 74 72 69  |. SWI      "Stri|
00023360  6e 67 5f 4d 6f 76 65 24  22 0d 9b aa 04 0d 9b b4  |ng_Move$".......|
00023370  52 20 41 44 44 20 20 20  20 20 52 31 2c 52 31 32  |R ADD     R1,R12|
00023380  2c 23 62 6c 6f 63 6b 25  20 20 20 20 20 20 20 20  |,#block%        |
00023390  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
000233a0  63 74 69 6f 6e 20 63 68  65 63 6b 73 20 69 66 20  |ction checks if |
000233b0  74 68 65 20 63 61 72 65  74 20 69 73 20 69 6e 0d  |the caret is in.|
000233c0  9b be 51 20 53 57 49 20  20 20 20 20 22 57 69 6d  |..Q SWI     "Wim|
000233d0  70 5f 47 65 74 43 61 72  65 74 50 6f 73 69 74 69  |p_GetCaretPositi|
000233e0  6f 6e 22 20 20 20 20 20  20 20 3b 74 68 65 20 69  |on"       ;the i|
000233f0  63 6f 6e 20 74 68 61 74  20 68 61 73 20 62 65 65  |con that has bee|
00023400  6e 20 75 70 64 61 74 65  64 2e 20 49 66 20 73 6f  |n updated. If so|
00023410  0d 9b c8 4a 20 4c 44 52  20 20 20 20 20 52 30 2c  |...J LDR     R0,|
00023420  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 30 5d 20  |[R12,#block%+0] |
00023430  20 20 20 20 20 20 20 20  20 20 20 3b 74 68 65 20  |           ;the |
00023440  63 61 72 65 74 20 6e 65  65 64 73 20 74 6f 20 62  |caret needs to b|
00023450  65 20 72 65 64 72 61 77  6e 2e 0d 9b d2 1f 20 4c  |e redrawn..... L|
00023460  44 52 20 20 20 20 20 52  31 2c 5b 52 31 32 2c 23  |DR     R1,[R12,#|
00023470  62 6c 6f 63 6b 25 2b 34  5d 0d 9b dc 20 20 4c 44  |block%+4]...  LD|
00023480  52 20 20 20 20 20 52 32  2c 5b 52 31 32 2c 23 62  |R     R2,[R12,#b|
00023490  6c 6f 63 6b 25 2b 32 30  5d 0d 9b e6 12 20 43 4d  |lock%+20].... CM|
000234a0  50 20 20 20 20 20 52 30  2c 52 37 0d 9b f0 13 20  |P     R0,R7.... |
000234b0  20 43 4d 50 45 51 20 20  20 52 31 2c 52 36 0d 9b  | CMPEQ   R1,R6..|
000234c0  fa 19 20 20 20 42 4e 45  20 20 20 20 20 77 69 63  |..   BNE     wic|
000234d0  6f 6e 74 69 6e 75 65 0d  9c 04 12 20 43 4d 50 20  |ontinue.... CMP |
000234e0  20 20 20 20 52 32 2c 52  38 0d 9c 0e 13 20 20 4d  |    R2,R8....  M|
000234f0  4f 56 47 54 20 20 20 52  35 2c 52 38 0d 9c 18 13  |OVGT   R5,R8....|
00023500  20 20 4d 4f 56 4c 45 20  20 20 52 35 2c 52 32 0d  |  MOVLE   R5,R2.|
00023510  9c 22 12 20 4d 56 4e 20  20 20 20 20 52 34 2c 23  |.". MVN     R4,#|
00023520  30 0d 9c 2c 24 20 53 57  49 20 20 20 20 20 22 57  |0..,$ SWI     "W|
00023530  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
00023540  74 69 6f 6e 22 0d 9c 36  04 0d 9c 40 51 20 2e 77  |tion"..6...@Q .w|
00023550  69 63 6f 6e 74 69 6e 75  65 20 20 20 20 20 20 20  |icontinue       |
00023560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00023570  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00023580  6e 20 65 6e 73 75 72 65  73 20 74 68 61 74 20 74  |n ensures that t|
00023590  68 65 20 69 63 6f 6e 20  69 73 0d 9c 4a 51 20 41  |he icon is..JQ A|
000235a0  44 44 20 20 20 20 20 20  52 31 2c 52 31 32 2c 23  |DD      R1,R12,#|
000235b0  62 6c 6f 63 6b 25 20 20  20 20 20 20 20 20 20 20  |block%          |
000235c0  20 20 20 20 20 3b 72 65  64 72 61 77 6e 20 62 79  |     ;redrawn by|
000235d0  20 74 68 65 20 57 69 6d  70 20 61 66 74 65 72 20  | the Wimp after |
000235e0  69 74 20 68 61 73 20 62  65 65 6e 0d 9c 54 34 20  |it has been..T4 |
000235f0  53 54 52 20 20 20 20 20  20 52 37 2c 5b 52 31 32  |STR      R7,[R12|
00023600  2c 23 62 6c 6f 63 6b 25  2b 30 5d 20 20 20 20 20  |,#block%+0]     |
00023610  20 20 20 20 20 20 3b 75  70 64 61 74 65 64 2e 0d  |      ;updated..|
00023620  9c 5e 20 20 53 54 52 20  20 20 20 20 20 52 36 2c  |.^  STR      R6,|
00023630  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 34 5d 0d  |[R12,#block%+4].|
00023640  9c 68 13 20 4d 4f 56 20  20 20 20 20 20 52 33 2c  |.h. MOV      R3,|
00023650  23 30 0d 9c 72 20 20 53  54 52 20 20 20 20 20 20  |#0..r  STR      |
00023660  52 33 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R3,[R12,#block%+|
00023670  38 5d 0d 9c 7c 21 20 53  54 52 20 20 20 20 20 20  |8]..|! STR      |
00023680  52 33 2c 5b 52 31 32 2c  23 62 6c 6f 63 6b 25 2b  |R3,[R12,#block%+|
00023690  31 32 5d 0d 9c 86 21 20  53 57 49 20 20 20 20 20  |12]...! SWI     |
000236a0  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
000236b0  61 74 65 22 0d 9c 90 04  0d 9c 9a 1d 4c 44 4d 46  |ate"........LDMF|
000236c0  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 38  |D    R13!,{R0-R8|
000236d0  2c 50 43 7d 5e 0d 9c a4  04 0d 9c ae 52 3b 2d 2d  |,PC}^.......R;--|
000236e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00023720  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 9c b8 35 3b  |-----------...5;|
00023730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00023740  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2a 2a  |             ***|
00023750  20 57 72 69 74 65 49 63  6f 6e 4e 6f 20 2a 2a 2a  | WriteIconNo ***|
00023760  0d 9c c2 50 3b 54 68 69  73 20 73 75 62 72 6f 75  |...P;This subrou|
00023770  74 69 6e 65 20 74 61 6b  65 73 20 61 20 76 61 6c  |tine takes a val|
00023780  75 65 20 52 32 20 61 6e  64 20 63 6f 70 69 65 73  |ue R2 and copies|
00023790  20 69 74 27 73 20 73 74  72 69 6e 67 20 65 71 75  | it's string equ|
000237a0  69 76 69 6c 65 6e 74 20  69 6e 74 6f 20 74 68 65  |ivilent into the|
000237b0  0d 9c cc 37 3b 69 6e 64  69 72 65 63 74 69 6f 6e  |...7;indirection|
000237c0  20 62 75 66 66 65 72 20  6f 66 20 74 68 65 20 69  | buffer of the i|
000237d0  63 6f 6e 20 73 70 65 63  69 66 69 65 64 20 62 79  |con specified by|
000237e0  20 52 30 2f 52 31 2e 0d  9c d6 04 0d 9c e0 10 2e  | R0/R1..........|
000237f0  57 72 69 74 65 49 63 6f  6e 4e 6f 0d 9c ea 15 3b  |WriteIconNo....;|
00023800  52 30 3d 57 69 6e 64 6f  77 20 48 61 6e 64 6c 65  |R0=Window Handle|
00023810  0d 9c f4 13 3b 52 31 3d  49 63 6f 6e 20 48 61 6e  |....;R1=Icon Han|
00023820  64 6c 65 0d 9c fe 0d 3b  52 32 3d 56 61 6c 75 65  |dle....;R2=Value|
00023830  0d 9d 08 04 0d 9d 12 1c  53 54 4d 46 44 20 20 52  |........STMFD  R|
00023840  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
00023850  0d 9d 1c 04 0d 9d 26 11  4d 4f 56 20 20 20 20 20  |......&.MOV     |
00023860  52 37 2c 52 30 0d 9d 30  11 4d 4f 56 20 20 20 20  |R7,R0..0.MOV    |
00023870  20 52 38 2c 52 31 0d 9d  3a 04 0d 9d 44 11 4d 4f  | R8,R1..:...D.MO|
00023880  56 20 20 20 20 20 52 30  2c 52 32 0d 9d 4e 11 4d  |V     R0,R2..N.M|
00023890  4f 56 20 20 20 20 20 52  31 2c 52 39 0d 9d 58 13  |OV     R1,R9..X.|
000238a0  4d 4f 56 20 20 20 20 20  52 32 2c 23 32 35 35 0d  |MOV     R2,#255.|
000238b0  9d 62 20 53 57 49 20 20  20 20 20 22 4f 53 5f 42  |.b SWI     "OS_B|
000238c0  69 6e 61 72 79 54 6f 44  65 63 69 6d 61 6c 22 0d  |inaryToDecimal".|
000238d0  9d 6c 04 0d 9d 76 12 4d  4f 56 20 20 20 20 20 52  |.l...v.MOV     R|
000238e0  30 2c 23 31 33 0d 9d 80  16 53 54 52 42 20 20 20  |0,#13....STRB   |
000238f0  20 52 30 2c 5b 52 39 2c  52 32 5d 0d 9d 8a 04 0d  | R0,[R9,R2].....|
00023900  9d 94 11 4d 4f 56 20 20  20 20 20 52 30 2c 52 37  |...MOV     R0,R7|
00023910  0d 9d 9e 11 4d 4f 56 20  20 20 20 20 52 31 2c 52  |....MOV     R1,R|
00023920  38 0d 9d a8 11 4d 4f 56  20 20 20 20 20 52 32 2c  |8....MOV     R2,|
00023930  52 39 0d 9d b2 15 42 4c  20 20 20 20 20 20 57 72  |R9....BL      Wr|
00023940  69 74 65 49 63 6f 6e 0d  9d bc 04 0d 9d c6 1c 4c  |iteIcon........L|
00023950  44 4d 46 44 20 20 52 31  33 21 2c 7b 52 30 2d 52  |DMFD  R13!,{R0-R|
00023960  31 32 2c 50 43 7d 5e 0d  9d d0 04 0d 9d da 52 3b  |12,PC}^.......R;|
00023970  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000239b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 9d e4  |-------------...|
000239c0  31 3b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1;              |
000239d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 2a  |              **|
000239e0  2a 20 52 65 61 64 49 63  6f 6e 20 2a 2a 2a 0d 9d  |* ReadIcon ***..|
000239f0  ee 52 3b 20 54 68 69 73  20 73 75 62 72 6f 75 74  |.R; This subrout|
00023a00  69 6e 65 20 63 6f 70 69  65 73 20 74 68 65 20 63  |ine copies the c|
00023a10  6f 6e 74 65 6e 74 73 20  6f 66 20 61 6e 20 69 63  |ontents of an ic|
00023a20  6f 6e 20 69 6e 74 6f 20  74 68 65 20 62 75 66 66  |on into the buff|
00023a30  65 72 20 70 6f 69 6e 74  65 64 20 74 6f 20 62 79  |er pointed to by|
00023a40  0d 9d f8 09 3b 20 52 32  2e 0d 9e 02 04 0d 9e 0c  |....; R2........|
00023a50  0d 2e 52 65 61 64 49 63  6f 6e 0d 9e 16 15 3b 52  |..ReadIcon....;R|
00023a60  30 3d 57 69 6e 64 6f 77  20 48 61 6e 64 6c 65 0d  |0=Window Handle.|
00023a70  9e 20 12 3b 52 31 3d 49  63 6f 6e 48 61 6e 64 6c  |. .;R1=IconHandl|
00023a80  65 0d 9e 2a 19 3b 52 32  3d 50 6f 69 6e 74 65 72  |e..*.;R2=Pointer|
00023a90  20 74 6f 20 62 75 66 66  65 72 0d 9e 34 04 0d 9e  | to buffer..4...|
00023aa0  3e 1d 53 54 4d 46 44 20  20 20 20 52 31 33 21 2c  |>.STMFD    R13!,|
00023ab0  7b 52 30 2d 52 32 2c 52  31 34 7d 0d 9e 48 04 0d  |{R0-R2,R14}..H..|
00023ac0  9e 52 50 20 53 54 52 20  20 20 20 20 20 52 30 2c  |.RP STR      R0,|
00023ad0  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 30 5d 20  |[R12,#block%+0] |
00023ae0  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00023af0  73 65 63 74 69 6f 6e 20  67 65 74 73 20 74 68 65  |section gets the|
00023b00  20 64 65 74 61 69 6c 73  20 6f 66 20 74 68 65 0d  | details of the.|
00023b10  9e 5c 4f 20 53 54 52 20  20 20 20 20 20 52 31 2c  |.\O STR      R1,|
00023b20  5b 52 31 32 2c 23 62 6c  6f 63 6b 25 2b 34 5d 20  |[R12,#block%+4] |
00023b30  20 20 20 20 20 20 20 20  20 20 3b 69 63 6f 6e 2c  |          ;icon,|
00023b40  20 69 6e 63 6c 75 64 69  6e 67 20 74 68 65 20 61  | including the a|
00023b50  64 64 72 65 73 73 20 6f  66 20 69 74 27 73 0d 9e  |ddress of it's..|
00023b60  66 51 20 41 44 44 20 20  20 20 20 20 52 31 2c 52  |fQ ADD      R1,R|
00023b70  31 32 2c 23 62 6c 6f 63  6b 25 20 20 20 20 20 20  |12,#block%      |
00023b80  20 20 20 20 20 20 20 20  20 3b 69 6e 64 69 72 65  |         ;indire|
00023b90  63 74 69 6f 6e 20 62 75  66 66 65 72 20 77 68 69  |ction buffer whi|
00023ba0  63 68 20 63 6f 6e 74 61  69 6e 73 20 74 68 65 0d  |ch contains the.|
00023bb0  9e 70 38 20 53 57 49 20  20 20 20 20 20 22 58 57  |.p8 SWI      "XW|
00023bc0  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00023bd0  22 20 20 20 20 20 20 20  20 20 3b 74 65 78 74 20  |"         ;text |
00023be0  73 74 72 69 6e 67 2e 0d  9e 7a 04 0d 9e 84 4f 20  |string...z....O |
00023bf0  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
00023c00  2c 23 62 6c 6f 63 6b 25  2b 32 38 5d 20 20 20 20  |,#block%+28]    |
00023c10  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00023c20  69 6f 6e 20 63 6f 70 69  65 73 20 74 68 65 20 73  |ion copies the s|
00023c30  74 72 69 6e 67 20 69 6e  74 6f 0d 9e 8e 41 20 4d  |tring into...A M|
00023c40  4f 56 20 20 20 20 20 20  52 31 2c 52 32 20 20 20  |OV      R1,R2   |
00023c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00023c60  20 20 20 20 20 3b 74 68  65 20 73 70 65 63 69 66  |     ;the specif|
00023c70  69 65 64 20 62 75 66 66  65 72 2e 0d 9e 98 14 20  |ied buffer..... |
00023c80  4d 4f 56 20 20 20 20 20  20 52 32 2c 23 31 33 0d  |MOV      R2,#13.|
00023c90  9e a2 1c 20 53 57 49 20  20 20 20 20 20 22 53 74  |... SWI      "St|
00023ca0  72 69 6e 67 5f 4d 6f 76  65 24 22 0d 9e ac 04 0d  |ring_Move$".....|
00023cb0  9e b6 1d 4c 44 4d 46 44  20 20 20 20 52 31 33 21  |...LDMFD    R13!|
00023cc0  2c 7b 52 30 2d 52 32 2c  50 43 7d 5e 0d 9e c0 04  |,{R0-R2,PC}^....|
00023cd0  0d 9e ca 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...R;-----------|
00023ce0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00023d20  2d 2d 0d 9e d4 33 3b 20  20 20 20 20 20 20 20 20  |--...3;         |
00023d30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00023d40  20 20 20 2a 2a 2a 20 52  65 61 64 49 63 6f 6e 4e  |   *** ReadIconN|
00023d50  6f 20 2a 2a 2a 0d 9e de  52 3b 20 54 68 69 73 20  |o ***...R; This |
00023d60  73 75 62 72 6f 75 74 69  6e 65 20 63 6f 70 69 65  |subroutine copie|
00023d70  73 20 74 68 65 20 63 6f  6e 74 65 6e 74 73 20 6f  |s the contents o|
00023d80  66 20 61 6e 20 69 63 6f  6e 20 69 6e 74 6f 20 74  |f an icon into t|
00023d90  68 65 20 62 75 66 66 65  72 20 70 6f 69 6e 74 65  |he buffer pointe|
00023da0  64 20 74 6f 20 62 79 0d  9e e8 2f 3b 20 52 32 2c  |d to by.../; R2,|
00023db0  20 63 6f 6e 76 65 72 74  69 6e 67 20 69 74 20 69  | converting it i|
00023dc0  6e 74 6f 20 61 20 64 65  63 69 6d 61 6c 20 69 6e  |nto a decimal in|
00023dd0  74 65 67 65 72 2e 0d 9e  f2 04 0d 9e fc 0f 2e 52  |teger..........R|
00023de0  65 61 64 49 63 6f 6e 4e  6f 0d 9f 06 15 3b 52 30  |eadIconNo....;R0|
00023df0  3d 57 69 6e 64 6f 77 20  48 61 6e 64 6c 65 0d 9f  |=Window Handle..|
00023e00  10 12 3b 52 31 3d 49 63  6f 6e 48 61 6e 64 6c 65  |..;R1=IconHandle|
00023e10  0d 9f 1a 04 0d 9f 24 22  53 54 4d 46 44 20 20 52  |......$"STMFD  R|
00023e20  31 33 21 2c 7b 52 30 2d  52 31 2c 52 33 2d 52 31  |13!,{R0-R1,R3-R1|
00023e30  32 2c 52 31 34 7d 0d 9f  2e 04 0d 9f 38 11 4d 4f  |2,R14}......8.MO|
00023e40  56 20 20 20 20 20 52 32  2c 52 39 0d 9f 42 14 42  |V     R2,R9..B.B|
00023e50  4c 20 20 20 20 20 20 52  65 61 64 49 63 6f 6e 0d  |L      ReadIcon.|
00023e60  9f 4c 04 0d 9f 56 12 4d  4f 56 20 20 20 20 20 52  |.L...V.MOV     R|
00023e70  30 2c 23 31 30 0d 9f 60  11 4d 4f 56 20 20 20 20  |0,#10..`.MOV    |
00023e80  20 52 31 2c 52 39 0d 9f  6a 1d 53 57 49 20 20 20  | R1,R9..j.SWI   |
00023e90  20 20 22 4f 53 5f 52 65  61 64 55 6e 73 69 67 6e  |  "OS_ReadUnsign|
00023ea0  65 64 22 0d 9f 74 04 0d  9f 7e 22 4c 44 4d 46 44  |ed"..t...~"LDMFD|
00023eb0  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 2c 52 33  |  R13!,{R0-R1,R3|
00023ec0  2d 52 31 32 2c 50 43 7d  5e 0d 9f 88 04 0d 9f 92  |-R12,PC}^.......|
00023ed0  52 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |R;--------------|
00023ee0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00023f10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00023f20  9f 9c 2b 3b 20 20 20 20  20 20 20 20 20 20 20 20  |..+;            |
00023f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 2a  |              **|
00023f40  2a 20 49 6e 69 74 20 2a  2a 2a 0d 9f a6 04 0d 9f  |* Init ***......|
00023f50  b0 09 2e 49 6e 69 74 0d  9f ba 04 0d 9f c4 1e 53  |...Init........S|
00023f60  54 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 30  |TMFD    R13!,{R0|
00023f70  2d 52 31 32 2c 52 31 34  7d 0d 9f ce 04 0d 9f d8  |-R12,R14}.......|
00023f80  1a 20 42 4c 20 20 20 20  20 20 20 49 6e 69 74 4d  |. BL       InitM|
00023f90  65 73 73 61 67 65 73 0d  9f e2 04 0d 9f ec 4e 20  |essages.......N |
00023fa0  4c 44 52 20 20 20 20 20  20 52 30 2c 5b 52 31 32  |LDR      R0,[R12|
00023fb0  2c 23 64 69 73 70 6c 61  79 25 5d 20 20 20 20 20  |,#display%]     |
00023fc0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00023fd0  69 6f 6e 20 65 6e 73 75  72 65 73 20 74 68 61 74  |ion ensures that|
00023fe0  20 74 68 65 20 27 4e 6f  74 0d 9f f6 51 20 53 54  | the 'Not...Q ST|
00023ff0  52 20 20 20 20 20 20 52  30 2c 5b 52 31 32 2c 23  |R      R0,[R12,#|
00024000  62 6c 6f 63 6b 25 2b 30  5d 20 20 20 20 20 20 20  |block%+0]       |
00024010  20 20 20 20 3b 46 6f 75  6e 64 27 20 69 63 6f 6e  |    ;Found' icon|
00024020  20 68 61 73 20 69 74 73  20 27 44 65 6c 65 74 65  | has its 'Delete|
00024030  64 27 20 62 69 74 20 73  65 74 0d a0 00 52 20 4d  |d' bit set...R M|
00024040  4f 56 20 20 20 20 20 20  52 30 2c 23 33 38 20 20  |OV      R0,#38  |
00024050  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024060  20 20 20 20 20 3b 73 6f  20 74 68 61 74 20 69 74  |     ;so that it|
00024070  20 69 73 20 69 6e 69 74  69 61 6c 6c 79 20 6e 6f  | is initially no|
00024080  74 20 64 69 73 70 6c 61  79 65 64 2e 0d a0 0a 20  |t displayed.... |
00024090  20 53 54 52 20 20 20 20  20 20 52 30 2c 5b 52 31  | STR      R0,[R1|
000240a0  32 2c 23 62 6c 6f 63 6b  25 2b 34 5d 0d a0 14 17  |2,#block%+4]....|
000240b0  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 23 31 3c  | MOV      R0,#1<|
000240c0  3c 32 33 0d a0 1e 20 20  53 54 52 20 20 20 20 20  |<23...  STR     |
000240d0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
000240e0  2b 38 5d 0d a0 28 21 20  53 54 52 20 20 20 20 20  |+8]..(! STR     |
000240f0  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00024100  2b 31 32 5d 0d a0 32 1c  20 41 44 44 20 20 20 20  |+12]..2. ADD    |
00024110  20 20 52 31 2c 52 31 32  2c 23 62 6c 6f 63 6b 25  |  R1,R12,#block%|
00024120  0d a0 3c 22 20 53 57 49  20 20 20 20 20 20 22 58  |..<" SWI      "X|
00024130  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
00024140  65 22 0d a0 46 04 0d a0  50 17 20 42 4c 20 20 20  |e"..F...P. BL   |
00024150  20 20 20 20 53 68 61 64  65 53 61 76 65 0d a0 5a  |    ShadeSave..Z|
00024160  04 0d a0 64 50 20 4d 4f  56 20 20 20 20 20 20 52  |...dP MOV      R|
00024170  30 2c 23 26 34 46 20 20  20 20 20 20 20 20 20 20  |0,#&4F          |
00024180  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00024190  73 20 73 65 63 74 69 6f  6e 20 74 72 79 73 20 74  |s section trys t|
000241a0  6f 20 6f 70 65 6e 20 74  68 65 20 53 65 61 72 63  |o open the Searc|
000241b0  68 0d a0 6e 51 20 41 44  44 20 20 20 20 20 20 52  |h..nQ ADD      R|
000241c0  31 2c 52 31 30 2c 23 73  65 61 72 63 68 66 69 6c  |1,R10,#searchfil|
000241d0  65 20 20 20 20 20 20 20  20 20 20 20 3b 66 69 6c  |e           ;fil|
000241e0  65 2e 20 49 66 20 69 74  20 63 61 6e 6e 6f 74 20  |e. If it cannot |
000241f0  62 65 20 66 6f 75 6e 64  20 61 20 6e 65 77 20 6f  |be found a new o|
00024200  6e 65 0d a0 78 37 20 53  57 49 20 20 20 20 20 20  |ne..x7 SWI      |
00024210  22 58 4f 53 5f 46 69 6e  64 22 20 20 20 20 20 20  |"XOS_Find"      |
00024220  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 69 73  |             ;is|
00024230  20 63 72 65 61 74 65 64  2e 0d a0 82 26 20 20 53  | created....&  S|
00024240  54 52 56 43 20 20 20 20  52 30 2c 5b 52 31 30 2c  |TRVC    R0,[R10,|
00024250  23 73 65 61 72 63 68 68  61 6e 64 6c 65 25 5d 0d  |#searchhandle%].|
00024260  a0 8c 1f 20 20 42 4c 56  53 20 20 20 20 20 43 72  |...  BLVS     Cr|
00024270  65 61 74 65 53 65 61 72  63 68 46 69 6c 65 0d a0  |eateSearchFile..|
00024280  96 26 20 20 4c 44 52 56  53 20 20 20 20 52 30 2c  |.&  LDRVS    R0,|
00024290  5b 52 31 30 2c 23 73 65  61 72 63 68 68 61 6e 64  |[R10,#searchhand|
000242a0  6c 65 25 5d 0d a0 a0 04  0d a0 aa 4f 20 42 4c 20  |le%].......O BL |
000242b0  20 20 20 20 20 20 43 6f  75 6e 74 52 65 63 6f 72  |      CountRecor|
000242c0  64 73 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ds              |
000242d0  20 20 20 3b 54 68 65 20  6e 75 6d 62 65 72 20 6f  |   ;The number o|
000242e0  66 20 72 65 63 6f 72 64  73 20 69 6e 20 74 68 65  |f records in the|
000242f0  20 53 65 61 72 63 68 0d  a0 b4 4c 20 53 54 52 20  | Search...L STR |
00024300  20 20 20 20 20 52 30 2c  5b 52 31 30 2c 23 73 65  |     R0,[R10,#se|
00024310  61 72 63 68 6d 61 78 25  5d 20 20 20 20 20 20 20  |archmax%]       |
00024320  20 20 3b 66 69 6c 65 20  69 73 20 63 6f 75 6e 74  |  ;file is count|
00024330  65 64 2e 20 49 66 20 74  68 65 72 65 20 61 72 65  |ed. If there are|
00024340  20 6e 6f 0d a0 be 51 20  43 4d 50 20 20 20 20 20  | no...Q CMP     |
00024350  20 52 30 2c 23 30 20 20  20 20 20 20 20 20 20 20  | R0,#0          |
00024360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 74  |              ;t|
00024370  68 65 6e 20 74 68 65 20  27 4c 61 73 74 20 53 65  |hen the 'Last Se|
00024380  61 72 63 68 27 20 69 63  6f 6e 20 69 73 20 67 72  |arch' icon is gr|
00024390  65 79 65 64 0d a0 c8 50  20 20 4c 44 52 45 51 20  |eyed...P  LDREQ |
000243a0  20 20 20 52 30 2c 5b 52  31 32 2c 23 64 69 73 70  |   R0,[R12,#disp|
000243b0  6c 61 79 25 5d 20 20 20  20 20 20 20 20 20 20 3b  |lay%]          ;|
000243c0  6f 75 74 20 73 6f 20 74  68 61 74 20 69 74 20 63  |out so that it c|
000243d0  61 6e 6e 6f 74 20 62 65  20 73 65 6c 65 63 74 65  |annot be selecte|
000243e0  64 20 62 79 0d a0 d2 35  20 20 53 54 52 45 51 20  |d by...5  STREQ |
000243f0  20 20 20 52 30 2c 5b 52  31 32 2c 23 62 6c 6f 63  |   R0,[R12,#bloc|
00024400  6b 25 2b 30 5d 20 20 20  20 20 20 20 20 20 20 3b  |k%+0]          ;|
00024410  74 68 65 20 75 73 65 72  2e 0d a0 dc 12 20 20 ec  |the user.....  .|
00024420  51 20 20 20 20 52 30 2c  23 32 37 0d a0 e6 21 20  |Q    R0,#27...! |
00024430  20 53 54 52 45 51 20 20  20 20 52 30 2c 5b 52 31  | STREQ    R0,[R1|
00024440  32 2c 23 62 6c 6f 63 6b  25 2b 34 5d 0d a0 f0 16  |2,#block%+4]....|
00024450  20 20 ec 51 20 20 20 20  52 30 2c 23 25 31 3c 3c  |  .Q    R0,#%1<<|
00024460  32 32 0d a0 fa 21 20 20  53 54 52 45 51 20 20 20  |22...!  STREQ   |
00024470  20 52 30 2c 5b 52 31 32  2c 23 62 6c 6f 63 6b 25  | R0,[R12,#block%|
00024480  2b 38 5d 0d a1 04 22 20  20 53 54 52 45 51 20 20  |+8]..."  STREQ  |
00024490  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
000244a0  25 2b 31 32 5d 0d a1 0e  1d 20 20 41 44 44 20 20  |%+12]....  ADD  |
000244b0  20 20 20 20 52 31 2c 52  31 32 2c 23 62 6c 6f 63  |    R1,R12,#bloc|
000244c0  6b 25 0d a1 18 22 20 20  53 57 49 20 20 20 20 20  |k%..."  SWI     |
000244d0  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
000244e0  61 74 65 22 0d a1 22 04  0d a1 2c 4d 20 4d 4f 56  |ate".."...,M MOV|
000244f0  20 20 20 20 20 20 52 30  2c 23 26 34 46 20 20 20  |      R0,#&4F   |
00024500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024510  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00024520  20 6f 70 65 6e 73 20 74  68 65 20 49 6e 64 65 78  | opens the Index|
00024530  66 69 6c 65 2e 0d a1 36  1f 20 41 44 44 20 20 20  |file...6. ADD   |
00024540  20 20 20 52 31 2c 52 31  30 2c 23 69 6e 64 65 78  |   R1,R10,#index|
00024550  66 69 6c 65 0d a1 40 18  20 53 57 49 20 20 20 20  |file..@. SWI    |
00024560  20 20 22 58 4f 53 5f 46  69 6e 64 22 0d a1 4a 16  |  "XOS_Find"..J.|
00024570  20 20 42 56 53 20 20 20  20 20 20 6e 6f 69 6e 64  |  BVS      noind|
00024580  65 78 0d a1 54 24 20 53  54 52 20 20 20 20 20 20  |ex..T$ STR      |
00024590  52 30 2c 5b 52 31 30 2c  23 69 6e 64 65 78 68 61  |R0,[R10,#indexha|
000245a0  6e 64 6c 65 25 5d 0d a1  5e 23 20 53 54 52 20 20  |ndle%]..^# STR  |
000245b0  20 20 20 20 52 30 2c 5b  52 31 30 2c 23 66 69 6c  |    R0,[R10,#fil|
000245c0  65 68 61 6e 64 6c 65 25  5d 0d a1 68 04 0d a1 72  |ehandle%]..h...r|
000245d0  4d 20 42 4c 20 20 20 20  20 20 20 43 6f 75 6e 74  |M BL       Count|
000245e0  52 65 63 6f 72 64 73 20  20 20 20 20 20 20 20 20  |Records         |
000245f0  20 20 20 20 20 20 20 20  3b 54 68 69 73 20 73 65  |        ;This se|
00024600  63 74 69 6f 6e 20 63 6f  75 6e 74 73 20 74 68 65  |ction counts the|
00024610  20 6e 75 6d 62 65 72 20  6f 66 0d a1 7c 45 20 53  | number of..|E S|
00024620  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |TR      R0,[R10,|
00024630  23 69 6e 64 65 78 6d 61  78 25 5d 20 20 20 20 20  |#indexmax%]     |
00024640  20 20 20 20 20 3b 72 65  63 6f 72 64 73 20 69 6e  |     ;records in|
00024650  20 74 68 65 20 49 6e 64  65 78 66 69 6c 65 2e 0d  | the Indexfile..|
00024660  a1 86 1c 20 53 54 52 20  20 20 20 20 20 52 30 2c  |... STR      R0,|
00024670  5b 52 31 30 2c 23 6d 61  78 25 5d 0d a1 90 1f 20  |[R10,#max%].... |
00024680  53 54 52 20 20 20 20 20  20 52 30 2c 5b 52 31 30  |STR      R0,[R10|
00024690  2c 23 72 65 63 6f 72 64  25 5d 0d a1 9a 24 20 53  |,#record%]...$ S|
000246a0  54 52 20 20 20 20 20 20  52 30 2c 5b 52 31 30 2c  |TR      R0,[R10,|
000246b0  23 69 6e 64 65 78 72 65  63 6f 72 64 25 5d 0d a1  |#indexrecord%]..|
000246c0  a4 04 0d a1 ae 52 20 4d  4f 56 20 20 20 20 20 20  |.....R MOV      |
000246d0  52 30 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  |R0,#1           |
000246e0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
000246f0  69 73 20 73 65 63 74 69  6f 6e 20 69 6e 69 74 69  |is section initi|
00024700  61 6c 69 73 65 73 20 74  68 65 20 76 61 72 69 61  |alises the varia|
00024710  62 6c 65 73 0d a1 b8 1d  20 53 54 52 20 20 20 20  |bles.... STR    |
00024720  20 20 52 30 2c 5b 52 31  30 2c 23 73 68 6f 77 25  |  R0,[R10,#show%|
00024730  5d 0d a1 c2 25 20 53 54  52 20 20 20 20 20 20 52  |]...% STR      R|
00024740  30 2c 5b 52 31 30 2c 23  73 65 61 72 63 68 72 65  |0,[R10,#searchre|
00024750  63 6f 72 64 25 5d 0d a1  cc 04 0d a1 d6 51 20 4d  |cord%].......Q M|
00024760  4f 56 20 20 20 20 20 20  52 30 2c 23 32 20 20 20  |OV      R0,#2   |
00024770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024780  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00024790  6f 6e 20 6d 6f 76 65 73  20 74 68 65 20 49 6e 64  |on moves the Ind|
000247a0  65 78 66 69 6c 65 20 66  69 6c 65 0d a1 e0 4b 20  |exfile file...K |
000247b0  4c 44 52 20 20 20 20 20  20 52 31 2c 5b 52 31 30  |LDR      R1,[R10|
000247c0  2c 23 69 6e 64 65 78 68  61 6e 64 6c 65 25 5d 20  |,#indexhandle%] |
000247d0  20 20 20 20 20 20 3b 70  6f 69 6e 74 65 72 20 74  |      ;pointer t|
000247e0  6f 20 74 68 65 20 65 6e  64 20 6f 66 20 74 68 65  |o the end of the|
000247f0  20 66 69 6c 65 2e 0d a1  ea 18 20 53 57 49 20 20  | file..... SWI  |
00024800  20 20 20 20 22 58 4f 53  5f 41 72 67 73 22 0d a1  |    "XOS_Args"..|
00024810  f4 16 20 20 42 56 53 20  20 20 20 20 20 6e 6f 69  |..  BVS      noi|
00024820  6e 64 65 78 0d a1 fe 13  20 4d 4f 56 20 20 20 20  |ndex.... MOV    |
00024830  20 20 52 30 2c 23 31 0d  a2 08 18 20 53 57 49 20  |  R0,#1.... SWI |
00024840  20 20 20 20 20 22 58 4f  53 5f 41 72 67 73 22 0d  |     "XOS_Args".|
00024850  a2 12 16 20 20 42 56 53  20 20 20 20 20 20 6e 6f  |...  BVS      no|
00024860  69 6e 64 65 78 0d a2 1c  04 0d a2 26 4c 20 4c 44  |index......&L LD|
00024870  52 20 20 20 20 20 20 52  30 2c 5b 52 31 30 2c 23  |R      R0,[R10,#|
00024880  72 65 63 6f 72 64 25 5d  20 20 20 20 20 20 20 20  |record%]        |
00024890  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
000248a0  6e 20 72 65 61 64 73 20  69 6e 20 74 68 65 20 6c  |n reads in the l|
000248b0  61 74 65 73 74 0d a2 30  3d 20 4d 4f 56 20 20 20  |atest..0= MOV   |
000248c0  20 20 20 52 31 2c 23 32  20 20 20 20 20 20 20 20  |   R1,#2        |
000248d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000248e0  3b 69 6e 20 74 68 65 20  49 6e 64 65 78 66 69 6c  |;in the Indexfil|
000248f0  65 2e 0d a2 3a 18 20 42  4c 20 20 20 20 20 20 20  |e...:. BL       |
00024900  47 65 74 52 65 63 6f 72  64 73 0d a2 44 04 0d a2  |GetRecords..D...|
00024910  4e 4e 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 23  |NN MOV      R0,#|
00024920  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00024930  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
00024940  65 63 74 69 6f 6e 20 63  6c 6f 73 65 73 20 74 68  |ection closes th|
00024950  65 20 69 6e 64 65 78 66  69 6c 65 2e 0d a2 58 51  |e indexfile...XQ|
00024960  20 4c 44 52 20 20 20 20  20 20 52 31 2c 5b 52 31  | LDR      R1,[R1|
00024970  30 2c 23 69 6e 64 65 78  68 61 6e 64 6c 65 25 5d  |0,#indexhandle%]|
00024980  20 20 20 20 20 20 20 3b  49 74 20 69 73 20 62 61  |       ;It is ba|
00024990  64 20 70 72 61 63 74 69  63 65 20 74 6f 20 6c 65  |d practice to le|
000249a0  61 76 65 20 66 69 6c 65  20 6f 70 65 6e 0d a2 62  |ave file open..b|
000249b0  45 20 53 57 49 20 20 20  20 20 20 22 58 4f 53 5f  |E SWI      "XOS_|
000249c0  46 69 6e 64 22 20 20 20  20 20 20 20 20 20 20 20  |Find"           |
000249d0  20 20 20 20 20 20 20 20  3b 6f 63 72 6f 73 73 20  |        ;ocross |
000249e0  63 61 6c 6c 73 20 74 6f  20 57 69 6d 70 5f 50 6f  |calls to Wimp_Po|
000249f0  6c 6c 0d a2 6c 04 0d a2  76 4e 20 4d 4f 56 20 20  |ll..l...vN MOV  |
00024a00  20 20 20 20 52 30 2c 23  30 20 20 20 20 20 20 20  |    R0,#0       |
00024a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024a20  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
00024a30  6c 6f 73 65 73 20 74 68  65 20 53 65 61 72 63 68  |loses the Search|
00024a40  66 69 6c 65 0d a2 80 25  20 4c 44 52 20 20 20 20  |file...% LDR    |
00024a50  20 20 52 31 2c 5b 52 31  30 2c 23 73 65 61 72 63  |  R1,[R10,#searc|
00024a60  68 68 61 6e 64 6c 65 25  5d 0d a2 8a 18 20 53 57  |hhandle%].... SW|
00024a70  49 20 20 20 20 20 20 22  58 4f 53 5f 46 69 6e 64  |I      "XOS_Find|
00024a80  22 0d a2 94 04 0d a2 9e  4c 20 42 4c 20 20 20 20  |".......L BL    |
00024a90  20 20 20 55 70 64 61 74  65 20 20 20 20 20 20 20  |   Update       |
00024aa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024ab0  3b 54 68 69 73 20 75 70  64 61 74 65 73 20 74 68  |;This updates th|
00024ac0  65 20 44 69 73 70 6c 61  79 20 77 69 6e 64 6f 77  |e Display window|
00024ad0  2e 0d a2 a8 04 0d a2 b2  1e 4c 44 4d 46 44 20 20  |.........LDMFD  |
00024ae0  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 50  |  R13!,{R0-R12,P|
00024af0  43 7d 5e 0d a2 bc 04 0d  a2 c6 52 3b 2d 2d 2d 2d  |C}^.......R;----|
00024b00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00024b40  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d a2 d0 33 3b 20 20  |---------...3;  |
00024b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024b60  20 20 20 20 2a 2a 2a 20  43 72 65 61 74 65 53 65  |    *** CreateSe|
00024b70  61 72 63 68 46 69 6c 65  20 2a 2a 2a 0d a2 da 46  |archFile ***...F|
00024b80  3b 20 54 68 69 73 20 73  75 62 72 6f 75 74 69 6e  |; This subroutin|
00024b90  65 20 69 73 20 63 61 6c  6c 65 64 20 77 68 65 6e  |e is called when|
00024ba0  20 6e 6f 20 53 65 61 72  63 68 66 69 6c 65 20 63  | no Searchfile c|
00024bb0  61 6e 20 62 65 20 66 6f  75 6e 64 20 64 75 72 69  |an be found duri|
00024bc0  6e 67 0d a2 e4 34 3b 20  69 6e 69 74 69 61 6c 69  |ng...4; initiali|
00024bd0  73 61 74 69 6f 6e 2e 20  49 74 20 63 72 65 61 74  |sation. It creat|
00024be0  65 73 20 61 20 62 6c 61  6e 6b 20 53 65 61 72 63  |es a blank Searc|
00024bf0  68 66 69 6c 65 2e 0d a2  ee 04 0d a2 f8 15 2e 43  |hfile..........C|
00024c00  72 65 61 74 65 53 65 61  72 63 68 46 69 6c 65 0d  |reateSearchFile.|
00024c10  a3 02 04 0d a3 0c 1e 53  54 4d 46 44 20 20 20 20  |.......STMFD    |
00024c20  52 31 33 21 2c 7b 52 30  2d 52 31 32 2c 52 31 34  |R13!,{R0-R12,R14|
00024c30  7d 0d a3 16 04 0d a3 20  4e 20 4d 4f 56 20 20 20  |}...... N MOV   |
00024c40  20 20 20 52 30 2c 23 31  31 20 20 20 20 20 20 20  |   R0,#11       |
00024c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024c60  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 72  |;This section cr|
00024c70  65 61 74 65 73 20 61 6e  20 65 6d 70 74 79 20 66  |eates an empty f|
00024c80  69 6c 65 0d a3 2a 45 20  41 44 44 20 20 20 20 20  |ile..*E ADD     |
00024c90  20 52 31 2c 52 31 30 2c  23 73 65 61 72 63 68 66  | R1,R10,#searchf|
00024ca0  69 6c 65 20 20 20 20 20  20 20 20 20 20 20 3b 6f  |ile           ;o|
00024cb0  66 20 74 79 70 65 20 26  30 41 43 20 28 49 6e 64  |f type &0AC (Ind|
00024cc0  65 78 46 69 6c 65 29 2e  0d a3 34 16 20 4d 4f 56  |exFile)...4. MOV|
00024cd0  20 20 20 20 20 20 52 32  2c 23 26 30 41 43 0d a3  |      R2,#&0AC..|
00024ce0  3e 13 20 4d 4f 56 20 20  20 20 20 20 52 34 2c 23  |>. MOV      R4,#|
00024cf0  30 0d a3 48 13 20 4d 4f  56 20 20 20 20 20 20 52  |0..H. MOV      R|
00024d00  35 2c 23 30 0d a3 52 18  20 53 57 49 20 20 20 20  |5,#0..R. SWI    |
00024d10  20 20 22 58 4f 53 5f 46  69 6c 65 22 0d a3 5c 17  |  "XOS_File"..\.|
00024d20  20 20 42 56 53 20 20 20  20 20 20 6e 6f 73 65 61  |  BVS      nosea|
00024d30  72 63 68 0d a3 66 04 0d  a3 70 48 20 4d 4f 56 20  |rch..f...pH MOV |
00024d40  20 20 20 20 20 52 30 2c  23 26 34 46 20 20 20 20  |     R0,#&4F    |
00024d50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024d60  20 20 3b 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |  ;This section |
00024d70  6f 70 65 6e 73 20 74 68  65 20 66 69 6c 65 2e 0d  |opens the file..|
00024d80  a3 7a 20 20 41 44 44 20  20 20 20 20 20 52 31 2c  |.z  ADD      R1,|
00024d90  52 31 30 2c 23 73 65 61  72 63 68 66 69 6c 65 0d  |R10,#searchfile.|
00024da0  a3 84 18 20 53 57 49 20  20 20 20 20 20 22 58 4f  |... SWI      "XO|
00024db0  53 5f 46 69 6e 64 22 0d  a3 8e 17 20 20 42 56 53  |S_Find"....  BVS|
00024dc0  20 20 20 20 20 20 6e 6f  73 65 61 72 63 68 0d a3  |      nosearch..|
00024dd0  98 04 0d a3 a2 24 20 53  54 52 20 20 20 20 20 52  |.....$ STR     R|
00024de0  30 2c 5b 52 31 30 2c 23  73 65 61 72 63 68 68 61  |0,[R10,#searchha|
00024df0  6e 64 6c 65 25 5d 0d a3  ac 04 0d a3 b6 1e 4c 44  |ndle%]........LD|
00024e00  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00024e10  52 31 32 2c 50 43 7d 5e  0d a3 c0 04 0d a3 ca 52  |R12,PC}^.......R|
00024e20  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00024e30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00024e60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d a3  |--------------..|
00024e70  d4 33 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |.3;             |
00024e80  20 20 20 20 20 20 20 20  20 20 20 20 20 2a 2a 2a  |             ***|
00024e90  20 49 6e 69 74 4d 65 73  73 61 67 65 73 20 2a 2a  | InitMessages **|
00024ea0  2a 0d a3 de 52 3b 20 54  68 69 73 20 73 65 63 74  |*...R; This sect|
00024eb0  69 6f 6e 20 6f 70 65 6e  73 20 74 68 65 20 61 70  |ion opens the ap|
00024ec0  70 6c 69 63 61 74 69 6f  6e 73 20 4d 65 73 73 61  |plications Messa|
00024ed0  67 65 73 20 66 69 6c 65  20 61 6e 64 20 63 72 65  |ges file and cre|
00024ee0  61 74 65 73 20 6c 6f 6f  6b 2d 75 70 20 74 61 62  |ates look-up tab|
00024ef0  6c 65 73 0d a3 e8 2c 3b  20 61 6e 64 20 4d 65 6e  |les...,; and Men|
00024f00  75 20 73 74 72 75 63 74  75 72 65 73 20 66 72 6f  |u structures fro|
00024f10  6d 20 74 68 65 20 6d 65  73 73 61 67 65 73 2e 0d  |m the messages..|
00024f20  a3 f2 04 0d a3 fc 11 2e  49 6e 69 74 4d 65 73 73  |........InitMess|
00024f30  61 67 65 73 0d a4 06 04  0d a4 10 1e 53 54 4d 46  |ages........STMF|
00024f40  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
00024f50  32 2c 52 31 34 7d 0d a4  1a 04 0d a4 24 4f 20 4d  |2,R14}......$O M|
00024f60  4f 56 20 20 20 20 20 20  52 30 2c 23 30 20 20 20  |OV      R0,#0   |
00024f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024f80  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00024f90  6f 6e 20 66 69 6e 64 73  20 74 68 65 20 75 70 70  |on finds the upp|
00024fa0  65 72 20 6d 65 6d 6f 72  79 0d a4 2e 4d 20 4d 4f  |er memory...M MO|
00024fb0  56 20 20 20 20 20 20 52  31 2c 23 30 20 20 20 20  |V      R1,#0    |
00024fc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00024fd0  20 20 20 20 3b 6c 69 6d  69 74 20 74 68 61 74 20  |    ;limit that |
00024fe0  63 61 6e 20 62 65 20 61  63 63 65 73 73 65 64 20  |can be accessed |
00024ff0  62 79 20 6f 75 72 0d a4  38 38 20 53 57 49 20 20  |by our..88 SWI  |
00025000  20 20 20 20 22 58 4f 53  5f 43 68 61 6e 67 65 45  |    "XOS_ChangeE|
00025010  6e 76 69 72 6f 6e 6d 65  6e 74 22 20 20 20 20 20  |nvironment"     |
00025020  20 3b 61 70 70 6c 69 63  61 74 69 6f 6e 2e 0d a4  | ;application...|
00025030  42 1b 20 20 42 56 53 20  20 20 20 20 20 53 65 72  |B.  BVS      Ser|
00025040  69 6f 75 73 45 72 72 6f  72 0d a4 4c 16 20 53 55  |iousError..L. SU|
00025050  42 20 20 20 20 20 20 52  30 2c 52 31 2c 23 31 0d  |B      R0,R1,#1.|
00025060  a4 56 18 20 42 49 43 20  20 20 20 20 20 52 30 2c  |.V. BIC      R0,|
00025070  52 30 2c 23 25 31 31 0d  a4 60 04 0d a4 6a 51 20  |R0,#%11..`...jQ |
00025080  a4 4c 6f 6e 67 41 64 72  28 22 22 2c 31 2c 68 65  |.LongAdr("",1,he|
00025090  61 70 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |ap)             |
000250a0  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
000250b0  6f 6e 20 61 73 69 67 6e  73 20 74 68 65 20 6d 65  |on asigns the me|
000250c0  6d 6f 72 79 20 62 65 74  77 65 65 6e 0d a4 74 51  |mory between..tQ|
000250d0  20 53 55 42 20 20 20 20  20 20 52 33 2c 52 30 2c  | SUB      R3,R0,|
000250e0  52 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R1              |
000250f0  20 20 20 20 20 20 20 3b  74 68 65 20 65 6e 64 20  |       ;the end |
00025100  6f 66 20 74 68 65 20 70  72 6f 67 72 61 6d 20 61  |of the program a|
00025110  6e 64 20 74 68 65 20 65  6e 64 20 6f 66 0d a4 7e  |nd the end of..~|
00025120  51 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 30  |Q MOV      R0,#0|
00025130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00025140  20 20 20 20 20 20 20 20  3b 6f 75 72 20 61 70 70  |        ;our app|
00025150  6c 69 63 61 74 69 6f 6e  20 73 70 61 63 65 20 74  |lication space t|
00025160  6f 20 62 65 20 75 73 65  64 20 61 73 20 61 0d a4  |o be used as a..|
00025170  88 31 20 53 57 49 20 20  20 20 20 20 22 58 4f 53  |.1 SWI      "XOS|
00025180  5f 48 65 61 70 22 20 20  20 20 20 20 20 20 20 20  |_Heap"          |
00025190  20 20 20 20 20 20 20 20  20 3b 48 65 61 70 2e 0d  |         ;Heap..|
000251a0  a4 92 1b 20 20 42 56 53  20 20 20 20 20 20 53 65  |...  BVS      Se|
000251b0  72 69 6f 75 73 45 72 72  6f 72 0d a4 9c 04 0d a4  |riousError......|
000251c0  a6 4e 20 41 44 52 20 20  20 20 20 20 52 31 2c 6d  |.N ADR      R1,m|
000251d0  65 73 73 61 67 65 66 69  6c 65 6e 61 6d 65 20 20  |essagefilename  |
000251e0  20 20 20 20 20 20 20 20  20 3b 54 68 69 73 20 73  |         ;This s|
000251f0  65 63 74 69 6f 6e 20 66  69 6e 64 73 20 6f 75 74  |ection finds out|
00025200  20 68 6f 77 20 62 69 67  20 74 68 65 0d a4 b0 4e  | how big the...N|
00025210  20 53 57 49 20 20 20 20  20 20 22 58 4d 65 73 73  | SWI      "XMess|
00025220  61 67 65 54 72 61 6e 73  5f 46 69 6c 65 49 6e 66  |ageTrans_FileInf|
00025230  6f 22 20 20 20 20 20 3b  4d 65 73 73 61 67 65 73  |o"     ;Messages|
00025240  20 66 69 6c 65 20 69 73  20 61 6e 64 20 63 6c 61  | file is and cla|
00025250  69 6d 73 20 61 20 68 65  61 70 0d a4 ba 43 20 20  |ims a heap...C  |
00025260  42 56 53 20 20 20 20 20  20 6e 6f 6d 65 73 73 61  |BVS      nomessa|
00025270  67 65 73 20 20 20 20 20  20 20 20 20 20 20 20 20  |ges             |
00025280  20 20 20 20 20 3b 62 6c  6f 63 6b 20 6f 66 20 74  |     ;block of t|
00025290  68 65 20 73 61 6d 65 20  73 69 7a 65 2e 0d a4 c4  |he same size....|
000252a0  13 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 32  |. MOV      R0,#2|
000252b0  0d a4 ce 18 20 a4 4c 6f  6e 67 41 64 72 28 22 22  |.... .LongAdr(""|
000252c0  2c 31 2c 68 65 61 70 29  0d a4 d8 13 20 4d 4f 56  |,1,heap).... MOV|
000252d0  20 20 20 20 20 20 52 33  2c 52 32 0d a4 e2 18 20  |      R3,R2.... |
000252e0  53 57 49 20 20 20 20 20  20 22 58 4f 53 5f 48 65  |SWI      "XOS_He|
000252f0  61 70 22 0d a4 ec 15 20  20 42 4c 56 53 20 20 20  |ap"....  BLVS   |
00025300  20 20 6e 6f 72 6f 6f 6d  0d a4 f6 20 20 20 4c 44  |  noroom...   LD|
00025310  4d 56 53 46 44 20 20 52  31 33 21 2c 7b 52 30 2d  |MVSFD  R13!,{R0-|
00025320  52 31 32 2c 50 43 7d 5e  0d a5 00 04 0d a5 0a 4f  |R12,PC}^.......O|
00025330  20 41 44 52 20 20 20 20  20 20 52 30 2c 6d 65 73  | ADR      R0,mes|
00025340  73 61 67 65 73 20 20 20  20 20 20 20 20 20 20 20  |sages           |
00025350  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00025360  69 6f 6e 20 6f 70 65 6e  73 20 74 68 65 20 6d 65  |ion opens the me|
00025370  73 73 61 67 65 73 20 66  69 6c 65 0d a5 14 4c 20  |ssages file...L |
00025380  41 44 52 20 20 20 20 20  20 52 31 2c 6d 65 73 73  |ADR      R1,mess|
00025390  61 67 65 66 69 6c 65 6e  61 6d 65 20 20 20 20 20  |agefilename     |
000253a0  20 20 20 20 20 3b 61 6e  64 20 6c 6f 61 64 73 20  |     ;and loads |
000253b0  69 74 20 69 6e 74 6f 20  74 68 65 20 68 65 61 70  |it into the heap|
000253c0  20 62 6c 6f 63 6b 2e 0d  a5 1e 26 20 53 57 49 20  | block....& SWI |
000253d0  20 20 20 20 20 22 58 4d  65 73 73 61 67 65 54 72  |     "XMessageTr|
000253e0  61 6e 73 5f 4f 70 65 6e  46 69 6c 65 22 0d a5 28  |ans_OpenFile"..(|
000253f0  19 20 20 42 56 53 20 20  20 20 20 20 6e 6f 6d 65  |.  BVS      nome|
00025400  73 73 61 67 65 73 0d a5  32 04 0d a5 3c 4c 20 a4  |ssages..2...<L .|
00025410  4c 6f 6e 67 41 64 72 28  22 22 2c 30 2c 6d 65 73  |LongAdr("",0,mes|
00025420  73 61 67 65 73 29 20 20  20 20 20 20 20 20 20 20  |sages)          |
00025430  20 20 20 3b 54 68 65 20  66 6f 6c 6c 6f 77 69 6e  |   ;The followin|
00025440  67 20 73 65 63 74 69 6f  6e 20 72 65 61 64 73 20  |g section reads |
00025450  69 6e 20 74 68 65 0d a5  46 4f 20 41 44 44 20 20  |in the..FO ADD  |
00025460  20 20 20 20 52 38 2c 52  31 30 2c 23 6d 6f 6e 74  |    R8,R10,#mont|
00025470  68 73 25 20 20 20 20 20  20 20 20 20 20 20 20 20  |hs%             |
00025480  3b 4d 6f 6e 74 68 20 6e  61 6d 65 73 20 66 72 6f  |;Month names fro|
00025490  6d 20 74 68 65 20 66 69  6c 65 20 61 6e 64 20 62  |m the file and b|
000254a0  75 69 6c 64 73 0d a5 50  47 20 4d 4f 56 20 20 20  |uilds..PG MOV   |
000254b0  20 20 20 52 39 2c 23 30  20 20 20 20 20 20 20 20  |   R9,#0        |
000254c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000254d0  75 70 20 61 20 6c 6f 6f  6b 2d 75 70 20 74 61 62  |up a look-up tab|
000254e0  6c 65 20 6f 66 20 6e 61  6d 65 73 2e 0d a5 5a 04  |le of names...Z.|
000254f0  0d a5 64 0d 20 2e 49 4d  6c 6f 6f 70 31 0d a5 6e  |..d. .IMloop1..n|
00025500  16 20 41 44 44 20 20 20  20 20 20 52 31 2c 52 38  |. ADD      R1,R8|
00025510  2c 52 39 0d a5 78 13 20  4d 4f 56 20 20 20 20 20  |,R9..x. MOV     |
00025520  20 52 32 2c 52 31 0d a5  82 15 20 4d 4f 56 20 20  | R2,R1.... MOV  |
00025530  20 20 20 20 52 33 2c 23  26 31 30 0d a5 8c 04 0d  |    R3,#&10.....|
00025540  a5 96 24 20 53 57 49 20  20 20 20 20 20 22 58 4d  |..$ SWI      "XM|
00025550  65 73 73 61 67 65 54 72  61 6e 73 5f 4c 6f 6f 6b  |essageTrans_Look|
00025560  75 70 22 0d a5 a0 2a 20  20 42 56 53 20 20 20 20  |up"...*  BVS    |
00025570  20 20 4e 6f 6e 53 65 72  69 6f 75 73 45 72 72 6f  |  NonSeriousErro|
00025580  72 20 3b 6e 6f 6d 65 73  73 61 67 65 73 0d a5 aa  |r ;nomessages...|
00025590  14 20 4d 4f 56 20 20 20  20 20 20 52 37 2c 23 31  |. MOV      R7,#1|
000255a0  33 0d a5 b4 19 20 53 54  52 42 20 20 20 20 20 20  |3.... STRB      |
000255b0  52 37 2c 5b 52 32 2c 52  33 5d 0d a5 be 15 20 43  |R7,[R2,R3].... C|
000255c0  4d 50 20 20 20 20 20 20  52 39 2c 23 26 43 30 0d  |MP      R9,#&C0.|
000255d0  a5 c8 19 20 20 41 44 44  4e 45 20 20 20 20 52 39  |...  ADDNE    R9|
000255e0  2c 52 39 2c 23 26 31 30  0d a5 d2 16 20 20 42 4e  |,R9,#&10....  BN|
000255f0  45 20 20 20 20 20 20 49  4d 6c 6f 6f 70 31 0d a5  |E      IMloop1..|
00025600  dc 04 0d a5 e6 4c 20 4d  4f 56 20 20 20 20 20 20  |.....L MOV      |
00025610  52 30 2c 23 32 20 20 20  20 20 20 20 20 20 20 20  |R0,#2           |
00025620  20 20 20 20 20 20 20 20  20 20 20 20 3b 54 68 69  |            ;Thi|
00025630  73 20 73 65 63 74 69 6f  6e 20 63 6c 61 69 6d 73  |s section claims|
00025640  20 73 70 61 63 65 20 66  6f 72 20 74 68 65 0d a5  | space for the..|
00025650  f0 41 20 a4 4c 6f 6e 67  41 64 72 28 22 22 2c 31  |.A .LongAdr("",1|
00025660  2c 68 65 61 70 29 20 20  20 20 20 20 20 20 20 20  |,heap)          |
00025670  20 20 20 20 20 20 20 3b  69 63 6f 6e 62 61 72 20  |       ;iconbar |
00025680  6d 65 6e 75 20 73 74 72  75 63 74 75 72 65 2e 0d  |menu structure..|
00025690  a5 fa 14 20 4d 4f 56 20  20 20 20 20 20 52 33 2c  |... MOV      R3,|
000256a0  23 37 32 0d a6 04 18 20  53 57 49 20 20 20 20 20  |#72.... SWI     |
000256b0  20 22 58 4f 53 5f 48 65  61 70 22 0d a6 0e 15 20  | "XOS_Heap".... |
000256c0  20 42 4c 56 53 20 20 20  20 20 6e 6f 72 6f 6f 6d  | BLVS     noroom|
000256d0  0d a6 18 20 20 4c 44 4d  56 53 46 44 20 20 20 52  |...  LDMVSFD   R|
000256e0  31 33 21 2c 7b 52 30 2d  52 31 32 2c 50 43 7d 5e  |13!,{R0-R12,PC}^|
000256f0  0d a6 22 1c 20 a4 4c 6f  6e 67 41 64 72 28 22 22  |..". .LongAdr(""|
00025700  2c 38 2c 6d 65 6e 75 6c  69 73 74 29 0d a6 2c 18  |,8,menulist)..,.|
00025710  20 53 54 52 20 20 20 20  20 20 52 32 2c 5b 52 38  | STR      R2,[R8|
00025720  2c 23 30 5d 0d a6 36 04  0d a6 40 4f 20 a4 4c 6f  |,#0]..6...@O .Lo|
00025730  6e 67 41 64 72 28 22 22  2c 30 2c 6d 65 73 73 61  |ngAdr("",0,messa|
00025740  67 65 73 29 20 20 20 20  20 20 20 20 20 20 20 20  |ges)            |
00025750  20 3b 54 68 69 73 20 73  65 63 74 69 6f 6e 20 63  | ;This section c|
00025760  72 65 61 74 65 73 20 74  68 65 20 69 63 6f 6e 62  |reates the iconb|
00025770  61 72 20 6d 65 6e 75 0d  a6 4a 34 20 a4 4c 6f 6e  |ar menu..J4 .Lon|
00025780  67 41 64 72 28 22 22 2c  31 2c 69 62 6d 65 6e 75  |gAdr("",1,ibmenu|
00025790  25 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%)              |
000257a0  3b 73 74 72 75 63 74 75  72 65 2e 0d a6 54 14 20  |;structure...T. |
000257b0  4d 4f 56 20 20 20 20 20  20 52 33 2c 23 37 32 0d  |MOV      R3,#72.|
000257c0  a6 5e 27 20 53 57 49 20  20 20 20 20 20 22 58 4d  |.^' SWI      "XM|
000257d0  65 73 73 61 67 65 54 72  61 6e 73 5f 4d 61 6b 65  |essageTrans_Make|
000257e0  4d 65 6e 75 73 22 0d a6  68 19 20 20 42 56 53 20  |Menus"..h.  BVS |
000257f0  20 20 20 20 20 6e 6f 6d  65 73 73 61 67 65 73 0d  |     nomessages.|
00025800  a6 72 04 0d a6 7c 51 20  4d 4f 56 20 20 20 20 20  |.r...|Q MOV     |
00025810  20 52 30 2c 23 32 20 20  20 20 20 20 20 20 20 20  | R0,#2          |
00025820  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00025830  69 73 20 73 65 63 74 69  6f 6e 20 63 6c 61 69 6d  |is section claim|
00025840  73 20 73 70 61 63 65 20  66 6f 72 20 74 68 65 20  |s space for the |
00025850  4d 61 69 6e 0d a6 86 39  20 a4 4c 6f 6e 67 41 64  |Main...9 .LongAd|
00025860  72 28 22 22 2c 31 2c 68  65 61 70 29 20 20 20 20  |r("",1,heap)    |
00025870  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 6d 65  |             ;me|
00025880  6e 75 20 73 74 72 75 63  74 75 72 65 2e 0d a6 90  |nu structure....|
00025890  15 20 4d 4f 56 20 20 20  20 20 20 52 33 2c 23 31  |. MOV      R3,#1|
000258a0  34 38 0d a6 9a 18 20 53  57 49 20 20 20 20 20 20  |48.... SWI      |
000258b0  22 58 4f 53 5f 48 65 61  70 22 0d a6 a4 15 20 20  |"XOS_Heap"....  |
000258c0  42 4c 56 53 20 20 20 20  20 6e 6f 72 6f 6f 6d 0d  |BLVS     noroom.|
000258d0  a6 ae 20 20 20 4c 44 4d  56 53 46 44 20 20 52 31  |..   LDMVSFD  R1|
000258e0  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
000258f0  a6 b8 18 20 53 54 52 20  20 20 20 20 20 52 32 2c  |... STR      R2,|
00025900  5b 52 38 2c 23 34 5d 0d  a6 c2 04 0d a6 cc 4c 20  |[R8,#4].......L |
00025910  a4 4c 6f 6e 67 41 64 72  28 22 22 2c 30 2c 6d 65  |.LongAdr("",0,me|
00025920  73 73 61 67 65 73 29 20  20 20 20 20 20 20 20 20  |ssages)         |
00025930  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00025940  6e 20 63 72 65 61 74 65  73 20 74 68 65 20 4d 61  |n creates the Ma|
00025950  69 6e 20 6d 65 6e 75 0d  a6 d6 34 20 a4 4c 6f 6e  |in menu...4 .Lon|
00025960  67 41 64 72 28 22 22 2c  31 2c 6d 61 69 6e 6d 65  |gAdr("",1,mainme|
00025970  6e 75 25 29 20 20 20 20  20 20 20 20 20 20 20 20  |nu%)            |
00025980  3b 73 74 72 75 63 74 75  72 65 2e 0d a6 e0 15 20  |;structure..... |
00025990  4d 4f 56 20 20 20 20 20  20 52 33 2c 23 31 34 38  |MOV      R3,#148|
000259a0  0d a6 ea 27 20 53 57 49  20 20 20 20 20 20 22 58  |...' SWI      "X|
000259b0  4d 65 73 73 61 67 65 54  72 61 6e 73 5f 4d 61 6b  |MessageTrans_Mak|
000259c0  65 4d 65 6e 75 73 22 0d  a6 f4 19 20 20 42 56 53  |eMenus"....  BVS|
000259d0  20 20 20 20 20 20 6e 6f  6d 65 73 73 61 67 65 73  |      nomessages|
000259e0  0d a6 fe 04 0d a7 08 51  20 4d 4f 56 20 20 20 20  |.......Q MOV    |
000259f0  20 20 52 30 2c 23 32 20  20 20 20 20 20 20 20 20  |  R0,#2         |
00025a00  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 54 68  |             ;Th|
00025a10  69 73 20 73 65 63 74 69  6f 6e 20 63 6c 61 69 6d  |is section claim|
00025a20  73 20 73 70 61 63 65 20  66 6f 72 20 74 68 65 20  |s space for the |
00025a30  54 6f 70 69 63 0d a7 12  38 20 a4 4c 6f 6e 67 41  |Topic...8 .LongA|
00025a40  64 72 28 22 22 2c 31 2c  68 65 61 70 29 20 20 20  |dr("",1,heap)   |
00025a50  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 6d 65  |             ;me|
00025a60  6e 75 20 73 74 72 75 63  74 75 72 65 2e 0d a7 1c  |nu structure....|
00025a70  15 20 4d 4f 56 20 20 20  20 20 20 52 33 2c 23 38  |. MOV      R3,#8|
00025a80  32 30 0d a7 26 18 20 53  57 49 20 20 20 20 20 20  |20..&. SWI      |
00025a90  22 58 4f 53 5f 48 65 61  70 22 0d a7 30 15 20 20  |"XOS_Heap"..0.  |
00025aa0  42 4c 56 53 20 20 20 20  20 6e 6f 72 6f 6f 6d 0d  |BLVS     noroom.|
00025ab0  a7 3a 20 20 20 4c 44 4d  56 53 46 44 20 20 52 31  |.:   LDMVSFD  R1|
00025ac0  33 21 2c 7b 52 30 2d 52  31 32 2c 50 43 7d 5e 0d  |3!,{R0-R12,PC}^.|
00025ad0  a7 44 18 20 53 54 52 20  20 20 20 20 20 52 32 2c  |.D. STR      R2,|
00025ae0  5b 52 38 2c 23 38 5d 0d  a7 4e 04 0d a7 58 52 20  |[R8,#8]..N...XR |
00025af0  41 44 44 20 20 20 20 20  20 52 31 2c 52 32 2c 52  |ADD      R1,R2,R|
00025b00  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
00025b10  20 20 20 20 3b 54 68 69  73 20 73 65 63 74 69 6f  |    ;This sectio|
00025b20  6e 20 66 69 6c 6c 73 20  69 6e 20 74 68 65 20 64  |n fills in the d|
00025b30  65 74 61 69 6c 73 20 6f  66 20 74 68 65 0d a7 62  |etails of the..b|
00025b40  50 20 53 55 42 20 20 20  20 20 20 52 31 2c 52 31  |P SUB      R1,R1|
00025b50  2c 23 31 32 20 20 20 20  20 20 20 20 20 20 20 20  |,#12            |
00025b60  20 20 20 20 20 20 3b 6c  61 73 74 20 69 74 65 6d  |      ;last item|
00025b70  20 6f 6e 20 74 68 65 20  74 6f 70 69 63 20 6d 65  | on the topic me|
00025b80  6e 75 20 77 68 69 63 68  20 69 73 20 61 0d a7 6c  |nu which is a..l|
00025b90  3f 20 a4 4c 6f 6e 67 41  64 72 28 22 22 2c 37 2c  |? .LongAdr("",7,|
00025ba0  77 72 69 74 65 61 62 6c  65 74 65 78 74 29 20 20  |writeabletext)  |
00025bb0  20 20 20 20 20 3b 77 72  69 74 65 61 62 6c 65 20  |     ;writeable |
00025bc0  6d 65 6e 75 20 6f 70 74  69 6f 6e 2e 0d a7 76 13  |menu option...v.|
00025bd0  20 4d 4f 56 20 20 20 20  20 20 52 36 2c 23 30 0d  | MOV      R6,#0.|
00025be0  a7 80 15 20 4d 4f 56 20  20 20 20 20 20 52 35 2c  |... MOV      R5,|
00025bf0  23 32 35 36 0d a7 8a 18  20 53 54 52 20 20 20 20  |#256.... STR    |
00025c00  20 20 52 37 2c 5b 52 31  5d 2c 23 34 0d a7 94 18  |  R7,[R1],#4....|
00025c10  20 53 54 52 20 20 20 20  20 20 52 36 2c 5b 52 31  | STR      R6,[R1|
00025c20  5d 2c 23 34 0d a7 9e 15  20 53 54 52 20 20 20 20  |],#4.... STR    |
00025c30  20 20 52 35 2c 5b 52 31  5d 0d a7 a8 04 0d a7 b2  |  R5,[R1].......|
00025c40  4c 20 a4 4c 6f 6e 67 41  64 72 28 22 22 2c 30 2c  |L .LongAdr("",0,|
00025c50  6d 65 73 73 61 67 65 73  29 20 20 20 20 20 20 20  |messages)       |
00025c60  20 20 20 20 20 3b 54 68  69 73 20 73 65 63 74 69  |     ;This secti|
00025c70  6f 6e 20 63 72 65 61 74  65 73 20 74 68 65 20 54  |on creates the T|
00025c80  6f 70 69 63 20 6d 65 6e  75 0d a7 bc 33 20 a4 4c  |opic menu...3 .L|
00025c90  6f 6e 67 41 64 72 28 22  22 2c 31 2c 74 6f 70 69  |ongAdr("",1,topi|
00025ca0  63 6d 65 6e 75 25 29 20  20 20 20 20 20 20 20 20  |cmenu%)         |
00025cb0  20 3b 73 74 72 75 63 74  75 72 65 2e 0d a7 c6 15  | ;structure.....|
00025cc0  20 4d 4f 56 20 20 20 20  20 20 52 33 2c 23 38 32  | MOV      R3,#82|
00025cd0  30 0d a7 d0 27 20 53 57  49 20 20 20 20 20 20 22  |0...' SWI      "|
00025ce0  58 4d 65 73 73 61 67 65  54 72 61 6e 73 5f 4d 61  |XMessageTrans_Ma|
00025cf0  6b 65 4d 65 6e 75 73 22  0d a7 da 19 20 20 42 56  |keMenus"....  BV|
00025d00  53 20 20 20 20 20 20 6e  6f 6d 65 73 73 61 67 65  |S      nomessage|
00025d10  73 0d a7 e4 04 0d a7 ee  4b 20 4c 44 52 20 20 20  |s.......K LDR   |
00025d20  20 20 20 52 31 2c 5b 52  31 32 2c 23 69 6e 66 6f  |   R1,[R12,#info|
00025d30  25 5d 20 20 20 20 20 20  20 20 20 20 20 20 3b 54  |%]            ;T|
00025d40  68 69 73 20 73 65 63 74  69 6f 6e 20 70 75 74 73  |his section puts|
00025d50  20 74 68 65 20 49 6e 66  6f 20 77 69 6e 64 6f 77  | the Info window|
00025d60  0d a7 f8 50 20 4c 44 52  20 20 20 20 20 20 52 30  |...P LDR      R0|
00025d70  2c 5b 52 38 2c 23 30 5d  20 20 20 20 20 20 20 20  |,[R8,#0]        |
00025d80  20 20 20 20 20 20 20 20  20 3b 68 61 6e 64 6c 65  |         ;handle|
00025d90  20 69 6e 20 74 68 65 20  4d 61 69 6e 20 6d 65 6e  | in the Main men|
00025da0  75 20 73 74 72 75 63 74  75 72 65 20 61 73 20 61  |u structure as a|
00025db0  0d a8 02 42 20 53 54 52  20 20 20 20 20 20 52 31  |...B STR      R1|
00025dc0  2c 5b 52 30 2c 23 33 32  5d 20 20 20 20 20 20 20  |,[R0,#32]       |
00025dd0  20 20 20 20 20 20 20 20  20 3b 61 20 70 6f 69 6e  |         ;a poin|
00025de0  74 65 72 20 74 6f 20 61  20 73 75 62 2d 6d 65 6e  |ter to a sub-men|
00025df0  75 2e 0d a8 0c 18 20 4c  44 52 20 20 20 20 20 20  |u..... LDR      |
00025e00  52 30 2c 5b 52 38 2c 23  34 5d 0d a8 16 19 20 53  |R0,[R8,#4].... S|
00025e10  54 52 20 20 20 20 20 20  52 31 2c 5b 52 30 2c 23  |TR      R1,[R0,#|
00025e20  33 32 5d 0d a8 20 04 0d  a8 2a 4f 20 4c 44 52 20  |32].. ...*O LDR |
00025e30  20 20 20 20 20 52 31 2c  5b 52 31 32 2c 23 73 65  |     R1,[R12,#se|
00025e40  61 72 63 68 25 5d 20 20  20 20 20 20 20 20 20 20  |arch%]          |
00025e50  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 70 75  |;This section pu|
00025e60  74 73 20 74 68 65 20 53  65 61 72 63 68 20 61 6e  |ts the Search an|
00025e70  64 20 53 61 76 65 0d a8  34 4b 20 53 54 52 20 20  |d Save..4K STR  |
00025e80  20 20 20 20 52 31 2c 5b  52 30 2c 23 35 36 5d 20  |    R1,[R0,#56] |
00025e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00025ea0  77 69 6e 64 6f 77 20 68  61 6e 64 6c 65 73 20 69  |window handles i|
00025eb0  6e 74 6f 20 74 68 65 20  4d 61 69 6e 20 6d 65 6e  |nto the Main men|
00025ec0  75 0d a8 3e 4d 20 4c 44  52 20 20 20 20 20 20 52  |u..>M LDR      R|
00025ed0  31 2c 5b 52 31 32 2c 23  73 61 76 65 25 5d 20 20  |1,[R12,#save%]  |
00025ee0  20 20 20 20 20 20 20 20  20 20 3b 73 74 72 75 63  |          ;struc|
00025ef0  74 75 72 65 20 61 73 20  70 6f 69 6e 74 65 72 73  |ture as pointers|
00025f00  20 74 6f 20 73 75 62 2d  6d 65 6e 75 73 2e 0d a8  | to sub-menus...|
00025f10  48 1a 20 53 54 52 20 20  20 20 20 20 52 31 2c 5b  |H. STR      R1,[|
00025f20  52 30 2c 23 31 30 34 5d  0d a8 52 04 0d a8 5c 1e  |R0,#104]..R...\.|
00025f30  4c 44 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |LDMFD    R13!,{R|
00025f40  30 2d 52 31 32 2c 50 43  7d 5e 0d a8 66 04 0d a8  |0-R12,PC}^..f...|
00025f50  70 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |pR;-------------|
00025f60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00025fa0  0d a8 7a 3f 3b 20 54 68  69 73 20 73 65 63 74 69  |..z?; This secti|
00025fb0  6f 6e 20 63 6f 6e 74 61  69 6e 73 20 74 68 65 20  |on contains the |
00025fc0  70 61 74 68 6e 61 6d 65  20 6f 66 20 74 68 65 20  |pathname of the |
00025fd0  4d 65 61 73 73 61 67 65  73 20 66 69 6c 65 2e 0d  |Meassages file..|
00025fe0  a8 84 04 0d a8 8e 14 2e  6d 65 73 73 61 67 65 66  |........messagef|
00025ff0  69 6c 65 6e 61 6d 65 0d  a8 98 2a 45 51 55 53 20  |ilename...*EQUS |
00026000  20 20 20 20 22 3c 41 55  49 6e 64 65 78 24 52 65  |    "<AUIndex$Re|
00026010  73 6f 75 72 63 65 3e 2e  4d 65 73 73 61 67 65 73  |source>.Messages|
00026020  22 0d a8 a2 0e 45 51 55  42 20 20 20 20 20 30 0d  |"....EQUB     0.|
00026030  a8 ac 09 41 4c 49 47 4e  0d a8 b6 04 0d a8 c0 52  |...ALIGN.......R|
00026040  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00026050  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00026080  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d a8  |--------------..|
00026090  ca 52 3b 20 54 68 69 73  20 73 65 63 74 69 6f 6e  |.R; This section|
000260a0  20 63 6f 6e 74 61 69 6e  73 20 61 20 4d 65 73 73  | contains a Mess|
000260b0  61 67 65 20 66 69 6c 65  20 64 65 73 63 72 69 70  |age file descrip|
000260c0  74 6f 72 20 77 68 69 63  68 20 69 73 20 75 73 65  |tor which is use|
000260d0  64 20 74 6f 20 69 6e 66  6f 72 6d 61 74 69 6f 6e  |d to information|
000260e0  0d a8 d4 1e 3b 20 61 62  6f 75 74 20 74 68 65 20  |....; about the |
000260f0  4d 65 73 73 61 67 65 73  20 66 69 6c 65 2e 0d a8  |Messages file...|
00026100  de 04 0d a8 e8 0d 2e 6d  65 73 73 61 67 65 73 0d  |.......messages.|
00026110  a8 f2 0e 45 51 55 44 20  20 20 20 20 30 0d a8 fc  |...EQUD     0...|
00026120  0e 45 51 55 44 20 20 20  20 20 30 0d a9 06 0e 45  |.EQUD     0....E|
00026130  51 55 44 20 20 20 20 20  30 0d a9 10 0e 45 51 55  |QUD     0....EQU|
00026140  44 20 20 20 20 20 30 0d  a9 1a 0e 45 51 55 44 20  |D     0....EQUD |
00026150  20 20 20 20 30 0d a9 24  09 41 4c 49 47 4e 0d a9  |    0..$.ALIGN..|
00026160  2e 04 0d a9 38 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....8R;---------|
00026170  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000261b0  2d 2d 2d 2d 0d a9 42 33  3b 20 20 20 20 20 20 20  |----..B3;       |
000261c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000261d0  20 20 20 2a 2a 2a 20 43  6f 75 6e 74 52 65 63 6f  |   *** CountReco|
000261e0  72 64 73 20 2a 2a 2a 0d  a9 4c 4c 3b 20 54 68 69  |rds ***..LL; Thi|
000261f0  73 20 73 65 63 74 69 6f  6e 20 63 6f 75 6e 74 73  |s section counts|
00026200  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 72  | the number of r|
00026210  65 63 6f 72 64 73 20 69  6e 20 74 68 65 20 66 69  |ecords in the fi|
00026220  6c 65 20 73 70 65 63 69  66 69 65 64 20 69 6e 20  |le specified in |
00026230  52 30 2e 0d a9 56 04 0d  a9 60 11 2e 43 6f 75 6e  |R0...V...`..Coun|
00026240  74 52 65 63 6f 72 64 73  0d a9 6a 04 0d a9 74 0d  |tRecords..j...t.|
00026250  3b 4f 6e 20 45 6e 74 72  79 0d a9 7e 12 3b 52 30  |;On Entry..~.;R0|
00026260  3d 66 69 6c 65 68 61 6e  64 6c 65 0d a9 88 05 3b  |=filehandle....;|
00026270  0d a9 92 0c 3b 4f 6e 20  45 78 69 74 0d a9 9c 1b  |....;On Exit....|
00026280  3b 52 30 3d 4e 6f 2e 20  72 65 63 6f 72 64 73 20  |;R0=No. records |
00026290  69 6e 20 66 69 6c 65 0d  a9 a6 04 0d a9 b0 1e 53  |in file........S|
000262a0  54 4d 46 44 20 20 20 20  52 31 33 21 2c 7b 52 31  |TMFD    R13!,{R1|
000262b0  2d 52 31 32 2c 52 31 34  7d 0d a9 ba 04 0d a9 c4  |-R12,R14}.......|
000262c0  4e 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 52 30  |N MOV      R1,R0|
000262d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000262e0  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
000262f0  69 6f 6e 20 66 69 6e 64  73 20 74 68 65 20 6c 65  |ion finds the le|
00026300  6e 67 74 68 20 6f 66 20  74 68 65 0d a9 ce 2f 20  |ngth of the.../ |
00026310  4d 4f 56 20 20 20 20 20  20 52 30 2c 23 32 20 20  |MOV      R0,#2  |
00026320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00026330  20 20 20 20 3b 66 69 6c  65 2e 0d a9 d8 18 20 53  |    ;file..... S|
00026340  57 49 20 20 20 20 20 20  22 58 4f 53 5f 41 72 67  |WI      "XOS_Arg|
00026350  73 22 0d a9 e2 18 20 20  42 56 53 20 20 20 20 20  |s"....  BVS     |
00026360  20 6e 6f 72 65 63 6f 72  64 73 0d a9 ec 04 0d a9  | norecords......|
00026370  f6 50 20 4d 4f 56 20 20  20 20 20 20 52 30 2c 52  |.P MOV      R0,R|
00026380  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
00026390  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000263a0  74 69 6f 6e 20 64 69 76  69 64 65 73 20 74 68 65  |tion divides the|
000263b0  20 6c 65 6e 67 74 68 20  6f 66 20 74 68 65 0d aa  | length of the..|
000263c0  00 52 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 23  |.R MOV      R1,#|
000263d0  38 38 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |88              |
000263e0  20 20 20 20 20 20 20 3b  66 69 6c 65 20 62 79 20  |       ;file by |
000263f0  74 68 65 20 6c 65 6e 67  74 68 20 6f 66 20 61 20  |the length of a |
00026400  72 65 63 6f 72 64 2c 20  38 38 20 62 79 74 65 73  |record, 88 bytes|
00026410  0d aa 0a 48 20 42 4c 20  20 20 20 20 20 20 44 69  |...H BL       Di|
00026420  76 69 64 65 20 20 20 20  20 20 20 20 20 20 20 20  |vide            |
00026430  20 20 20 20 20 20 20 20  20 3b 74 6f 20 66 69 6e  |         ;to fin|
00026440  64 20 74 68 65 20 6e 75  6d 62 65 72 20 6f 66 20  |d the number of |
00026450  72 65 63 6f 72 64 73 2e  0d aa 14 13 20 4d 4f 56  |records..... MOV|
00026460  20 20 20 20 20 20 52 30  2c 52 32 0d aa 1e 04 0d  |      R0,R2.....|
00026470  aa 28 1e 4c 44 4d 46 44  20 20 20 20 52 31 33 21  |.(.LDMFD    R13!|
00026480  2c 7b 52 31 2d 52 31 32  2c 50 43 7d 5e 0d aa 32  |,{R1-R12,PC}^..2|
00026490  04 0d aa 3c 52 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...<R;----------|
000264a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000264e0  2d 2d 2d 0d aa 46 31 3b  20 20 20 20 20 20 20 20  |---..F1;        |
000264f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00026500  20 20 2a 2a 2a 20 47 65  74 52 65 63 6f 72 64 73  |  *** GetRecords|
00026510  20 2a 2a 2a 0d aa 50 50  3b 20 54 68 69 73 20 73  | ***..PP; This s|
00026520  75 62 72 6f 75 74 69 6e  65 20 72 65 61 64 73 20  |ubroutine reads |
00026530  69 6e 20 61 20 6e 75 6d  62 65 72 20 6f 66 20 72  |in a number of r|
00026540  65 63 6f 72 64 73 20 69  6e 20 74 68 65 20 64 69  |ecords in the di|
00026550  72 65 63 74 69 6f 6e 20  73 70 65 63 69 66 69 65  |rection specifie|
00026560  64 20 62 79 0d aa 5a 4e  3b 20 52 31 2e 20 54 68  |d by..ZN; R1. Th|
00026570  65 20 72 6f 75 74 69 6e  65 20 6f 6e 6c 79 20 72  |e routine only r|
00026580  65 61 64 73 20 69 6e 20  31 20 72 65 63 6f 72 64  |eads in 1 record|
00026590  20 62 75 74 20 73 6b 69  70 73 20 74 68 65 20 73  | but skips the s|
000265a0  70 65 63 69 66 69 65 64  20 6e 75 6d 62 65 72 20  |pecified number |
000265b0  6f 66 0d aa 64 18 3b 20  72 65 63 6f 72 64 73 20  |of..d.; records |
000265c0  69 6e 62 65 74 77 65 65  6e 2e 0d aa 6e 04 0d aa  |inbetween...n...|
000265d0  78 0f 2e 47 65 74 52 65  63 6f 72 64 73 0d aa 82  |x..GetRecords...|
000265e0  04 0d aa 8c 0d 3b 4f 6e  20 45 6e 74 72 79 0d aa  |.....;On Entry..|
000265f0  96 1e 3b 52 30 3d 4e 6f  2e 20 4f 66 20 52 65 63  |..;R0=No. Of Rec|
00026600  6f 72 64 73 20 74 6f 20  72 65 61 64 0d aa a0 19  |ords to read....|
00026610  3b 52 31 3d 44 69 72 65  63 74 69 6f 6e 20 20 30  |;R1=Direction  0|
00026620  2d 6e 65 78 74 0d aa aa  19 3b 20 20 20 20 20 20  |-next....;      |
00026630  20 20 20 20 20 20 20 20  31 2d 6c 61 73 74 0d aa  |        1-last..|
00026640  b4 2a 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |.*;             |
00026650  20 32 2d 52 65 61 64 20  73 70 65 63 69 66 69 65  | 2-Read specifie|
00026660  64 20 72 65 63 6f 72 64  0d aa be 04 0d aa c8 1e  |d record........|
00026670  53 54 4d 46 44 20 20 20  20 52 31 33 21 2c 7b 52  |STMFD    R13!,{R|
00026680  30 2d 52 31 32 2c 52 31  34 7d 0d aa d2 04 0d aa  |0-R12,R14}......|
00026690  dc 51 20 4d 4f 56 20 20  20 20 20 20 52 35 2c 52  |.Q MOV      R5,R|
000266a0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000266b0  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000266c0  74 69 6f 6e 20 63 6f 70  69 65 73 20 74 68 65 20  |tion copies the |
000266d0  70 61 72 61 6d 65 74 65  72 73 20 69 6e 74 6f 0d  |parameters into.|
000266e0  aa e6 50 20 4d 4f 56 20  20 20 20 20 20 52 34 2c  |..P MOV      R4,|
000266f0  52 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |R1              |
00026700  20 20 20 20 20 20 20 20  3b 68 69 67 68 20 6e 75  |        ;high nu|
00026710  6d 62 65 72 65 64 20 72  65 67 69 73 74 65 72 73  |mbered registers|
00026720  20 66 6f 72 20 6c 61 74  65 72 20 75 73 65 2e 0d  | for later use..|
00026730  aa f0 1f 20 4c 44 52 20  20 20 20 20 20 52 38 2c  |... LDR      R8,|
00026740  5b 52 31 30 2c 23 72 65  63 6f 72 64 25 5d 0d aa  |[R10,#record%]..|
00026750  fa 1c 20 4c 44 52 20 20  20 20 20 20 52 37 2c 5b  |.. LDR      R7,[|
00026760  52 31 30 2c 23 6d 61 78  25 5d 0d ab 04 04 0d ab  |R10,#max%]......|
00026770  0e 50 20 43 4d 50 20 20  20 20 20 20 52 34 2c 23  |.P CMP      R4,#|
00026780  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00026790  20 20 20 20 20 20 20 3b  54 68 69 73 20 73 65 63  |       ;This sec|
000267a0  74 69 6f 6e 20 63 68 65  63 6b 73 20 77 68 69 63  |tion checks whic|
000267b0  68 20 64 69 72 65 63 74  69 6f 6e 20 74 6f 0d ab  |h direction to..|
000267c0  18 32 20 20 42 45 51 20  20 20 20 20 20 62 61 63  |.2  BEQ      bac|
000267d0  6b 77 61 72 64 73 20 20  20 20 20 20 20 20 20 20  |kwards          |
000267e0  20 20 20 20 20 20 20 3b  72 65 61 64 20 69 6e 2e  |       ;read in.|
000267f0  0d ab 22 13 20 43 4d 50  20 20 20 20 20 20 52 34  |..". CMP      R4|
00026800  2c 23 32 0d ab 2c 11 20  20 ec 51 20 20 20 20 52  |,#2..,.  .Q    R|
00026810  38 2c 52 30 0d ab 36 19  20 20 42 45 51 20 20 20  |8,R0..6.  BEQ   |
00026820  20 20 20 72 65 61 64 72  65 63 6f 72 64 0d ab 40  |   readrecord..@|
00026830  04 0d ab 4a 49 20 20 43  4d 50 20 20 20 20 20 20  |...JI  CMP      |
00026840  52 38 2c 52 37 20 20 20  20 20 20 20 20 20 20 20  |R8,R7           |
00026850  20 20 20 20 20 20 20 20  20 20 3b 54 68 69 73 20  |          ;This |
00026860  73 65 63 74 69 6f 6e 20  63 6f 75 6e 74 73 20 66  |section counts f|
00026870  6f 72 77 61 72 64 20 74  68 65 0d ab 54 43 20 20  |orward the..TC  |
00026880  20 ec 51 20 20 20 20 52  38 2c 23 30 20 20 20 20  | .Q    R8,#0    |
00026890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000268a0  3b 73 70 65 63 69 66 69  65 64 20 6e 75 6d 62 65  |;specified numbe|
000268b0  72 20 6f 66 20 72 65 63  6f 72 64 73 2e 0d ab 5e  |r of records...^|
000268c0  17 20 20 41 44 44 20 20  20 20 20 20 52 38 2c 52  |.  ADD      R8,R|
000268d0  38 2c 52 35 0d ab 68 14  20 20 43 4d 50 20 20 20  |8,R5..h.  CMP   |
000268e0  20 20 20 52 38 2c 52 37  0d ab 72 15 20 20 20 4d  |   R8,R7..r.   M|
000268f0  4f 56 47 54 20 20 20 20  52 38 2c 52 37 0d ab 7c  |OVGT    R8,R7..||
00026900  04 0d ab 86 38 20 20 42  20 20 20 20 20 20 20 20  |....8  B        |
00026910  72 65 61 64 72 65 63 6f  72 64 20 20 20 20 20 20  |readrecord      |
00026920  20 20 20 20 20 20 20 20  20 20 3b 46 6f 72 77 61  |          ;Forwa|
00026930  72 64 20 62 72 61 6e 63  68 0d ab 90 04 0d ab 9a  |rd branch.......|
00026940  10 20 20 2e 62 61 63 6b  77 61 72 64 73 0d ab a4  |.  .backwards...|
00026950  4b 20 20 43 4d 50 20 20  20 20 20 20 52 38 2c 23  |K  CMP      R8,#|
00026960  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
00026970  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00026980  69 6f 6e 20 63 6f 75 6e  74 73 20 62 61 63 6b 77  |ion counts backw|
00026990  61 72 64 73 20 74 68 65  0d ab ae 43 20 20 20 ec  |ards the...C   .|
000269a0  51 20 20 20 20 52 38 2c  52 37 20 20 20 20 20 20  |Q    R8,R7      |
000269b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 73  |              ;s|
000269c0  70 65 63 6f 66 69 65 64  20 6e 75 6d 62 65 72 20  |pecofied number |
000269d0  6f 66 20 72 65 63 6f 72  64 73 2e 0d ab b8 18 20  |of records..... |
000269e0  20 20 41 44 44 45 51 20  20 20 20 52 38 2c 52 38  |  ADDEQ    R8,R8|
000269f0  2c 23 31 0d ab c2 17 20  20 53 55 42 20 20 20 20  |,#1....  SUB    |
00026a00  20 20 52 38 2c 52 38 2c  52 35 0d ab cc 14 20 20  |  R8,R8,R5....  |
00026a10  43 4d 50 20 20 20 20 20  20 52 38 2c 23 31 0d ab  |CMP      R8,#1..|
00026a20  d6 15 20 20 20 4d 4f 56  4c 54 20 20 20 20 52 38  |..   MOVLT    R8|
00026a30  2c 23 31 0d ab e0 04 0d  ab ea 10 20 2e 72 65 61  |,#1........ .rea|
00026a40  64 72 65 63 6f 72 64 0d  ab f4 4c 20 53 55 42 20  |drecord...L SUB |
00026a50  20 20 20 20 20 52 38 2c  52 38 2c 23 31 20 20 20  |     R8,R8,#1   |
00026a60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00026a70  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 6d 75  |;This section mu|
00026a80  6c 74 69 70 6c 69 65 73  20 74 68 65 20 74 61 72  |ltiplies the tar|
00026a90  67 65 74 0d ab fe 52 20  4d 4f 56 20 20 20 20 20  |get...R MOV     |
00026aa0  20 52 32 2c 20 20 20 52  38 2c 20 4c 53 4c 20 23  | R2,   R8, LSL #|
00026ab0  33 20 20 20 20 20 20 20  20 20 20 20 3b 72 65 63  |3           ;rec|
00026ac0  6f 72 64 20 6e 75 6d 62  65 72 20 62 79 20 38 38  |ord number by 88|
00026ad0  20 74 6f 20 66 69 6e 64  20 74 68 65 20 70 6f 73  | to find the pos|
00026ae0  69 74 69 6f 6e 0d ac 08  46 20 41 44 44 20 20 20  |ition...F ADD   |
00026af0  20 20 20 52 32 2c 52 32  2c 52 38 2c 20 4c 53 4c  |   R2,R2,R8, LSL|
00026b00  20 23 34 20 20 20 20 20  20 20 20 20 20 20 3b 69  | #4           ;i|
00026b10  6e 20 74 68 65 20 66 69  6c 65 20 77 68 65 72 65  |n the file where|
00026b20  20 69 74 20 73 74 61 72  74 73 2e 0d ac 12 1e 20  | it starts..... |
00026b30  41 44 44 20 20 20 20 20  20 52 32 2c 52 32 2c 52  |ADD      R2,R2,R|
00026b40  38 2c 20 4c 53 4c 20 23  36 0d ac 1c 04 0d ac 26  |8, LSL #6......&|
00026b50  4f 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 23 31  |O MOV      R0,#1|
00026b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00026b70  20 20 20 20 20 20 3b 54  68 69 73 20 73 65 63 74  |      ;This sect|
00026b80  69 6f 6e 20 6d 6f 76 65  73 20 74 68 65 20 66 69  |ion moves the fi|
00026b90  6c 65 70 6f 69 6e 74 65  72 20 74 6f 0d ac 30 4b  |lepointer to..0K|
00026ba0  20 4c 44 52 20 20 20 20  20 20 52 31 2c 5b 52 31  | LDR      R1,[R1|
00026bb0  30 2c 23 66 69 6c 65 68  61 6e 64 6c 65 25 5d 20  |0,#filehandle%] |
00026bc0  20 20 20 20 20 3b 74 68  65 20 63 6f 72 72 65 63  |     ;the correc|
00026bd0  74 20 70 6f 73 69 74 69  6f 6e 20 69 6e 20 74 68  |t position in th|
00026be0  65 20 66 69 6c 65 2e 0d  ac 3a 17 20 53 57 49 20  |e file...:. SWI |
00026bf0  20 20 20 20 20 22 4f 53  5f 41 72 67 73 22 0d ac  |     "OS_Args"..|
00026c00  44 18 20 20 42 56 53 20  20 20 20 20 20 6e 6f 72  |D.  BVS      nor|
00026c10  65 63 6f 72 64 73 0d ac  4e 04 0d ac 58 50 20 41  |ecords..N...XP A|
00026c20  44 44 20 20 20 20 20 20  52 30 2c 52 31 30 2c 23  |DD      R0,R10,#|
00026c30  72 65 63 6f 72 64 20 20  20 20 20 20 20 20 20 20  |record          |
00026c40  20 20 20 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |   ;This section|
00026c50  20 72 65 61 64 73 20 69  6e 20 74 68 65 20 72 65  | reads in the re|
00026c60  63 6f 72 64 20 75 70 20  74 6f 0d ac 62 44 20 4c  |cord up to..bD L|
00026c70  44 52 20 20 20 20 20 20  52 31 2c 5b 52 31 30 2c  |DR      R1,[R10,|
00026c80  23 66 69 6c 65 68 61 6e  64 6c 65 25 5d 20 20 20  |#filehandle%]   |
00026c90  20 20 20 3b 74 68 65 20  65 6e 64 20 6f 66 20 74  |   ;the end of t|
00026ca0  68 65 20 6c 61 73 74 20  66 69 65 6c 64 2e 0d ac  |he last field...|
00026cb0  6c 15 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |l. MOV      R2,#|
00026cc0  32 35 36 0d ac 76 14 20  4d 4f 56 20 20 20 20 20  |256..v. MOV     |
00026cd0  20 52 33 2c 23 31 33 0d  ac 80 13 20 4d 4f 56 20  | R3,#13.... MOV |
00026ce0  20 20 20 20 20 52 34 2c  23 30 0d ac 8a 1c 20 53  |     R4,#0.... S|
00026cf0  57 49 20 20 20 20 20 20  22 53 74 72 69 6e 67 5f  |WI      "String_|
00026d00  47 65 74 24 23 22 0d ac  94 18 20 20 42 56 53 20  |Get$#"....  BVS |
00026d10  20 20 20 20 20 6e 6f 72  65 63 6f 72 64 73 0d ac  |     norecords..|
00026d20  9e 04 0d ac a8 51 20 41  44 44 20 20 20 20 20 20  |.....Q ADD      |
00026d30  52 38 2c 52 38 2c 23 31  20 20 20 20 20 20 20 20  |R8,R8,#1        |
00026d40  20 20 20 20 20 20 20 20  20 20 20 3b 54 68 69 73  |           ;This|
00026d50  20 73 65 63 74 69 6f 6e  20 75 70 64 61 74 65 73  | section updates|
00026d60  20 74 68 65 20 63 75 72  72 65 6e 74 20 72 65 63  | the current rec|
00026d70  6f 72 64 0d ac b2 31 20  53 54 52 20 20 20 20 20  |ord...1 STR     |
00026d80  20 52 38 2c 5b 52 31 30  2c 23 72 65 63 6f 72 64  | R8,[R10,#record|
00026d90  25 5d 20 20 20 20 20 20  20 20 20 20 3b 6e 75 6d  |%]          ;num|
00026da0  62 65 72 2e 0d ac bc 04  0d ac c6 1e 4c 44 4d 46  |ber.........LDMF|
00026db0  44 20 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 31  |D    R13!,{R0-R1|
00026dc0  32 2c 50 43 7d 5e 0d ac  d0 04 0d ac da 52 3b 2d  |2,PC}^.......R;-|
00026dd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00026e10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d ac e4 30  |------------...0|
00026e20  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00026e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 2a  |              **|
00026e40  2a 20 55 70 64 61 74 65  20 2a 2a 2a 0d ac ee 4f  |* Update ***...O|
00026e50  3b 20 54 68 69 73 20 73  75 62 72 6f 75 74 69 6e  |; This subroutin|
00026e60  65 20 74 61 6b 65 73 20  74 68 65 20 72 65 63 6f  |e takes the reco|
00026e70  72 64 20 73 74 6f 72 65  64 20 69 6e 20 74 68 65  |rd stored in the|
00026e80  20 52 65 63 6f 72 64 20  62 75 66 66 65 72 20 61  | Record buffer a|
00026e90  6e 64 20 69 73 6f 6c 61  74 65 73 0d ac f8 4b 3b  |nd isolates...K;|
00026ea0  20 65 61 63 68 20 66 69  65 6c 64 20 69 6e 20 74  | each field in t|
00026eb0  75 72 6e 20 74 6f 20 75  70 64 61 74 65 20 65 61  |urn to update ea|
00026ec0  63 68 20 6f 66 20 74 68  65 20 69 63 6f 6e 73 20  |ch of the icons |
00026ed0  69 6e 20 74 68 65 20 44  69 73 70 6c 61 79 20 77  |in the Display w|
00026ee0  69 6e 64 6f 77 2e 0d ad  02 0b 2e 55 70 64 61 74  |indow......Updat|
00026ef0  65 0d ad 0c 04 0d ad 16  1e 53 54 4d 46 44 20 20  |e........STMFD  |
00026f00  20 20 52 31 33 21 2c 7b  52 30 2d 52 31 32 2c 52  |  R13!,{R0-R12,R|
00026f10  31 34 7d 0d ad 20 04 0d  ad 2a 20 20 4c 44 52 20  |14}.. ...*  LDR |
00026f20  20 20 20 20 20 52 38 2c  5b 52 31 32 2c 23 64 69  |     R8,[R12,#di|
00026f30  73 70 6c 61 79 25 5d 0d  ad 34 1c 20 41 44 44 20  |splay%]..4. ADD |
00026f40  20 20 20 20 20 52 37 2c  52 31 30 2c 23 72 65 63  |     R7,R10,#rec|
00026f50  6f 72 64 0d ad 3e 1f 20  4c 44 52 20 20 20 20 20  |ord..>. LDR     |
00026f60  20 52 36 2c 5b 52 31 30  2c 23 72 65 63 6f 72 64  | R6,[R10,#record|
00026f70  25 5d 0d ad 48 1c 20 4c  44 52 20 20 20 20 20 20  |%]..H. LDR      |
00026f80  52 35 2c 5b 52 31 30 2c  23 6d 61 78 25 5d 0d ad  |R5,[R10,#max%]..|
00026f90  52 04 0d ad 5c 37 20 4d  4f 56 20 20 20 20 20 20  |R...\7 MOV      |
00026fa0  52 30 2c 52 36 20 20 20  20 20 20 20 20 20 20 20  |R0,R6           |
00026fb0  20 20 20 20 20 20 20 20  20 20 20 3b 52 65 63 6f  |           ;Reco|
00026fc0  72 64 20 4e 75 6d 62 65  72 0d ad 66 13 20 4d 4f  |rd Number..f. MO|
00026fd0  56 20 20 20 20 20 20 52  31 2c 52 39 0d ad 70 15  |V      R1,R9..p.|
00026fe0  20 4d 4f 56 20 20 20 20  20 20 52 32 2c 23 32 35  | MOV      R2,#25|
00026ff0  36 0d ad 7a 22 20 53 57  49 20 20 20 20 20 20 22  |6..z" SWI      "|
00027000  4f 53 5f 43 6f 6e 76 65  72 74 49 6e 74 65 67 65  |OS_ConvertIntege|
00027010  72 34 22 0d ad 84 14 20  4d 4f 56 20 20 20 20 20  |r4".... MOV     |
00027020  20 52 32 2c 23 31 33 0d  ad 8e 18 20 53 54 52 42  | R2,#13.... STRB|
00027030  20 20 20 20 20 52 32 2c  5b 52 31 2c 23 31 5d 0d  |     R2,[R1,#1].|
00027040  ad 98 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |... MOV      R0,|
00027050  52 38 0d ad a2 14 20 4d  4f 56 20 20 20 20 20 20  |R8.... MOV      |
00027060  52 31 2c 23 32 38 0d ad  ac 13 20 4d 4f 56 20 20  |R1,#28.... MOV  |
00027070  20 20 20 20 52 32 2c 52  39 0d ad b6 17 20 42 4c  |    R2,R9.... BL|
00027080  20 20 20 20 20 20 20 57  72 69 74 65 49 63 6f 6e  |       WriteIcon|
00027090  0d ad c0 04 0d ad ca 3f  20 4d 4f 56 20 20 20 20  |.......? MOV    |
000270a0  20 20 52 30 2c 52 35 20  20 20 20 20 20 20 20 20  |  R0,R5         |
000270b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 4d 61  |             ;Ma|
000270c0  78 69 6d 75 6d 20 52 65  63 6f 72 64 20 4e 75 6d  |ximum Record Num|
000270d0  62 65 72 0d ad d4 13 20  4d 4f 56 20 20 20 20 20  |ber.... MOV     |
000270e0  20 52 31 2c 52 39 0d ad  de 15 20 4d 4f 56 20 20  | R1,R9.... MOV  |
000270f0  20 20 20 20 52 32 2c 23  32 35 36 0d ad e8 22 20  |    R2,#256..." |
00027100  53 57 49 20 20 20 20 20  20 22 4f 53 5f 43 6f 6e  |SWI      "OS_Con|
00027110  76 65 72 74 49 6e 74 65  67 65 72 34 22 0d ad f2  |vertInteger4"...|
00027120  14 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 23 31  |. MOV      R2,#1|
00027130  33 0d ad fc 18 20 53 54  52 42 20 20 20 20 20 52  |3.... STRB     R|
00027140  32 2c 5b 52 31 2c 23 31  5d 0d ae 06 13 20 4d 4f  |2,[R1,#1].... MO|
00027150  56 20 20 20 20 20 20 52  30 2c 52 38 0d ae 10 14  |V      R0,R8....|
00027160  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 23 32 39  | MOV      R1,#29|
00027170  0d ae 1a 13 20 4d 4f 56  20 20 20 20 20 20 52 32  |.... MOV      R2|
00027180  2c 52 39 0d ae 24 17 20  42 4c 20 20 20 20 20 20  |,R9..$. BL      |
00027190  20 57 72 69 74 65 49 63  6f 6e 0d ae 2e 38 20 20  | WriteIcon...8  |
000271a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000271c0  20 20 20 3b 4d 6f 6e 74  68 20 6f 66 20 49 73 73  |   ;Month of Iss|
000271d0  75 65 0d ae 38 13 20 4d  4f 56 20 20 20 20 20 20  |ue..8. MOV      |
000271e0  52 30 2c 52 37 0d ae 42  1f 20 41 44 44 20 20 20  |R0,R7..B. ADD   |
000271f0  20 20 20 52 31 2c 52 31  30 2c 23 62 61 63 6b 73  |   R1,R10,#backs|
00027200  6c 61 73 68 0d ae 4c 14  20 4d 4f 56 20 20 20 20  |lash..L. MOV    |
00027210  20 20 52 32 2c 23 31 33  0d ae 56 13 20 4d 4f 56  |  R2,#13..V. MOV|
00027220  20 20 20 20 20 20 52 33  2c 23 30 0d ae 60 1c 20  |      R3,#0..`. |
00027230  53 57 49 20 20 20 20 20  20 22 53 74 72 69 6e 67  |SWI      "String|
00027240  5f 49 6e 73 74 72 22 0d  ae 6a 13 20 4d 4f 56 20  |_Instr"..j. MOV |
00027250  20 20 20 20 20 52 30 2c  52 37 0d ae 74 13 20 4d  |     R0,R7..t. M|
00027260  4f 56 20 20 20 20 20 20  52 31 2c 52 39 0d ae 7e  |OV      R1,R9..~|
00027270  14 20 4d 4f 56 20 20 20  20 20 20 52 32 2c 23 31  |. MOV      R2,#1|
00027280  33 0d ae 88 13 20 4d 4f  56 20 20 20 20 20 20 52  |3.... MOV      R|
00027290  34 2c 23 30 0d ae 92 1b  20 53 57 49 20 20 20 20  |4,#0.... SWI    |
000272a0  20 20 22 53 74 72 69 6e  67 5f 4d 69 64 24 22 0d  |  "String_Mid$".|
000272b0  ae 9c 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |... MOV      R0,|
000272c0  52 31 0d ae a6 14 20 4d  4f 56 20 20 20 20 20 20  |R1.... MOV      |
000272d0  52 31 2c 23 31 33 0d ae  b0 1a 20 53 57 49 20 20  |R1,#13.... SWI  |
000272e0  20 20 20 20 22 53 74 72  69 6e 67 5f 56 61 6c 22  |    "String_Val"|
000272f0  0d ae ba 25 20 53 54 52  20 20 20 20 20 20 52 31  |...% STR      R1|
00027300  2c 5b 52 31 30 2c 23 64  69 73 70 6c 61 79 6d 6f  |,[R10,#displaymo|
00027310  6e 74 68 25 5d 0d ae c4  1d 20 4d 4f 56 20 20 20  |nth%].... MOV   |
00027320  20 20 20 52 32 2c 23 6d  6f 6e 74 68 73 25 2d 26  |   R2,#months%-&|
00027330  31 30 0d ae ce 1d 20 41  44 44 20 20 20 20 20 20  |10.... ADD      |
00027340  52 32 2c 52 32 2c 52 31  2c 4c 53 4c 20 23 34 0d  |R2,R2,R1,LSL #4.|
00027350  ae d8 17 20 41 44 44 20  20 20 20 20 20 52 32 2c  |... ADD      R2,|
00027360  52 31 30 2c 52 32 0d ae  e2 14 20 4d 4f 56 20 20  |R10,R2.... MOV  |
00027370  20 20 20 20 52 31 2c 23  33 32 0d ae ec 13 20 4d  |    R1,#32.... M|
00027380  4f 56 20 20 20 20 20 20  52 30 2c 52 38 0d ae f6  |OV      R0,R8...|
00027390  17 20 42 4c 20 20 20 20  20 20 20 57 72 69 74 65  |. BL       Write|
000273a0  49 63 6f 6e 0d af 00 04  0d af 0a 04 0d af 14 37  |Icon...........7|
000273b0  20 41 44 44 20 20 20 20  20 20 52 34 2c 52 33 2c  | ADD      R4,R3,|
000273c0  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
000273d0  20 20 20 20 20 3b 59 65  61 72 20 4f 66 20 49 73  |     ;Year Of Is|
000273e0  73 75 65 0d af 1e 13 20  4d 4f 56 20 20 20 20 20  |sue.... MOV     |
000273f0  20 52 30 2c 52 37 0d af  28 1f 20 41 44 44 20 20  | R0,R7..(. ADD  |
00027400  20 20 20 20 52 31 2c 52  31 30 2c 23 62 61 63 6b  |    R1,R10,#back|
00027410  73 6c 61 73 68 0d af 32  14 20 4d 4f 56 20 20 20  |slash..2. MOV   |
00027420  20 20 20 52 32 2c 23 31  33 0d af 3c 16 20 41 44  |   R2,#13..<. AD|
00027430  44 20 20 20 20 20 20 52  33 2c 52 33 2c 23 31 0d  |D      R3,R3,#1.|
00027440  af 46 1c 20 53 57 49 20  20 20 20 20 20 22 53 74  |.F. SWI      "St|
00027450  72 69 6e 67 5f 49 6e 73  74 72 22 0d af 50 13 20  |ring_Instr"..P. |
00027460  4d 4f 56 20 20 20 20 20  20 52 35 2c 52 33 0d af  |MOV      R5,R3..|
00027470  5a 13 20 4d 4f 56 20 20  20 20 20 20 52 31 2c 52  |Z. MOV      R1,R|
00027480  39 0d af 64 13 20 4d 4f  56 20 20 20 20 20 20 52  |9..d. MOV      R|
00027490  30 2c 52 37 0d af 6e 14  20 4d 4f 56 20 20 20 20  |0,R7..n. MOV    |
000274a0  20 20 52 32 2c 23 31 33  0d af 78 16 20 53 55 42  |  R2,#13..x. SUB|
000274b0  20 20 20 20 20 20 52 33  2c 52 33 2c 52 34 0d af  |      R3,R3,R4..|
000274c0  82 1b 20 53 57 49 20 20  20 20 20 20 22 53 74 72  |.. SWI      "Str|
000274d0  69 6e 67 5f 4d 69 64 24  22 0d af 8c 13 20 4d 4f  |ing_Mid$".... MO|
000274e0  56 20 20 20 20 20 20 52  30 2c 52 38 0d af 96 14  |V      R0,R8....|
000274f0  20 4d 4f 56 20 20 20 20  20 20 52 31 2c 23 33 33  | MOV      R1,#33|
00027500  0d af a0 13 20 4d 4f 56  20 20 20 20 20 20 52 32  |.... MOV      R2|
00027510  2c 52 39 0d af aa 17 20  42 4c 20 20 20 20 20 20  |,R9.... BL      |
00027520  20 57 72 69 74 65 49 63  6f 6e 0d af b4 04 0d af  | WriteIcon......|
00027530  be 36 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.6              |
00027540  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027550  20 20 20 20 20 20 20 3b  49 73 73 75 65 20 4e 75  |       ;Issue Nu|
00027560  6d 62 65 72 0d af c8 13  20 4d 4f 56 20 20 20 20  |mber.... MOV    |
00027570  20 20 52 33 2c 52 35 0d  af d2 16 20 41 44 44 20  |  R3,R5.... ADD |
00027580  20 20 20 20 20 52 34 2c  52 33 2c 23 31 0d af dc  |     R4,R3,#1...|
00027590  13 20 4d 4f 56 20 20 20  20 20 20 52 30 2c 52 37  |. MOV      R0,R7|
000275a0  0d af e6 1f 20 41 44 44  20 20 20 20 20 20 52 31  |.... ADD      R1|
000275b0  2c 52 31 30 2c 23 62 61  63 6b 73 6c 61 73 68 0d  |,R10,#backslash.|
000275c0  af f0 14 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |... MOV      R2,|
000275d0  23 31 33 0d af fa 16 20  41 44 44 20 20 20 20 20  |#13.... ADD     |
000275e0  20 52 33 2c 52 33 2c 23  31 0d b0 04 1c 20 53 57  | R3,R3,#1.... SW|
000275f0  49 20 20 20 20 20 20 22  53 74 72 69 6e 67 5f 49  |I      "String_I|
00027600  6e 73 74 72 22 0d b0 0e  13 20 4d 4f 56 20 20 20  |nstr".... MOV   |
00027610  20 20 20 52 35 2c 52 33  0d b0 18 13 20 4d 4f 56  |   R5,R3.... MOV|
00027620  20 20 20 20 20 20 52 30  2c 52 37 0d b0 22 13 20  |      R0,R7..". |
00027630  4d 4f 56 20 20 20 20 20  20 52 31 2c 52 39 0d b0  |MOV      R1,R9..|
00027640  2c 14 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 23  |,. MOV      R2,#|
00027650  31 33 0d b0 36 16 20 53  55 42 20 20 20 20 20 20  |13..6. SUB      |
00027660  52 33 2c 52 33 2c 52 34  0d b0 40 1b 20 53 57 49  |R3,R3,R4..@. SWI|
00027670  20 20 20 20 20 20 22 53  74 72 69 6e 67 5f 4d 69  |      "String_Mi|
00027680  64 24 22 0d b0 4a 13 20  4d 4f 56 20 20 20 20 20  |d$"..J. MOV     |
00027690  20 52 30 2c 52 38 0d b0  54 14 20 4d 4f 56 20 20  | R0,R8..T. MOV  |
000276a0  20 20 20 20 52 31 2c 23  33 34 0d b0 5e 13 20 4d  |    R1,#34..^. M|
000276b0  4f 56 20 20 20 20 20 20  52 32 2c 52 39 0d b0 68  |OV      R2,R9..h|
000276c0  17 20 42 4c 20 20 20 20  20 20 20 57 72 69 74 65  |. BL       Write|
000276d0  49 63 6f 6e 0d b0 72 04  0d b0 7c 35 20 20 20 20  |Icon..r...|5    |
000276e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00027700  20 3b 50 61 67 65 20 4e  75 6d 62 65 72 0d b0 86  | ;Page Number...|
00027710  13 20 4d 4f 56 20 20 20  20 20 20 52 33 2c 52 35  |. MOV      R3,R5|
00027720  0d b0 90 16 20 41 44 44  20 20 20 20 20 20 52 34  |.... ADD      R4|
00027730  2c 52 33 2c 23 31 0d b0  9a 13 20 4d 4f 56 20 20  |,R3,#1.... MOV  |
00027740  20 20 20 20 52 30 2c 52  37 0d b0 a4 1f 20 41 44  |    R0,R7.... AD|
00027750  44 20 20 20 20 20 20 52  31 2c 52 31 30 2c 23 62  |D      R1,R10,#b|
00027760  61 63 6b 73 6c 61 73 68  0d b0 ae 14 20 4d 4f 56  |ackslash.... MOV|
00027770  20 20 20 20 20 20 52 32  2c 23 31 33 0d b0 b8 16  |      R2,#13....|
00027780  20 41 44 44 20 20 20 20  20 20 52 33 2c 52 33 2c  | ADD      R3,R3,|
00027790  23 31 0d b0 c2 1c 20 53  57 49 20 20 20 20 20 20  |#1.... SWI      |
000277a0  22 53 74 72 69 6e 67 5f  49 6e 73 74 72 22 0d b0  |"String_Instr"..|
000277b0  cc 13 20 4d 4f 56 20 20  20 20 20 20 52 35 2c 52  |.. MOV      R5,R|
000277c0  33 0d b0 d6 13 20 4d 4f  56 20 20 20 20 20 20 52  |3.... MOV      R|
000277d0  30 2c 52 37 0d b0 e0 13  20 4d 4f 56 20 20 20 20  |0,R7.... MOV    |
000277e0  20 20 52 31 2c 52 39 0d  b0 ea 14 20 4d 4f 56 20  |  R1,R9.... MOV |
000277f0  20 20 20 20 20 52 32 2c  23 31 33 0d b0 f4 16 20  |     R2,#13.... |
00027800  53 55 42 20 20 20 20 20  20 52 33 2c 52 33 2c 52  |SUB      R3,R3,R|
00027810  34 0d b0 fe 1b 20 53 57  49 20 20 20 20 20 20 22  |4.... SWI      "|
00027820  53 74 72 69 6e 67 5f 4d  69 64 24 22 0d b1 08 13  |String_Mid$"....|
00027830  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 52 38 0d  | MOV      R0,R8.|
00027840  b1 12 14 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |... MOV      R1,|
00027850  23 33 35 0d b1 1c 13 20  4d 4f 56 20 20 20 20 20  |#35.... MOV     |
00027860  20 52 32 2c 52 39 0d b1  26 17 20 42 4c 20 20 20  | R2,R9..&. BL   |
00027870  20 20 20 20 57 72 69 74  65 49 63 6f 6e 0d b1 30  |    WriteIcon..0|
00027880  04 0d b1 3a 3a 20 4d 4f  56 20 20 20 20 20 20 52  |...:: MOV      R|
00027890  33 2c 52 35 20 20 20 20  20 20 20 20 20 20 20 20  |3,R5            |
000278a0  20 20 20 20 20 20 20 20  20 20 3b 54 6f 70 69 63  |          ;Topic|
000278b0  20 4f 66 20 41 72 74 69  63 6c 65 0d b1 44 16 20  | Of Article..D. |
000278c0  41 44 44 20 20 20 20 20  20 52 34 2c 52 33 2c 23  |ADD      R4,R3,#|
000278d0  31 0d b1 4e 13 20 4d 4f  56 20 20 20 20 20 20 52  |1..N. MOV      R|
000278e0  30 2c 52 37 0d b1 58 1f  20 41 44 44 20 20 20 20  |0,R7..X. ADD    |
000278f0  20 20 52 31 2c 52 31 30  2c 23 62 61 63 6b 73 6c  |  R1,R10,#backsl|
00027900  61 73 68 0d b1 62 14 20  4d 4f 56 20 20 20 20 20  |ash..b. MOV     |
00027910  20 52 32 2c 23 31 33 0d  b1 6c 16 20 41 44 44 20  | R2,#13..l. ADD |
00027920  20 20 20 20 20 52 33 2c  52 33 2c 23 31 0d b1 76  |     R3,R3,#1..v|
00027930  1c 20 53 57 49 20 20 20  20 20 20 22 53 74 72 69  |. SWI      "Stri|
00027940  6e 67 5f 49 6e 73 74 72  22 0d b1 80 13 20 4d 4f  |ng_Instr".... MO|
00027950  56 20 20 20 20 20 20 52  35 2c 52 33 0d b1 8a 13  |V      R5,R3....|
00027960  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 52 37 0d  | MOV      R0,R7.|
00027970  b1 94 13 20 4d 4f 56 20  20 20 20 20 20 52 31 2c  |... MOV      R1,|
00027980  52 39 0d b1 9e 14 20 4d  4f 56 20 20 20 20 20 20  |R9.... MOV      |
00027990  52 32 2c 23 31 33 0d b1  a8 16 20 53 55 42 20 20  |R2,#13.... SUB  |
000279a0  20 20 20 20 52 33 2c 52  33 2c 52 34 0d b1 b2 1b  |    R3,R3,R4....|
000279b0  20 53 57 49 20 20 20 20  20 20 22 53 74 72 69 6e  | SWI      "Strin|
000279c0  67 5f 4d 69 64 24 22 0d  b1 bc 13 20 4d 4f 56 20  |g_Mid$".... MOV |
000279d0  20 20 20 20 20 52 30 2c  52 38 0d b1 c6 14 20 4d  |     R0,R8.... M|
000279e0  4f 56 20 20 20 20 20 20  52 31 2c 23 33 30 0d b1  |OV      R1,#30..|
000279f0  d0 13 20 4d 4f 56 20 20  20 20 20 20 52 32 2c 52  |.. MOV      R2,R|
00027a00  39 0d b1 da 17 20 42 4c  20 20 20 20 20 20 20 57  |9.... BL       W|
00027a10  72 69 74 65 49 63 6f 6e  0d b1 e4 04 0d b1 ee 41  |riteIcon.......A|
00027a20  20 4d 4f 56 20 20 20 20  20 20 52 30 2c 52 37 20  | MOV      R0,R7 |
00027a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027a40  20 20 20 20 20 3b 44 65  73 63 72 69 70 74 69 6f  |     ;Descriptio|
00027a50  6e 20 4f 66 20 41 72 74  69 63 6c 65 2e 0d b1 f8  |n Of Article....|
00027a60  14 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 23 31  |. MOV      R1,#1|
00027a70  33 0d b2 02 1a 20 53 57  49 20 20 20 20 20 20 22  |3.... SWI      "|
00027a80  53 74 72 69 6e 67 5f 4c  65 6e 22 0d b2 0c 13 20  |String_Len".... |
00027a90  4d 4f 56 20 20 20 20 20  20 52 30 2c 52 35 0d b2  |MOV      R0,R5..|
00027aa0  16 16 20 53 55 42 20 20  20 20 20 20 52 33 2c 52  |.. SUB      R3,R|
00027ab0  31 2c 52 30 0d b2 20 16  20 53 55 42 20 20 20 20  |1,R0.. . SUB    |
00027ac0  20 20 52 33 2c 52 33 2c  23 31 0d b2 2a 13 20 4d  |  R3,R3,#1..*. M|
00027ad0  4f 56 20 20 20 20 20 20  52 30 2c 52 37 0d b2 34  |OV      R0,R7..4|
00027ae0  13 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 52 39  |. MOV      R1,R9|
00027af0  0d b2 3e 14 20 4d 4f 56  20 20 20 20 20 20 52 32  |..>. MOV      R2|
00027b00  2c 23 31 33 0d b2 48 1d  20 53 57 49 20 20 20 20  |,#13..H. SWI    |
00027b10  20 20 22 53 74 72 69 6e  67 5f 52 69 67 68 74 24  |  "String_Right$|
00027b20  22 0d b2 52 13 20 4d 4f  56 20 20 20 20 20 20 52  |"..R. MOV      R|
00027b30  30 2c 52 38 0d b2 5c 14  20 4d 4f 56 20 20 20 20  |0,R8..\. MOV    |
00027b40  20 20 52 31 2c 23 33 31  0d b2 66 13 20 4d 4f 56  |  R1,#31..f. MOV|
00027b50  20 20 20 20 20 20 52 32  2c 52 39 0d b2 70 17 20  |      R2,R9..p. |
00027b60  42 4c 20 20 20 20 20 20  20 57 72 69 74 65 49 63  |BL       WriteIc|
00027b70  6f 6e 0d b2 7a 04 0d b2  84 1e 4c 44 4d 46 44 20  |on..z.....LDMFD |
00027b80  20 20 20 52 31 33 21 2c  7b 52 30 2d 52 31 32 2c  |   R13!,{R0-R12,|
00027b90  50 43 7d 5e 0d b2 8e 04  0d b2 98 52 3b 2d 2d 2d  |PC}^.......R;---|
00027ba0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00027be0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d b2 a2 2f 3b 20  |----------.../; |
00027bf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027c00  20 20 20 20 20 20 20 20  20 20 20 2a 2a 2a 20 44  |           *** D|
00027c10  69 76 69 64 65 20 2a 2a  2a 0d b2 ac 50 3b 20 54  |ivide ***...P; T|
00027c20  68 69 73 20 73 75 62 72  6f 75 74 69 6e 65 20 70  |his subroutine p|
00027c30  65 72 66 6f 72 6d 73 20  61 6e 20 69 6e 74 65 67  |erforms an integ|
00027c40  65 72 20 64 69 76 69 73  69 6f 6e 20 75 73 69 6e  |er division usin|
00027c50  67 20 52 30 20 61 6e 64  20 52 31 2e 20 54 68 69  |g R0 and R1. Thi|
00027c60  73 20 72 6f 75 74 69 6e  65 0d b2 b6 3c 3b 20 68  |s routine...<; h|
00027c70  61 73 20 62 65 65 6e 20  61 64 61 70 74 65 64 20  |as been adapted |
00027c80  66 72 6f 6d 20 61 6e 20  61 6c 67 6f 72 69 74 68  |from an algorith|
00027c90  6d 20 62 79 20 50 65 74  65 72 20 43 6f 63 6b 65  |m by Peter Cocke|
00027ca0  72 65 6c 6c 2e 0d b2 c0  04 0d b2 ca 0b 2e 44 69  |rell..........Di|
00027cb0  76 69 64 65 0d b2 d4 19  3b 20 50 65 72 66 6f 72  |vide....; Perfor|
00027cc0  6d 73 20 52 32 3d 52 30  20 81 20 52 31 0d b2 de  |ms R2=R0 . R1...|
00027cd0  19 3b 20 61 6e 64 20 20  20 20 20 20 52 33 3d 52  |.; and      R3=R|
00027ce0  30 20 83 20 52 31 0d b2  e8 04 0d b2 f2 24 53 54  |0 . R1.......$ST|
00027cf0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
00027d00  52 31 2c 52 34 2d 52 31  32 2c 52 31 34 7d 0d b2  |R1,R4-R12,R14}..|
00027d10  fc 04 0d b3 06 47 20 43  4d 50 20 20 20 20 20 20  |.....G CMP      |
00027d20  52 31 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R1,#0           |
00027d30  20 20 20 20 20 20 20 20  20 20 20 3b 54 72 61 70  |           ;Trap|
00027d40  20 44 69 76 69 73 69 6f  6e 20 62 79 20 5a 65 72  | Division by Zer|
00027d50  6f 20 65 72 72 6f 72 73  2e 0d b3 10 18 20 20 42  |o errors.....  B|
00027d60  45 51 20 20 20 20 20 20  64 69 76 62 79 7a 65 72  |EQ      divbyzer|
00027d70  6f 0d b3 1a 04 0d b3 24  3f 20 4d 4f 56 20 20 20  |o......$? MOV   |
00027d80  20 20 20 52 32 2c 23 30  20 20 20 20 20 20 20 20  |   R2,#0        |
00027d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 49  |              ;I|
00027da0  6e 69 74 69 61 6c 69 73  65 20 72 65 67 69 73 74  |nitialise regist|
00027db0  65 72 73 2e 0d b3 2e 13  20 4d 4f 56 20 20 20 20  |ers..... MOV    |
00027dc0  20 20 52 33 2c 23 30 0d  b3 38 3d 20 4d 4f 56 20  |  R3,#0..8= MOV |
00027dd0  20 20 20 20 20 52 34 2c  23 33 32 20 20 20 20 20  |     R4,#32     |
00027de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027df0  3b 49 6e 69 74 69 61 6c  69 73 65 20 63 6f 75 6e  |;Initialise coun|
00027e00  74 65 72 2e 0d b3 42 04  0d b3 4c 0e 20 2e 64 69  |ter...B...L. .di|
00027e10  76 6c 6f 6f 70 31 0d b3  56 50 20 20 53 55 42 53  |vloop1..VP  SUBS|
00027e20  20 20 20 20 20 52 34 2c  52 34 2c 23 31 20 20 20  |     R4,R4,#1   |
00027e30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00027e40  53 68 69 66 74 20 52 30  20 75 6e 74 69 6c 20 66  |Shift R0 until f|
00027e50  69 72 73 74 20 73 65 74  20 62 69 74 20 69 73 20  |irst set bit is |
00027e60  69 6e 20 62 69 74 0d b3  60 50 20 20 20 4c 44 4d  |in bit..`P   LDM|
00027e70  45 51 46 44 20 20 52 31  33 21 2c 7b 52 30 2d 52  |EQFD  R13!,{R0-R|
00027e80  31 2c 52 34 2d 52 31 32  2c 50 43 7d 5e 20 20 3b  |1,R4-R12,PC}^  ;|
00027e90  33 31 2e 20 49 66 20 74  68 65 20 63 6f 75 74 65  |31. If the coute|
00027ea0  72 20 72 65 61 63 68 65  73 20 30 20 66 69 72 73  |r reaches 0 firs|
00027eb0  74 20 74 68 65 6e 0d b3  6a 44 20 20 4d 4f 56 53  |t then..jD  MOVS|
00027ec0  20 20 20 20 20 52 30 2c  52 30 2c 41 53 4c 20 23  |     R0,R0,ASL #|
00027ed0  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |1              ;|
00027ee0  52 30 20 77 61 73 20 7a  65 72 6f 20 74 6f 20 73  |R0 was zero to s|
00027ef0  74 61 72 74 20 77 69 74  68 2e 0d b3 74 18 20 20  |tart with...t.  |
00027f00  20 42 50 4c 20 20 20 20  20 20 64 69 76 6c 6f 6f  | BPL      divloo|
00027f10  70 31 0d b3 7e 04 0d b3  88 0e 20 2e 64 69 76 6c  |p1..~..... .divl|
00027f20  6f 6f 70 32 0d b3 92 45  20 20 4d 4f 56 53 20 20  |oop2...E  MOVS  |
00027f30  20 20 20 52 30 2c 52 30  2c 41 53 4c 20 23 31 20  |   R0,R0,ASL #1 |
00027f40  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 53 68  |             ;Sh|
00027f50  69 66 74 20 74 6f 70 20  62 69 74 20 6f 66 20 52  |ift top bit of R|
00027f60  30 20 69 6e 74 6f 20 52  33 0d b3 9c 52 20 20 41  |0 into R3...R  A|
00027f70  44 43 20 20 20 20 20 20  52 33 2c 52 33 2c 52 33  |DC      R3,R3,R3|
00027f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027f90  20 20 3b 54 68 69 73 20  76 61 6c 75 65 20 69 73  |  ;This value is|
00027fa0  20 74 68 65 6e 20 73 75  62 74 72 61 63 74 65 64  | then subtracted|
00027fb0  20 66 72 6f 6d 20 52 31  20 69 66 0d b3 a6 50 20  | from R1 if...P |
00027fc0  20 43 4d 50 20 20 20 20  20 20 52 33 2c 52 31 20  | CMP      R3,R1 |
00027fd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00027fe0  20 20 20 20 3b 69 74 20  64 6f 65 73 20 6e 6f 74  |    ;it does not|
00027ff0  20 70 72 6f 64 75 63 65  20 61 20 6e 65 67 61 74  | produce a negat|
00028000  69 76 65 20 72 65 73 75  6c 74 2e 0d b3 b0 18 20  |ive result..... |
00028010  20 20 53 55 42 43 53 20  20 20 20 52 33 2c 52 33  |  SUBCS    R3,R3|
00028020  2c 52 31 0d b3 ba 04 0d  b3 c4 50 20 20 41 44 43  |,R1.......P  ADC|
00028030  20 20 20 20 20 20 52 32  2c 52 32 2c 52 32 20 20  |      R2,R2,R2  |
00028040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00028050  3b 52 65 70 65 61 74 20  66 6f 72 20 65 61 63 68  |;Repeat for each|
00028060  20 73 69 67 6e 69 66 69  63 61 6e 74 20 62 69 74  | significant bit|
00028070  20 6f 66 20 52 30 2e 0d  b3 ce 17 20 20 53 55 42  | of R0.....  SUB|
00028080  53 20 20 20 20 20 52 34  2c 52 34 2c 23 31 0d b3  |S     R4,R4,#1..|
00028090  d8 18 20 20 20 42 4e 45  20 20 20 20 20 20 64 69  |..   BNE      di|
000280a0  76 6c 6f 6f 70 32 0d b3  e2 04 0d b3 ec 24 4c 44  |vloop2.......$LD|
000280b0  4d 46 44 20 20 20 20 52  31 33 21 2c 7b 52 30 2d  |MFD    R13!,{R0-|
000280c0  52 31 2c 52 34 2d 52 31  32 2c 50 43 7d 5e 0d b3  |R1,R4-R12,PC}^..|
000280d0  f6 04 0d b4 00 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.....R;---------|
000280e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028120  2d 2d 2d 2d 0d b4 0a 3a  3b 20 20 20 20 20 20 20  |----...:;       |
00028130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2a  |               *|
00028140  2a 2a 20 45 72 72 6f 72  20 48 61 6e 64 6c 69 6e  |** Error Handlin|
00028150  67 20 52 6f 75 74 69 6e  65 73 20 2a 2a 2a 0d b4  |g Routines ***..|
00028160  14 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.R;-------------|
00028170  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000281b0  0d b4 1e 38 3b 54 68 69  73 20 73 75 62 72 6f 75  |...8;This subrou|
000281c0  74 69 6e 65 20 64 65 61  6c 73 20 77 69 74 68 20  |tine deals with |
000281d0  44 69 76 69 73 69 6f 6e  20 42 79 20 5a 65 72 6f  |Division By Zero|
000281e0  20 65 72 72 6f 72 73 2e  0d b4 28 04 0d b4 32 0f  | errors...(...2.|
000281f0  20 2e 64 69 76 62 79 7a  65 72 6f 0d b4 3c 04 0d  | .divbyzero..<..|
00028200  b4 46 4f 4c 44 4d 46 44  20 20 20 20 52 31 33 21  |.FOLDMFD    R13!|
00028210  2c 7b 52 30 2d 52 31 2c  52 34 2d 52 31 32 2c 52  |,{R0-R1,R4-R12,R|
00028220  31 34 7d 20 20 20 20 20  3b 54 68 69 73 20 73 65  |14}     ;This se|
00028230  63 74 69 6f 6e 20 73 69  6d 70 6c 79 20 72 65 70  |ction simply rep|
00028240  6f 72 74 73 20 74 68 65  20 65 72 72 6f 72 0d b4  |orts the error..|
00028250  50 36 20 41 44 52 20 20  20 20 20 20 52 30 2c 64  |P6 ADR      R0,d|
00028260  69 76 62 79 7a 65 72 6f  65 72 72 6f 72 20 20 20  |ivbyzeroerror   |
00028270  20 20 20 20 20 20 20 3b  74 6f 20 74 68 65 20 75  |       ;to the u|
00028280  73 65 72 2e 0d b4 5a 13  20 4d 4f 56 20 20 20 20  |ser...Z. MOV    |
00028290  20 20 52 31 2c 23 33 0d  b4 64 13 20 4d 4f 56 20  |  R1,#3..d. MOV |
000282a0  20 20 20 20 20 52 32 2c  23 30 0d b4 6e 20 20 53  |     R2,#0..n  S|
000282b0  57 49 20 20 20 20 20 20  22 57 69 6d 70 5f 52 65  |WI      "Wimp_Re|
000282c0  70 6f 72 74 45 72 72 6f  72 22 0d b4 78 13 4d 4f  |portError"..x.MO|
000282d0  56 20 20 20 20 20 20 50  43 2c 52 31 34 0d b4 82  |V      PC,R14...|
000282e0  04 0d b4 8c 52 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....R;----------|
000282f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028330  2d 2d 2d 0d b4 96 4b 3b  20 54 68 69 73 20 73 65  |---...K; This se|
00028340  63 74 69 6f 6e 20 63 6f  6e 74 61 69 6e 73 20 74  |ction contains t|
00028350  68 65 20 73 74 72 69 6e  67 20 75 73 65 64 20 69  |he string used i|
00028360  6e 20 74 68 65 20 44 69  76 42 79 5a 65 72 6f 20  |n the DivByZero |
00028370  65 72 72 6f 72 20 6d 65  73 73 61 67 65 2e 0d b4  |error message...|
00028380  a0 04 0d b4 aa 13 2e 64  69 76 62 79 7a 65 72 6f  |.......divbyzero|
00028390  65 72 72 6f 72 0d b4 b4  0d 45 51 55 44 20 20 20  |error....EQUD   |
000283a0  20 30 0d b4 be 1e 45 51  55 53 20 20 20 20 22 44  | 0....EQUS    "D|
000283b0  69 76 69 73 69 6f 6e 20  42 79 20 5a 65 72 6f 22  |ivision By Zero"|
000283c0  0d b4 c8 0d 45 51 55 42  20 20 20 20 30 0d b4 d2  |....EQUB    0...|
000283d0  09 41 4c 49 47 4e 0d b4  dc 04 0d b4 e6 52 3b 2d  |.ALIGN.......R;-|
000283e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028420  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d b4 f0 44  |------------...D|
00028430  3b 54 68 69 73 20 73 65  63 74 69 6f 6e 20 64 65  |;This section de|
00028440  61 6c 73 20 77 69 74 68  20 6e 6f 74 20 62 65 69  |als with not bei|
00028450  6e 67 20 61 62 6c 65 20  74 6f 20 61 63 63 65 73  |ng able to acces|
00028460  73 20 74 68 65 20 49 6e  64 65 78 66 69 6c 65 2e  |s the Indexfile.|
00028470  0d b4 fa 04 0d b5 04 0c  2e 6e 6f 69 6e 64 65 78  |.........noindex|
00028480  0d b5 0e 1d 20 41 44 52  20 20 20 20 20 20 52 30  |.... ADR      R0|
00028490  2c 6e 6f 69 6e 64 65 78  65 72 72 6f 72 0d b5 18  |,noindexerror...|
000284a0  1c 20 a4 4c 6f 6e 67 41  64 72 28 22 22 2c 31 2c  |. .LongAdr("",1,|
000284b0  6d 65 73 73 61 67 65 73  29 0d b5 22 13 20 4d 4f  |messages)..". MO|
000284c0  56 20 20 20 20 20 20 52  32 2c 23 30 0d b5 2c 29  |V      R2,#0..,)|
000284d0  20 53 57 49 20 20 20 20  20 20 22 58 4d 65 73 73  | SWI      "XMess|
000284e0  61 67 65 54 72 61 6e 73  5f 45 72 72 6f 72 4c 6f  |ageTrans_ErrorLo|
000284f0  6f 6b 75 70 22 0d b5 36  1a 20 42 20 20 20 20 20  |okup"..6. B     |
00028500  20 20 20 53 65 72 69 6f  75 73 45 72 72 6f 72 0d  |   SeriousError.|
00028510  b5 40 04 0d b5 4a 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |.@...JR;--------|
00028520  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028560  2d 2d 2d 2d 2d 0d b5 54  44 3b 20 54 68 69 73 20  |-----..TD; This |
00028570  73 65 63 74 69 6f 6e 20  63 6f 6e 74 61 69 6e 73  |section contains|
00028580  20 74 68 65 20 4d 65 73  73 61 67 65 20 54 6f 6b  | the Message Tok|
00028590  65 6e 20 66 6f 72 20 74  68 65 20 4e 6f 49 6e 64  |en for the NoInd|
000285a0  65 78 20 65 72 72 6f 72  2e 0d b5 5e 04 0d b5 68  |ex error...^...h|
000285b0  11 2e 6e 6f 69 6e 64 65  78 65 72 72 6f 72 0d b5  |..noindexerror..|
000285c0  72 0e 45 51 55 44 20 20  20 20 20 30 0d b5 7c 16  |r.EQUD     0..|.|
000285d0  45 51 55 53 20 20 20 20  20 22 4e 6f 49 6e 64 65  |EQUS     "NoInde|
000285e0  78 22 0d b5 86 0e 45 51  55 42 20 20 20 20 20 30  |x"....EQUB     0|
000285f0  0d b5 90 09 41 4c 49 47  4e 0d b5 9a 04 0d b5 a4  |....ALIGN.......|
00028600  52 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |R;--------------|
00028610  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028640  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00028650  b5 ae 4f 3b 54 68 69 73  20 73 65 63 74 69 6f 6e  |..O;This section|
00028660  20 64 65 61 6c 73 20 77  69 74 68 20 6e 6f 74 20  | deals with not |
00028670  62 65 69 6e 67 20 61 62  6c 65 20 74 6f 20 61 63  |being able to ac|
00028680  63 65 73 73 20 74 68 65  20 49 6e 64 65 78 66 69  |cess the Indexfi|
00028690  6c 65 20 66 6f 72 20 75  70 64 61 74 65 2e 0d b5  |le for update...|
000286a0  b8 04 0d b5 c2 0f 2e 63  61 6e 74 75 70 64 61 74  |.......cantupdat|
000286b0  65 0d b5 cc 13 20 4d 4f  56 20 20 20 20 20 20 52  |e.... MOV      R|
000286c0  30 2c 23 30 0d b5 d6 21  20 53 54 52 20 20 20 20  |0,#0...! STR    |
000286d0  20 20 52 30 2c 5b 52 31  30 2c 23 75 70 64 61 74  |  R0,[R10,#updat|
000286e0  69 6e 67 25 5d 0d b5 e0  1f 20 4c 44 52 20 20 20  |ing%].... LDR   |
000286f0  20 20 20 52 30 2c 5b 52  31 32 2c 23 75 70 64 61  |   R0,[R12,#upda|
00028700  74 65 25 5d 0d b5 ea 20  20 53 54 52 20 20 20 20  |te%]...  STR    |
00028710  20 20 52 30 2c 5b 52 31  32 2c 23 62 6c 6f 63 6b  |  R0,[R12,#block|
00028720  25 2b 30 5d 0d b5 f4 1c  20 41 44 44 20 20 20 20  |%+0].... ADD    |
00028730  20 20 52 31 2c 52 31 32  2c 23 62 6c 6f 63 6b 25  |  R1,R12,#block%|
00028740  0d b5 fe 20 20 53 57 49  20 20 20 20 20 20 22 57  |...  SWI      "W|
00028750  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
00028760  0d b6 08 04 0d b6 12 20  20 41 44 52 20 20 20 20  |.......  ADR    |
00028770  20 20 52 30 2c 63 61 6e  74 75 70 64 61 74 65 65  |  R0,cantupdatee|
00028780  72 72 6f 72 0d b6 1c 1c  20 a4 4c 6f 6e 67 41 64  |rror.... .LongAd|
00028790  72 28 22 22 2c 31 2c 6d  65 73 73 61 67 65 73 29  |r("",1,messages)|
000287a0  0d b6 26 13 20 4d 4f 56  20 20 20 20 20 20 52 32  |..&. MOV      R2|
000287b0  2c 23 30 0d b6 30 29 20  53 57 49 20 20 20 20 20  |,#0..0) SWI     |
000287c0  20 22 58 4d 65 73 73 61  67 65 54 72 61 6e 73 5f  | "XMessageTrans_|
000287d0  45 72 72 6f 72 4c 6f 6f  6b 75 70 22 0d b6 3a 1d  |ErrorLookup"..:.|
000287e0  20 42 20 20 20 20 20 20  20 20 4e 6f 6e 53 65 72  | B        NonSer|
000287f0  69 6f 75 73 45 72 72 6f  72 0d b6 44 04 0d b6 4e  |iousError..D...N|
00028800  52 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |R;--------------|
00028810  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028840  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00028850  b6 58 47 3b 20 54 68 69  73 20 73 65 63 74 69 6f  |.XG; This sectio|
00028860  6e 20 63 6f 6e 74 61 69  6e 73 20 74 68 65 20 4d  |n contains the M|
00028870  65 73 73 61 67 65 20 54  6f 6b 65 6e 20 66 6f 72  |essage Token for|
00028880  20 74 68 65 20 63 61 6e  74 75 70 64 61 74 65 20  | the cantupdate |
00028890  65 72 72 6f 72 2e 0d b6  62 04 0d b6 6c 14 2e 63  |error...b...l..c|
000288a0  61 6e 74 75 70 64 61 74  65 65 72 72 6f 72 0d b6  |antupdateerror..|
000288b0  76 0e 45 51 55 44 20 20  20 20 20 30 0d b6 80 19  |v.EQUD     0....|
000288c0  45 51 55 53 20 20 20 20  20 22 43 61 6e 74 55 70  |EQUS     "CantUp|
000288d0  64 61 74 65 22 0d b6 8a  0e 45 51 55 42 20 20 20  |date"....EQUB   |
000288e0  20 20 30 0d b6 94 09 41  4c 49 47 4e 0d b6 9e 52  |  0....ALIGN...R|
000288f0  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00028900  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028930  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d b6  |--------------..|
00028940  a8 46 3b 20 54 68 69 73  20 73 65 63 74 69 6f 6e  |.F; This section|
00028950  20 64 65 61 6c 73 20 77  69 74 68 20 6e 6f 74 20  | deals with not |
00028960  62 65 69 6e 67 20 61 62  6c 65 20 74 6f 20 61 63  |being able to ac|
00028970  63 65 73 73 20 74 68 65  20 53 65 61 72 63 68 66  |cess the Searchf|
00028980  69 6c 65 2e 0d b6 b2 04  0d b6 bc 0d 2e 6e 6f 73  |ile..........nos|
00028990  65 61 72 63 68 0d b6 c6  1e 20 41 44 52 20 20 20  |earch.... ADR   |
000289a0  20 20 20 52 30 2c 6e 6f  73 65 61 72 63 68 65 72  |   R0,nosearcher|
000289b0  72 6f 72 0d b6 d0 1c 20  a4 4c 6f 6e 67 41 64 72  |ror.... .LongAdr|
000289c0  28 22 22 2c 31 2c 6d 65  73 73 61 67 65 73 29 0d  |("",1,messages).|
000289d0  b6 da 13 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |... MOV      R2,|
000289e0  23 30 0d b6 e4 29 20 53  57 49 20 20 20 20 20 20  |#0...) SWI      |
000289f0  22 58 4d 65 73 73 61 67  65 54 72 61 6e 73 5f 45  |"XMessageTrans_E|
00028a00  72 72 6f 72 4c 6f 6f 6b  75 70 22 0d b6 ee 1a 20  |rrorLookup".... |
00028a10  42 20 20 20 20 20 20 20  20 53 65 72 69 6f 75 73  |B        Serious|
00028a20  45 72 72 6f 72 0d b6 f8  04 0d b7 02 52 3b 2d 2d  |Error.......R;--|
00028a30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028a70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d b7 0c 45 3b  |-----------...E;|
00028a80  20 54 68 69 73 20 73 65  63 74 69 6f 6e 20 63 6f  | This section co|
00028a90  6e 74 61 69 6e 73 20 74  68 65 20 4d 65 73 73 61  |ntains the Messa|
00028aa0  67 65 20 54 6f 6b 65 6e  20 66 6f 72 20 74 68 65  |ge Token for the|
00028ab0  20 4e 6f 53 65 61 72 63  68 20 65 72 72 6f 72 2e  | NoSearch error.|
00028ac0  0d b7 16 04 0d b7 20 12  2e 6e 6f 73 65 61 72 63  |...... ..nosearc|
00028ad0  68 65 72 72 6f 72 0d b7  2a 0e 45 51 55 44 20 20  |herror..*.EQUD  |
00028ae0  20 20 20 30 0d b7 34 17  45 51 55 53 20 20 20 20  |   0..4.EQUS    |
00028af0  20 22 4e 6f 53 65 61 72  63 68 22 0d b7 3e 0e 45  | "NoSearch"..>.E|
00028b00  51 55 42 20 20 20 20 20  30 0d b7 48 09 41 4c 49  |QUB     0..H.ALI|
00028b10  47 4e 0d b7 52 04 0d b7  5c 52 3b 2d 2d 2d 2d 2d  |GN..R...\R;-----|
00028b20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028b60  2d 2d 2d 2d 2d 2d 2d 2d  0d b7 66 4c 3b 20 54 68  |--------..fL; Th|
00028b70  69 73 20 73 65 63 74 69  6f 6e 20 70 72 6f 64 75  |is section produ|
00028b80  63 65 73 20 61 6e 20 65  72 72 6f 72 20 77 68 65  |ces an error whe|
00028b90  6e 20 74 68 65 20 49 6e  64 65 78 66 69 6c 65 20  |n the Indexfile |
00028ba0  63 6f 6e 74 61 69 6e 73  20 6e 6f 20 72 65 63 6f  |contains no reco|
00028bb0  72 64 73 2e 0d b7 70 04  0d b7 7a 0e 2e 6e 6f 72  |rds...p...z..nor|
00028bc0  65 63 6f 72 64 73 0d b7  84 1f 20 41 44 52 20 20  |ecords.... ADR  |
00028bd0  20 20 20 20 52 30 2c 6e  6f 72 65 63 6f 72 64 73  |    R0,norecords|
00028be0  65 72 72 6f 72 0d b7 8e  1c 20 a4 4c 6f 6e 67 41  |error.... .LongA|
00028bf0  64 72 28 22 22 2c 31 2c  6d 65 73 73 61 67 65 73  |dr("",1,messages|
00028c00  29 0d b7 98 13 20 4d 4f  56 20 20 20 20 20 20 52  |).... MOV      R|
00028c10  32 2c 23 30 0d b7 a2 29  20 53 57 49 20 20 20 20  |2,#0...) SWI    |
00028c20  20 20 22 58 4d 65 73 73  61 67 65 54 72 61 6e 73  |  "XMessageTrans|
00028c30  5f 45 72 72 6f 72 4c 6f  6f 6b 75 70 22 0d b7 ac  |_ErrorLookup"...|
00028c40  1a 20 42 20 20 20 20 20  20 20 20 53 65 72 69 6f  |. B        Serio|
00028c50  75 73 45 72 72 6f 72 0d  b7 b6 04 0d b7 c0 52 3b  |usError.......R;|
00028c60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028ca0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d b7 ca  |-------------...|
00028cb0  46 3b 20 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |F; This section |
00028cc0  63 6f 6e 74 61 69 6e 73  20 74 68 65 20 4d 65 73  |contains the Mes|
00028cd0  73 61 67 65 20 54 6f 6b  65 6e 20 66 6f 72 20 74  |sage Token for t|
00028ce0  68 65 20 4e 6f 52 65 63  6f 72 64 73 20 65 72 72  |he NoRecords err|
00028cf0  6f 72 2e 0d b7 d4 04 0d  b7 de 13 2e 6e 6f 72 65  |or..........nore|
00028d00  63 6f 72 64 73 65 72 72  6f 72 0d b7 e8 0e 45 51  |cordserror....EQ|
00028d10  55 44 20 20 20 20 20 30  0d b7 f2 18 45 51 55 53  |UD     0....EQUS|
00028d20  20 20 20 20 20 22 4e 6f  52 65 63 6f 72 64 73 22  |     "NoRecords"|
00028d30  0d b7 fc 0e 45 51 55 42  20 20 20 20 20 30 0d b8  |....EQUB     0..|
00028d40  06 09 41 4c 49 47 4e 0d  b8 10 04 0d b8 1a 52 3b  |..ALIGN.......R;|
00028d50  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028d90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d b8 24  |-------------..$|
00028da0  4b 3b 20 54 68 69 73 20  73 65 63 74 69 6f 6e 20  |K; This section |
00028db0  64 65 61 6c 73 20 77 69  74 68 20 6e 6f 74 20 62  |deals with not b|
00028dc0  65 69 6e 67 20 61 62 6c  65 20 74 6f 20 61 63 63  |eing able to acc|
00028dd0  65 73 73 20 61 20 66 69  6c 65 20 74 68 61 74 20  |ess a file that |
00028de0  69 73 20 74 6f 20 62 65  0d b8 2e 1c 3b 20 6d 65  |is to be....; me|
00028df0  72 67 65 64 20 77 69 74  68 20 74 68 65 20 69 6e  |rged with the in|
00028e00  64 65 78 2e 0d b8 38 04  0d b8 42 0c 2e 6e 6f 69  |dex...8...B..noi|
00028e10  6e 70 75 74 0d b8 4c 1e  53 54 4d 46 44 20 20 20  |nput..L.STMFD   |
00028e20  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 52 31  | R13!,{R0-R12,R1|
00028e30  34 7d 0d b8 56 04 0d b8  60 1d 20 41 44 52 20 20  |4}..V...`. ADR  |
00028e40  20 20 20 20 52 30 2c 6e  6f 69 6e 70 75 74 65 72  |    R0,noinputer|
00028e50  72 6f 72 0d b8 6a 1c 20  a4 4c 6f 6e 67 41 64 72  |ror..j. .LongAdr|
00028e60  28 22 22 2c 31 2c 6d 65  73 73 61 67 65 73 29 0d  |("",1,messages).|
00028e70  b8 74 13 20 4d 4f 56 20  20 20 20 20 20 52 32 2c  |.t. MOV      R2,|
00028e80  23 30 0d b8 7e 29 20 53  57 49 20 20 20 20 20 20  |#0..~) SWI      |
00028e90  22 58 4d 65 73 73 61 67  65 54 72 61 6e 73 5f 45  |"XMessageTrans_E|
00028ea0  72 72 6f 72 4c 6f 6f 6b  75 70 22 0d b8 88 1d 20  |rrorLookup".... |
00028eb0  42 20 20 20 20 20 20 20  20 4e 6f 6e 53 65 72 69  |B        NonSeri|
00028ec0  6f 75 73 45 72 72 6f 72  0d b8 92 04 0d b8 9c 52  |ousError.......R|
00028ed0  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00028ee0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00028f10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d b8  |--------------..|
00028f20  a6 44 3b 20 54 68 69 73  20 73 65 63 74 69 6f 6e  |.D; This section|
00028f30  20 63 6f 6e 74 61 69 6e  73 20 74 68 65 20 4d 65  | contains the Me|
00028f40  73 73 61 67 65 20 54 6f  6b 65 6e 20 66 6f 72 20  |ssage Token for |
00028f50  74 68 65 20 4e 6f 49 6e  70 75 74 20 65 72 72 6f  |the NoInput erro|
00028f60  72 2e 0d b8 b0 04 0d b8  ba 11 2e 6e 6f 69 6e 70  |r..........noinp|
00028f70  75 74 65 72 72 6f 72 0d  b8 c4 0e 45 51 55 44 20  |uterror....EQUD |
00028f80  20 20 20 20 30 0d b8 ce  16 45 51 55 53 20 20 20  |    0....EQUS   |
00028f90  20 20 22 4e 6f 49 6e 70  75 74 22 0d b8 d8 0e 45  |  "NoInput"....E|
00028fa0  51 55 42 20 20 20 20 20  30 0d b8 e2 09 41 4c 49  |QUB     0....ALI|
00028fb0  47 4e 0d b8 ec 04 0d b8  f6 52 3b 2d 2d 2d 2d 2d  |GN.......R;-----|
00028fc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029000  2d 2d 2d 2d 2d 2d 2d 2d  0d b9 00 51 3b 20 54 68  |--------...Q; Th|
00029010  69 73 20 73 65 63 74 69  6f 6e 20 64 65 61 6c 73  |is section deals|
00029020  20 77 69 74 68 20 6e 6f  74 20 62 65 69 6e 67 20  | with not being |
00029030  61 62 6c 65 20 74 6f 20  6f 70 65 6e 20 61 20 66  |able to open a f|
00029040  69 6c 65 20 74 68 61 74  20 69 73 20 74 6f 20 62  |ile that is to b|
00029050  65 20 75 73 65 64 20 74  6f 0d b9 0a 1a 3b 20 73  |e used to....; s|
00029060  61 76 65 20 6f 75 74 20  72 65 63 6f 72 64 73 20  |ave out records |
00029070  74 6f 2e 0d b9 14 04 0d  b9 1e 0d 2e 6e 6f 6f 75  |to..........noou|
00029080  74 70 75 74 0d b9 28 1e  53 54 4d 46 44 20 20 20  |tput..(.STMFD   |
00029090  20 52 31 33 21 2c 7b 52  30 2d 52 31 32 2c 52 31  | R13!,{R0-R12,R1|
000290a0  34 7d 0d b9 32 04 0d b9  3c 1e 20 41 44 52 20 20  |4}..2...<. ADR  |
000290b0  20 20 20 20 52 30 2c 6e  6f 6f 75 74 70 75 74 65  |    R0,nooutpute|
000290c0  72 72 6f 72 0d b9 46 1c  20 a4 4c 6f 6e 67 41 64  |rror..F. .LongAd|
000290d0  72 28 22 22 2c 31 2c 6d  65 73 73 61 67 65 73 29  |r("",1,messages)|
000290e0  0d b9 50 13 20 4d 4f 56  20 20 20 20 20 20 52 32  |..P. MOV      R2|
000290f0  2c 23 30 0d b9 5a 29 20  53 57 49 20 20 20 20 20  |,#0..Z) SWI     |
00029100  20 22 58 4d 65 73 73 61  67 65 54 72 61 6e 73 5f  | "XMessageTrans_|
00029110  45 72 72 6f 72 4c 6f 6f  6b 75 70 22 0d b9 64 1d  |ErrorLookup"..d.|
00029120  20 42 20 20 20 20 20 20  20 20 4e 6f 6e 53 65 72  | B        NonSer|
00029130  69 6f 75 73 45 72 72 6f  72 0d b9 6e 04 0d b9 78  |iousError..n...x|
00029140  52 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |R;--------------|
00029150  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029180  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00029190  b9 82 45 3b 20 54 68 69  73 20 73 65 63 74 69 6f  |..E; This sectio|
000291a0  6e 20 63 6f 6e 74 61 69  6e 73 20 74 68 65 20 4d  |n contains the M|
000291b0  65 73 73 61 67 65 20 54  6f 6b 65 6e 20 66 6f 72  |essage Token for|
000291c0  20 74 68 65 20 4e 6f 4f  75 74 70 75 74 20 65 72  | the NoOutput er|
000291d0  72 6f 72 2e 0d b9 8c 04  0d b9 96 12 2e 6e 6f 6f  |ror..........noo|
000291e0  75 74 70 75 74 65 72 72  6f 72 0d b9 a0 0e 45 51  |utputerror....EQ|
000291f0  55 44 20 20 20 20 20 30  0d b9 aa 17 45 51 55 53  |UD     0....EQUS|
00029200  20 20 20 20 20 22 4e 6f  4f 75 74 70 75 74 22 0d  |     "NoOutput".|
00029210  b9 b4 0e 45 51 55 42 20  20 20 20 20 30 0d b9 be  |...EQUB     0...|
00029220  09 41 4c 49 47 4e 0d b9  c8 04 0d b9 d2 52 3b 2d  |.ALIGN.......R;-|
00029230  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029270  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d b9 dc 41  |------------...A|
00029280  3b 20 54 68 69 73 20 73  65 63 74 69 6f 6e 20 64  |; This section d|
00029290  65 61 6c 73 20 77 69 74  68 20 6e 6f 74 20 62 65  |eals with not be|
000292a0  69 6e 67 20 61 62 6c 65  20 74 6f 20 6f 70 65 6e  |ing able to open|
000292b0  20 61 20 53 63 72 61 70  66 69 6c 65 2e 0d b9 e6  | a Scrapfile....|
000292c0  04 0d b9 f0 10 2e 6e 6f  73 63 72 61 70 66 69 6c  |......noscrapfil|
000292d0  65 0d b9 fa 1f 53 54 4d  46 44 20 20 20 20 20 52  |e....STMFD     R|
000292e0  31 33 21 2c 7b 52 30 2d  52 31 32 2c 52 31 34 7d  |13!,{R0-R12,R14}|
000292f0  0d ba 04 04 0d ba 0e 21  20 41 44 52 20 20 20 20  |.......! ADR    |
00029300  20 20 52 30 2c 6e 6f 73  63 72 61 70 66 69 6c 65  |  R0,noscrapfile|
00029310  65 72 72 6f 72 0d ba 18  1c 20 a4 4c 6f 6e 67 41  |error.... .LongA|
00029320  64 72 28 22 22 2c 31 2c  6d 65 73 73 61 67 65 73  |dr("",1,messages|
00029330  29 0d ba 22 13 20 4d 4f  56 20 20 20 20 20 20 52  |)..". MOV      R|
00029340  32 2c 23 30 0d ba 2c 29  20 53 57 49 20 20 20 20  |2,#0..,) SWI    |
00029350  20 20 22 58 4d 65 73 73  61 67 65 54 72 61 6e 73  |  "XMessageTrans|
00029360  5f 45 72 72 6f 72 4c 6f  6f 6b 75 70 22 0d ba 36  |_ErrorLookup"..6|
00029370  1d 20 42 20 20 20 20 20  20 20 20 4e 6f 6e 53 65  |. B        NonSe|
00029380  72 69 6f 75 73 45 72 72  6f 72 0d ba 40 04 0d ba  |riousError..@...|
00029390  4a 52 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |JR;-------------|
000293a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000293e0  0d ba 54 48 3b 20 54 68  69 73 20 73 65 63 74 69  |..TH; This secti|
000293f0  6f 6e 20 63 6f 6e 74 61  69 6e 73 20 74 68 65 20  |on contains the |
00029400  4d 65 73 73 61 67 65 20  54 6f 6b 65 6e 20 66 6f  |Message Token fo|
00029410  72 20 74 68 65 20 4e 6f  53 63 72 61 70 46 69 6c  |r the NoScrapFil|
00029420  65 20 65 72 72 6f 72 2e  0d ba 5e 04 0d ba 68 15  |e error...^...h.|
00029430  2e 6e 6f 73 63 72 61 70  66 69 6c 65 65 72 72 6f  |.noscrapfileerro|
00029440  72 0d ba 72 0e 45 51 55  44 20 20 20 20 20 30 0d  |r..r.EQUD     0.|
00029450  ba 7c 1a 45 51 55 53 20  20 20 20 20 22 4e 6f 53  |.|.EQUS     "NoS|
00029460  63 72 61 70 46 69 6c 65  22 0d ba 86 0e 45 51 55  |crapFile"....EQU|
00029470  42 20 20 20 20 20 30 0d  ba 90 09 41 4c 49 47 4e  |B     0....ALIGN|
00029480  0d ba 9a 04 0d ba a4 52  3b 2d 2d 2d 2d 2d 2d 2d  |.......R;-------|
00029490  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000294d0  2d 2d 2d 2d 2d 2d 0d ba  ae 49 3b 20 54 68 69 73  |------...I; This|
000294e0  20 73 65 63 74 69 6f 6e  20 64 65 61 6c 73 20 77  | section deals w|
000294f0  69 74 68 20 6e 6f 74 20  62 65 69 6e 67 20 61 62  |ith not being ab|
00029500  6c 65 20 74 6f 20 61 63  63 65 73 73 20 74 68 65  |le to access the|
00029510  20 4d 65 73 73 61 67 65  73 20 66 69 6c 65 2e 0d  | Messages file..|
00029520  ba b8 04 0d ba c2 0f 2e  6e 6f 6d 65 73 73 61 67  |........nomessag|
00029530  65 73 0d ba cc 20 20 41  44 52 20 20 20 20 20 20  |es...  ADR      |
00029540  52 30 2c 6e 6f 6d 65 73  73 61 67 65 73 65 72 72  |R0,nomessageserr|
00029550  6f 72 0d ba d6 1a 20 42  20 20 20 20 20 20 20 20  |or.... B        |
00029560  53 65 72 69 6f 75 73 45  72 72 6f 72 0d ba e0 04  |SeriousError....|
00029570  0d ba ea 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...R;-----------|
00029580  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000295c0  2d 2d 0d ba f4 39 3b 20  54 68 69 73 20 73 65 63  |--...9; This sec|
000295d0  74 69 6f 6e 20 63 6f 6e  74 61 69 6e 73 20 74 68  |tion contains th|
000295e0  65 20 4e 6f 4d 65 73 73  61 67 65 73 20 65 72 72  |e NoMessages err|
000295f0  6f 72 20 6d 65 73 73 61  67 65 2e 0d ba fe 04 0d  |or message......|
00029600  bb 08 14 2e 6e 6f 6d 65  73 73 61 67 65 73 65 72  |....nomessageser|
00029610  72 6f 72 0d bb 12 0e 45  51 55 44 20 20 20 20 20  |ror....EQUD     |
00029620  30 0d bb 1c 23 45 51 55  53 20 20 20 20 20 22 41  |0...#EQUS     "A|
00029630  55 49 6e 64 65 78 20 69  73 20 75 6e 61 62 6c 65  |UIndex is unable|
00029640  20 74 6f 22 0d bb 26 28  45 51 55 53 20 20 20 20  | to"..&(EQUS    |
00029650  20 22 20 61 63 63 65 73  73 20 69 74 73 20 4d 65  | " access its Me|
00029660  73 73 61 67 65 73 20 66  69 6c 65 22 0d bb 30 29  |ssages file"..0)|
00029670  45 51 55 53 20 20 20 20  20 22 20 61 6e 64 20 6d  |EQUS     " and m|
00029680  75 73 74 20 65 78 69 74  20 69 6d 6d 65 64 69 61  |ust exit immedia|
00029690  74 65 6c 79 22 0d bb 3a  0e 45 51 55 42 20 20 20  |tely"..:.EQUB   |
000296a0  20 20 30 0d bb 44 09 41  4c 49 47 4e 0d bb 4e 04  |  0..D.ALIGN..N.|
000296b0  0d bb 58 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..XR;-----------|
000296c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029700  2d 2d 0d bb 62 40 3b 20  54 68 69 73 20 73 65 63  |--..b@; This sec|
00029710  74 69 6f 6e 20 64 65 61  6c 73 20 77 69 74 68 20  |tion deals with |
00029720  6e 6f 74 20 62 65 69 6e  67 20 61 62 6c 65 20 74  |not being able t|
00029730  6f 20 61 63 63 65 73 73  20 6f 75 72 20 48 65 61  |o access our Hea|
00029740  70 2e 0d bb 6c 04 0d bb  76 0b 2e 6e 6f 68 65 61  |p...l...v..nohea|
00029750  70 0d bb 80 1c 20 41 44  52 20 20 20 20 20 20 52  |p.... ADR      R|
00029760  30 2c 6e 6f 68 65 61 70  65 72 72 6f 72 0d bb 8a  |0,noheaperror...|
00029770  1c 20 a4 4c 6f 6e 67 41  64 72 28 22 22 2c 31 2c  |. .LongAdr("",1,|
00029780  6d 65 73 73 61 67 65 73  29 0d bb 94 13 20 4d 4f  |messages).... MO|
00029790  56 20 20 20 20 20 20 52  32 2c 23 30 0d bb 9e 29  |V      R2,#0...)|
000297a0  20 53 57 49 20 20 20 20  20 20 22 58 4d 65 73 73  | SWI      "XMess|
000297b0  61 67 65 54 72 61 6e 73  5f 45 72 72 6f 72 4c 6f  |ageTrans_ErrorLo|
000297c0  6f 6b 75 70 22 0d bb a8  1a 20 42 20 20 20 20 20  |okup".... B     |
000297d0  20 20 20 53 65 72 69 6f  75 73 45 72 72 6f 72 0d  |   SeriousError.|
000297e0  bb b2 04 0d bb bc 52 3b  2d 2d 2d 2d 2d 2d 2d 2d  |......R;--------|
000297f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029830  2d 2d 2d 2d 2d 0d bb c6  43 3b 20 54 68 69 73 20  |-----...C; This |
00029840  73 65 63 74 69 6f 6e 20  63 6f 6e 74 61 69 6e 73  |section contains|
00029850  20 74 68 65 20 4d 65 73  73 61 67 65 20 54 6f 6b  | the Message Tok|
00029860  65 6e 20 66 6f 72 20 74  68 65 20 4e 6f 48 65 61  |en for the NoHea|
00029870  70 20 65 72 72 6f 72 2e  0d bb d0 04 0d bb da 10  |p error.........|
00029880  2e 6e 6f 68 65 61 70 65  72 72 6f 72 0d bb e4 0e  |.noheaperror....|
00029890  45 51 55 44 20 20 20 20  20 30 0d bb ee 15 45 51  |EQUD     0....EQ|
000298a0  55 53 20 20 20 20 20 22  4e 6f 48 65 61 70 22 0d  |US     "NoHeap".|
000298b0  bb f8 0e 45 51 55 42 20  20 20 20 20 30 0d bc 02  |...EQUB     0...|
000298c0  09 41 4c 49 47 4e 0d bc  0c 04 0d bc 16 52 3b 2d  |.ALIGN.......R;-|
000298d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029910  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d bc 20 50  |------------.. P|
00029920  3b 20 54 68 69 73 20 73  65 63 74 69 6f 6e 20 64  |; This section d|
00029930  65 61 6c 73 20 77 69 74  68 20 6e 6f 74 20 62 65  |eals with not be|
00029940  69 6e 67 20 61 62 6c 65  20 74 6f 20 63 6c 61 69  |ing able to clai|
00029950  6d 20 61 20 6c 61 72 67  65 20 65 6e 6f 75 67 68  |m a large enough|
00029960  20 48 65 61 70 20 62 6c  6f 63 6b 2e 0d bc 2a 04  | Heap block...*.|
00029970  0d bc 34 0b 2e 6e 6f 72  6f 6f 6d 0d bc 3e 1c 20  |..4..noroom..>. |
00029980  41 44 52 20 20 20 20 20  20 52 30 2c 6e 6f 72 6f  |ADR      R0,noro|
00029990  6f 6d 65 72 72 6f 72 0d  bc 48 1c 20 a4 4c 6f 6e  |omerror..H. .Lon|
000299a0  67 41 64 72 28 22 22 2c  31 2c 6d 65 73 73 61 67  |gAdr("",1,messag|
000299b0  65 73 29 0d bc 52 13 20  4d 4f 56 20 20 20 20 20  |es)..R. MOV     |
000299c0  20 52 32 2c 23 30 0d bc  5c 29 20 53 57 49 20 20  | R2,#0..\) SWI  |
000299d0  20 20 20 20 22 58 4d 65  73 73 61 67 65 54 72 61  |    "XMessageTra|
000299e0  6e 73 5f 45 72 72 6f 72  4c 6f 6f 6b 75 70 22 0d  |ns_ErrorLookup".|
000299f0  bc 66 1d 20 42 20 20 20  20 20 20 20 20 4e 6f 6e  |.f. B        Non|
00029a00  53 65 72 69 6f 75 73 45  72 72 6f 72 0d bc 70 04  |SeriousError..p.|
00029a10  0d bc 7a 52 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..zR;-----------|
00029a20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029a60  2d 2d 0d bc 84 43 3b 20  54 68 69 73 20 73 65 63  |--...C; This sec|
00029a70  74 69 6f 6e 20 63 6f 6e  74 61 69 6e 73 20 74 68  |tion contains th|
00029a80  65 20 4d 65 73 73 61 67  65 20 54 6f 6b 65 6e 20  |e Message Token |
00029a90  66 6f 72 20 74 68 65 20  4e 6f 52 6f 6f 6d 20 65  |for the NoRoom e|
00029aa0  72 72 6f 72 2e 0d bc 8e  04 0d bc 98 10 2e 6e 6f  |rror..........no|
00029ab0  72 6f 6f 6d 65 72 72 6f  72 0d bc a2 0e 45 51 55  |roomerror....EQU|
00029ac0  44 20 20 20 20 20 30 0d  bc ac 15 45 51 55 53 20  |D     0....EQUS |
00029ad0  20 20 20 20 22 4e 6f 52  6f 6f 6d 22 0d bc b6 0e  |    "NoRoom"....|
00029ae0  45 51 55 42 20 20 20 20  20 30 0d bc c0 09 41 4c  |EQUB     0....AL|
00029af0  49 47 4e 0d bc ca 04 0d  bc d4 52 3b 2d 2d 2d 2d  |IGN.......R;----|
00029b00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029b40  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d bc de 4f 3b 20 54  |---------...O; T|
00029b50  68 69 73 20 73 65 63 74  69 6f 6e 20 74 69 64 69  |his section tidi|
00029b60  65 73 20 75 70 20 61 66  74 65 72 20 61 20 6e 6f  |es up after a no|
00029b70  6e 20 73 65 72 69 6f 75  73 20 65 72 72 6f 72 20  |n serious error |
00029b80  68 61 73 20 6f 63 63 75  72 72 65 64 2e 20 49 74  |has occurred. It|
00029b90  20 72 65 70 6f 72 74 73  0d bc e8 36 3b 20 74 68  | reports...6; th|
00029ba0  65 20 65 72 72 6f 72 20  74 6f 20 74 68 65 20 75  |e error to the u|
00029bb0  73 65 72 20 61 6e 64 20  63 6c 6f 73 65 73 20 61  |ser and closes a|
00029bc0  6e 79 20 6f 70 65 6e 20  66 69 6c 65 73 2e 0d bc  |ny open files...|
00029bd0  f2 04 0d bc fc 14 2e 4e  6f 6e 53 65 72 69 6f 75  |.......NonSeriou|
00029be0  73 45 72 72 6f 72 0d bd  06 04 0d bd 10 14 20 4d  |sError........ M|
00029bf0  4f 56 20 20 20 20 20 20  52 31 2c 23 25 31 0d bd  |OV      R1,#%1..|
00029c00  1a 1d 20 41 44 44 20 20  20 20 20 20 52 32 2c 52  |.. ADD      R2,R|
00029c10  31 32 2c 23 61 70 70 6e  61 6d 65 0d bd 24 20 20  |12,#appname..$  |
00029c20  53 57 49 20 20 20 20 20  20 22 57 69 6d 70 5f 52  |SWI      "Wimp_R|
00029c30  65 70 6f 72 74 45 72 72  6f 72 22 0d bd 2e 04 0d  |eportError".....|
00029c40  bd 38 13 20 4d 4f 56 20  20 20 20 20 20 52 30 2c  |.8. MOV      R0,|
00029c50  23 30 0d bd 42 24 20 4c  44 52 20 20 20 20 20 20  |#0..B$ LDR      |
00029c60  52 31 2c 5b 52 31 30 2c  23 69 6e 64 65 78 68 61  |R1,[R10,#indexha|
00029c70  6e 64 6c 65 25 5d 0d bd  4c 18 20 53 57 49 20 20  |ndle%]..L. SWI  |
00029c80  20 20 20 20 22 58 4f 53  5f 46 69 6e 64 22 0d bd  |    "XOS_Find"..|
00029c90  56 25 20 4c 44 52 20 20  20 20 20 20 52 31 2c 5b  |V% LDR      R1,[|
00029ca0  52 31 30 2c 23 73 65 61  72 63 68 68 61 6e 64 6c  |R10,#searchhandl|
00029cb0  65 25 5d 0d bd 60 18 20  53 57 49 20 20 20 20 20  |e%]..`. SWI     |
00029cc0  20 22 58 4f 53 5f 46 69  6e 64 22 0d bd 6a 04 0d  | "XOS_Find"..j..|
00029cd0  bd 74 1e 4c 44 4d 46 44  20 20 20 20 52 31 33 21  |.t.LDMFD    R13!|
00029ce0  2c 7b 52 30 2d 52 31 32  2c 50 43 7d 5e 0d bd 7e  |,{R0-R12,PC}^..~|
00029cf0  04 0d bd 88 52 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....R;----------|
00029d00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029d40  2d 2d 2d 0d bd 92 51 3b  20 54 68 69 73 20 73 65  |---...Q; This se|
00029d50  63 74 69 6f 6e 20 63 6c  6f 73 65 73 20 64 6f 77  |ction closes dow|
00029d60  6e 20 6f 75 72 20 74 61  73 6b 20 61 66 74 65 72  |n our task after|
00029d70  20 61 6e 20 75 6e 72 65  63 6f 76 65 72 61 62 6c  | an unrecoverabl|
00029d80  65 20 65 72 72 6f 72 20  68 61 73 20 6f 63 63 75  |e error has occu|
00029d90  72 65 64 2e 0d bd 9c 04  0d bd a6 11 2e 53 65 72  |red..........Ser|
00029da0  69 6f 75 73 45 72 72 6f  72 0d bd b0 04 0d bd ba  |iousError.......|
00029db0  14 20 4d 4f 56 20 20 20  20 20 20 52 31 2c 23 25  |. MOV      R1,#%|
00029dc0  31 0d bd c4 1d 20 41 44  44 20 20 20 20 20 20 52  |1.... ADD      R|
00029dd0  32 2c 52 31 32 2c 23 61  70 70 6e 61 6d 65 0d bd  |2,R12,#appname..|
00029de0  ce 20 20 53 57 49 20 20  20 20 20 20 22 57 69 6d  |.  SWI      "Wim|
00029df0  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 0d bd  |p_ReportError"..|
00029e00  d8 17 20 53 57 49 20 20  20 20 20 20 22 4f 53 5f  |.. SWI      "OS_|
00029e10  45 78 69 74 22 0d bd e2  04 0d bd ec 52 3b 2d 2d  |Exit".......R;--|
00029e20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029e60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d bd f6 09 2e  |-----------.....|
00029e70  68 65 61 70 0d be 00 05  5d 0d be 0a 05 ed 0d be  |heap....].......|
00029e80  14 20 ff 22 20 42 72 65  61 6b 53 65 74 20 22 2b  |. ." BreakSet "+|
00029e90  c3 7e 28 62 72 65 61 6b  70 6f 69 6e 74 29 0d be  |.~(breakpoint)..|
00029ea0  1e 3f ff 20 20 22 53 41  56 45 20 22 22 3c 41 55  |.?.  "SAVE ""<AU|
00029eb0  49 6e 64 65 78 24 44 69  72 3e 2e 21 52 75 6e 49  |Index$Dir>.!RunI|
00029ec0  6d 61 67 65 22 22 20 22  2b c3 7e 28 63 6f 64 65  |mage"" "+.~(code|
00029ed0  25 29 2b 22 20 22 2b c3  7e 28 50 25 29 0d be 28  |%)+" "+.~(P%)..(|
00029ee0  31 ff 20 20 22 53 65 74  54 79 70 65 20 3c 41 55  |1.  "SetType <AU|
00029ef0  49 6e 64 65 78 24 44 69  72 3e 2e 21 52 75 6e 49  |Index$Dir>.!RunI|
00029f00  6d 61 67 65 20 41 62 73  6f 6c 75 74 65 22 0d be  |mage Absolute"..|
00029f10  32 0b d6 20 63 6f 64 65  25 0d be 3c 05 e0 0d be  |2.. code%..<....|
00029f20  46 04 0d be 50 52 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |F...PR;---------|
00029f30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00029f70  2d 2d 2d 2d 0d be 5a 2d  3b 20 20 20 20 20 20 20  |----..Z-;       |
00029f80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00029f90  20 20 2a 2a 2a 20 4c 6f  6e 67 41 64 72 20 2a 2a  |  *** LongAdr **|
00029fa0  2a 0d be 64 50 3b 20 54  68 69 73 20 66 75 6e 63  |*..dP; This func|
00029fb0  74 69 6f 6e 20 69 73 20  61 20 6d 61 63 72 6f 20  |tion is a macro |
00029fc0  77 68 69 63 68 20 61 73  73 65 6d 62 6c 65 73 20  |which assembles |
00029fd0  63 6f 64 65 20 74 6f 20  65 6d 75 6c 61 74 65 20  |code to emulate |
00029fe0  74 68 65 20 41 44 52 20  64 69 72 65 63 74 69 76  |the ADR directiv|
00029ff0  65 0d be 6e 3d 3b 20 66  6f 72 20 61 64 64 72 65  |e..n=; for addre|
0002a000  73 73 65 73 20 67 72 65  61 74 65 72 20 74 68 61  |sses greater tha|
0002a010  6e 20 34 30 39 36 20 62  79 74 65 73 20 61 77 61  |n 4096 bytes awa|
0002a020  79 20 66 72 6f 6d 20 74  68 65 20 50 43 2e 0d be  |y from the PC...|
0002a030  78 49 3b 20 41 44 44 20  61 6e 64 20 53 55 42 20  |xI; ADD and SUB |
0002a040  69 6e 73 74 72 75 63 74  69 6f 6e 73 20 63 61 6e  |instructions can|
0002a050  20 6f 6e 6c 79 20 75 73  65 20 69 6d 6d 65 64 69  | only use immedi|
0002a060  61 74 65 20 76 61 6c 75  65 73 20 77 69 74 68 20  |ate values with |
0002a070  75 70 20 74 6f 20 38 0d  be 82 34 3b 20 73 69 67  |up to 8...4; sig|
0002a080  6e 69 66 69 63 61 6e 74  20 62 69 74 73 2c 73 6f  |nificant bits,so|
0002a090  20 74 77 6f 20 69 6e 73  74 72 75 63 74 69 6f 6e  | two instruction|
0002a0a0  73 20 61 72 65 20 75 73  65 64 2e 0d be 8c 04 0d  |s are used......|
0002a0b0  be 96 27 dd a4 4c 6f 6e  67 41 64 72 28 63 6f 6e  |..'..LongAdr(con|
0002a0c0  64 69 74 69 6f 6e 24 2c  72 65 67 25 2c 70 6f 69  |dition$,reg%,poi|
0002a0d0  6e 74 65 72 25 29 0d be  a0 04 0d be aa 1d 20 e7  |nter%)........ .|
0002a0e0  20 94 28 70 6f 69 6e 74  65 72 25 2d 50 25 29 3e  | .(pointer%-P%)>|
0002a0f0  36 35 35 33 36 20 8c 0d  be b4 4a 20 20 85 20 31  |65536 ....J  . 1|
0002a100  2c 22 4c 6f 6e 67 41 64  72 20 6f 6e 6c 79 20 77  |,"LongAdr only w|
0002a110  6f 72 6b 73 20 66 6f 72  20 61 64 64 72 65 73 73  |orks for address|
0002a120  65 73 20 77 69 74 68 69  6e 20 b1 36 34 20 4b 42  |es within .64 KB|
0002a130  79 74 65 73 20 61 74 20  26 22 2b c3 28 7e 50 25  |ytes at &"+.(~P%|
0002a140  29 0d be be 06 20 cd 0d  be c8 04 0d be d2 26 20  |).... ........& |
0002a150  e7 20 63 6f 6e 64 69 74  69 6f 6e 24 3d 22 22 20  |. condition$="" |
0002a160  8c 20 63 6f 6e 64 69 74  69 6f 6e 24 3d 22 41 4c  |. condition$="AL|
0002a170  22 0d be dc 38 20 63 63  25 3d a7 22 45 51 4e 45  |"...8 cc%=."EQNE|
0002a180  43 53 43 43 4d 49 50 4c  56 53 56 43 48 49 4c 53  |CSCCMIPLVSVCHILS|
0002a190  47 45 4c 54 47 54 4c 45  41 4c 4e 56 22 2c 63 6f  |GELTGTLEALNV",co|
0002a1a0  6e 64 69 74 69 6f 6e 24  29 0d be e6 04 0d be f0  |ndition$).......|
0002a1b0  0e 20 e7 20 63 63 25 3d  30 20 8c 0d be fa 36 20  |. . cc%=0 ....6 |
0002a1c0  20 85 20 31 2c 20 22 42  61 64 20 43 6f 6e 64 69  | . 1, "Bad Condi|
0002a1d0  74 69 6f 6e 20 43 6f 64  65 20 69 6e 20 4c 6f 6e  |tion Code in Lon|
0002a1e0  67 41 64 72 20 61 74 20  26 22 2b c3 28 7e 50 25  |gAdr at &"+.(~P%|
0002a1f0  29 0d bf 04 06 20 cd 0d  bf 0e 04 0d bf 18 14 20  |).... ......... |
0002a200  63 63 25 3d 28 63 63 25  2d 31 29 20 81 20 32 0d  |cc%=(cc%-1) . 2.|
0002a210  bf 22 04 0d bf 2c 1a 20  64 69 66 66 25 3d 70 6f  |."...,. diff%=po|
0002a220  69 6e 74 65 72 25 2d 28  50 25 2b 38 29 0d bf 36  |inter%-(P%+8)..6|
0002a230  04 0d bf 40 13 20 6f 70  31 25 3d 28 63 63 25 3c  |...@. op1%=(cc%<|
0002a240  3c 32 38 29 0d bf 4a 14  20 6f 70 31 25 2b 3d 26  |<28)..J. op1%+=&|
0002a250  30 32 34 46 30 30 30 30  0d bf 54 15 20 6f 70 31  |024F0000..T. op1|
0002a260  25 2b 3d 28 72 65 67 25  3c 3c 31 32 29 0d bf 5e  |%+=(reg%<<12)..^|
0002a270  19 20 6f 70 31 25 2b 3d  94 28 64 69 66 66 25 29  |. op1%+=.(diff%)|
0002a280  20 80 20 26 46 46 0d bf  68 04 0d bf 72 13 20 6f  | . &FF..h...r. o|
0002a290  70 32 25 3d 28 63 63 25  3c 3c 32 38 29 0d bf 7c  |p2%=(cc%<<28)..||
0002a2a0  14 20 6f 70 32 25 2b 3d  26 30 32 34 30 30 43 30  |. op2%+=&02400C0|
0002a2b0  30 0d bf 86 15 20 6f 70  32 25 2b 3d 28 72 65 67  |0.... op2%+=(reg|
0002a2c0  25 3c 3c 31 36 29 0d bf  90 15 20 6f 70 32 25 2b  |%<<16).... op2%+|
0002a2d0  3d 28 72 65 67 25 3c 3c  31 32 29 0d bf 9a 1c 20  |=(reg%<<12).... |
0002a2e0  6f 70 32 25 2b 3d 94 28  64 69 66 66 25 29 3e 3e  |op2%+=.(diff%)>>|
0002a2f0  38 20 80 20 26 46 46 0d  bf a4 04 0d bf ae 11 20  |8 . &FF........ |
0002a300  e7 20 64 69 66 66 25 3e  3d 30 20 8c 0d bf b8 11  |. diff%>=0 .....|
0002a310  20 20 6f 70 31 25 2b 3d  34 3c 3c 32 30 0d bf c2  |  op1%+=4<<20...|
0002a320  11 20 20 6f 70 32 25 2b  3d 34 3c 3c 32 30 0d bf  |.  op2%+=4<<20..|
0002a330  cc 06 20 cd 0d bf d6 04  0d bf e0 0f 20 5b 4f 50  |.. ......... [OP|
0002a340  54 20 70 61 73 73 25 0d  bf ea 49 20 45 51 55 44  |T pass%...I EQUD|
0002a350  20 20 20 20 20 20 6f 70  31 25 20 20 20 20 20 20  |      op1%      |
0002a360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0002a370  20 20 3b 41 73 73 65 6d  62 6c 65 20 74 68 65 20  |  ;Assemble the |
0002a380  74 77 6f 20 69 6e 73 74  72 75 63 74 69 6f 6e 73  |two instructions|
0002a390  0d bf f4 13 20 45 51 55  44 20 20 20 20 20 20 6f  |.... EQUD      o|
0002a3a0  70 32 25 0d bf fe 06 20  5d 0d c0 08 04 0d c0 12  |p2%.... ].......|
0002a3b0  06 3d 30 0d ff                                    |.=0..|
0002a3b5