4000           DATA >AA02,>0000,>4044,>0000,>404A,>4010,>0000,>0000,>4016
4012           DATA >5B38,>0110,>401C,>5B48,>0111,>4022,>5B52,>0112,>4028
4024           DATA >5BAC,>0113,>402E,>5C78,>0114,>4034,>5CE8,>0115,>403A
4036           DATA >5DAE,>0116,>0000,>5D5A,>0546,>494C,>4553,>0000,>4070
4048           DATA >0000,>4052,>504E,>0344,>534B,>405C,>505C,>0444,>534B
405A           DATA >3100,>4066,>5062,>0444,>534B,>3200,>0000,>5068,>0444
406C           DATA >534B,>3300

4000 AA             BYTE >AA		Identification
4001 02             BYTE 2		Version Number
4002 00             BYTE 0		Number of programs
4003 00             BYTE 0		Reserved
4004 4044           DATA >4044		Power up routine
4006 0000           DATA 0		User program header
4008 404A           DATA >404A		DSR Header
400A 4010           DATA >4010		Subroutine link header
400C 0000           DATA 0		Address of interrupt link
400E 0000           DATA 0		Address of BASIC subroutine libraries

*
* SUBROUTINE LINK HEADER
*
4010 4016           DATA >4016		Sector READ / WRITE
4012 5B38           DATA >5B38
4014 01             BYTE >01
4015 10             BYTE >10

4016 401C           DATA >401C		Disk Formatting
4018 5B48           DATA >5B48
401A 01             BYTE >01
401B 11             BYTE >11

401C 4022           DATA >4022		Modify File Protection
401E 5B52           DATA >5B52
4020 01             BYTE >01
4021 12             BYTE >12

4022 4028           DATA >4028		File Rename
4024 5BAC           DATA >5BAC
4026 01             BYTE >01
4027 13             BYTE >13

4028 402E           DATA >402E		Access Direct Input File
402A 5C78           DATA >5C78
402C 01             BYTE >01
402D 14             BYTE >14

402E 4034           DATA >4034		Access Direct Output File
4030 5CE8           DATA >5CE8
4032 01             BYTE >01
4033 15             BYTE >15

4034 403A           DATA >403A		Buffer Allocation
4036 5DAE           DATA >5DAE
4038 01             BYTE >01
4039 16             BYTE >16

403A 0000           DATA >0000
403C 5D5A           DATA >5D5A
403E 05             BYTE >05
403F 46494C4553     TEXT 'FILES'

4044 0000           DATA >0000		Link to next power up routine
4046 4070           DATA >4070		Power up routine

4048 0000           DATA >0000

*
* DSR HEADER
*
404A 4052           DATA >4052
404C 504E           DATA >504E
404E 03             BYTE >03
404F 44534B         TEXT 'DSK'

4052 405C           DATA >405C
4054 505C           DATA >505C
4056 04             BYTE >04
4057 44534B31       TEXT 'DSK1'

405C 4066           DATA >4066
405E 5062           DATA >5062
4060 04             BYTE >04
4061 44534B32       TEXT 'DSK2'

4066 0000           DATA >0000
4068 5068           DATA >5068
406A 04             BYTE >04
406B 44534B33       TEXT 'DSK3'

*************************************************************************
*									*
*			POWER UP ROUTINE				*
*									*
*************************************************************************

4070 C1CB           MOV  R11,R7
4072 02A9           STWP R9
4074 0229 FF20      AI   R9,>FF20
4078 C029 0070      MOV  @>0070(R9),R0	Allocate space in VDP ram
407C C080           MOV  R0,R2
407E 0220 F7D8      AI   R0,>F7D8	2088 bytes
4082 CA40 0070      MOV  R0,@>0070(R9)
4086 0580           INC  R0
4088 06A0 40DA      BL   @>40DA
408C 0201 0828      LI   R1,>0828	Clear out the VDP memory buffer
4090 04EF FFFE      CLR  @>FFFE(R15)
4094 0601           DEC  R1
4096 16FC           JNE  >4090
4098 06A0 40DA      BL   @>40DA
409C 0203 AA03      LI   R3,>AA03
40A0 DBC3 FFFE      MOVB R3,@>FFFE(R15)	Put in validity code
40A4 1000           NOP
40A6 DBC2 FFFE      MOVB R2,@>FFFE(R15)	Put in previous top of memory
40AA 06C2           SWPB R2
40AC DBC2 FFFE      MOVB R2,@>FFFE(R15)
40B0 1000           NOP
40B2 DBCC FFFE      MOVB R12,@>FFFE(R15) Put in CRU ID
40B6 06C3           SWPB R3
40B8 DBC3 FFFE      MOVB R3,@>FFFE(R15)	Put in number of files (default 3)
40BC 06A0 4726      BL   @>4726
40C0 06A0 4658      BL   @>4658
40C4 4554           DATA >4554
40C6 04E9 0054      CLR  @>0054(R9)
40CA 0429 005A      BLWP @>005A(R9)
40CE 0011           DATA >0011
40D0 CA60 40D8 006C MOV  @>40D8,@>006C(R9)
40D6 045B           RT

40D8 0404           DATA >0404

40DA 0260 4000      ORI  R0,>4000	Move R0 to VDP write address
40DE 06C0           SWPB R0
40E0 D7C0           MOVB R0,*R15
40E2 06C0           SWPB R0
40E4 D7C0           MOVB R0,*R15
40E6 045B           RT

40E8 0204 000A      LI   R4,10
40EC DA60 4630 0050 MOVB @>4630,@>0050(R9)
40F2 06A0 4496      BL   @>4496
40F6 06A0 45F0      BL   @>45F0
40FA 04C0           CLR  R0
40FC D02F FBFE      MOVB @>FBFE(R15),R0
4100 0280 D700      CI   R0,>D700
4104 1B03           JH   >410C
4106 06A0 4524      BL   @>4524
410A 0700           SETO R0
410C D800 5FFA      MOVB R0,@>5FFA
4110 C069 004A      MOV  @>004A(R9),R1
4114 1E07           SBZ  7
4116 04C7           CLR  R7
4118 0281 02D0      CI   R1,720  	720 Sectors
411C 144C           JHE  >41B6
411E 0281 0168      CI   R1,360  	360 Sectors
4122 1A0D           JL   >413E
4124 0221 FD31      AI   R1,>FD31
4128 0741           ABS  R1
412A 04C0           CLR  R0
412C 3C20 4632      DIV  @>4632,0
4130 0221 FFF8      AI   R1,>FFF8
4134 0741           ABS  R1
4136 1D07           SBO  7
4138 0207 0100      LI   R7,>0100
413C 1008           JMP  >414E
413E 0281 0001      CI   R1,1
4142 1B02           JH   >4148
4144 06A0 4524      BL   @>4524
4148 04C0           CLR  R0
414A 3C20 4632      DIV  @>4632,0
414E 06C0           SWPB R0
4150 0540           INV  R0
4152 06A0 4614      BL   @>4614
4156 DBC0 FFFE      MOVB R0,@>FFFE(R15)
415A D800 5FFE      MOVB R0,@>5FFE
415E 06C1           SWPB R1
4160 0541           INV  R1
4162 D801 5FFC      MOVB R1,@>5FFC
4166 9800 5FF2      CB   R0,@>5FF2
416A 1307           JEQ  >417A
416C 06A0 45CA      BL   @>45CA
4170 E100           DATA >E100
4172 06A0 4482      BL   @>4482
4176 0AD0           SLA  R0,13
4178 181B           JOC  >41B0
417A 06A0 45CA      BL   @>45CA
417E 3F00           DATA >3F00
4180 1D02           SBO  2
4182 D020 5FF6      MOVB @>5FF6,R0
4186 0206 0004      LI   R6,4
418A D160 5FF6      MOVB @>5FF6,R5
418E 0545           INV  R5
4190 D020 5FF6      MOVB @>5FF6,R0
4194 0606           DEC  R6
4196 16FC           JNE  >4190
4198 06A0 4480      BL   @>4480
419C 0AD0           SLA  R0,13
419E 180E           JOC  >41BC
41A0 1110           JLT  >41C2
41A2 0A20           SLA  R0,2
41A4 1811           JOC  >41C8
41A6 9147           CB   R7,R5
41A8 1312           JEQ  >41CE
41AA 06A0 45AC      BL   @>45AC
41AE 0600           DATA >0600
41B0 06A0 4590      BL   @>4590
41B4 1100           DATA >1100
41B6 06A0 45AC      BL   @>45AC
41BA 0700           DATA >0700
41BC 06A0 4590      BL   @>4590
41C0 2100           DATA >2100
41C2 06A0 4590      BL   @>4590
41C6 2200           DATA >2200
41C8 06A0 4590      BL   @>4590
41CC 2300           DATA >2300
41CE D801 5FFC      MOVB R1,@>5FFC
41D2 C0A9 004E      MOV  @>004E(R9),R2
41D6 D029 004D      MOVB @>004D(R9),R0
41DA 1340           JEQ  >425C
41DC 06A0 4614      BL   @>4614
41E0 06A0 45CA      BL   @>45CA
41E4 7700           DATA >7700
41E6 0206 0100      LI   R6,>0100
41EA 0705           SETO R5
41EC 1D02           SBO  2
41EE D029 004D      MOVB @>004D(R9),R0
41F2 1610           JNE  >4214
41F4 04C0           CLR  R0
41F6 D020 5FF6      MOVB @>5FF6,R0
41FA B02F FBFE      AB   @>FBFE(R15),R0
41FE 0280 FF00      CI   R0,>FF00
4202 1615           JNE  >422E
4204 5020 5FF6      SZCB @>5FF6,R0
4208 702F FBFE      SB   @>FBFE(R15),R0
420C 1610           JNE  >422E
420E 0646           DECT R6
4210 16F2           JNE  >41F6
4212 100C           JMP  >422C
4214 D020 5FF6      MOVB @>5FF6,R0
4218 0540           INV  R0
421A DBC0 FFFE      MOVB R0,@>FFFE(R15)
421E D020 5FF6      MOVB @>5FF6,R0
4222 0540           INV  R0
4224 DBC0 FFFE      MOVB R0,@>FFFE(R15)
4228 0646           DECT R6
422A 16F4           JNE  >4214
422C 04C5           CLR  R5
422E 06A0 4480      BL   @>4480
4232 0AD0           SLA  R0,13
4234 1807           JOC  >4244
4236 1109           JLT  >424A
4238 C145           MOV  R5,R5
423A 160D           JNE  >4256
423C 0A20           SLA  R0,2
423E 1808           JOC  >4250
4240 0460 4676      B    @>4676
4244 06A0 4590      BL   @>4590
4248 2100           DATA >2100
424A 06A0 4590      BL   @>4590
424E 2200           DATA >2200
4250 06A0 4590      BL   @>4590
4254 2300           DATA >2300
4256 06A0 4590      BL   @>4590
425A 2800           DATA >2800
425C 06A0 461E      BL   @>461E
4260 06A0 45CA      BL   @>45CA
4264 5700           DATA >5700
4266 0206 0100      LI   R6,>0100
426A 1D02           SBO  2
426C D02F FBFE      MOVB @>FBFE(R15),R0
4270 0540           INV  R0
4272 D800 5FFE      MOVB R0,@>5FFE
4276 D02F FBFE      MOVB @>FBFE(R15),R0
427A 0540           INV  R0
427C D800 5FFE      MOVB R0,@>5FFE
4280 0646           DECT R6
4282 16F4           JNE  >426C
4284 06A0 4480      BL   @>4480
4288 0AB0           SLA  R0,11
428A 1807           JOC  >429A
428C 0A20           SLA  R0,2
428E 1808           JOC  >42A0
4290 0A20           SLA  R0,2
4292 1809           JOC  >42A6
4294 06A0 461E      BL   @>461E
4298 10A3           JMP  >41E0
429A 06A0 45AC      BL   @>45AC
429E 3400           DATA >3400
42A0 06A0 4590      BL   @>4590
42A4 3100           DATA >3100
42A6 06A0 4590      BL   @>4590
42AA 3300           DATA >3300

* Disk format routine

42AC 04E9 004A      CLR  @>004A(R9)		Clear # of sectors/disk
42B0 D229 004C      MOVB @>004C(R9),R8
42B4 09C8           SRL  R8,12
42B6 1306           JEQ  >42C4			Branch if DSR version = 0
42B8 8808 4630      C    R8,@>4630		Does R8 = 1?
42BC 1303           JEQ  >42C4			Branch if so
42BE 06A0 45AC      BL   @>45AC			Report error #7
42C2 0700           DATA >0700

42C4 5A60 4638 004C SZCB @>4638,@>004C(R9)	Just leave Unit #
42CA 9829 0051 4657 CB   @>0051(R9),@>4657	Check if double sided
42D0 1602           JNE  >42D6			Branch if not
42D2 0729 004A      SETO @>004A(R9)		Sectors/disk = -1
42D6 DA60 4630 0050 MOVB @>4630,@>0050(R9)	Density = 0
42DC 06A0 4496      BL   @>4496
42E0 06A0 4524      BL   @>4524
42E4 04C3           CLR  R3
42E6 CA69 004A 004A MOV  @>004A(R9),@>004A(R9)
42EC 1305           JEQ  >42F8
42EE 1D07           SBO  7
42F0 0207 0100      LI   R7,>0100
42F4 06A0 43AA      BL   @>43AA
42F8 1E07           SBZ  7
42FA 04C7           CLR  R7
42FC 06A0 43AA      BL   @>43AA
4300 06A0 45CA      BL   @>45CA
4304 A500           DATA >A500
4306 06A0 4482      BL   @>4482
430A 0223 0100      AI   R3,>0100
430E 9A43 004D      CB   R3,@>004D(R9)
4312 16E9           JNE  >42E6
4314 CA69 004A 004A MOV  @>004A(R9),@>004A(R9)
431A 132F           JEQ  >437A
431C 1D07           SBO  7
431E 0204 000A      LI   R4,10
4322 06A0 4524      BL   @>4524
4326 C0A9 004E      MOV  @>004E(R9),R2
432A 06A0 4614      BL   @>4614
432E 06A0 45CA      BL   @>45CA
4332 3F00           DATA >3F00
4334 0206 0006      LI   R6,6
4338 1D02           SBO  2
433A D020 5FF6      MOVB @>5FF6,R0
433E 0540           INV  R0
4340 DBC0 FFFE      MOVB R0,@>FFFE(R15)
4344 D020 5FF6      MOVB @>5FF6,R0
4348 0540           INV  R0
434A DBC0 FFFE      MOVB R0,@>FFFE(R15)
434E 0646           DECT R6
4350 16F4           JNE  >433A
4352 06A0 4480      BL   @>4480
4356 0AD0           SLA  R0,13
4358 181F           JOC  >4398
435A 1121           JLT  >439E
435C 0A20           SLA  R0,2
435E 1822           JOC  >43A4
4360 C0A9 004E      MOV  @>004E(R9),R2
4364 0582           INC  R2
4366 06A0 461E      BL   @>461E
436A 04C0           CLR  R0
436C D02F FBFE      MOVB @>FBFE(R15),R0
4370 1304           JEQ  >437A
4372 D029 004D      MOVB @>004D(R9),R0
4376 0A10           SLA  R0,1
4378 1005           JMP  >4384
437A DA60 4631 0051 MOVB @>4631,@>0051(R9)
4380 D029 004D      MOVB @>004D(R9),R0		R0 = Number of tracks
4384 0980           SRL  R0,8			put in lower byte
4386 3820 4632      MPY  @>4632,0		Multiply by 9 to get sectors
438A CA41 004A      MOV  R1,@>004A(R9)		Store
438E DA60 4633 004D MOVB @>4633,@>004D(R9)
4394 0460 4676      B    @>4676
4398 06A0 4590      BL   @>4590
439C 2101           DATA >2101
439E 06A0 4590      BL   @>4590
43A2 2201           DATA >2201
43A4 06A0 4590      BL   @>4590
43A8 2301           DATA >2301
43AA C20B           MOV  R11,R8
43AC C0A9 004E      MOV  @>004E(R9),R2
43B0 06A0 4614      BL   @>4614
43B4 0206 0016      LI   R6,>0016
43B8 04C2           CLR  R2
43BA 1002           JMP  >43C0
43BC 0206 0006      LI   R6,6
43C0 DBE0 4630 FFFE MOVB @>4630,@>FFFE(R15)
43C6 0606           DEC  R6
43C8 16FB           JNE  >43C0
43CA DBE0 4639 FFFE MOVB @>4639,@>FFFE(R15)
43D0 1000           NOP
43D2 DBC3 FFFE      MOVB R3,@>FFFE(R15)
43D6 1000           NOP
43D8 DBC7 FFFE      MOVB R7,@>FFFE(R15)
43DC D003           MOVB R3,R0
43DE 0980           SRL  R0,8
43E0 06C7           SWPB R7
43E2 3827 4635      MPY  @>4635(R7),0
43E6 06C7           SWPB R7
43E8 A042           A    R2,R1
43EA 3C20 4632      DIV  @>4632,0
43EE DBE1 464F FFFE MOVB @>464F(R1),@>FFFE(R15)
43F4 0206 FFEC      LI   R6,>FFEC
43F8 DBE6 464E FFFE MOVB @>464E(R6),@>FFFE(R15)
43FE 0586           INC  R6
4400 16FB           JNE  >43F8
4402 0200 E5E5      LI   R0,>E5E5
4406 06A0 4474      BL   @>4474
440A 0100           DATA >0100
440C DBE0 464E FFFE MOVB @>464E,@>FFFE(R15)
4412 0700           SETO R0
4414 06A0 4474      BL   @>4474
4418 002D           DATA >002D
441A 0582           INC  R2
441C 0282 0009      CI   R2,9
4420 16CD           JNE  >43BC
4422 06A0 4474      BL   @>4474
4426 00E7           DATA >00E7
4428 0204 0003      LI   R4,3
442C D0A9 004E      MOVB @>004E(R9),R2
4430 06A0 461E      BL   @>461E
4434 06A0 45CA      BL   @>45CA
4438 0B00           DATA >0B00
443A 0206 0CA3      LI   R6,>0CA3
443E 1D02           SBO  2
4440 D02F FBFE      MOVB @>FBFE(R15),R0
4444 0540           INV  R0
4446 D800 5FFE      MOVB R0,@>5FFE
444A D02F FBFE      MOVB @>FBFE(R15),R0
444E 0540           INV  R0
4450 D800 5FFE      MOVB R0,@>5FFE
4454 0646           DECT R6
4456 15F4           JGT  >4440
4458 06A0 4480      BL   @>4480
445C 0AB0           SLA  R0,11
445E 1702           JNC  >4464
4460 0460 429A      B    @>429A
4464 0A40           SLA  R0,4
4466 1705           JNC  >4472
4468 0604           DEC  R4
446A 16E0           JNE  >442C
446C 06A0 45AC      BL   @>45AC
4470 3300           DATA >3300
4472 0458           B    *R8
4474 C1BB           MOV  *R11+,R6
4476 DBC0 FFFE      MOVB R0,@>FFFE(R15)
447A 0606           DEC  R6
447C 16FC           JNE  >4476
447E 045B           RT

4480 1E02           SBZ  2
4482 D020 5FF0      MOVB @>5FF0,R0
4486 0540           INV  R0
4488 1103           JLT  >4490
448A 0B90           SRC  R0,9
448C 18FA           JOC  >4482
448E 045B           RT

4490 06A0 45AC      BL   @>45AC
4494 0600           DATA >0600

4496 C1CB           MOV  R11,R7
4498 C0A9 0058      MOV  @>0058(R9),R2
449C 0222 FFF6      AI   R2,>FFF6
44A0 06A0 461E      BL   @>461E		Set VDP Read Address to R2
44A4 D02F FBFE      MOVB @>FBFE(R15),R0
44A8 04C5           CLR  R5
44AA 9A40 004C      CB   R0,@>004C(R9)	Is current disk # the one we format?
44AE 1301           JEQ  >44B2		Branch if so
44B0 0705           SETO R5		Otherwise set R5 = -1
44B2 04C0           CLR  R0
44B4 D029 004C      MOVB @>004C(R9),R0
44B8 1332           JEQ  >451E		Branch if format unit #0
44BA 06A0 4614      BL   @>4614		Set VDP write address to R2
44BE DBC0 FFFE      MOVB R0,@>FFFE(R15)	Store current disk # in status info
44C2 06C0           SWPB R0
44C4 0280 0003      CI   R0,3		Branch if unit # > 3
44C8 1B2A           JH   >451E
44CA 0202 0080      LI   R2,>0080
44CE 0A02           SLA  R2,0
44D0 022C 0008      AI   R12,>0008
44D4 C145           MOV  R5,R5
44D6 1317           JEQ  >4506		Skip code if disk is current
44D8 30E0 4505      LDCR @>4505,3	Tell controller we want to
44DC 022C FFFA      AI   R12,-6		access a new disk
44E0 34C0           STCR R0,3
44E2 022C 0006      AI   R12,6
44E6 2402           CZC  R2,0
44E8 130E           JEQ  >4506
44EA 04C0           CLR  R0
44EC C0A9 0058      MOV  @>0058(R9),R2
44F0 0222 FFF6      AI   R2,>FFF6
44F4 06A0 4614      BL   @>4614
44F8 DBC0 FFFE      MOVB R0,@>FFFE(R15)
44FC 022C FFF8      AI   R12,>FFF8
4500 06A0 45AC      BL   @>45AC
4504 0600           DATA >0600
4506 30C2           LDCR R2,3
4508 022C FFF8      AI   R12,>FFF8
450C C145           MOV  R5,R5
450E 1306           JEQ  >451C
4510 0200 0BB8      LI   R0,>0BB8
4514 0B45           SRC  R5,4
4516 0B45           SRC  R5,4
4518 0600           DEC  R0
451A 16FC           JNE  >4514
451C 0457           B    *R7
451E 06A0 45AC      BL   @>45AC		Report disk error #7
4522 0700           DATA >0700
4524 C20B           MOV  R11,R8
4526 06A0 45CA      BL   @>45CA
452A F500           DATA >F500
452C 06A0 4482      BL   @>4482
4530 06A0 4544      BL   @>4544
4534 06A0 45F0      BL   @>45F0
4538 06A0 4614      BL   @>4614
453C DBE0 4640 FFFE MOVB @>4640,@>FFFE(R15)
4542 0458           B    *R8
4544 D020 5FF0      MOVB @>5FF0,R0
4548 0540           INV  R0
454A 0A60           SLA  R0,6
454C 1802           JOC  >4552
454E 0460 4490      B    @>4490
4552 045B           RT

4554 022C 0008      AI   R12,>0008
4558 3120 4630      LDCR @>4630,4
455C 022C FFF8      AI   R12,>FFF8
4560 1E01           SBZ  1
4562 1D01           SBO  1
4564 D820 45BC 5FF8 MOVB @>45BC,@>5FF8
456A C0A9 0058      MOV  @>0058(R9),R2
456E 0222 FFF6      AI   R2,>FFF6
4572 06A0 4614      BL   @>4614
4576 0200 0004      LI   R0,4
457A DBC0 FFFE      MOVB R0,@>FFFE(R15)
457E 0600           DEC  R0
4580 16FC           JNE  >457A
4582 06A0 4480      BL   @>4480
4586 DA60 4630 0050 MOVB @>4630,@>0050(R9)
458C 0460 4676      B    @>4676
4590 0604           DEC  R4
4592 130C           JEQ  >45AC
4594 C2DB           MOV  *R11,R11
4596 0B1B           SRC  R11,1
4598 1702           JNC  >459E
459A 0460 4322      B    @>4322
459E 0284 0005      CI   R4,5
45A2 1B02           JH   >45A8
45A4 06A0 4524      BL   @>4524
45A8 0460 40EC      B    @>40EC

45AC C01B           MOV  *R11,R0
45AE DA40 0050      MOVB R0,@>0050(R9)
45B2 0280 0600      CI   R0,>0600
45B6 1607           JNE  >45C6
45B8 06A0 45CA      BL   @>45CA
45BC 2F00           DATA >2F00
45BE D020 5FF0      MOVB @>5FF0,R0
45C2 0B90           SRC  R0,9
45C4 17FC           JNC  >45BE
45C6 0460 4676      B    @>4676

45CA C03B           MOV  *R11+,R0
45CC D1A0 5FF0      MOVB @>5FF0,R6
45D0 0A16           SLA  R6,1
45D2 1E01           SBZ  1
45D4 1D01           SBO  1
45D6 1806           JOC  >45E4
45D8 0206 7530      LI   R6,>7530

45DC 0B45           SRC  R5,4		Some sort of bizarre delay
45DE 0B45           SRC  R5,4
45E0 0606           DEC  R6
45E2 16FC           JNE  >45DC

45E4 D800 5FF8      MOVB R0,@>5FF8
45E8 1D03           SBO  3
45EA 0B85           SRC  R5,8
45EC 0B85           SRC  R5,8
45EE 045B           RT

45F0 04C0           CLR  R0
45F2 D029 004C      MOVB @>004C(R9),R0
45F6 130B           JEQ  >460E
45F8 06C0           SWPB R0
45FA 0280 0003      CI   R0,3
45FE 1B07           JH   >460E
4600 C0A9 0058      MOV  @>0058(R9),R2
4604 0222 FFF6      AI   R2,>FFF6
4608 A080           A    R0,R2
460A 0460 461E      B    @>461E
460E 06A0 45AC      BL   @>45AC
4612 0700           DATA >0700
4614 0262 4000      ORI  R2,>4000
4618 0242 7FFF      ANDI R2,>7FFF
461C 1002           JMP  >4622

461E 0242 3FFF      ANDI R2,>3FFF
4622 06C2           SWPB R2
4624 D7C2           MOVB R2,*R15
4626 06C2           SWPB R2
4628 D7C2           MOVB R2,*R15

462A 0242 3FFF      ANDI R2,>3FFF
462E 045B           RT

4630 0001           DATA 1
4632 0009           DATA 9
4634 0006           DATA 6
4636 0003           DATA 3
4638 F0             BYTE >F0
4639 FE             BYTE >FE
463A 01F7           DATA >01F7
463C FFFF           SOCB *R15+,*R15+
463E FFFF           SOCB *R15+,*R15+
4640 FFFF           SOCB *R15+,*R15+
4642 FFFF           SOCB *R15+,*R15+
4644 FFFF           SOCB *R15+,*R15+
4646 FF00           SOCB R0,*R12+
4648 0000           DATA >0000
464A 0000           DATA >0000
464C 00FB           DATA >00FB
464E F700           SOCB R0,*R12
4650 0705           SETO R5
4652 0301 0806      LIMI >0806
4656 0402           BLWP R2
4658 0669 0066      DECT @>0066(R9)
465C C2A9 0066      MOV  @>0066(R9),R10
4660 0429 005A      BLWP @>005A(R9)
4664 0143           DATA >0143
4666 C2BB           MOV  *R11+,R10
4668 06CB           SWPB R11
466A DBCB FFFE      MOVB R11,@>FFFE(R15)
466E 06CB           SWPB R11
4670 DBCB FFFE      MOVB R11,@>FFFE(R15)
4674 045A           B    *R10

* Get return address off the stack and return

4676 C2E9 0066      MOV  @>0066(R9),R11
467A 0429 005A      BLWP @>005A(R9)
467E 0162           DATA >0162
4680 D2EF FBFE      MOVB @>FBFE(R15),R11
4684 06CB           SWPB R11
4686 D2EF FBFE      MOVB @>FBFE(R15),R11
468A 05E9 0066      INCT @>0066(R9)
468E 045B           RT

4690 C28D           MOV  R13,R10
4692 C23E           MOV  *R14+,R8
4694 C248           MOV  R8,R9
4696 0949           SRL  R9,4
4698 0248 0003      ANDI R8,>0003
469C A208           A    R8,R8
469E C2ED 001E      MOV  @>001E(R13),R11  Put caller's R15 into R11
46A2 C228 46A8      MOV  @>46A8(R8),R8
46A6 0458           B    *R8

46A8 46B0           DATA >46B0
46AA 46DC           DATA >46DC
46AC 4712           DATA >4712	Sets VDP read address to Register (R9)
46AE 4708           DATA >4708

46B0 022A 0016      AI   R10,>0016
46B4 0919           SRL  R9,1
46B6 1710           JNC  >46D8
46B8 064C           DECT R12
46BA C21A           MOV  *R10,R8	Get a register from caller's workspace
46BC 06CC           SWPB R12		Set VDP Write address
46BE D6CC           MOVB R12,*R11
46C0 06CC           SWPB R12
46C2 026C 4000      ORI  R12,>4000
46C6 D6CC           MOVB R12,*R11
46C8 06C8           SWPB R8		Write what's in R8 into VDP
46CA DAC8 FFFE      MOVB R8,@>FFFE(R11)
46CE 06C8           SWPB R8
46D0 DAC8 FFFE      MOVB R8,@>FFFE(R11)
46D4 C249           MOV  R9,R9
46D6 1317           JEQ  >4706
46D8 064A           DECT R10
46DA 10EC           JMP  >46B4
46DC 0A49           SLA  R9,4
46DE 0A19           SLA  R9,1
46E0 1710           JNC  >4702
46E2 06CC           SWPB R12
46E4 D6CC           MOVB R12,*R11
46E6 06CC           SWPB R12
46E8 024C 3FFF      ANDI R12,>3FFF
46EC D6CC           MOVB R12,*R11
46EE 1000           NOP
46F0 D22B FBFE      MOVB @>FBFE(R11),R8
46F4 06C8           SWPB R8
46F6 D22B FBFE      MOVB @>FBFE(R11),R8
46FA C688           MOV  R8,*R10
46FC 05CC           INCT R12
46FE C249           MOV  R9,R9
4700 1302           JEQ  >4706
4702 05CA           INCT R10
4704 10EC           JMP  >46DE
4706 0380           RTWP

4708 A24D           A    R13,R9
470A C219           MOV  *R9,R8
470C 0268 4000      ORI  R8,>4000
4710 1004           JMP  >471A

4712 A24D           A    R13,R9		Add callers WP to R9
4714 C219           MOV  *R9,R8		Put callers R0 into R8
4716 0248 3FFF      ANDI R8,>3FFF	Set VDP read address
471A 06C8           SWPB R8
471C D6C8           MOVB R8,*R11
471E 06C8           SWPB R8
4720 D6C8           MOVB R8,*R11
4722 0380           RTWP

* General purpose setup routine.  This gets called by just about
* everything.  It does the following:
*
* Set up a transfer vector at 835A
*     835A: 834E	Workspace pointer
*     835C: 4690	Transfer address
*
*     8358: Pointer to VIP in VDP RAM
*     8366: Pointer to additional info in VDP RAM (probably not used)
*
4724 05C7           INCT R7
4726 C28B           MOV  R11,R10	Save return address in R10
4728 02A9           STWP R9
472A 0229 FF20      AI   R9,>FF20	Set R9 to >8300
472E 0200 4690      LI   R0,>4690	Set up a transer vector
4732 CA40 005C      MOV  R0,@>005C(R9)  for a BLWP instruction
4736 C009           MOV  R9,R0
4738 0220 004E      AI   R0,>004E	Use >834E for a workspace
473C CA40 005A      MOV  R0,@>005A(R9)

4740 C229 0070      MOV  @>0070(R9),R8	Get highest VDP RAM address
4744 05C8           INCT R8
4746 06A0 4B76      BL   @>4B76		Get pointer to next buffer
474A C088           MOV  R8,R2
474C C200           MOV  R0,R8
474E D06F FBFE      MOVB @>FBFE(R15),R1	Get CRU ID of VDP RAM Block
4752 904C           CB   R12,R1		If it's not ours, look again.
4754 16F7           JNE  >4744
4756 0228 FEF6      AI   R8,-266	Subtract 266
475A CA48 0058      MOV  R8,@>0058(R9)	Save pointer to VIB
475E 0228 FFF6      AI   R8,-10		Subtract 10
4762 CA48 0066      MOV  R8,@>0066(R9)	Save pointer to Add'l Info
4766 0429 005A      BLWP @>005A(R9)	Push R8 on stack
476A 0100           DATA >0100
476C C1E9 0056      MOV  @>0056(R9),R7	Get pointer to filename
4770 C0C7           MOV  R7,R3		Save pointer in R3
4772 61E9 0054      S    @>0054(R9),R7	Subtract device name length
4776 CA42 0056      MOV  R2,@>0056(R9)
477A 0607           DEC  R7
477C 04C2           CLR  R2
477E 0429 005A      BLWP @>005A(R9)
4782 00E2           DATA >00E2
4784 D0AF FBFE      MOVB @>FBFE(R15),R2
4788 06C2           SWPB R2
478A 60A9 0054      S    @>0054(R9),R2
478E 0227 FFF7      AI   R7,>FFF7
4792 CA47 0054      MOV  R7,@>0054(R9)
4796 045A           B    *R10

4798 06A0 4658      BL   @>4658
479C 4E02           DATA >4E02
479E C104           MOV  R4,R4
47A0 1604           JNE  >47AA
47A2 06A0 4658      BL   @>4658
47A6 48DE           DATA >48DE
47A8 1045           JMP  >4834
47AA 06A0 4B0A      BL   @>4B0A
47AE 0701           SETO R1
47B0 06A0 4658      BL   @>4658
47B4 4EF6           DATA >4EF6
47B6 C000           MOV  R0,R0
47B8 1603           JNE  >47C0
47BA 06A0 4C72      BL   @>4C72
47BE 8000           C    R0,R0
47C0 0429 005A      BLWP @>005A(R9)
47C4 0103           DATA >0103
47C6 DBC0 FFFE      MOVB R0,@>FFFE(R15)
47CA 06C0           SWPB R0
47CC DBC0 FFFE      MOVB R0,@>FFFE(R15)
47D0 06C0           SWPB R0
47D2 C069 0056      MOV  @>0056(R9),R1
47D6 0221 FFFC      AI   R1,>FFFC
47DA 0429 005A      BLWP @>005A(R9)
47DE 0023           DATA >0023
47E0 DBC0 FFFE      MOVB R0,@>FFFE(R15)
47E4 06C0           SWPB R0
47E6 DBC0 FFFE      MOVB R0,@>FFFE(R15)
47EA 0221 0003      AI   R1,3
47EE 0429 005A      BLWP @>005A(R9)
47F2 0023           DATA >0023
47F4 DBC6 FFFE      MOVB R6,@>FFFE(R15)
47F8 04C2           CLR  R2
47FA 0581           INC  R1
47FC 06A0 4658      BL   @>4658
4800 4D36           DATA >4D36
4802 C169 0058      MOV  @>0058(R9),R5
4806 04C4           CLR  R4
4808 06A0 4658      BL   @>4658
480C 4D4E           DATA >4D4E
480E C0C5           MOV  R5,R3
4810 0223 0101      AI   R3,>0101
4814 0202 000A      LI   R2,10
4818 0429 005A      BLWP @>005A(R9)
481C 0062           DATA >0062
481E D02F FBFE      MOVB @>FBFE(R15),R0
4822 0583           INC  R3
4824 0429 005A      BLWP @>005A(R9)
4828 0023           DATA >0023
482A DBC0 FFFE      MOVB R0,@>FFFE(R15)
482E 0581           INC  R1
4830 0602           DEC  R2
4832 16F2           JNE  >4818
4834 C069 0056      MOV  @>0056(R9),R1
4838 0221 000A      AI   R1,10
483C 0202 00F6      LI   R2,>00F6
4840 0429 005A      BLWP @>005A(R9)
4844 0023           DATA >0023
4846 DBC2 FFFE      MOVB R2,@>FFFE(R15)
484A 0602           DEC  R2
484C 16FC           JNE  >4846
484E 1010           JMP  >4870
4850 C169 0056      MOV  @>0056(R9),R5
4854 0429 005A      BLWP @>005A(R9)
4858 00A2           DATA >00A2
485A D12F FBFE      MOVB @>FBFE(R15),R4
485E 1101           JLT  >4862
4860 100A           JMP  >4876
4862 0244 7F00      ANDI R4,>7F00
4866 0429 005A      BLWP @>005A(R9)
486A 00A3           DATA >00A3
486C DBC4 FFFE      MOVB R4,@>FFFE(R15)
4870 04C2           CLR  R2
4872 0460 4D40      B    @>4D40
4876 0460 4676      B    @>4676
487A 06A0 4658      BL   @>4658
487E 489A           DATA >489A
4880 06A0           BL   @>4658
4884 4850           DATA >4850
4886 C169 0056      MOV  @>0056(R9),R5
488A 04C6           CLR  R6
488C 0429 005A      BLWP @>005A(R9)
4890 00A3           DATA >00A3
4892 DBC6 FFFE      MOVB R6,@>FFFE(R15)
4896 0460 4CD2      B    @>4CD2
489A C129 0056      MOV  @>0056(R9),R4
489E 0604           DEC  R4
48A0 0429 005A      BLWP @>005A(R9)
48A4 0082           DATA >0082

48A6 D06F FBFE      MOVB @>FBFE(R15),R1
48AA 1101           JLT  >48AE
48AC 1016           JMP  >48DA
48AE 0241 7F00      ANDI R1,>7F00
48B2 0429 005A      BLWP @>005A(R9)
48B6 0083           DATA >0083
48B8 DBC1 FFFE      MOVB R1,@>FFFE(R15)
48BC 0224 FFFB      AI   R4,>FFFB
48C0 0429 005A      BLWP @>005A(R9)
48C4 0082           DATA >0082
48C6 D0EF FBFE      MOVB @>FBFE(R15),R3
48CA 06C3           SWPB R3
48CC D0EF FBFE      MOVB @>FBFE(R15),R3
48D0 06C3           SWPB R3
48D2 C1C4           MOV  R4,R7
48D4 0227 0106      AI   R7,>0106
48D8 103A           JMP  >494E
48DA 0460 4676      B    @>4676
48DE C0A9 0056      MOV  @>0056(R9),R2
48E2 0222 000C      AI   R2,>000C
48E6 0429 005A      BLWP @>005A(R9)
48EA 0042           DATA >0042
48EC D02F FBFE      MOVB @>FBFE(R15),R0
48F0 0240 0800      ANDI R0,>0800
48F4 1303           JEQ  >48FC
48F6 06A0 4C72      BL   @>4C72
48FA 2000           COC  R0,0
48FC C229 0056      MOV  @>0056(R9),R8
4900 0228 001C      AI   R8,>001C
4904 0704           SETO R4
4906 06A0 4EB6      BL   @>4EB6
490A 0228 0003      AI   R8,3
490E C041           MOV  R1,R1
4910 130C           JEQ  >492A
4912 C002           MOV  R2,R0
4914 6084           S    R4,R2
4916 C100           MOV  R0,R4
4918 06A0 4658      BL   @>4658
491C 4FC2           DATA >4FC2
491E C048           MOV  R8,R1
4920 6069 0056      S    @>0056(R9),R1
4924 0281 0100      CI   R1,>0100
4928 16EE           JNE  >4906
492A 0460 4676      B    @>4676
492E 06A0 4B70      BL   @>4B70
4932 000E           DATA >000E
4934 80C0           C    R0,R3
4936 1B03           JH   >493E
4938 06A0 4C72      BL   @>4C72
493C A000           A    R0,R0
493E 06A0 4658      BL   @>4658
4942 4A4E           DATA >4A4E
4944 A101           A    R1,R4
4946 0702           SETO R2
4948 C147           MOV  R7,R5
494A 0460 4D4E      B    @>4D4E
494E 0429 005A      BLWP @>005A(R9)
4952 8100           DATA >8100
4954 06A0 4658      BL   @>4658
4958 4964           DATA >4964
495A 0429 005A      BLWP @>005A(R9)
495E 8101           DATA >8101
4960 04C2           CLR  R2
4962 10F2           JMP  >4948
4964 06A0 4B70      BL   @>4B70
4968 000E           DATA >000E
496A 80C0           C    R0,R3
496C 1B47           JH   >49FC
496E C000           MOV  R0,R0
4970 1301           JEQ  >4974
4972 0600           DEC  R0
4974 C143           MOV  R3,R5
4976 C0C0           MOV  R0,R3
4978 06A0 4658      BL   @>4658
497C 4A4E           DATA >4A4E
497E 0429 005A      BLWP @>005A(R9)
4982 4000           DATA >4000
4984 A044           A    R4,R1
4986 C105           MOV  R5,R4
4988 06A0 4658      BL   @>4658
498C 4EF6           DATA >4EF6
498E C000           MOV  R0,R0
4990 1604           JNE  >499A
4992 C142           MOV  R2,R5
4994 06A0 4A08      BL   @>4A08
4998 101B           JMP  >49D0
499A C041           MOV  R1,R1
499C 1320           JEQ  >49DE
499E 0581           INC  R1
49A0 8040           C    R0,R1
49A2 131C           JEQ  >49DC
49A4 0429 005A      BLWP @>005A(R9)
49A8 4001           DATA >4001
49AA 0429 005A      BLWP @>005A(R9)
49AE A000           DATA >A000
49B0 06A0 4ED2      BL   @>4ED2
49B4 0429 005A      BLWP @>005A(R9)
49B8 A001           DATA >A001
49BA 0228 0003      AI   R8,3
49BE C048           MOV  R8,R1
49C0 6069 0056      S    @>0056(R9),R1
49C4 0281 0100      CI   R1,>0100
49C8 1605           JNE  >49D4
49CA 06A0 4658      BL   @>4658
49CE 4FBC           DATA >4FBC
49D0 0460 4E28      B    @>4E28
49D4 C040           MOV  R0,R1
49D6 0429 005A      BLWP @>005A(R9)
49DA 4000           DATA >4000
49DC 1007           JMP  >49EC
49DE 0429 005A      BLWP @>005A(R9)
49E2 4001           DATA >4001
49E4 0429 005A      BLWP @>005A(R9)
49E8 8000           DATA >8000
49EA 0702           SETO R2
49EC C040           MOV  R0,R1
49EE 0582           INC  R2
49F0 8102           C    R2,R4
49F2 16CA           JNE  >4988
49F4 C144           MOV  R4,R5
49F6 06A0 4A08      BL   @>4A08
49FA 1004           JMP  >4A04
49FC 06A0 4658      BL   @>4658
4A00 4A4E           DATA >4A4E
4A02 A101           A    R1,R4
4A04 0460 4676      B    @>4676
4A08 C28B           MOV  R11,R10
4A0A C101           MOV  R1,R4
4A0C 0429 005A      BLWP @>005A(R9)
4A10 4001           DATA >4001
4A12 C041           MOV  R1,R1
4A14 131B           JEQ  >4A4C
4A16 06A0 4ED2      BL   @>4ED2
4A1A C0A9 0056      MOV  @>0056(R9),R2
4A1E 0429 005A      BLWP @>005A(R9)
4A22 0042           DATA >0042
4A24 D06F FBFE      MOVB @>FBFE(R15),R1
4A28 0261 8000      ORI  R1,>8000
4A2C 0429 005A      BLWP @>005A(R9)
4A30 0043           DATA >0043
4A32 DBC1 FFFE      MOVB R1,@>FFFE(R15)
4A36 0222 000E      AI   R2,>000E
4A3A 0585           INC  R5
4A3C 0429 005A      BLWP @>005A(R9)
4A40 0043           DATA >0043
4A42 DBC5 FFFE      MOVB R5,@>FFFE(R15)
4A46 06C5           SWPB R5
4A48 DBC5 FFFE      MOVB R5,@>FFFE(R15)
4A4C 045A           B    *R10
4A4E C229 0056      MOV  @>0056(R9),R8
4A52 0228 001C      AI   R8,>001C
4A56 C103           MOV  R3,R4
4A58 06A0 4EB6      BL   @>4EB6
4A5C 80C2           C    R2,R3
4A5E 1101           JLT  >4A62
4A60 1006           JMP  >4A6E
4A62 0228 0003      AI   R8,3
4A66 C103           MOV  R3,R4
4A68 6102           S    R2,R4
4A6A 0604           DEC  R4
4A6C 10F5           JMP  >4A58
4A6E 0460 4676      B    @>4676
4A72 06A0 4658      BL   @>4658
4A76 4DA4           DATA >4DA4
4A78 C104           MOV  R4,R4
4A7A 1307           JEQ  >4A8A
4A7C 06A0 4658      BL   @>4658
4A80 4E0C           DATA >4E0C
4A82 C104           MOV  R4,R4
4A84 1313           JEQ  >4AAC
4A86 0460 4676      B    @>4676
4A8A 0581           INC  R1
4A8C CA41 0056      MOV  R1,@>0056(R9)
4A90 06A0 4658      BL   @>4658
4A94 4D34           DATA >4D34
4A96 06A0 4B70      BL   @>4B70
4A9A FFFC           DATA >FFFC
4A9C C0C0           MOV  R0,R3
4A9E C205           MOV  R5,R8
4AA0 06A0 4B76      BL   @>4B76
4AA4 05C8           INCT R8
4AA6 80C0           C    R0,R3
4AA8 16FB           JNE  >4AA0
4AAA 0648           DECT R8
4AAC 0429 005A      BLWP @>005A(R9)
4AB0 0080           DATA >0080
4AB2 06A0 4658      BL   @>4658
4AB6 48DE           DATA >48DE
4AB8 0429           BLWP @>005A(R9)
4ABC 0081           DATA >0081
4ABE 06A0 4ADA      BL   @>4ADA
4AC2 04C2           CLR  R2
4AC4 06A0 4658      BL   @>4658
4AC8 4D36           DATA >4D36
4ACA 06A0 4B70      BL   @>4B70
4ACE FFFC           DATA >FFFC
4AD0 06A0 4658      BL   @>4658
4AD4 4FBC           DATA >4FBC
4AD6 0460 4886      B    @>4886
4ADA C169 0056      MOV  @>0056(R9),R5
4ADE 0225 0100      AI   R5,>0100
4AE2 C0C5           MOV  R5,R3
4AE4 0223 0100      AI   R3,>0100
4AE8 C088           MOV  R8,R2
4AEA 05C2           INCT R2
4AEC 0429 005A      BLWP @>005A(R9)
4AF0 0042           DATA >0042
4AF2 D02F FBFE      MOVB @>FBFE(R15),R0
4AF6 0582           INC  R2
4AF8 0429 005A      BLWP @>005A(R9)
4AFC 0103           DATA >0103
4AFE DBC0 FFFE      MOVB R0,@>FFFE(R15)
4B02 0588           INC  R8
4B04 80C2           C    R2,R3
4B06 16F2           JNE  >4AEC
4B08 045B           RT

4B0A C28B           MOV  R11,R10
4B0C C048           MOV  R8,R1
4B0E 06A0 4B70      BL   @>4B70
4B12 01FC           DATA >01FC
4B14 C000           MOV  R0,R0
4B16 1302           JEQ  >4B1C
4B18 0460 4E28      B    @>4E28
4B1C 0608           DEC  R8
4B1E 0429 005A      BLWP @>005A(R9)
4B22 0102           DATA >0102
4B24 D02F FBFE      MOVB @>FBFE(R15),R0
4B28 05C8           INCT R8
4B2A 0429 005A      BLWP @>005A(R9)
4B2E 0103           DATA >0103
4B30 DBC0 FFFE      MOVB R0,@>FFFE(R15)
4B34 0648           DECT R8
4B36 8048           C    R8,R1
4B38 16F1           JNE  >4B1C
4B3A 045A           B    *R10
4B3C C0A9 0058      MOV  @>0058(R9),R2
4B40 0222 0100      AI   R2,>0100
4B44 0429 005A      BLWP @>005A(R9)
4B48 0022           DATA >0022
4B4A D02F FBFE      MOVB @>FBFE(R15),R0
4B4E 0240 7FFF      ANDI R0,>7FFF
4B52 0429 005A      BLWP @>005A(R9)
4B56 0042           DATA >0042
4B58 D0EF FBFE      MOVB @>FBFE(R15),R3
4B5C 90C0           CB   R0,R3
4B5E 1604           JNE  >4B68
4B60 0581           INC  R1
4B62 0582           INC  R2
4B64 0604           DEC  R4
4B66 16EE           JNE  >4B44
4B68 045B           RT

4B6A C229 0054      MOV  @>0054(R9),R8
4B6E 1002           JMP  >4B74
4B70 C229 0056      MOV  @>0056(R9),R8
4B74 A23B           A    *R11+,R8

4B76 0429 005A      BLWP @>005A(R9)	Set VDP Read address to R8
4B7A 0102           DATA >0102
4B7C D02F FBFE      MOVB @>FBFE(R15),R0	Read word from VDP RAM
4B80 06C0           SWPB R0
4B82 D02F FBFE      MOVB @>FBFE(R15),R0
4B86 0B80           SRC  R0,8
4B88 045B           RT

4B8A C069 0058      MOV  @>0058(R9),R1
4B8E 0221 0100      AI   R1,>0100
4B92 06A0 4C14      BL   @>4C14
4B96 0429 005A      BLWP @>005A(R9)
4B9A 3000           DATA >3000
4B9C C000           MOV  R0,R0
4B9E 1101           JLT  >4BA2
4BA0 1005           JMP  >4BAC
4BA2 C180           MOV  R0,R6
4BA4 0246 0300      ANDI R6,>0300
4BA8 1337           JEQ  >4C18
4BAA 102F           JMP  >4C0A
4BAC 04C6           CLR  R6
4BAE 06A0 4658      BL   @>4658
4BB2 4CD2           DATA >4CD2
4BB4 0226 0100      AI   R6,>0100
4BB8 0707           SETO R7
4BBA 0702           SETO R2
4BBC 04C4           CLR  R4
4BBE 06A0 4658      BL   @>4658
4BC2 4D50           DATA >4D50
4BC4 C1C7           MOV  R7,R7
4BC6 161D           JNE  >4C02
4BC8 0204 000A      LI   R4,10
4BCC C069 0058      MOV  @>0058(R9),R1
4BD0 0429 005A      BLWP @>005A(R9)
4BD4 7000           DATA >7000
4BD6 06A0 4B3C      BL   @>4B3C
4BDA 0429 005A      BLWP @>005A(R9)
4BDE 7001           DATA >7001
4BE0 C104           MOV  R4,R4
4BE2 160F           JNE  >4C02
4BE4 C006           MOV  R6,R0
4BE6 0260 8000      ORI  R0,>8000
4BEA 0429 005A      BLWP @>005A(R9)
4BEE 0063           DATA >0063
4BF0 DBC0 FFFE      MOVB R0,@>FFFE(R15)
4BF4 0605           DEC  R5
4BF6 0429 005A      BLWP @>005A(R9)
4BFA 00A3           DATA >00A3
4BFC DBC6 FFFE      MOVB R6,@>FFFE(R15)
4C00 1004           JMP  >4C0A
4C02 0286 0300      CI   R6,>0300
4C06 16D6           JNE  >4BB4
4C08 1007           JMP  >4C18
4C0A 0429 005A      BLWP @>005A(R9)
4C0E 3001           DATA >3001
4C10 0460 4676      B    @>4676
4C14 0602           DEC  R2
4C16 1B03           JH   >4C1E
4C18 06A0 4C9E      BL   @>4C9E
4C1C E000           DATA >E000
4C1E 0200 2000      LI   R0,>2000
4C22 0429 005A      BLWP @>005A(R9)
4C26 0023           DATA >0023
4C28 0208 000A      LI   R8,10
4C2C DBC0 FFFE      MOVB R0,@>FFFE(R15)
4C30 0608           DEC  R8
4C32 16FC           JNE  >4C2C
4C34 0208 000B      LI   R8,>000B
4C38 0583           INC  R3
4C3A 0429 005A      BLWP @>005A(R9)
4C3E 0062           DATA >0062
4C40 D02F FBFE      MOVB @>FBFE(R15),R0
4C44 13E9           JEQ  >4C18
4C46 1110           JLT  >4C68
4C48 0280 2E00      CI   R0,>2E00
4C4C 130D           JEQ  >4C68
4C4E 0608           DEC  R8
4C50 13E3           JEQ  >4C18
4C52 0280 2000      CI   R0,>2000
4C56 13E0           JEQ  >4C18
4C58 0429 005A      BLWP @>005A(R9)
4C5C 0023           DATA >0023
4C5E DBC0 FFFE      MOVB R0,@>FFFE(R15)
4C62 0581           INC  R1
4C64 0602           DEC  R2
4C66 16E8           JNE  >4C38
4C68 0288 000B      CI   R8,>000B
4C6C 13D5           JEQ  >4C18
4C6E 045B           RT

4C70 AA00 C00B      A    R0,@>C00B(R8)
4C74 C0E9 0056      MOV  @>0056(R9),R3
4C78 0603           DEC  R3
4C7A 0429 005A      BLWP @>005A(R9)
4C7E 0062           DATA >0062
4C80 D0AF FBFE      MOVB @>FBFE(R15),R2
4C84 9802 4C70      CB   R2,@>4C70
4C88 1309           JEQ  >4C9C
4C8A 0429 005A      BLWP @>005A(R9)
4C8E 8000           DATA >8000
4C90 06A0 4658      BL   @>4658
4C94 487A           DATA >487A
4C96 0429 005A      BLWP @>005A(R9)
4C9A 8001           DATA >8001
4C9C C2C0           MOV  R0,R11
4C9E C069 0054      MOV  @>0054(R9),R1
4CA2 130D           JEQ  >4CBE
4CA4 0581           INC  R1
4CA6 0429 005A      BLWP @>005A(R9)
4CAA 0022           DATA >0022
4CAC D0AF FBFE      MOVB @>FBFE(R15),R2
4CB0 E0BB           SOC  *R11+,R2
4CB2 0429 005A      BLWP @>005A(R9)
4CB6 0023           DATA >0023
4CB8 DBC2 FFFE      MOVB R2,@>FFFE(R15)
4CBC 1002           JMP  >4CC2
4CBE CA7B 0050      MOV  *R11+,@>0050(R9)
4CC2 C229 0058      MOV  @>0058(R9),R8
4CC6 0228 FFF4      AI   R8,>FFF4
4CCA CA48 0066      MOV  R8,@>0066(R9)
4CCE 0460 4676      B    @>4676
4CD2 0429 005A      BLWP @>005A(R9)
4CD6 3000           DATA >3000
4CD8 C169 0058      MOV  @>0058(R9),R5
4CDC 0605           DEC  R5
4CDE 0429 005A      BLWP @>005A(R9)
4CE2 00A2           DATA >00A2
4CE4 D0AF FBFE      MOVB @>FBFE(R15),R2
4CE8 C0C2           MOV  R2,R3
4CEA 04C4           CLR  R4
4CEC 0242 0300      ANDI R2,>0300
4CF0 9182           CB   R2,R6
4CF2 131A           JEQ  >4D28
4CF4 C0C3           MOV  R3,R3
4CF6 1101           JLT  >4CFA
4CF8 100A           JMP  >4D0E
4CFA 0429 005A      BLWP @>005A(R9)
4CFE 00A3           DATA >00A3
4D00 DBC4 FFFE      MOVB R4,@>FFFE(R15)
4D04 0585           INC  R5
4D06 06A0 4658      BL   @>4658
4D0A 4D52           DATA >4D52
4D0C 0605           DEC  R5
4D0E 0702           SETO R2
4D10 D086           MOVB R6,R2
4D12 1305           JEQ  >4D1E
4D14 0585           INC  R5
4D16 06A0 4658      BL   @>4658
4D1A 4D50           DATA >4D50
4D1C 0605           DEC  R5
4D1E 0429 005A      BLWP @>005A(R9)
4D22 00A3           DATA >00A3
4D24 DBC6 FFFE      MOVB R6,@>FFFE(R15)
4D28 0585           INC  R5
4D2A 0429 005A      BLWP @>005A(R9)
4D2E 3001           DATA >3001
4D30 0460 4676      B    @>4676
4D34 0702           SETO R2
4D36 0204 0001      LI   R4,1
4D3A 0205 0100      LI   R5,>0100
4D3E 1005           JMP  >4D4A
4D40 06A0 4B70      BL   @>4B70
4D44 FFFC           DATA >FFFC
4D46 C100           MOV  R0,R4
4D48 04C5           CLR  R5
4D4A A169 0056      A    @>0056(R9),R5
4D4E 04C7           CLR  R7
4D50 D086           MOVB R6,R2
4D52 0429 005A      BLWP @>005A(R9)
4D56 FF80           DATA >FF80
4D58 CA44 004A      MOV  R4,@>004A(R9)
4D5C CA42 004C      MOV  R2,@>004C(R9)
4D60 CA45 004E      MOV  R5,@>004E(R9)
4D64 06A0 4658      BL   @>4658
4D68 40E8           DATA >40E8
4D6A 0429 005A      BLWP @>005A(R9)
4D6E FF81           DATA >FF81
4D70 D1E9 0050      MOVB @>0050(R9),R7
4D74 06C7           SWPB R7
4D76 1312           JEQ  >4D9C
4D78 C1C7           MOV  R7,R7
4D7A 1501           JGT  >4D7E
4D7C 100B           JMP  >4D94
4D7E 0247 00FF      ANDI R7,>00FF
4D82 0287 0034      CI   R7,>0034
4D86 1603           JNE  >4D8E
4D88 06A0 4C72      BL   @>4C72
4D8C 2000           COC  R0,0
4D8E 06A0 4C72      BL   @>4C72
4D92 C000           MOV  R0,R0
4D94 DA69 004D 004D MOVB @>004D(R9),@>004D(R9)
4D9A 13F1           JEQ  >4D7E
4D9C 0247 00FF      ANDI R7,>00FF
4DA0 0460 4676      B    @>4676
4DA4 C069 0058      MOV  @>0058(R9),R1
4DA8 0221 0100      AI   R1,>0100
4DAC 0429 005A      BLWP @>005A(R9)
4DB0 0023           DATA >0023
4DB2 DBC6 FFFE      MOVB R6,@>FFFE(R15)
4DB6 0581           INC  R1
4DB8 06A0 4C14      BL   @>4C14
4DBC C082           MOV  R2,R2
4DBE 1302           JEQ  >4DC4
4DC0 0460 4C18      B    @>4C18
4DC4 C069 0056      MOV  @>0056(R9),R1
4DC8 0221 0003      AI   R1,3
4DCC 0429 005A      BLWP @>005A(R9)
4DD0 0022           DATA >0022
4DD2 D0AF FBFE      MOVB @>FBFE(R15),R2
4DD6 0982           SRL  R2,8
4DD8 C0C2           MOV  R2,R3
4DDA 0221 0006      AI   R1,6
4DDE 0204 000B      LI   R4,11
4DE2 0429 005A      BLWP @>005A(R9)
4DE6 7000           DATA >7000
4DE8 06A0 4B3C      BL   @>4B3C
4DEC 0429 005A      BLWP @>005A(R9)
4DF0 7001           DATA >7001
4DF2 C104           MOV  R4,R4
4DF4 1304           JEQ  >4DFE
4DF6 0221 0206      AI   R1,>0206
4DFA 0602           DEC  R2
4DFC 16F0           JNE  >4DDE
4DFE 0460 4676      B    @>4676
4E02 06A0 4658      BL   @>4658
4E06 4DA4           DATA >4DA4
4E08 C104           MOV  R4,R4
4E0A 13DA           JEQ  >4DC0
4E0C C169 0056      MOV  @>0056(R9),R5
4E10 0225 000A      AI   R5,10
4E14 0429 005A      BLWP @>005A(R9)
4E18 00A2           DATA >00A2
4E1A D0AF FBFE      MOVB @>FBFE(R15),R2
4E1E 1307           JEQ  >4E2E
4E20 0225 0206      AI   R5,>0206
4E24 0603           DEC  R3
4E26 16F6           JNE  >4E14
4E28 06A0 4C72      BL   @>4C72
4E2C 8000           C    R0,R0
4E2E CA45 0056      MOV  R5,@>0056(R9)
4E32 06A0 4658      BL   @>4658
4E36 4D34           DATA >4D34
4E38 C229 0056      MOV  @>0056(R9),R8
4E3C 0228 017E      AI   R8,>017E
4E40 0202 0040      LI   R2,>0040
4E44 0704           SETO R4
4E46 06A0 4B76      BL   @>4B76
4E4A C000           MOV  R0,R0
4E4C 132E           JEQ  >4EAA
4E4E 0429 005A      BLWP @>005A(R9)
4E52 2000           DATA >2000
4E54 0702           SETO R2
4E56 06A0 4658      BL   @>4658
4E5A 4D46           DATA >4D46
4E5C C045           MOV  R5,R1
4E5E 0225 FFFC      AI   R5,>FFFC
4E62 0429 005A      BLWP @>005A(R9)
4E66 00A3           DATA >00A3
4E68 DBC4 FFFE      MOVB R4,@>FFFE(R15)
4E6C 06C4           SWPB R4
4E6E DBC4 FFFE      MOVB R4,@>FFFE(R15)
4E72 C141           MOV  R1,R5
4E74 0601           DEC  R1
4E76 0429 005A      BLWP @>005A(R9)
4E7A 0023           DATA >0023
4E7C DBC6 FFFE      MOVB R6,@>FFFE(R15)
4E80 0204 000B      LI   R4,>000B
4E84 06A0 4B3C      BL   @>4B3C
4E88 0429 005A      BLWP @>005A(R9)
4E8C 2001           DATA >2001
4E8E 130B           JEQ  >4EA6
4E90 0429 005A      BLWP @>005A(R9)
4E94 00A3           DATA >00A3
4E96 DBC4 FFFE      MOVB R4,@>FFFE(R15)
4E9A 80C0           C    R0,R3
4E9C 1B06           JH   >4EAA
4E9E A202           A    R2,R8
4EA0 C082           MOV  R2,R2
4EA2 1606           JNE  >4EB0
4EA4 05C8           INCT R8
4EA6 0460 4676      B    @>4676
4EAA 6202           S    R2,R8
4EAC C082           MOV  R2,R2
4EAE 13FB           JEQ  >4EA6
4EB0 0922           SRL  R2,2
4EB2 A082           A    R2,R2
4EB4 10C7           JMP  >4E44
4EB6 C28B           MOV  R11,R10
4EB8 06A0 4B76      BL   @>4B76
4EBC 06C0           SWPB R0
4EBE D0AF FBFE      MOVB @>FBFE(R15),R2
4EC2 C040           MOV  R0,R1
4EC4 0241 0FFF      ANDI R1,>0FFF
4EC8 4001           SZC  R1,R0
4ECA 0982           SRL  R2,8
4ECC E080           SOC  R0,R2
4ECE 0BC2           SRC  R2,12
4ED0 045A           B    *R10
4ED2 0B42           SRC  R2,4
4ED4 C002           MOV  R2,R0
4ED6 0240 F000      ANDI R0,>F000
4EDA E040           SOC  R0,R1
4EDC 0429 005A      BLWP @>005A(R9)
4EE0 0103           DATA >0103
4EE2 06C1           SWPB R1
4EE4 DBC1 FFFE      MOVB R1,@>FFFE(R15)
4EE8 06C1           SWPB R1
4EEA DBC1 FFFE      MOVB R1,@>FFFE(R15)
4EEE 06C2           SWPB R2
4EF0 DBC2 FFFE      MOVB R2,@>FFFE(R15)
4EF4 045B           RT

4EF6 0429 005A      BLWP @>005A(R9)
4EFA 7800           DATA >7800
4EFC 06A0 4658      BL   @>4658
4F00 4CD2           DATA >4CD2
4F02 C041           MOV  R1,R1
4F04 1602           JNE  >4F0A
4F06 0201 0021      LI   R1,>0021
4F0A 0581           INC  R1
4F0C C001           MOV  R1,R0
4F0E 0931           SRL  R1,3
4F10 0202 00FF      LI   R2,>00FF
4F14 0240 0007      ANDI R0,>0007
4F18 1301           JEQ  >4F1C
4F1A 0A02           SLA  R2,0
4F1C C0C1           MOV  R1,R3
4F1E A0C5           A    R5,R3
4F20 0223 0038      AI   R3,>0038
4F24 0281 00C8      CI   R1,>00C8
4F28 1101           JLT  >4F2C
4F2A 04C1           CLR  R1
4F2C A045           A    R5,R1
4F2E 0221 0038      AI   R1,>0038
4F32 0429 005A      BLWP @>005A(R9)
4F36 0022           DATA >0022
4F38 0700           SETO R0
4F3A D02F FBFE      MOVB @>FBFE(R15),R0
4F3E C100           MOV  R0,R4
4F40 E002           SOC  R2,R0
4F42 04C2           CLR  R2
4F44 0580           INC  R0
4F46 1610           JNE  >4F68
4F48 0581           INC  R1
4F4A C001           MOV  R1,R0
4F4C 0220 FF00      AI   R0,>FF00
4F50 8140           C    R0,R5
4F52 1605           JNE  >4F5E
4F54 0221 FF38      AI   R1,>FF38
4F58 0429 005A      BLWP @>005A(R9)
4F5C 0022           DATA >0022
4F5E 80C1           C    R1,R3
4F60 16EB           JNE  >4F38
4F62 C004           MOV  R4,R0
4F64 0580           INC  R0
4F66 1325           JEQ  >4FB2
4F68 0600           DEC  R0
4F6A C080           MOV  R0,R2
4F6C 04C0           CLR  R0
4F6E 06C2           SWPB R2
4F70 0580           INC  R0
4F72 0B12           SRC  R2,1
4F74 18FD           JOC  >4F70
4F76 0202 0080      LI   R2,>0080
4F7A 0A02           SLA  R2,0
4F7C 0600           DEC  R0
4F7E E102           SOC  R2,R4
4F80 0429 005A      BLWP @>005A(R9)
4F84 0023           DATA >0023
4F86 DBC4 FFFE      MOVB R4,@>FFFE(R15)
4F8A 0221 FFC8      AI   R1,>FFC8
4F8E 6045           S    R5,R1
4F90 0A31           SLA  R1,3
4F92 E040           SOC  R0,R1
4F94 C001           MOV  R1,R0
4F96 0605           DEC  R5
4F98 0429 005A      BLWP @>005A(R9)
4F9C 00A2           DATA >00A2
4F9E D06F FBFE      MOVB @>FBFE(R15),R1
4FA2 0261 8000      ORI  R1,>8000
4FA6 0429 005A      BLWP @>005A(R9)
4FAA 00A3           DATA >00A3
4FAC DBC1 FFFE      MOVB R1,@>FFFE(R15)
4FB0 0585           INC  R5
4FB2 0429 005A      BLWP @>005A(R9)
4FB6 7801           DATA >7801
4FB8 0460 4676      B    @>4676
4FBC C040           MOV  R0,R1
4FBE 0202 0001      LI   R2,1
4FC2 0429 005A      BLWP @>005A(R9)
4FC6 7800           DATA >7800
4FC8 06A0 4658      BL   @>4658
4FCC 4CD2           DATA >4CD2
4FCE C001           MOV  R1,R0
4FD0 0240 0007      ANDI R0,>0007
4FD4 0931           SRL  R1,3
4FD6 A045           A    R5,R1
4FD8 0221 0038      AI   R1,>0038
4FDC C0C0           MOV  R0,R3
4FDE 0500           NEG  R0
4FE0 0220 0008      AI   R0,8
4FE4 0204 00FF      LI   R4,>00FF
4FE8 8002           C    R2,R0
4FEA 1101           JLT  >4FEE
4FEC 100B           JMP  >5004
4FEE 0200 0008      LI   R0,8
4FF2 6002           S    R2,R0
4FF4 0B04           SRC  R4,0
4FF6 C003           MOV  R3,R0
4FF8 1301           JEQ  >4FFC
4FFA 0A04           SLA  R4,0
4FFC 1001           JMP  >5000
4FFE 0939           SRL  R9,3
5000 06C4           SWPB R4
5002 1019           JMP  >5036
5004 0B04           SRC  R4,0
5006 6080           S    R0,R2
5008 0429 005A      BLWP @>005A(R9)
500C 0022           DATA >0022
500E D02F FBFE      MOVB @>FBFE(R15),R0
5012 4004           SZC  R4,R0
5014 0429 005A      BLWP @>005A(R9)
5018 0023           DATA >0023
501A DBC0 FFFE      MOVB R0,@>FFFE(R15)
501E 0204 FF00      LI   R4,>FF00
5022 0581           INC  R1
5024 0200 0008      LI   R0,8
5028 8002           C    R2,R0
502A 1101           JLT  >502E
502C 10EC           JMP  >5006
502E C002           MOV  R2,R0
5030 0204 00FF      LI   R4,>00FF
5034 0A04           SLA  R4,0
5036 0429 005A      BLWP @>005A(R9)
503A 0022           DATA >0022
503C D02F FBFE      MOVB @>FBFE(R15),R0
5040 4004           SZC  R4,R0
5042 0429 005A      BLWP @>005A(R9)
5046 0023           DATA >0023
5048 DBC0 FFFE      MOVB R0,@>FFFE(R15)
504C 10A4           JMP  >4F96
504E C1CB           MOV  R11,R7
5050 06A0 4724      BL   @>4724
5054 06A0 4658      BL   @>4658
5058 4B8A           DATA >4B8A
505A 100B           JMP  >5072           - CHECK

* Device service routine entry point.  R6 contains the
* drive number.

505C 0206 0100      LI   R6,>0100
5060 1005           JMP  >506C
5062 0206 0200      LI   R6,>0200
5066 1002           JMP  >506C
5068 0206 0300      LI   R6,>0300

506C C1CB           MOV  R11,R7		Save return address
506E 06A0 4724      BL   @>4724
5072 C029 0054      MOV  @>0054(R9),R0	R0 points to device name length
5076 0429 005A      BLWP @>005A(R9)	Set VDP read address to R0
507A 0002           DATA >0002
507C D06F FBFE      MOVB @>FBFE(R15),R1	Read filename length
5080 0981           SRL  R1,8
5082 0281 0009      CI   R1,9		See if filename length is too large
5086 1B19           JH   >50BA
5088 0282 0001      CI   R2,1
508C 1605           JNE  >5098
508E 0221 000A      AI   R1,10
5092 0281 000C      CI   R1,12
5096 1B11           JH   >50BA
5098 A041           A    R1,R1
509A C061 50A0      MOV  @>50A0(R1),R1
509E 0451           B    *R1
50A0 50C0           DATA >50C0        I/O Op Code 0  - Open
50A2 52D2           DATA >52D2        I/O Op Code 1  - Close
50A4 52DC           DATA >52DC        I/O Op Code 2  - Read
50A6 53C6           DATA >53C6        I/O Op Code 3  - Write
50A8 567A           DATA >567A        I/O Op Code 4
50AA 56CE           DATA >56CE        I/O Op Code 5
50AC 5770           DATA >5770        I/O Op Code 6
50AE 4A72           DATA >4A72        I/O Op Code 7
50B0 4C9E           DATA >4C9E        I/O Op Code 8
50B2 57F4           DATA >57F4        I/O Op Code 9
50B4 58B4           DATA >58B4        I/O Op Code 10 - Open catalog
50B6 5912           DATA >5912        I/O Op Code 11 - Close catalog
50B8 5928           DATA >5928        I/O Op Code 12 - Read catalog

50BA 06A0 4C72      BL   @>4C72
50BE 6000           DATA >6000
50C0 04C0           CLR  R0
50C2 D02F FBFE      MOVB @>FBFE(R15),R0
50C6 0429 005A      BLWP @>005A(R9)
50CA 8000           DATA >8000
50CC 0240 1600      ANDI R0,>1600
50D0 0280 0600      CI   R0,>0600
50D4 1603           JNE  >50DC
50D6 06A0 4C72      BL   @>4C72
50DA 4000           DATA >4000
50DC 120A           JLE  >50F2
50DE C040           MOV  R0,R1
50E0 06A0 4B6A      BL   @>4B6A
50E4 0004           DATA >0004
50E6 0280 FF00      CI   R0,>FF00
50EA 14F5           JHE  >50D6
50EC C001           MOV  R1,R0
50EE 0240 0600      ANDI R0,>0600
50F2 0280 0200      CI   R0,>0200
50F6 1657           JNE  >51A6
50F8 06A0 4658      BL   @>4658
50FC 4798           DATA >4798
50FE 06A0 5280      BL   @>5280
5102 0429 005A      BLWP @>005A(R9)
5106 0083           DATA >0083
5108 DBC2 FFFE      MOVB R2,@>FFFE(R15)
510C C0E9 0054      MOV  @>0054(R9),R3
5110 0223 0004      AI   R3,4
5114 04C5           CLR  R5
5116 0429 005A      BLWP @>005A(R9)
511A 0062           DATA >0062
511C D16F FBFE      MOVB @>FBFE(R15),R5
5120 1607           JNE  >5130
5122 0205 5000      LI   R5,>5000
5126 0429 005A      BLWP @>005A(R9)
512A 0063           DATA >0063
512C DBC5 FFFE      MOVB R5,@>FFFE(R15)
5130 0224 0005      AI   R4,5
5134 0429 005A      BLWP @>005A(R9)
5138 0083           DATA >0083
513A DBC5 FFFE      MOVB R5,@>FFFE(R15)
513E 0201 0100      LI   R1,>0100
5142 C082           MOV  R2,R2
5144 1101           JLT  >5148
5146 1002           JMP  >514C
5148 A141           A    R1,R5
514A 0601           DEC  R1
514C 06C5           SWPB R5
514E 04C0           CLR  R0
5150 3C05           DIV  R5,0
5152 0224 FFFC      AI   R4,>FFFC
5156 C040           MOV  R0,R1
5158 06C0           SWPB R0
515A 0429 005A      BLWP @>005A(R9)
515E 0083           DATA >0083
5160 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5164 C229 0056      MOV  @>0056(R9),R8
5168 0429 005A      BLWP @>005A(R9)
516C 0102           DATA >0102
516E D02F FBFE      MOVB @>FBFE(R15),R0
5172 0260 8000      ORI  R0,>8000
5176 0429 005A      BLWP @>005A(R9)
517A 0103           DATA >0103
517C DBC0 FFFE      MOVB R0,@>FFFE(R15)
5180 0429 005A      BLWP @>005A(R9)
5184 8001           DATA >8001
5186 06A0 4B6A      BL   @>4B6A
518A 0006           DATA >0006
518C C100           MOV  R0,R4
518E 1309           JEQ  >51A2
5190 11A2           JLT  >50D6
5192 A101           A    R1,R4
5194 0604           DEC  R4
5196 04C3           CLR  R3
5198 3CC1           DIV  R1,3
519A 0603           DEC  R3
519C 06A0 4658      BL   @>4658
51A0 4964           DATA >4964
51A2 0460 56A8      B    @>56A8
51A6 0429 005A      BLWP @>005A(R9)
51AA 8000           DATA >8000
51AC 06A0 4658      BL   @>4658
51B0 4E02           DATA >4E02
51B2 0429 005A      BLWP @>005A(R9)
51B6 8001           DATA >8001
51B8 C104           MOV  R4,R4
51BA 1309           JEQ  >51CE
51BC 0280 0400      CI   R0,>0400
51C0 1304           JEQ  >51CA
51C2 06A0 4658      BL   @>4658
51C6 47AA           DATA >47AA
51C8 109A           JMP  >50C2               -- CHECK
51CA 0460 50D6      B    @>50D6
51CE C1C0           MOV  R0,R7
51D0 06A0 5280      BL   @>5280
51D4 0429 005A      BLWP @>005A(R9)
51D8 0082           DATA >0082
51DA D02F FBFE      MOVB @>FBFE(R15),R0
51DE C0C0           MOV  R0,R3
51E0 0243 0800      ANDI R3,>0800
51E4 1306           JEQ  >51F2
51E6 0287 0400      CI   R7,>0400
51EA 1303           JEQ  >51F2
51EC 06A0 4C72      BL   @>4C72
51F0 2000           COC  R0,0
51F2 0240 8300      ANDI R0,>8300
51F6 2802           XOR  R2,0
51F8 16E8           JNE  >51CA
51FA C0E9 0054      MOV  @>0054(R9),R3
51FE 0223 0004      AI   R3,4
5202 0224 0005      AI   R4,5
5206 0429 005A      BLWP @>005A(R9)
520A 0082           DATA >0082
520C D02F FBFE      MOVB @>FBFE(R15),R0
5210 0429 005A      BLWP @>005A(R9)
5214 0062           DATA >0062
5216 D0AF FBFE      MOVB @>FBFE(R15),R2
521A 1302           JEQ  >5220
521C 9080           CB   R0,R2
521E 16D5           JNE  >51CA
5220 0429 005A      BLWP @>005A(R9)
5224 0063           DATA >0063
5226 DBC0 FFFE      MOVB R0,@>FFFE(R15)
522A 0429 005A      BLWP @>005A(R9)
522E 8001           DATA >8001
5230 0240 0600      ANDI R0,>0600
5234 04C2           CLR  R2
5236 0703           SETO R3
5238 0280 0600      CI   R0,>0600
523C 161D           JNE  >5278
523E C129 0056      MOV  @>0056(R9),R4
5242 C1C4           MOV  R4,R7
5244 0224 000E      AI   R4,>000E
5248 0429 005A      BLWP @>005A(R9)
524C 0082           DATA >0082
524E D0EF FBFE      MOVB @>FBFE(R15),R3
5252 06C3           SWPB R3
5254 D0EF FBFE      MOVB @>FBFE(R15),R3
5258 06C3           SWPB R3
525A D0AF FBFE      MOVB @>FBFE(R15),R2
525E 0603           DEC  R3
5260 110B           JLT  >5278
5262 0429 005A      BLWP @>005A(R9)
5266 3000           DATA >3000
5268 0227 0100      AI   R7,>0100
526C 06A0 4658      BL   @>4658
5270 492E           DATA >492E
5272 0429 005A      BLWP @>005A(R9)
5276 3001           DATA >3001
5278 06A0 52AA      BL   @>52AA
527C 0460 4676      B    @>4676
5280 0429 005A      BLWP @>005A(R9)
5284 8001           DATA >8001
5286 0429 005A      BLWP @>005A(R9)
528A 8000           DATA >8000
528C 0202 0002      LI   R2,2
5290 C129 0056      MOV  @>0056(R9),R4
5294 0A40           SLA  R0,4
5296 1703           JNC  >529E
5298 0202 0082      LI   R2,>0082
529C C000           MOV  R0,R0
529E 1101           JLT  >52A2
52A0 0642           DECT R2
52A2 0224 000C      AI   R4,>000C
52A6 06C2           SWPB R2
52A8 045B           RT

52AA C129 0056      MOV  @>0056(R9),R4
52AE 0224 FFFA      AI   R4,>FFFA
52B2 0429 005A      BLWP @>005A(R9)
52B6 0083           DATA >0083
52B8 DBC3 FFFE      MOVB R3,@>FFFE(R15)
52BC 06C3           SWPB R3
52BE DBC3 FFFE      MOVB R3,@>FFFE(R15)
52C2 0224 0004      AI   R4,4
52C6 0429 005A      BLWP @>005A(R9)
52CA 0083           DATA >0083
52CC DBC2 FFFE      MOVB R2,@>FFFE(R15)
52D0 045B           RT

* Read I/O op code

52D2 06A0 4658      BL   @>4658
52D6 54D0           DATA >54D0
52D8 0460 487A      B    @>487A
52DC 06A0 4658      BL   @>4658
52E0 54D0           DATA >54D0
52E2 0240 0200      ANDI R0,>0200
52E6 1302           JEQ  >52EC
52E8 0460 50BA      B    @>50BA
52EC 06A0 54FC      BL   @>54FC
52F0 110A           JLT  >5306
52F2 06A0 5510      BL   @>5510
52F6 1A03           JL   >52FE
52F8 06A0 4C72      BL   @>4C72
52FC A000           A    R0,R0
52FE 06A0 4658      BL   @>4658
5302 5576           DATA >5576
5304 1011           JMP  >5328
5306 06A0 4658      BL   @>4658
530A 5362           DATA >5362
530C 10F5           JMP  >52F8        -- CHECK 
530E 0582           INC  R2
5310 A004           A    R4,R0
5312 0580           INC  R0
5314 C169 0056      MOV  @>0056(R9),R5
5318 0645           DECT R5
531A 06C0           SWPB R0
531C 0429 005A      BLWP @>005A(R9)
5320 00A3           DATA >00A3
5322 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5326 C004           MOV  R4,R0
5328 C129 0054      MOV  @>0054(R9),R4
532C 0224 0005      AI   R4,5
5330 06C0           SWPB R0
5332 0429 005A      BLWP @>005A(R9)
5336 0083           DATA >0083
5338 DBC0 FFFE      MOVB R0,@>FFFE(R15)
533C 06C0           SWPB R0
533E C000           MOV  R0,R0
5340 130E           JEQ  >535E
5342 0429 005A      BLWP @>005A(R9)
5346 0042           DATA >0042
5348 D0EF FBFE      MOVB @>FBFE(R15),R3
534C 0582           INC  R2
534E 0429 005A      BLWP @>005A(R9)
5352 0023           DATA >0023
5354 DBC3 FFFE      MOVB R3,@>FFFE(R15)
5358 0581           INC  R1
535A 0600           DEC  R0
535C 16F2           JNE  >5342
535E 0460 4676      B    @>4676
5362 06A0 5650      BL   @>5650
5366 C0C3           MOV  R3,R3
5368 1101           JLT  >536C
536A 1012           JMP  >5390
536C C003           MOV  R3,R0
536E 0580           INC  R0
5370 8080           C    R0,R2
5372 13F5           JEQ  >535E
5374 06A0 4658      BL   @>4658
5378 489A           DATA >489A
537A C0C0           MOV  R0,R3
537C 04C5           CLR  R5
537E 06A0 55EE      BL   @>55EE
5382 0227 0100      AI   R7,>0100
5386 06A0 4658      BL   @>4658
538A 492E           DATA >492E
538C 04C0           CLR  R0
538E 1004           JMP  >5398          -- CHECK
5390 C000           MOV  R0,R0
5392 1602           JNE  >5398
5394 8080           C    R0,R2
5396 13E3           JEQ  >535E
5398 C080           MOV  R0,R2
539A 06A0 4658      BL   @>4658
539E 55CA           DATA >55CA
53A0 0429 005A      BLWP @>005A(R9)
53A4 0042           DATA >0042
53A6 D12F FBFE      MOVB @>FBFE(R15),R4
53AA 0984           SRL  R4,8
53AC C000           MOV  R0,R0
53AE 1306           JEQ  >53BC
53B0 0284 00FF      CI   R4,>00FF
53B4 1603           JNE  >53BC
53B6 06A0 5650      BL   @>5650
53BA 10D8           JMP  >536C
53BC 0429 005A      BLWP @>005A(R9)
53C0 0011           DATA >0011
53C2 05CB           INCT R11
53C4 045B           RT

53C6 06A0 4658      BL   @>4658
53CA 54D0           DATA >54D0
53CC 0240 0600      ANDI R0,>0600
53D0 0280 0400      CI   R0,>0400
53D4 1389           JEQ  >52E8
53D6 06A0 54FC      BL   @>54FC
53DA 1113           JLT  >5402
53DC 06A0 5510      BL   @>5510
53E0 1A0C           JL   >53FA
53E2 0429 005A      BLWP @>005A(R9)
53E6 D800           DATA >D800
53E8 C0C0           MOV  R0,R3
53EA 06A0 4658      BL   @>4658
53EE 4964           DATA >4964
53F0 0429 005A      BLWP @>005A(R9)
53F4 D801           DATA >D801
53F6 06A0 561A      BL   @>561A
53FA 06A0 4658      BL   @>4658
53FE 5576           DATA >5576
5400 1053           JMP  >54A8
5402 06A0 5650      BL   @>5650
5406 C0C3           MOV  R3,R3
5408 1101           JLT  >540C
540A 100B           JMP  >5422
540C 0429 005A      BLWP @>005A(R9)
5410 3000           DATA >3000
5412 06A0 4658      BL   @>4658
5416 489A           DATA >489A
5418 0429 005A      BLWP @>005A(R9)
541C 3001           DATA >3001
541E 0583           INC  R3
5420 04C0           CLR  R0
5422 8083           C    R3,R2
5424 1609           JNE  >5438
5426 0429 005A      BLWP @>005A(R9)
542A 9000           DATA >9000
542C 06A0 4658      BL   @>4658
5430 4964           DATA >4964
5432 0429 005A      BLWP @>005A(R9)
5436 9001           DATA >9001
5438 C169 0054      MOV  @>0054(R9),R5
543C 0225 0005      AI   R5,5
5440 0429 005A      BLWP @>005A(R9)
5444 00A2           DATA >00A2
5446 D12F FBFE      MOVB @>FBFE(R15),R4
544A 0984           SRL  R4,8
544C C144           MOV  R4,R5
544E A140           A    R0,R5
5450 0585           INC  R5
5452 0285 00FF      CI   R5,>00FF
5456 1BDA           JH   >540C
5458 0702           SETO R2
545A C069 0056      MOV  @>0056(R9),R1
545E A045           A    R5,R1
5460 0221 0100      AI   R1,>0100
5464 0429 005A      BLWP @>005A(R9)
5468 0023           DATA >0023
546A DBC2 FFFE      MOVB R2,@>FFFE(R15)
546E 0429 005A      BLWP @>005A(R9)
5472 8000           DATA >8000
5474 C003           MOV  R3,R0
5476 06A0 55EE      BL   @>55EE
547A 0221 0012      AI   R1,>0012
547E 0429 005A      BLWP @>005A(R9)
5482 0023           DATA >0023
5484 DBC5 FFFE      MOVB R5,@>FFFE(R15)
5488 06A0 561A      BL   @>561A
548C 0429 005A      BLWP @>005A(R9)
5490 2001           DATA >2001
5492 C004           MOV  R4,R0
5494 06A0 4658      BL   @>4658
5498 55CA           DATA >55CA
549A 06C4           SWPB R4
549C 0429 005A      BLWP @>005A(R9)
54A0 0043           DATA >0043
54A2 DBC4 FFFE      MOVB R4,@>FFFE(R15)
54A6 0582           INC  R2
54A8 C0C2           MOV  R2,R3
54AA C081           MOV  R1,R2
54AC C043           MOV  R3,R1
54AE C129 0056      MOV  @>0056(R9),R4
54B2 0604           DEC  R4
54B4 0429 005A      BLWP @>005A(R9)
54B8 0082           DATA >0082
54BA D16F FBFE      MOVB @>FBFE(R15),R5
54BE 0265 8000      ORI  R5,>8000
54C2 0429 005A      BLWP @>005A(R9)
54C6 0083           DATA >0083
54C8 DBC5 FFFE      MOVB R5,@>FFFE(R15)
54CC 0460 533E      B    @>533E
54D0 06A0 4658      BL   @>4658
54D4 4DA4           DATA >4DA4
54D6 C104           MOV  R4,R4
54D8 1303           JEQ  >54E0
54DA 06A0 4C72      BL   @>4C72
54DE E000           DATA >E000
54E0 0581           INC  R1
54E2 CA41 0056      MOV  R1,@>0056(R9)
54E6 C129 0054      MOV  @>0054(R9),R4
54EA 0584           INC  R4
54EC 04C0           CLR  R0
54EE 0429 005A      BLWP @>005A(R9)
54F2 0082           DATA >0082
54F4 D02F FBFE      MOVB @>FBFE(R15),R0
54F8 0460 4676      B    @>4676
54FC C129 0056      MOV  @>0056(R9),R4
5500 0224 000C      AI   R4,>000C
5504 0429 005A      BLWP @>005A(R9)
5508 0082           DATA >0082
550A D02F FBFE      MOVB @>FBFE(R15),R0
550E 045B           RT

5510 D16F FBFE      MOVB @>FBFE(R15),R5
5514 0985           SRL  R5,8
5516 1602           JNE  >551C
5518 0205 0100      LI   R5,>0100
551C C0E9 0054      MOV  @>0054(R9),R3
5520 0223 0006      AI   R3,6
5524 0429 005A      BLWP @>005A(R9)
5528 0062           DATA >0062
552A D06F FBFE      MOVB @>FBFE(R15),R1
552E 06C1           SWPB R1
5530 D06F FBFE      MOVB @>FBFE(R15),R1
5534 06C1           SWPB R1
5536 C001           MOV  R1,R0
5538 1101           JLT  >553C
553A 1003           JMP  >5542
553C 06A0 4C72      BL   @>4C72
5540 8000           C    R0,R0
5542 0580           INC  R0
5544 0429 005A      BLWP @>005A(R9)
5548 0063           DATA >0063
554A DBC0 FFFE      MOVB R0,@>FFFE(R15)
554E 06C0           SWPB R0
5550 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5554 04C0           CLR  R0
5556 C0C1           MOV  R1,R3
5558 3C05           DIV  R5,0
555A C0A9 0056      MOV  @>0056(R9),R2
555E 0222 0012      AI   R2,>0012
5562 0429 005A      BLWP @>005A(R9)
5566 0042           DATA >0042
5568 D0AF FBFE      MOVB @>FBFE(R15),R2
556C 06C2           SWPB R2
556E D0AF FBFE      MOVB @>FBFE(R15),R2
5572 8083           C    R3,R2
5574 045B           RT

5576 0429 005A      BLWP @>005A(R9)
557A 4000           DATA >4000
557C 0224 FFEE      AI   R4,>FFEE
5580 0429 005A      BLWP @>005A(R9)
5584 0082           DATA >0082
5586 D16F FBFE      MOVB @>FBFE(R15),R5
558A 06C5           SWPB R5
558C D16F FBFE      MOVB @>FBFE(R15),R5
5590 0B85           SRC  R5,8
5592 1105           JLT  >559E
5594 8005           C    R5,R0
5596 130B           JEQ  >55AE
5598 06A0 4658      BL   @>4658
559C 489A           DATA >489A
559E C0C0           MOV  R0,R3
55A0 06A0 55EE      BL   @>55EE
55A4 0227 0100      AI   R7,>0100
55A8 06A0 4658      BL   @>4658
55AC 492E           DATA >492E
55AE 0429 005A      BLWP @>005A(R9)
55B2 4001           DATA >4001
55B4 C0E9 0056      MOV  @>0056(R9),R3
55B8 0223 0011      AI   R3,>0011
55BC 0429 005A      BLWP @>005A(R9)
55C0 0062           DATA >0062
55C2 D02F FBFE      MOVB @>FBFE(R15),R0
55C6 0980           SRL  R0,8
55C8 3840           MPY  R0,1
55CA A0A9 0056      A    @>0056(R9),R2
55CE 0222 0100      AI   R2,>0100
55D2 C0E9 0054      MOV  @>0054(R9),R3
55D6 05C3           INCT R3
55D8 0429 005A      BLWP @>005A(R9)
55DC 0062           DATA >0062
55DE D06F FBFE      MOVB @>FBFE(R15),R1
55E2 06C1           SWPB R1
55E4 D06F FBFE      MOVB @>FBFE(R15),R1
55E8 06C1           SWPB R1
55EA 0460 4676      B    @>4676
55EE C1E9 0056      MOV  @>0056(R9),R7
55F2 C047           MOV  R7,R1
55F4 0221 FFFA      AI   R1,>FFFA
55F8 0429 005A      BLWP @>005A(R9)
55FC 0023           DATA >0023
55FE DBC0 FFFE      MOVB R0,@>FFFE(R15)
5602 06C0           SWPB R0
5604 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5608 0221 0004      AI   R1,4
560C 06C5           SWPB R5
560E 0429 005A      BLWP @>005A(R9)
5612 0023           DATA >0023
5614 DBC5 FFFE      MOVB R5,@>FFFE(R15)
5618 045B           RT

561A C0A9 0056      MOV  @>0056(R9),R2
561E 0429 005A      BLWP @>005A(R9)
5622 0042           DATA >0042
5624 D2AF FBFE      MOVB @>FBFE(R15),R10
5628 026A 8000      ORI  R10,>8000
562C 0429 005A      BLWP @>005A(R9)
5630 0043           DATA >0043
5632 DBCA FFFE      MOVB R10,@>FFFE(R15)
5636 0222 0012      AI   R2,>0012
563A 0583           INC  R3
563C 0429 005A      BLWP @>005A(R9)
5640 0043           DATA >0043
5642 06C3           SWPB R3
5644 DBC3 FFFE      MOVB R3,@>FFFE(R15)
5648 06C3           SWPB R3
564A DBC3 FFFE      MOVB R3,@>FFFE(R15)
564E 045B           RT

5650 C229 0056      MOV  @>0056(R9),R8
5654 C108           MOV  R8,R4
5656 0224 0100      AI   R4,>0100
565A 0648           DECT R8
565C 0429 005A      BLWP @>005A(R9)
5660 0102           DATA >0102
5662 D0AF FBFE      MOVB @>FBFE(R15),R2
5666 0982           SRL  R2,8
5668 C28B           MOV  R11,R10
566A 06A0 4B74      BL   @>4B74
566E FFFC           DATA >FFFC
5670 C0C0           MOV  R0,R3
5672 C2CA           MOV  R10,R11
5674 C002           MOV  R2,R0
5676 0460 555A      B    @>555A
567A 06A0 4658      BL   @>4658
567E 54D0           DATA >54D0
5680 0429 005A      BLWP @>005A(R9)
5684 8000           DATA >8000
5686 0240 0600      ANDI R0,>0600
568A 1305           JEQ  >5696
568C 0280 0400      CI   R0,>0400
5690 1302           JEQ  >5696
5692 0460 50BA      B    @>50BA
5696 06A0 4658      BL   @>4658
569A 489A           DATA >489A
569C 0429 005A      BLWP @>005A(R9)
56A0 8001           DATA >8001
56A2 0240 0100      ANDI R0,>0100
56A6 1611           JNE  >56CA
56A8 04C2           CLR  R2
56AA 0703           SETO R3
56AC 06A0 52AA      BL   @>52AA
56B0 04C0           CLR  R0
56B2 C229 0054      MOV  @>0054(R9),R8
56B6 0228 0006      AI   R8,6
56BA 0429 005A      BLWP @>005A(R9)
56BE 0103           DATA >0103
56C0 DBC0 FFFE      MOVB R0,@>FFFE(R15)
56C4 1000           NOP
56C6 DBC0 FFFE      MOVB R0,@>FFFE(R15)
56CA 0460 4676      B    @>4676
56CE 06A0 4658      BL   @>4658
56D2 4E02           DATA >4E02
56D4 C104           MOV  R4,R4
56D6 1303           JEQ  >56DE
56D8 06A0 4C72      BL   @>4C72
56DC E000           DATA >E000
56DE 06A0 4B70      BL   @>4B70
56E2 000C           DATA >000C
56E4 0240 0100      ANDI R0,>0100
56E8 13F7           JEQ  >56D8
56EA 05C8           INCT R8
56EC 0429 005A      BLWP @>005A(R9)
56F0 0102           DATA >0102
56F2 D06F FBFE      MOVB @>FBFE(R15),R1
56F6 06C1           SWPB R1
56F8 D06F FBFE      MOVB @>FBFE(R15),R1
56FC 0B81           SRC  R1,8
56FE 13EC           JEQ  >56D8
5700 06A0 57C0      BL   @>57C0
5704 05C8           INCT R8
5706 04C4           CLR  R4
5708 0429 005A      BLWP @>005A(R9)
570C 0102           DATA >0102
570E D12F FBFE      MOVB @>FBFE(R15),R4
5712 8081           C    R1,R2
5714 1BE1           JH   >56D8
5716 1602           JNE  >571C
5718 8100           C    R0,R4
571A 1ADE           JL   >56D8
571C 04C3           CLR  R3
571E 06C4           SWPB R4
5720 0601           DEC  R1
5722 130D           JEQ  >573E
5724 0429 005A      BLWP @>005A(R9)
5728 D900           DATA >D900
572A 06A0 4658      BL   @>4658
572E 492E           DATA >492E
5730 0429 005A      BLWP @>005A(R9)
5734 D901           DATA >D901
5736 0583           INC  R3
5738 0227 0100      AI   R7,>0100
573C 10F1           JMP  >5720
573E C104           MOV  R4,R4
5740 1604           JNE  >574A
5742 06A0 4658      BL   @>4658
5746 492E           DATA >492E
5748 1011           JMP  >576C        -- CHECK
574A C147           MOV  R7,R5
574C C1E9 0056      MOV  @>0056(R9),R7
5750 0227 0100      AI   R7,>0100
5754 0429 005A      BLWP @>005A(R9)
5758 0D00           DATA >0D00
575A 06A0 4658      BL   @>4658
575E 492E           DATA >492E
5760 0429 005A      BLWP @>005A(R9)
5764 E001           DATA >E001
5766 06A0 4658      BL   @>4658
576A 533E           DATA >533E
576C 0460 487A      B    @>487A
5770 06A0 4658      BL   @>4658
5774 4798           DATA >4798
5776 06A0 57C0      BL   @>57C0
577A 04C3           CLR  R3
577C 0429 005A      BLWP @>005A(R9)
5780 B100           DATA >B100
5782 06A0 4658      BL   @>4658
5786 494E           DATA >494E
5788 0429 005A      BLWP @>005A(R9)
578C B101           DATA >B101
578E 0583           INC  R3
5790 0227 0100      AI   R7,>0100
5794 0602           DEC  R2
5796 16F2           JNE  >577C
5798 C069 0056      MOV  @>0056(R9),R1
579C 0221 000C      AI   R1,>000C
57A0 0202 0100      LI   R2,>0100
57A4 0429 005A      BLWP @>005A(R9)
57A8 0023           DATA >0023
57AA DBC2 FFFE      MOVB R2,@>FFFE(R15)
57AE 0221 0004      AI   R1,4
57B2 0429 005A      BLWP @>005A(R9)
57B6 0023           DATA >0023
57B8 DBC0 FFFE      MOVB R0,@>FFFE(R15)
57BC 0460 487A      B    @>487A
57C0 C029 0054      MOV  @>0054(R9),R0
57C4 05C0           INCT R0
57C6 0429 005A      BLWP @>005A(R9)
57CA 0002           DATA >0002
57CC D1EF FBFE      MOVB @>FBFE(R15),R7
57D0 06C7           SWPB R7
57D2 D1EF FBFE      MOVB @>FBFE(R15),R7
57D6 06C7           SWPB R7
57D8 0220 0004      AI   R0,4
57DC 0429 005A      BLWP @>005A(R9)
57E0 0002           DATA >0002
57E2 D0AF FBFE      MOVB @>FBFE(R15),R2
57E6 0982           SRL  R2,8
57E8 04C0           CLR  R0
57EA D02F FBFE      MOVB @>FBFE(R15),R0
57EE 1301           JEQ  >57F2
57F0 0582           INC  R2
57F2 045B           RT

57F4 06A0 4658      BL   @>4658
57F8 4DA4           DATA >4DA4
57FA C104           MOV  R4,R4
57FC 1310           JEQ  >581E
57FE 06A0 4658      BL   @>4658
5802 4E0C           DATA >4E0C
5804 0200 8000      LI   R0,>8000
5808 C104           MOV  R4,R4
580A 1649           JNE  >589E
580C C069 0056      MOV  @>0056(R9),R1
5810 04C2           CLR  R2
5812 0429 005A      BLWP @>005A(R9)
5816 0023           DATA >0023
5818 DBC2 FFFE      MOVB R2,@>FFFE(R15)
581C 1036           JMP  >588A
581E 06A0 4658      BL   @>4658
5822 54E0           DATA >54E0
5824 06A0 54FC      BL   @>54FC
5828 1101           JLT  >582C
582A 1006           JMP  >5838
582C 06A0 4658      BL   @>4658
5830 5362           DATA >5362
5832 1013           JMP  >585A        -- CHECK
5834 04C2           CLR  R2
5836 1029           JMP  >588A
5838 D16F FBFE      MOVB @>FBFE(R15),R5
583C 0985           SRL  R5,8
583E 1602           JNE  >5844
5840 0205 0100      LI   R5,>0100
5844 06A0 4B6A      BL   @>4B6A
5848 0006           DATA >0006
584A C0C0           MOV  R0,R3
584C 111C           JLT  >5886
584E 06A0 555A      BL   @>555A
5852 04C2           CLR  R2
5854 1A1A           JL   >588A
5856 3C85           DIV  R5,2
5858 C0C2           MOV  R2,R3
585A 06A0 4B70      BL   @>4B70
585E 000E           DATA >000E
5860 0583           INC  R3
5862 0202 0100      LI   R2,>0100
5866 60C0           S    R0,R3
5868 1501           JGT  >586C
586A 100F           JMP  >588A
586C 06A0 4658      BL   @>4658
5870 4CD2           DATA >4CD2
5872 C103           MOV  R3,R4
5874 C205           MOV  R5,R8
5876 0228 000A      AI   R8,10
587A 06A0 5A68      BL   @>5A68
587E 0202 0100      LI   R2,>0100
5882 8103           C    R3,R4
5884 1402           JHE  >588A
5886 0202 0200      LI   R2,>0200
588A 06A0 4B70      BL   @>4B70
588E 000C           DATA >000C
5890 0240 8F00      ANDI R0,>8F00
5894 1502           JGT  >589A
5896 0260 0080      ORI  R0,>0080
589A 0A30           SLA  R0,3
589C F002           SOCB R2,R0
589E C069 0054      MOV  @>0054(R9),R1
58A2 0221 0008      AI   R1,8
58A6 0429 005A      BLWP @>005A(R9)
58AA 0023           DATA >0023
58AC DBC0 FFFE      MOVB R0,@>FFFE(R15)
58B0 0460 4676      B    @>4676
58B4 D02F FBFE      MOVB @>FBFE(R15),R0
58B8 0240 1E00      ANDI R0,>1E00
58BC 0280 0C00      CI   R0,>0C00
58C0 1303           JEQ  >58C8
58C2 06A0 4C9E      BL   @>4C9E
58C6 4000           DATA >4000
58C8 06A0 4B6A      BL   @>4B6A
58CC 0004           DATA >0004
58CE 0980           SRL  R0,8
58D0 1303           JEQ  >58D8
58D2 0280 0026      CI   R0,>0026
58D6 16F5           JNE  >58C2
58D8 0200 2600      LI   R0,>2600
58DC 0429 005A      BLWP @>005A(R9)
58E0 0103           DATA >0103
58E2 DBC0 FFFE      MOVB R0,@>FFFE(R15)
58E6 04C7           CLR  R7
58E8 06A0 5AA2      BL   @>5AA2
58EC 58F4           DATA >58F4
58EE 06A0 4C72      BL   @>4C72
58F2 E000           DATA >E000
58F4 C1C7           MOV  R7,R7
58F6 1603           JNE  >58FE
58F8 06A0 4C9E      BL   @>4C9E
58FC 8000           C    R0,R0
58FE 0429 005A      BLWP @>005A(R9)
5902 00E3           DATA >00E3
5904 DBC3 FFFE      MOVB R3,@>FFFE(R15)
5908 06C3           SWPB R3
590A DBC3 FFFE      MOVB R3,@>FFFE(R15)
590E 0460 4676      B    @>4676
5912 06A0 5AA2      BL   @>5AA2
5916 58EE           DATA >58EE
5918 04C0           CLR  R0
591A 0429 005A      BLWP @>005A(R9)
591E 0103           DATA >0103
5920 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5924 0460 4676      B    @>4676

**
*
* Here we are reading from the directory
*
**

5928 06A0 5AA2      BL   @>5AA2
592C 58EE           DATA >58EE
592E 0588           INC  R8
5930 C148           MOV  R8,R5
5932 06A0 4B6A      BL   @>4B6A
5936 0006           DATA >0006
5938 C080           MOV  R0,R2
593A 0582           INC  R2
593C 0429 005A      BLWP @>005A(R9)
5940 0103           DATA >0103
5942 DBC2 FFFE      MOVB R2,@>FFFE(R15)
5946 06C2           SWPB R2
5948 DBC2 FFFE      MOVB R2,@>FFFE(R15)
594C 0A10           SLA  R0,1
594E D000           MOVB R0,R0
5950 1303           JEQ  >5958
5952 06A0 4C72      BL   @>4C72
5956 A000           A    R0,R0
5958 0702           SETO R2
595A C100           MOV  R0,R4
595C 133B           JEQ  >59D4
595E 0204 0001      LI   R4,1
5962 06A0 4658      BL   @>4658
5966 4D4E           DATA >4D4E
5968 C205           MOV  R5,R8
596A 0225 00FF      AI   R5,>00FF
596E 0640           DECT R0
5970 A200           A    R0,R8
5972 06A0 4B76      BL   @>4B76
5976 C100           MOV  R0,R4
5978 1328           JEQ  >59CA
597A 06A0 4658      BL   @>4658
597E 4D4E           DATA >4D4E
5980 06A0 4B70      BL   @>4B70
5984 010E           DATA >010E
5986 C180           MOV  R0,R6
5988 0586           INC  R6
598A D0EF FBFE      MOVB @>FBFE(R15),R3
598E 0202 0A00      LI   R2,>0A00
5992 D0EF FBFE      MOVB @>FBFE(R15),R3
5996 0983           SRL  R3,8
5998 0648           DECT R8
599A 0429 005A      BLWP @>005A(R9)
599E 0102           DATA >0102
59A0 D02F FBFE      MOVB @>FBFE(R15),R0
59A4 C1C0           MOV  R0,R7
59A6 0240 0800      ANDI R0,>0800
59AA 51C0           SZCB R0,R7
59AC 0987           SRL  R7,8
59AE 0587           INC  R7
59B0 0287 0002      CI   R7,2
59B4 1602           JNE  >59BA
59B6 0227 0003      AI   R7,3
59BA 0287 0008      CI   R7,8
59BE 1A02           JL   >59C4
59C0 0227 FF81      AI   R7,>FF81
59C4 0A40           SLA  R0,4
59C6 E1C0           SOC  R0,R7
59C8 1004           JMP  >59D2
59CA 04C2           CLR  R2
59CC 04C6           CLR  R6
59CE 04C3           CLR  R3
59D0 04C7           CLR  R7
59D2 100F           JMP  >59F2
59D4 0225 00FF      AI   R5,>00FF
59D8 06A0 4658      BL   @>4658
59DC 4D4E           DATA >4D4E
59DE 06A0 4B70      BL   @>4B70
59E2 010A           DATA >010A
59E4 C180           MOV  R0,R6
59E6 0646           DECT R6
59E8 06A0 5A68      BL   @>5A68
59EC 04C7           CLR  R7
59EE 0202 0A00      LI   R2,>0A00
59F2 06A0 4B6A      BL   @>4B6A
59F6 0002           DATA >0002
59F8 C200           MOV  R0,R8
59FA 0588           INC  R8
59FC 0982           SRL  R2,8
59FE 1316           JEQ  >5A2C
5A00 04C1           CLR  R1
5A02 0429 005A      BLWP @>005A(R9)
5A06 00A2           DATA >00A2
5A08 D06F FBFE      MOVB @>FBFE(R15),R1
5A0C 0281 2000      CI   R1,>2000
5A10 1309           JEQ  >5A24
5A12 0429 005A      BLWP @>005A(R9)
5A16 0103           DATA >0103
5A18 DBC1 FFFE      MOVB R1,@>FFFE(R15)
5A1C 0585           INC  R5
5A1E 0588           INC  R8
5A20 0602           DEC  R2
5A22 16EF           JNE  >5A02
5A24 0502           NEG  R2
5A26 0222 000A      AI   R2,10
5A2A 06C2           SWPB R2
5A2C 0429 005A      BLWP @>005A(R9)
5A30 0003           DATA >0003
5A32 DBC2 FFFE      MOVB R2,@>FFFE(R15)
5A36 0429 005A      BLWP @>005A(R9)
5A3A 0103           DATA >0103
5A3C C047           MOV  R7,R1
5A3E 06A0 5AE6      BL   @>5AE6
5A42 C046           MOV  R6,R1
5A44 06A0 5AE6      BL   @>5AE6
5A48 C043           MOV  R3,R1
5A4A 06A0 5AE6      BL   @>5AE6
5A4E C229 0054      MOV  @>0054(R9),R8
5A52 0228 0005      AI   R8,5
5A56 0200 2600      LI   R0,>2600
5A5A 0429 005A      BLWP @>005A(R9)
5A5E 0103           DATA >0103
5A60 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5A64 0460 4676      B    @>4676
5A68 0228 002E      AI   R8,>002E
5A6C 0202 00C8      LI   R2,>00C8
5A70 04C3           CLR  R3
5A72 0429 005A      BLWP @>005A(R9)
5A76 0102           DATA >0102
5A78 D06F FBFE      MOVB @>FBFE(R15),R1
5A7C 0221 0100      AI   R1,>0100
5A80 0981           SRL  R1,8
5A82 130C           JEQ  >5A9C
5A84 0601           DEC  R1
5A86 1603           JNE  >5A8E
5A88 0223 0008      AI   R3,8
5A8C 1007           JMP  >5A9C
5A8E 0200 0008      LI   R0,8
5A92 0911           SRL  R1,1
5A94 1801           JOC  >5A98
5A96 0583           INC  R3
5A98 0600           DEC  R0
5A9A 16FB           JNE  >5A92
5A9C 0602           DEC  R2
5A9E 16EC           JNE  >5A78
5AA0 045B           RT

5AA2 C2BB           MOV  *R11+,R10
5AA4 C14B           MOV  R11,R5
5AA6 C229 0056      MOV  @>0056(R9),R8
5AAA 0228 0003      AI   R8,3
5AAE 0429 005A      BLWP @>005A(R9)
5AB2 0102           DATA >0102
5AB4 D0AF FBFE      MOVB @>FBFE(R15),R2
5AB8 0882           SRA  R2,8
5ABA 0228 0006      AI   R8,6
5ABE 0203 0020      LI   R3,>0020
5AC2 D0C6           MOVB R6,R3
5AC4 06A0 4B76      BL   @>4B76
5AC8 8003           C    R3,R0
5ACA 1309           JEQ  >5ADE
5ACC 0240 00FF      ANDI R0,>00FF
5AD0 1601           JNE  >5AD4
5AD2 C1C8           MOV  R8,R7
5AD4 0228 0206      AI   R8,>0206
5AD8 0602           DEC  R2
5ADA 16F4           JNE  >5AC4
5ADC 045A           B    *R10
5ADE 0588           INC  R8
5AE0 CA48 0056      MOV  R8,@>0056(R9)
5AE4 0455           B    *R5
5AE6 0202 0800      LI   R2,>0800
5AEA DBC2 FFFE      MOVB R2,@>FFFE(R15)
5AEE C141           MOV  R1,R5
5AF0 0241 7FFF      ANDI R1,>7FFF
5AF4 0281 0064      CI   R1,>0064
5AF8 1A07           JL   >5B08
5AFA 04C0           CLR  R0
5AFC 0204 0064      LI   R4,>0064
5B00 3C04           DIV  R4,0
5B02 0260 4100      ORI  R0,>4100
5B06 1005           JMP  >5B12
5B08 C001           MOV  R1,R0
5B0A 1302           JEQ  >5B10
5B0C 0260 4000      ORI  R0,>4000
5B10 04C1           CLR  R1
5B12 C145           MOV  R5,R5
5B14 1101           JLT  >5B18
5B16 1001           JMP  >5B1A
5B18 0500           NEG  R0
5B1A DBC0 FFFE      MOVB R0,@>FFFE(R15)
5B1E 06C0           SWPB R0
5B20 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5B24 06C1           SWPB R1
5B26 DBC1 FFFE      MOVB R1,@>FFFE(R15)
5B2A 0202 0005      LI   R2,5
5B2E DBC2 FFFE      MOVB R2,@>FFFE(R15)
5B32 0602           DEC  R2
5B34 16FC           JNE  >5B2E
5B36 045B           RT

*************************************************************************
*									*
*  Sector READ / WRITE							*
*									*
*************************************************************************

5B38 C1CB           MOV  R11,R7
5B3A 06A0 4724      BL   @>4724
5B3E CA69 0050 004A MOV  @>0050(R9),@>004A(R9)
5B44 0460 40E8      B    @>40E8

*************************************************************************
*									*
*  Disk Formatting							*
*									*
*************************************************************************

5B48 C1CB           MOV  R11,R7
5B4A 06A0 4724      BL   @>4724
5B4E 0460 42AC      B    @>42AC

*************************************************************************
*									*
*  Modify file Protection						*
*									*
*************************************************************************

5B52 C1CB           MOV  R11,R7
5B54 06A0 4724      BL   @>4724
5B58 D029 004D      MOVB @>004D(R9),R0
5B5C 0240 0800      ANDI R0,>0800
5B60 0429 005A      BLWP @>005A(R9)
5B64 8000           DATA >8000
5B66 C029 004E      MOV  @>004E(R9),R0
5B6A 06A0 4658      BL   @>4658
5B6E 5C54           DATA >5C54
5B70 0429 005A      BLWP @>005A(R9)
5B74 2001           DATA >2001
5B76 06A0 4B70      BL   @>4B70
5B7A 000C           DATA >000C
5B7C 0240 F700      ANDI R0,>F700
5B80 F002           SOCB R2,R0
5B82 0429 005A      BLWP @>005A(R9)
5B86 0103           DATA >0103
5B88 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5B8C C229 0056      MOV  @>0056(R9),R8
5B90 0429 005A      BLWP @>005A(R9)
5B94 0102           DATA >0102
5B96 D02F FBFE      MOVB @>FBFE(R15),R0
5B9A 0260 8000      ORI  R0,>8000
5B9E 0429 005A      BLWP @>005A(R9)
5BA2 0103           DATA >0103
5BA4 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5BA8 0460 487A      B    @>487A

*************************************************************************
*									*
*  File Rename								*
*									*
*************************************************************************

5BAC C1CB           MOV  R11,R7
5BAE 06A0 4724      BL   @>4724
5BB2 C029 004E      MOV  @>004E(R9),R0
5BB6 0429 005A      BLWP @>005A(R9)
5BBA 8000           DATA >8000
5BBC C029 0050      MOV  @>0050(R9),R0
5BC0 06A0 4658      BL   @>4658
5BC4 5C54           DATA >5C54
5BC6 06A0 4ADA      BL   @>4ADA
5BCA 06A0 4B70      BL   @>4B70
5BCE 000C           DATA >000C
5BD0 0240 0800      ANDI R0,>0800
5BD4 1303           JEQ  >5BDC
5BD6 06A0 4C72      BL   @>4C72
5BDA 2000           COC  R0,0
5BDC 06A0 4B70      BL   @>4B70
5BE0 FFFC           DATA >FFFC
5BE2 C040           MOV  R0,R1
5BE4 0429 005A      BLWP @>005A(R9)
5BE8 8001           DATA >8001
5BEA 0429 005A      BLWP @>005A(R9)
5BEE 4000           DATA >4000
5BF0 06A0 5E9C      BL   @>5E9C
5BF4 06A0 4658      BL   @>4658
5BF8 4E38           DATA >4E38
5BFA C104           MOV  R4,R4
5BFC 1338           JEQ  >5C6E
5BFE 06A0 4B0A      BL   @>4B0A
5C02 0429 005A      BLWP @>005A(R9)
5C06 0801           DATA >0801
5C08 0429 005A      BLWP @>005A(R9)
5C0C 0103           DATA >0103
5C0E DBC4 FFFE      MOVB R4,@>FFFE(R15)
5C12 06C4           SWPB R4
5C14 DBC4 FFFE      MOVB R4,@>FFFE(R15)
5C18 06C4           SWPB R4
5C1A 0702           SETO R2
5C1C 04C5           CLR  R5
5C1E 06A0 4658      BL   @>4658
5C22 4D4A           DATA >4D4A
5C24 C045           MOV  R5,R1
5C26 C029 0058      MOV  @>0058(R9),R0
5C2A 0220 0101      AI   R0,>0101
5C2E 0601           DEC  R1
5C30 06A0 5EB2      BL   @>5EB2
5C34 04C2           CLR  R2
5C36 06A0 4658      BL   @>4658
5C3A 4D4E           DATA >4D4E
5C3C 06A0 4658      BL   @>4658
5C40 4D36           DATA >4D36
5C42 C069 0056      MOV  @>0056(R9),R1
5C46 0429 005A      BLWP @>005A(R9)
5C4A 0023           DATA >0023
5C4C DBC4 FFFE      MOVB R4,@>FFFE(R15)
5C50 0460 4676      B    @>4676
5C54 04C6           CLR  R6
5C56 D1A9 004C      MOVB @>004C(R9),R6
5C5A 06A0 5E9C      BL   @>5E9C
5C5E 06A0 4658      BL   @>4658
5C62 4DC4           DATA >4DC4
5C64 06A0 4658      BL   @>4658
5C68 4E08           DATA >4E08
5C6A C104           MOV  R4,R4
5C6C 1303           JEQ  >5C74
5C6E 06A0 4C9E      BL   @>4C9E
5C72 E000           DATA >E000
5C74 0460 4676      B    @>4676

*************************************************************************
*									*
*  Access Direct Input File						*
*									*
*************************************************************************

5C78 C1CB           MOV  R11,R7
5C7A 06A0 4724      BL   @>4724
5C7E 06A0 5ED4      BL   @>5ED4
5C82 06A0 5EFA      BL   @>5EFA
5C86 C082           MOV  R2,R2
5C88 131E           JEQ  >5CC6
5C8A 6003           S    R3,R0
5C8C 1502           JGT  >5C92
5C8E 04C2           CLR  R2
5C90 1017           JMP  >5CC0
5C92 8002           C    R2,R0
5C94 1A01           JL   >5C98
5C96 C080           MOV  R0,R2
5C98 0429 005A      BLWP @>005A(R9)
5C9C 2000           DATA >2000
5C9E 0429 005A      BLWP @>005A(R9)
5CA2 3100           DATA >3100
5CA4 06A0 4658      BL   @>4658
5CA8 492E           DATA >492E
5CAA 0429 005A      BLWP @>005A(R9)
5CAE 3101           DATA >3101
5CB0 0583           INC  R3
5CB2 0227 0100      AI   R7,>0100
5CB6 0602           DEC  R2
5CB8 16F2           JNE  >5C9E
5CBA 0429 005A      BLWP @>005A(R9)
5CBE 2001           DATA >2001
5CC0 CA42 004C      MOV  R2,@>004C(R9)
5CC4 100A           JMP  >5CDA
5CC6 CD00           MOV  R0,*R4+
5CC8 0648           DECT R8
5CCA 05C2           INCT R2
5CCC 06A0 5F2E      BL   @>5F2E
5CD0 0202 0004      LI   R2,4
5CD4 A202           A    R2,R8
5CD6 06A0 5F2E      BL   @>5F2E
5CDA 06A0 4658      BL   @>4658
5CDE 487A           DATA >487A
5CE0 04E9 0050      CLR  @>0050(R9)
5CE4 0460 4676      B    @>4676

(************************************************************************)
(*									*)
(*  I don't know - probably Access Direct Output File			*)
(*									*)
(************************************************************************)

5CE8 C1CB           MOV  R11,R7
5CEA 06A0 4724      BL   @>4724
5CEE 06A0 5ED4      BL   @>5ED4
5CF2 1314           JEQ  >5D1C
5CF4 06A0 5EFA      BL   @>5EFA
5CF8 0429 005A      BLWP @>005A(R9)
5CFC 2000           DATA >2000
5CFE 0429 005A      BLWP @>005A(R9)
5D02 3100           DATA >3100
5D04 06A0 4658      BL   @>4658
5D08 494E           DATA >494E
5D08 0429           BLWP @>005A(R9)
5D0E 3101           DATA >3101
5D10 0583           INC  R3
5D12 0227 0100      AI   R7,>0100
5D16 0602           DEC  R2
5D18 16F2           JNE  >5CFE
5D1A 10CF           JMP  >5CBA
5D1C 06A0 4658      BL   @>4658
5D20 4DC4           DATA >4DC4
5D22 06A0 4658      BL   @>4658
5D26 4E08           DATA >4E08
5D28 06A0 4658      BL   @>4658
5D2C 479E           DATA >479E
5D2E 0429 005A      BLWP @>005A(R9)
5D32 0801           DATA >0801
5D34 C229 0056      MOV  @>0056(R9),R8
5D38 05C4           INCT R4
5D3A C0F4           MOV  *R4+,R3
5D3C 0228 000A      AI   R8,10
5D40 06A0 5F3E      BL   @>5F3E
5D44 0002           DATA >0002
5D46 06A0 5F3E      BL   @>5F3E
5D4A 0004           DATA >0004
5D4C 0603           DEC  R3
5D4E 1103           JLT  >5D56
5D50 06A0 4658      BL   @>4658
5D54 4964           DATA >4964
5D56 0460 5B8C      B    @>5BB0

*************************************************************************
*									*
*  Files subprogram							*
*									*
*************************************************************************

5D5A C1CB           MOV  R11,R7
5D5C 06A0 4724      BL   @>4724
5D60 C229 002C      MOV  @>002C(R9),R8
5D64 0228 0007      AI   R8,7
5D68 06A0 4B76      BL   @>4B76		Read word in VDP
5D6C 0280 C801      CI   R0,>C801
5D70 161C           JNE  >5DAA
5D72 05C8           INCT R8
5D74 06A0 4B76      BL   @>4B76
5D78 06C0           SWPB R0
5D7A 0220 49D0      AI   R0,>49D0
5D7E 0280 0009      CI   R0,>0009
5D82 1B13           JH   >5DAA
5D84 06C0           SWPB R0
5D86 DA40 004C      MOVB R0,@>004C(R9)
5D8A 06A0 4658      BL   @>4658
5D8E 5DB4           DATA >5DB4
5D90 DA69 0050 0050 MOVB @>0050(R9),@>0050(R9)
5D96 1609           JNE  >5DAA
5D98 C229 002C      MOV  @>002C(R9),R8
5D9C 0228 000C      AI   R8,>000C
5DA0 CA48 002C      MOV  R8,@>002C(R9)
5DA4 5A69 0042 0042 SZCB @>0042(R9),@>0042(R9)
5DAA 0460 4676      B    @>4676

*************************************************************************
*									*
*  Buffer Allocation							*
*									*
*************************************************************************

5DAE C1CB           MOV  R11,R7
5DB0 06A0 4724      BL   @>4724
5DB4 04C0           CLR  R0
5DB6 D029 004C      MOVB @>004C(R9),R0
5DBA 136C           JEQ  >5E94
5DBC C229 0056      MOV  @>0056(R9),R8
5DC0 0228 0003      AI   R8,3
5DC4 04C3           CLR  R3
5DC6 0429 005A      BLWP @>005A(R9)
5DCA 0102           DATA >0102
5DCC D0EF FBFE      MOVB @>FBFE(R15),R3
5DD0 0205 0206      LI   R5,>0206
5DD4 90C0           CB   R0,R3
5DD6 135B           JEQ  >5E8E
5DD8 122B           JLE  >5E30
5DDA C180           MOV  R0,R6
5DDC 0280 1000      CI   R0,>1000
5DE0 1B59           JH   >5E94
5DE2 6003           S    R3,R0
5DE4 0980           SRL  R0,8
5DE6 3805           MPY  R5,0
5DE8 C101           MOV  R1,R4
5DEA 0504           NEG  R4
5DEC C0A9 0070      MOV  @>0070(R9),R2
5DF0 C002           MOV  R2,R0
5DF2 6001           S    R1,R0
5DF4 0280 0800      CI   R0,>0800
5DF8 114D           JLT  >5E94
5DFA C040           MOV  R0,R1
5DFC 0582           INC  R2
5DFE 0580           INC  R0
5E00 0429 005A      BLWP @>005A(R9)
5E04 0042           DATA >0042
5E06 D0EF FBFE      MOVB @>FBFE(R15),R3
5E0A 0429 005A      BLWP @>005A(R9)
5E0E 0003           DATA >0003
5E10 DBC3 FFFE      MOVB R3,@>FFFE(R15)
5E14 8202           C    R2,R8
5E16 16F2           JNE  >5DFC
5E18 0429 005A      BLWP @>005A(R9)
5E1C 0003           DATA >0003
5E1E DBC6 FFFE      MOVB R6,@>FFFE(R15)
5E22 04C6           CLR  R6
5E24 6080           S    R0,R2
5E26 DBC6 FFFE      MOVB R6,@>FFFE(R15)
5E2A 0602           DEC  R2
5E2C 16FC           JNE  >5E26
5E2E 101A           JMP  >5E64
5E30 0429 005A      BLWP @>005A(R9)
5E34 0103           DATA >0103
5E36 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5E3A 60C0           S    R0,R3
5E3C 0983           SRL  R3,8
5E3E 38C5           MPY  R5,3
5E40 C044           MOV  R4,R1
5E42 A048           A    R8,R1
5E44 C0A9 0070      MOV  @>0070(R9),R2
5E48 0429 005A      BLWP @>005A(R9)
5E4C 0102           DATA >0102
5E4E D02F FBFE      MOVB @>FBFE(R15),R0
5E52 0429 005A      BLWP @>005A(R9)
5E56 0023           DATA >0023
5E58 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5E5C 0601           DEC  R1
5E5E 0608           DEC  R8
5E60 8088           C    R8,R2
5E62 16F2           JNE  >5E48
5E64 CA41 0070      MOV  R1,@>0070(R9)
5E68 C201           MOV  R1,R8
5E6A 05C8           INCT R8
5E6C 06A0 4B76      BL   @>4B76
5E70 D06F FBFE      MOVB @>FBFE(R15),R1
5E74 904C           CB   R12,R1
5E76 130B           JEQ  >5E8E
5E78 A004           A    R4,R0
5E7A 0429 005A      BLWP @>005A(R9)
5E7E 0103           DATA >0103
5E80 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5E84 C200           MOV  R0,R8
5E86 06C0           SWPB R0
5E88 DBC0 FFFE      MOVB R0,@>FFFE(R15)
5E8C 10EE           JMP  >5E6A
5E8E 04E9 0050      CLR  @>0050(R9)
5E92 1002           JMP  >5E98
5E94 0729 0050      SETO @>0050(R9)
5E98 0460 4676      B    @>4676

5E9C 04E9 0054      CLR  @>0054(R9)
5EA0 C069 0058      MOV  @>0058(R9),R1
5EA4 0221 0100      AI   R1,>0100	R1 points to name compare buffer
5EA8 0429 005A      BLWP @>005A(R9)
5EAC 0023           DATA >0023
5EAE DBC6 FFFE      MOVB R6,@>FFFE(R15)
5EB2 0202 000A      LI   R2,10
5EB6 0581           INC  R1
5EB8 0429 005A      BLWP @>005A(R9)
5EBC 0002           DATA >0002
5EBE D0EF FBFE      MOVB @>FBFE(R15),R3
5EC2 0580           INC  R0
5EC4 0429 005A      BLWP @>005A(R9)
5EC8 0023           DATA >0023
5ECA DBC3 FFFE      MOVB R3,@>FFFE(R15)
5ECE 0602           DEC  R2
5ED0 16F2           JNE  >5EB6
5ED2 045B           RT

5ED4 C28B           MOV  R11,R10
5ED6 04C6           CLR  R6
5ED8 D1A9 004C      MOVB @>004C(R9),R6	Unit number
5EDC C029 004E      MOV  @>004E(R9),R0  Pointer to filename in VDP RAM
5EE0 06A0 5E9C      BL   @>5E9C
5EE4 D129 0050      MOVB @>0050(R9),R4
5EE8 0984           SRL  R4,8
5EEA A109           A    R9,R4
5EEC D029 004D      MOVB @>004D(R9),R0	Access code
5EF0 0429 005A      BLWP @>005A(R9)
5EF4 0800           DATA >0800
5EF6 0980           SRL  R0,8
5EF8 045A           B    *R10
5EFA 0429 005A      BLWP @>005A(R9)
5EFE 8010           DATA >8010
5F00 06A0 4658      BL   @>4658
5F04 4DC4           DATA >4DC4
5F06 06A0 4658      BL   @>4658
5F0A 4E08           DATA >4E08
5F0C C104           MOV  R4,R4
5F0E 1303           JEQ  >5F16
5F10 06A0 4C72      BL   @>4C72
5F14 E000           DATA >E000
5F16 06A0 4B70      BL   @>4B70
5F1A 000E           DATA >000E
5F1C 0429 005A      BLWP @>005A(R9)
5F20 2011           DATA >2011
5F22 0429 005A      BLWP @>005A(R9)
5F26 0801           DATA >0801
5F28 C1F4           MOV  *R4+,R7
5F2A C0D4           MOV  *R4,R3
5F2C 045B           RT

5F2E 0429 005A      BLWP @>005A(R9)
5F32 0102           DATA >0102
5F34 DD2F FBFE      MOVB @>FBFE(R15),*R4+
5F38 0602           DEC  R2
5F3A 16FC           JNE  >5F34
5F3C 045B           RT

5F3E C0BB           MOV  *R11+,R2
5F40 A202           A    R2,R8
5F42 0429 005A      BLWP @>005A(R9)
5F46 0103           DATA >0103
5F48 DBF4 FFFE      MOVB *R4+,@>FFFE(R15)
5F4C 0602           DEC  R2
5F4E 16FC           JNE  >5F48
5F50 045B           RT

5F52 FFFF           SOCB *R15+,*R15+
5F54 FFFF           SOCB *R15+,*R15+
5F56 FFFF           SOCB *R15+,*R15+
5F58 FFFF           SOCB *R15+,*R15+
5F5A FFFF           SOCB *R15+,*R15+
5F5C FFFF           SOCB *R15+,*R15+
5F5E FFFF           SOCB *R15+,*R15+
5F60 FFFF           SOCB *R15+,*R15+
5F62 FFFF           SOCB *R15+,*R15+
5F64 FFFF           SOCB *R15+,*R15+
5F66 FFFF           SOCB *R15+,*R15+
5F68 FFFF           SOCB *R15+,*R15+
5F6A FFFF           SOCB *R15+,*R15+
5F6C FFFF           SOCB *R15+,*R15+
5F6E FFFF           SOCB *R15+,*R15+
5F70 FFFF           SOCB *R15+,*R15+
5F72 FFFF           SOCB *R15+,*R15+
5F74 FFFF           SOCB *R15+,*R15+
5F76 FFFF           SOCB *R15+,*R15+
5F78 FFFF           SOCB *R15+,*R15+
5F7A FFFF           SOCB *R15+,*R15+
5F7C FFFF           SOCB *R15+,*R15+
5F7E FFFF           SOCB *R15+,*R15+
5F80 FFFF           SOCB *R15+,*R15+
5F82 FFFF           SOCB *R15+,*R15+
5F84 FFFF           SOCB *R15+,*R15+
5F86 FFFF           SOCB *R15+,*R15+
5F88 FFFF           SOCB *R15+,*R15+
5F8A FFFF           SOCB *R15+,*R15+
5F8C FFFF           SOCB *R15+,*R15+
5F8E FFFF           SOCB *R15+,*R15+
5F90 FFFF           SOCB *R15+,*R15+
5F92 FFFF           SOCB *R15+,*R15+
5F94 FFFF           SOCB *R15+,*R15+
5F96 FFFF           SOCB *R15+,*R15+
5F98 FFFF           SOCB *R15+,*R15+
5F9A FFFF           SOCB *R15+,*R15+
5F9C FFFF           SOCB *R15+,*R15+
5F9E FFFF           SOCB *R15+,*R15+
5FA0 FFFF           SOCB *R15+,*R15+
5FA2 FFFF           SOCB *R15+,*R15+
5FA4 FFFF           SOCB *R15+,*R15+
5FA6 FFFF           SOCB *R15+,*R15+
5FA8 FFFF           SOCB *R15+,*R15+
5FAA FFFF           SOCB *R15+,*R15+
5FAC FFFF           SOCB *R15+,*R15+
5FAE FFFF           SOCB *R15+,*R15+
5FB0 FFFF           SOCB *R15+,*R15+
5FB2 FFFF           SOCB *R15+,*R15+
5FB4 FFFF           SOCB *R15+,*R15+
5FB6 FFFF           SOCB *R15+,*R15+
5FB8 FFFF           SOCB *R15+,*R15+
5FBA FFFF           SOCB *R15+,*R15+
5FBC FFFF           SOCB *R15+,*R15+
5FBE FFFF           SOCB *R15+,*R15+
5FC0 FFFF           SOCB *R15+,*R15+
5FC2 FFFF           SOCB *R15+,*R15+
5FC4 FFFF           SOCB *R15+,*R15+
5FC6 FFFF           SOCB *R15+,*R15+
5FC8 FFFF           SOCB *R15+,*R15+
5FCA FFFF           SOCB *R15+,*R15+
5FCC FFFF           SOCB *R15+,*R15+
5FCE FFFF           SOCB *R15+,*R15+
5FD0 FFFF           SOCB *R15+,*R15+
5FD2 FFFF           SOCB *R15+,*R15+
5FD4 FFFF           SOCB *R15+,*R15+
5FD6 FFFF           SOCB *R15+,*R15+
5FD8 FFFF           SOCB *R15+,*R15+
5FDA FFFF           SOCB *R15+,*R15+
5FDC FFFF           SOCB *R15+,*R15+
5FDE FFFF           SOCB *R15+,*R15+
5FE0 FFFF           SOCB *R15+,*R15+
5FE2 FFFF           SOCB *R15+,*R15+
5FE4 FFFF           SOCB *R15+,*R15+
5FE6 FFFF           SOCB *R15+,*R15+
5FE8 FFFF           SOCB *R15+,*R15+
5FEA FFFF           SOCB *R15+,*R15+
5FEC FFFF           SOCB *R15+,*R15+
5FEE FFFF           SOCB *R15+,*R15+
5FF0 7FFF           SB   *R15+,*R15+
5FF2 E3FF           SOC  *R15+,R15
5FF4 FDFF           SOCB *R15+,*R7+
5FF6 FFFF           SOCB *R15+,*R15+
5FF8 FFFF           SOCB *R15+,*R15+
5FFA FFFF           SOCB *R15+,*R15+
5FFC FFFF           SOCB *R15+,*R15+
5FFE FFFF           SOCB *R15+,*R15+
