Home » Archimedes archive » Acorn User » AU 1993-08.adf » !3DGraphic_3DGraphic » BAU3DSrce

BAU3DSrce

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

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

Tape/disk: Home » Archimedes archive » Acorn User » AU 1993-08.adf » !3DGraphic_3DGraphic
Filename: BAU3DSrce
Read OK:
File size: 10FD bytes
Load address: 0000
Exec address: 0000
File contents
    0REM Extra/replacement lines for BAU3DSrce
   10REM >BAU3DSrce
   20REM by DCA
   30REM for 32-bit machines
   40REM (c) BAU July 1993
   50:
   60DIM code% &10000,swi$(64),swi(64),def(64)
   70def()=FALSE
   80max_swi=-1
   90i%=0
  100REPEAT
  110 SYS "OS_GBPB",9,"Source",code%,1,i%,&100,"*" TO ,,,read%,i%
  120 IF read%=1 THEN
  130  j%=code%
  140  WHILE ?j%>=32
  150   j%+=1
  160  ENDWHILE
  170  ?j%=13
  180  f$=FNlc($code%)
  190  IF LEFT$(f$,3)="swi" THEN
  200   swi_no=VAL(MID$(f$,4))
  210   def(swi_no)=TRUE
  220   IF swi_no>max_swi max_swi=swi_no
  230   swi$(swi_no)="Source."+f$
  240  ENDIF
  250 ENDIF
  260UNTIL i%=-1
  270IF max_swi=-1 ERROR 0,"No source files found!"
  280swi$(64)="Source.Version"
  290OVERLAY swi$()
  300swi_chunk=&CE440
  310vbit=1<<28
  320wp=12:sp=13:link=14:pc=15
  330wk=0
  340FOR swi=0 TO max_swi
  341 IF def(swi) THEN z=EVAL("FNswi"+RIGHT$("0"+STR$swi,2)+"_vars")
  342NEXT
  350FOR pass%=4 TO 6 STEP 2
  360P%=0
  370O%=code%
  380[OPT pass%
  390.module_base
  400        DCD     0
  410        DCD     init
  420        DCD     final
  430        DCD     service
  440        DCD     title
  450        DCD     help
  460        DCD     0
  470        DCD     swi_chunk
  480        DCD     swi_handler
  490        DCD     swi_table
  500        DCD     0
  510
  520.init   STMFD   (sp)!,{link}
  530        MOV     r0,#6
  540        MOV     r2,#0
  550        MOV     r3,#wk AND &FF
  560        ORR     r3,r3,#wk AND &FF00
  570        SWI     "XOS_Module"
  580        MOVVS   r2,#0
  590        LDMFD   (sp)!,{link}
  600        CMP     r2,#0
  610        ADREQ   r0,cant_init
  620        ORREQS  pc,link,#vbit
  630        STR     r2,[wp]
  631     FNinit_code
  640        BICS    pc,link,#vbit
  650
  660.cant_init
  670        DCD     0
  680        EQUS    "BAU3D cannot initialise"
  690        DCB     0
  700        ALIGN
  710
  720.final  STMFD   (sp)!,{link}
  721     FNfinal_code
  730        MOV     r0,#7
  740        LDR     r2,[wp]
  750        SWI     "XOS_Module"
  760        LDMFD   (sp)!,{pc}
  770
  780.service
  790        STMFD   (sp)!,{link}
  800        LDMFD   (sp)!,{pc}
  810
  820.title  EQUS    "BAU3D"
  830        DCB     0
  840        ALIGN
  850
  860.help   EQUS    "BAU3D"
  870        DCB     9
  880        DCB     9
  890        EQUS    FNversion
  900        DCB     0
  910        ALIGN
  920
  930.swi_handler
  940        LDR     wp,[wp]
  950        CMP     r11,#max_swi+1
  960        ADDCC   pc,pc,r11,LSL #2
  970        B       unknown_swi
  980]
  990FOR swi=0 TO max_swi
 1000 [OPT pass%
 1010        B       swi(swi)
 1020 ]
 1030NEXT
 1040[OPT pass%
 1050.unknown_swi
 1060        ADR     r0,bad_swi_err
 1070        ORRS    pc,link,#vbit
 1080.bad_swi_err
 1090        DCD     &1E6
 1100        EQUS    "Unknown BAU3D operation"
 1110        DCB     0
 1120        ALIGN
 1130
 1140.swi_table
 1150        EQUS     "BAU3D"
 1160        DCB     0
 1170]
 1180FOR swi=0 TO max_swi
 1190 IF def(swi) THEN
 1200  [OPT pass%
 1210        EQUS    EVAL("FNswi"+RIGHT$("0"+STR$swi,2)+"_name")
 1220        DCB     0
 1230  ]
 1240 ELSE
 1250  [OPT pass%
 1260        EQUS    "Unused"+RIGHT$("0"+STR$swi,2)
 1270        DCB     0
 1280  ]
 1290 ENDIF
 1300NEXT
 1310[OPT pass%
 1320        DCB     0
 1330        ALIGN
 1340
 1350]
 1360FOR swi=0 TO max_swi
 1370 swi(swi)=P%
 1380 IF def(swi) THEN
 1390  k=EVAL("FNswi"+RIGHT$("0"+STR$swi,2)+"_code")
 1400 ELSE
 1410  [OPT pass%
 1420        MOV     pc,link
 1430  ]
 1440 ENDIF
 1450NEXT
 1460[OPT pass%
 1470.divide
 1480        STMFD   (sp)!,{r3,link}
 1490        EOR     r3,r0,r1
 1500        CMP     r0,#0
 1510        RSBLT   r0,r0,#0
 1520        CMP     r1,#0
 1530        RSBLT   r1,r1,#0
 1540        MOV     r14,r1
 1550        CMP     r14,r0,LSR #1
 1560.div1   MOVLS   r14,r14,LSL #1
 1570        CMPLS   r14,r0,LSR #1
 1580        BLS     div1
 1590        MOV     r2,#0
 1600.div2   CMP     r0,r14
 1610        SUBCS   r0,r0,r14
 1620        ADC     r2,r2,r2
 1630        MOV     r14,r14,LSR #1
 1640        CMP     r14,r1
 1650        BCS     div2
 1660        TST     r3,#1<<31
 1670        RSBNE   r2,r2,#0
 1680        LDMFD   (sp)!,{r3,pc}
 1690]
 1700NEXT pass%
 1710SYS "OS_File",10,"BAU3D",&FFA,,code%,O%
 1720END
 1730:
 1740DEF FNtable(size%)
 1750P%+=size%
 1760O%+=size%
 1770=0
 1780:
 1790DEF FNswap(a,b)
 1800[OPT pass%
 1810        EOR     a,a,b
 1820        EOR     b,a,b
 1830        EOR     a,a,b
 1840]
 1850=0
 1860:
 1870DEF FNadrl(reg,off)
 1880[OPT pass%
 1890        ADD     reg,wp,#(off AND &FF)
 1900        ADD     reg,reg,#(off AND &FF00)
 1910]
 1920=0
 1930:
 1940DEF FNadreql(reg,off)
 1950[OPT pass%
 1960        ADDEQ   reg,wp,#(off AND &FF)
 1970        ADDEQ   reg,reg,#(off AND &FF00)
 1980]
 1990=0
 2000:
 2010DEF FNwk(req)
 2020wk+=req
 2030=wk-req
 2040:
 2050DEF FNlc(a$)
 2060LOCAL b$,i,c
 2070FOR i=1 TO LEN(a$)
 2080 c=ASCMID$(a$,i)
 2090 IF c>=ASC"A" AND c<=ASC"Z" c+=32
 2100 b$+=CHR$c
 2110NEXT
 2120=b$
+� Extra/replacement lines for BAU3DSrce

� >BAU3DSrce
� by DCA
� for 32-bit machines
(� (c) BAU July 1993
2:
<+� code% &10000,swi$(64),swi(64),def(64)
Fdef()=�
Pmax_swi=-1
Zi%=0
d�
n> ș "OS_GBPB",9,"Source",code%,1,i%,&100,"*" � ,,,read%,i%
x � read%=1 �
�  j%=code%
�  ȕ ?j%>=32
�   j%+=1
�  �
�  ?j%=13
�  f$=�lc($code%)
�  � �f$,3)="swi" �
�   swi_no=�(�f$,4))
�   def(swi_no)=�
�&   � swi_no>max_swi max_swi=swi_no
�    swi$(swi_no)="Source."+f$
�  �
� �
� i%=-1
-� max_swi=-1 � 0,"No source files found!"
swi$(64)="Source.Version"
"
ȣ swi$()
,swi_chunk=&CE440
6vbit=1<<28
@wp=12:sp=13:link=14:pc=15
Jwk=0
T� swi=0 � max_swi
U3 � def(swi) � z=�("FNswi"+�"0"+�swi,2)+"_vars")
V�
^� pass%=4 � 6 � 2
hP%=0
rO%=code%
|[OPT pass%
�.module_base
�        DCD     0
�        DCD     init
�        DCD     final
�        DCD     service
�        DCD     title
�        DCD     help
�        DCD     0
�        DCD     swi_chunk
�        DCD     swi_handler
�        DCD     swi_table
�        DCD     0
�
 .init   STMFD   (sp)!,{link}
        MOV     r0,#6
        MOV     r2,#0
&         MOV     r3,#wk � &FF
0$        �R     r3,r3,#wk � &FF00
:         SWI     "XOS_Module"
D        MOVVS   r2,#0
N         LDMFD   (sp)!,{link}
X        CMP     r2,#0
b         ADREQ   r0,cant_init
l         �REQS  pc,link,#vbit
v        STR     r2,[wp]
w     �init_code
�!        BICS    pc,link,#vbit
�
�.cant_init
�        DCD     0
�-        EQUS    "BAU3D cannot initialise"
�        DCB     0
�        ALIGN
�
� .final  STMFD   (sp)!,{link}
�     �final_code
�        MOV     r0,#7
�        LDR     r2,[wp]
�         SWI     "XOS_Module"
�        LDMFD   (sp)!,{pc}

.service
         STMFD   (sp)!,{link}
         LDMFD   (sp)!,{pc}
*
4.title  EQUS    "BAU3D"
>        DCB     0
H        ALIGN
R
\.help   EQUS    "BAU3D"
f        DCB     9
p        DCB     9
z        EQUS    �version
�        DCB     0
�        ALIGN
�
�.swi_handler
�        LDR     wp,[wp]
�"        CMP     r11,#max_swi+1
�$        ADDCC   pc,pc,r11,LSL #2
�        B       unknown_swi
�]
�� swi=0 � max_swi
� [OPT pass%
�        B       swi(swi)
� ]
�
[OPT pass%
.unknown_swi
$"        ADR     r0,bad_swi_err
.         �RS    pc,link,#vbit
8.bad_swi_err
B        DCD     &1E6
L-        EQUS    "Unknown BAU3D operation"
V        DCB     0
`        ALIGN
j
t.swi_table
~        EQUS     "BAU3D"
�        DCB     0
�]
�� swi=0 � max_swi
� � def(swi) �
�  [OPT pass%
�3        EQUS    �("FNswi"+�"0"+�swi,2)+"_name")
�        DCB     0
�  ]
� �
�  [OPT pass%
�)        EQUS    "Unused"+�"0"+�swi,2)
�        DCB     0
  ]

 �
�
[OPT pass%
(        DCB     0
2        ALIGN
<
F]
P� swi=0 � max_swi
Z swi(swi)=P%
d � def(swi) �
n'  k=�("FNswi"+�"0"+�swi,2)+"_code")
x �
�  [OPT pass%
�        MOV     pc,link
�  ]
� �
��
�[OPT pass%
�.divide
�#        STMFD   (sp)!,{r3,link}
�        �     r3,r0,r1
�        CMP     r0,#0
�        RSBLT   r0,r0,#0
�        CMP     r1,#0
�        RSBLT   r1,r1,#0
        MOV     r14,r1
!        CMP     r14,r0,LSR #1
".div1   MOVLS   r14,r14,LSL #1
"!        CMPLS   r14,r0,LSR #1
,        BLS     div1
6        MOV     r2,#0
@.div2   CMP     r0,r14
J        SUBCS   r0,r0,r14
T        ADC     r2,r2,r2
^"        MOV     r14,r14,LSR #1
h        CMP     r14,r1
r        BCS     div2
|        TST     r3,#1<<31
�        RSBNE   r2,r2,#0
�!        LDMFD   (sp)!,{r3,pc}
�]
�� pass%
�*ș "OS_File",10,"BAU3D",&FFA,,code%,O%
��
�:
�� �table(size%)
�
P%+=size%
�
O%+=size%
�=0
�:
�� �swap(a,b)
[OPT pass%
        �     a,a,b
        �     b,a,b
&        �     a,a,b
0]
:=0
D:
N� �adrl(reg,off)
X[OPT pass%
b'        ADD     reg,wp,#(off � &FF)
l*        ADD     reg,reg,#(off � &FF00)
v]
�=0
�:
�� �adreql(reg,off)
�[OPT pass%
�'        ADDEQ   reg,wp,#(off � &FF)
�*        ADDEQ   reg,reg,#(off � &FF00)
�]
�=0
�:
�� �wk(req)
�wk+=req
�=wk-req
�:

� �lc(a$)
� b$,i,c
� i=1 � �(a$)
  c=��a$,i)
* � c>=�"A" � c<=�"Z" c+=32
4 b$+=�c
>�
H=b$
�
00000000  0d 00 00 2b f4 20 45 78  74 72 61 2f 72 65 70 6c  |...+. Extra/repl|
00000010  61 63 65 6d 65 6e 74 20  6c 69 6e 65 73 20 66 6f  |acement lines fo|
00000020  72 20 42 41 55 33 44 53  72 63 65 0d 00 0a 10 f4  |r BAU3DSrce.....|
00000030  20 3e 42 41 55 33 44 53  72 63 65 0d 00 14 0c f4  | >BAU3DSrce.....|
00000040  20 62 79 20 44 43 41 0d  00 1e 19 f4 20 66 6f 72  | by DCA..... for|
00000050  20 33 32 2d 62 69 74 20  6d 61 63 68 69 6e 65 73  | 32-bit machines|
00000060  0d 00 28 17 f4 20 28 63  29 20 42 41 55 20 4a 75  |..(.. (c) BAU Ju|
00000070  6c 79 20 31 39 39 33 0d  00 32 05 3a 0d 00 3c 2b  |ly 1993..2.:..<+|
00000080  de 20 63 6f 64 65 25 20  26 31 30 30 30 30 2c 73  |. code% &10000,s|
00000090  77 69 24 28 36 34 29 2c  73 77 69 28 36 34 29 2c  |wi$(64),swi(64),|
000000a0  64 65 66 28 36 34 29 0d  00 46 0b 64 65 66 28 29  |def(64)..F.def()|
000000b0  3d a3 0d 00 50 0e 6d 61  78 5f 73 77 69 3d 2d 31  |=...P.max_swi=-1|
000000c0  0d 00 5a 08 69 25 3d 30  0d 00 64 05 f5 0d 00 6e  |..Z.i%=0..d....n|
000000d0  3e 20 c8 99 20 22 4f 53  5f 47 42 50 42 22 2c 39  |> .. "OS_GBPB",9|
000000e0  2c 22 53 6f 75 72 63 65  22 2c 63 6f 64 65 25 2c  |,"Source",code%,|
000000f0  31 2c 69 25 2c 26 31 30  30 2c 22 2a 22 20 b8 20  |1,i%,&100,"*" . |
00000100  2c 2c 2c 72 65 61 64 25  2c 69 25 0d 00 78 10 20  |,,,read%,i%..x. |
00000110  e7 20 72 65 61 64 25 3d  31 20 8c 0d 00 82 0e 20  |. read%=1 ..... |
00000120  20 6a 25 3d 63 6f 64 65  25 0d 00 8c 10 20 20 c8  | j%=code%....  .|
00000130  95 20 3f 6a 25 3e 3d 33  32 0d 00 96 0c 20 20 20  |. ?j%>=32....   |
00000140  6a 25 2b 3d 31 0d 00 a0  07 20 20 ce 0d 00 aa 0c  |j%+=1....  .....|
00000150  20 20 3f 6a 25 3d 31 33  0d 00 b4 14 20 20 66 24  |  ?j%=13....  f$|
00000160  3d a4 6c 63 28 24 63 6f  64 65 25 29 0d 00 be 16  |=.lc($code%)....|
00000170  20 20 e7 20 c0 66 24 2c  33 29 3d 22 73 77 69 22  |  . .f$,3)="swi"|
00000180  20 8c 0d 00 c8 17 20 20  20 73 77 69 5f 6e 6f 3d  | .....   swi_no=|
00000190  bb 28 c1 66 24 2c 34 29  29 0d 00 d2 14 20 20 20  |.(.f$,4))....   |
000001a0  64 65 66 28 73 77 69 5f  6e 6f 29 3d b9 0d 00 dc  |def(swi_no)=....|
000001b0  26 20 20 20 e7 20 73 77  69 5f 6e 6f 3e 6d 61 78  |&   . swi_no>max|
000001c0  5f 73 77 69 20 6d 61 78  5f 73 77 69 3d 73 77 69  |_swi max_swi=swi|
000001d0  5f 6e 6f 0d 00 e6 20 20  20 20 73 77 69 24 28 73  |_no...    swi$(s|
000001e0  77 69 5f 6e 6f 29 3d 22  53 6f 75 72 63 65 2e 22  |wi_no)="Source."|
000001f0  2b 66 24 0d 00 f0 07 20  20 cd 0d 00 fa 06 20 cd  |+f$....  ..... .|
00000200  0d 01 04 0b fd 20 69 25  3d 2d 31 0d 01 0e 2d e7  |..... i%=-1...-.|
00000210  20 6d 61 78 5f 73 77 69  3d 2d 31 20 85 20 30 2c  | max_swi=-1 . 0,|
00000220  22 4e 6f 20 73 6f 75 72  63 65 20 66 69 6c 65 73  |"No source files|
00000230  20 66 6f 75 6e 64 21 22  0d 01 18 1d 73 77 69 24  | found!"....swi$|
00000240  28 36 34 29 3d 22 53 6f  75 72 63 65 2e 56 65 72  |(64)="Source.Ver|
00000250  73 69 6f 6e 22 0d 01 22  0d c8 a3 20 73 77 69 24  |sion".."... swi$|
00000260  28 29 0d 01 2c 14 73 77  69 5f 63 68 75 6e 6b 3d  |()..,.swi_chunk=|
00000270  26 43 45 34 34 30 0d 01  36 0e 76 62 69 74 3d 31  |&CE440..6.vbit=1|
00000280  3c 3c 32 38 0d 01 40 1d  77 70 3d 31 32 3a 73 70  |<<28..@.wp=12:sp|
00000290  3d 31 33 3a 6c 69 6e 6b  3d 31 34 3a 70 63 3d 31  |=13:link=14:pc=1|
000002a0  35 0d 01 4a 08 77 6b 3d  30 0d 01 54 15 e3 20 73  |5..J.wk=0..T.. s|
000002b0  77 69 3d 30 20 b8 20 6d  61 78 5f 73 77 69 0d 01  |wi=0 . max_swi..|
000002c0  55 33 20 e7 20 64 65 66  28 73 77 69 29 20 8c 20  |U3 . def(swi) . |
000002d0  7a 3d a0 28 22 46 4e 73  77 69 22 2b c2 22 30 22  |z=.("FNswi"+."0"|
000002e0  2b c3 73 77 69 2c 32 29  2b 22 5f 76 61 72 73 22  |+.swi,2)+"_vars"|
000002f0  29 0d 01 56 05 ed 0d 01  5e 15 e3 20 70 61 73 73  |)..V....^.. pass|
00000300  25 3d 34 20 b8 20 36 20  88 20 32 0d 01 68 08 50  |%=4 . 6 . 2..h.P|
00000310  25 3d 30 0d 01 72 0c 4f  25 3d 63 6f 64 65 25 0d  |%=0..r.O%=code%.|
00000320  01 7c 0e 5b 4f 50 54 20  70 61 73 73 25 0d 01 86  |.|.[OPT pass%...|
00000330  10 2e 6d 6f 64 75 6c 65  5f 62 61 73 65 0d 01 90  |..module_base...|
00000340  15 20 20 20 20 20 20 20  20 44 43 44 20 20 20 20  |.        DCD    |
00000350  20 30 0d 01 9a 18 20 20  20 20 20 20 20 20 44 43  | 0....        DC|
00000360  44 20 20 20 20 20 69 6e  69 74 0d 01 a4 19 20 20  |D     init....  |
00000370  20 20 20 20 20 20 44 43  44 20 20 20 20 20 66 69  |      DCD     fi|
00000380  6e 61 6c 0d 01 ae 1b 20  20 20 20 20 20 20 20 44  |nal....        D|
00000390  43 44 20 20 20 20 20 73  65 72 76 69 63 65 0d 01  |CD     service..|
000003a0  b8 19 20 20 20 20 20 20  20 20 44 43 44 20 20 20  |..        DCD   |
000003b0  20 20 74 69 74 6c 65 0d  01 c2 18 20 20 20 20 20  |  title....     |
000003c0  20 20 20 44 43 44 20 20  20 20 20 68 65 6c 70 0d  |   DCD     help.|
000003d0  01 cc 15 20 20 20 20 20  20 20 20 44 43 44 20 20  |...        DCD  |
000003e0  20 20 20 30 0d 01 d6 1d  20 20 20 20 20 20 20 20  |   0....        |
000003f0  44 43 44 20 20 20 20 20  73 77 69 5f 63 68 75 6e  |DCD     swi_chun|
00000400  6b 0d 01 e0 1f 20 20 20  20 20 20 20 20 44 43 44  |k....        DCD|
00000410  20 20 20 20 20 73 77 69  5f 68 61 6e 64 6c 65 72  |     swi_handler|
00000420  0d 01 ea 1d 20 20 20 20  20 20 20 20 44 43 44 20  |....        DCD |
00000430  20 20 20 20 73 77 69 5f  74 61 62 6c 65 0d 01 f4  |    swi_table...|
00000440  15 20 20 20 20 20 20 20  20 44 43 44 20 20 20 20  |.        DCD    |
00000450  20 30 0d 01 fe 04 0d 02  08 20 2e 69 6e 69 74 20  | 0....... .init |
00000460  20 20 53 54 4d 46 44 20  20 20 28 73 70 29 21 2c  |  STMFD   (sp)!,|
00000470  7b 6c 69 6e 6b 7d 0d 02  12 19 20 20 20 20 20 20  |{link}....      |
00000480  20 20 4d 4f 56 20 20 20  20 20 72 30 2c 23 36 0d  |  MOV     r0,#6.|
00000490  02 1c 19 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |...        MOV  |
000004a0  20 20 20 72 32 2c 23 30  0d 02 26 20 20 20 20 20  |   r2,#0..&     |
000004b0  20 20 20 20 4d 4f 56 20  20 20 20 20 72 33 2c 23  |    MOV     r3,#|
000004c0  77 6b 20 80 20 26 46 46  0d 02 30 24 20 20 20 20  |wk . &FF..0$    |
000004d0  20 20 20 20 84 52 20 20  20 20 20 72 33 2c 72 33  |    .R     r3,r3|
000004e0  2c 23 77 6b 20 80 20 26  46 46 30 30 0d 02 3a 20  |,#wk . &FF00..: |
000004f0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00000500  22 58 4f 53 5f 4d 6f 64  75 6c 65 22 0d 02 44 19  |"XOS_Module"..D.|
00000510  20 20 20 20 20 20 20 20  4d 4f 56 56 53 20 20 20  |        MOVVS   |
00000520  72 32 2c 23 30 0d 02 4e  20 20 20 20 20 20 20 20  |r2,#0..N        |
00000530  20 4c 44 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | LDMFD   (sp)!,{|
00000540  6c 69 6e 6b 7d 0d 02 58  19 20 20 20 20 20 20 20  |link}..X.       |
00000550  20 43 4d 50 20 20 20 20  20 72 32 2c 23 30 0d 02  | CMP     r2,#0..|
00000560  62 20 20 20 20 20 20 20  20 20 41 44 52 45 51 20  |b         ADREQ |
00000570  20 20 72 30 2c 63 61 6e  74 5f 69 6e 69 74 0d 02  |  r0,cant_init..|
00000580  6c 20 20 20 20 20 20 20  20 20 84 52 45 51 53 20  |l         .REQS |
00000590  20 70 63 2c 6c 69 6e 6b  2c 23 76 62 69 74 0d 02  | pc,link,#vbit..|
000005a0  76 1b 20 20 20 20 20 20  20 20 53 54 52 20 20 20  |v.        STR   |
000005b0  20 20 72 32 2c 5b 77 70  5d 0d 02 77 13 20 20 20  |  r2,[wp]..w.   |
000005c0  20 20 a4 69 6e 69 74 5f  63 6f 64 65 0d 02 80 21  |  .init_code...!|
000005d0  20 20 20 20 20 20 20 20  42 49 43 53 20 20 20 20  |        BICS    |
000005e0  70 63 2c 6c 69 6e 6b 2c  23 76 62 69 74 0d 02 8a  |pc,link,#vbit...|
000005f0  04 0d 02 94 0e 2e 63 61  6e 74 5f 69 6e 69 74 0d  |......cant_init.|
00000600  02 9e 15 20 20 20 20 20  20 20 20 44 43 44 20 20  |...        DCD  |
00000610  20 20 20 30 0d 02 a8 2d  20 20 20 20 20 20 20 20  |   0...-        |
00000620  45 51 55 53 20 20 20 20  22 42 41 55 33 44 20 63  |EQUS    "BAU3D c|
00000630  61 6e 6e 6f 74 20 69 6e  69 74 69 61 6c 69 73 65  |annot initialise|
00000640  22 0d 02 b2 15 20 20 20  20 20 20 20 20 44 43 42  |"....        DCB|
00000650  20 20 20 20 20 30 0d 02  bc 11 20 20 20 20 20 20  |     0....      |
00000660  20 20 41 4c 49 47 4e 0d  02 c6 04 0d 02 d0 20 2e  |  ALIGN....... .|
00000670  66 69 6e 61 6c 20 20 53  54 4d 46 44 20 20 20 28  |final  STMFD   (|
00000680  73 70 29 21 2c 7b 6c 69  6e 6b 7d 0d 02 d1 14 20  |sp)!,{link}.... |
00000690  20 20 20 20 a4 66 69 6e  61 6c 5f 63 6f 64 65 0d  |    .final_code.|
000006a0  02 da 19 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |...        MOV  |
000006b0  20 20 20 72 30 2c 23 37  0d 02 e4 1b 20 20 20 20  |   r0,#7....    |
000006c0  20 20 20 20 4c 44 52 20  20 20 20 20 72 32 2c 5b  |    LDR     r2,[|
000006d0  77 70 5d 0d 02 ee 20 20  20 20 20 20 20 20 20 53  |wp]...         S|
000006e0  57 49 20 20 20 20 20 22  58 4f 53 5f 4d 6f 64 75  |WI     "XOS_Modu|
000006f0  6c 65 22 0d 02 f8 1e 20  20 20 20 20 20 20 20 4c  |le"....        L|
00000700  44 4d 46 44 20 20 20 28  73 70 29 21 2c 7b 70 63  |DMFD   (sp)!,{pc|
00000710  7d 0d 03 02 04 0d 03 0c  0c 2e 73 65 72 76 69 63  |}.........servic|
00000720  65 0d 03 16 20 20 20 20  20 20 20 20 20 53 54 4d  |e...         STM|
00000730  46 44 20 20 20 28 73 70  29 21 2c 7b 6c 69 6e 6b  |FD   (sp)!,{link|
00000740  7d 0d 03 20 1e 20 20 20  20 20 20 20 20 4c 44 4d  |}.. .        LDM|
00000750  46 44 20 20 20 28 73 70  29 21 2c 7b 70 63 7d 0d  |FD   (sp)!,{pc}.|
00000760  03 2a 04 0d 03 34 1b 2e  74 69 74 6c 65 20 20 45  |.*...4..title  E|
00000770  51 55 53 20 20 20 20 22  42 41 55 33 44 22 0d 03  |QUS    "BAU3D"..|
00000780  3e 15 20 20 20 20 20 20  20 20 44 43 42 20 20 20  |>.        DCB   |
00000790  20 20 30 0d 03 48 11 20  20 20 20 20 20 20 20 41  |  0..H.        A|
000007a0  4c 49 47 4e 0d 03 52 04  0d 03 5c 1b 2e 68 65 6c  |LIGN..R...\..hel|
000007b0  70 20 20 20 45 51 55 53  20 20 20 20 22 42 41 55  |p   EQUS    "BAU|
000007c0  33 44 22 0d 03 66 15 20  20 20 20 20 20 20 20 44  |3D"..f.        D|
000007d0  43 42 20 20 20 20 20 39  0d 03 70 15 20 20 20 20  |CB     9..p.    |
000007e0  20 20 20 20 44 43 42 20  20 20 20 20 39 0d 03 7a  |    DCB     9..z|
000007f0  1c 20 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |.        EQUS   |
00000800  20 a4 76 65 72 73 69 6f  6e 0d 03 84 15 20 20 20  | .version....   |
00000810  20 20 20 20 20 44 43 42  20 20 20 20 20 30 0d 03  |     DCB     0..|
00000820  8e 11 20 20 20 20 20 20  20 20 41 4c 49 47 4e 0d  |..        ALIGN.|
00000830  03 98 04 0d 03 a2 10 2e  73 77 69 5f 68 61 6e 64  |........swi_hand|
00000840  6c 65 72 0d 03 ac 1b 20  20 20 20 20 20 20 20 4c  |ler....        L|
00000850  44 52 20 20 20 20 20 77  70 2c 5b 77 70 5d 0d 03  |DR     wp,[wp]..|
00000860  b6 22 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |."        CMP   |
00000870  20 20 72 31 31 2c 23 6d  61 78 5f 73 77 69 2b 31  |  r11,#max_swi+1|
00000880  0d 03 c0 24 20 20 20 20  20 20 20 20 41 44 44 43  |...$        ADDC|
00000890  43 20 20 20 70 63 2c 70  63 2c 72 31 31 2c 4c 53  |C   pc,pc,r11,LS|
000008a0  4c 20 23 32 0d 03 ca 1f  20 20 20 20 20 20 20 20  |L #2....        |
000008b0  42 20 20 20 20 20 20 20  75 6e 6b 6e 6f 77 6e 5f  |B       unknown_|
000008c0  73 77 69 0d 03 d4 05 5d  0d 03 de 15 e3 20 73 77  |swi....]..... sw|
000008d0  69 3d 30 20 b8 20 6d 61  78 5f 73 77 69 0d 03 e8  |i=0 . max_swi...|
000008e0  0f 20 5b 4f 50 54 20 70  61 73 73 25 0d 03 f2 1c  |. [OPT pass%....|
000008f0  20 20 20 20 20 20 20 20  42 20 20 20 20 20 20 20  |        B       |
00000900  73 77 69 28 73 77 69 29  0d 03 fc 06 20 5d 0d 04  |swi(swi).... ]..|
00000910  06 05 ed 0d 04 10 0e 5b  4f 50 54 20 70 61 73 73  |.......[OPT pass|
00000920  25 0d 04 1a 10 2e 75 6e  6b 6e 6f 77 6e 5f 73 77  |%.....unknown_sw|
00000930  69 0d 04 24 22 20 20 20  20 20 20 20 20 41 44 52  |i..$"        ADR|
00000940  20 20 20 20 20 72 30 2c  62 61 64 5f 73 77 69 5f  |     r0,bad_swi_|
00000950  65 72 72 0d 04 2e 20 20  20 20 20 20 20 20 20 84  |err...         .|
00000960  52 53 20 20 20 20 70 63  2c 6c 69 6e 6b 2c 23 76  |RS    pc,link,#v|
00000970  62 69 74 0d 04 38 10 2e  62 61 64 5f 73 77 69 5f  |bit..8..bad_swi_|
00000980  65 72 72 0d 04 42 18 20  20 20 20 20 20 20 20 44  |err..B.        D|
00000990  43 44 20 20 20 20 20 26  31 45 36 0d 04 4c 2d 20  |CD     &1E6..L- |
000009a0  20 20 20 20 20 20 20 45  51 55 53 20 20 20 20 22  |       EQUS    "|
000009b0  55 6e 6b 6e 6f 77 6e 20  42 41 55 33 44 20 6f 70  |Unknown BAU3D op|
000009c0  65 72 61 74 69 6f 6e 22  0d 04 56 15 20 20 20 20  |eration"..V.    |
000009d0  20 20 20 20 44 43 42 20  20 20 20 20 30 0d 04 60  |    DCB     0..`|
000009e0  11 20 20 20 20 20 20 20  20 41 4c 49 47 4e 0d 04  |.        ALIGN..|
000009f0  6a 04 0d 04 74 0e 2e 73  77 69 5f 74 61 62 6c 65  |j...t..swi_table|
00000a00  0d 04 7e 1c 20 20 20 20  20 20 20 20 45 51 55 53  |..~.        EQUS|
00000a10  20 20 20 20 20 22 42 41  55 33 44 22 0d 04 88 15  |     "BAU3D"....|
00000a20  20 20 20 20 20 20 20 20  44 43 42 20 20 20 20 20  |        DCB     |
00000a30  30 0d 04 92 05 5d 0d 04  9c 15 e3 20 73 77 69 3d  |0....]..... swi=|
00000a40  30 20 b8 20 6d 61 78 5f  73 77 69 0d 04 a6 11 20  |0 . max_swi.... |
00000a50  e7 20 64 65 66 28 73 77  69 29 20 8c 0d 04 b0 10  |. def(swi) .....|
00000a60  20 20 5b 4f 50 54 20 70  61 73 73 25 0d 04 ba 33  |  [OPT pass%...3|
00000a70  20 20 20 20 20 20 20 20  45 51 55 53 20 20 20 20  |        EQUS    |
00000a80  a0 28 22 46 4e 73 77 69  22 2b c2 22 30 22 2b c3  |.("FNswi"+."0"+.|
00000a90  73 77 69 2c 32 29 2b 22  5f 6e 61 6d 65 22 29 0d  |swi,2)+"_name").|
00000aa0  04 c4 15 20 20 20 20 20  20 20 20 44 43 42 20 20  |...        DCB  |
00000ab0  20 20 20 30 0d 04 ce 07  20 20 5d 0d 04 d8 06 20  |   0....  ].... |
00000ac0  cc 0d 04 e2 10 20 20 5b  4f 50 54 20 70 61 73 73  |.....  [OPT pass|
00000ad0  25 0d 04 ec 29 20 20 20  20 20 20 20 20 45 51 55  |%...)        EQU|
00000ae0  53 20 20 20 20 22 55 6e  75 73 65 64 22 2b c2 22  |S    "Unused"+."|
00000af0  30 22 2b c3 73 77 69 2c  32 29 0d 04 f6 15 20 20  |0"+.swi,2)....  |
00000b00  20 20 20 20 20 20 44 43  42 20 20 20 20 20 30 0d  |      DCB     0.|
00000b10  05 00 07 20 20 5d 0d 05  0a 06 20 cd 0d 05 14 05  |...  ].... .....|
00000b20  ed 0d 05 1e 0e 5b 4f 50  54 20 70 61 73 73 25 0d  |.....[OPT pass%.|
00000b30  05 28 15 20 20 20 20 20  20 20 20 44 43 42 20 20  |.(.        DCB  |
00000b40  20 20 20 30 0d 05 32 11  20 20 20 20 20 20 20 20  |   0..2.        |
00000b50  41 4c 49 47 4e 0d 05 3c  04 0d 05 46 05 5d 0d 05  |ALIGN..<...F.]..|
00000b60  50 15 e3 20 73 77 69 3d  30 20 b8 20 6d 61 78 5f  |P.. swi=0 . max_|
00000b70  73 77 69 0d 05 5a 10 20  73 77 69 28 73 77 69 29  |swi..Z. swi(swi)|
00000b80  3d 50 25 0d 05 64 11 20  e7 20 64 65 66 28 73 77  |=P%..d. . def(sw|
00000b90  69 29 20 8c 0d 05 6e 27  20 20 6b 3d a0 28 22 46  |i) ...n'  k=.("F|
00000ba0  4e 73 77 69 22 2b c2 22  30 22 2b c3 73 77 69 2c  |Nswi"+."0"+.swi,|
00000bb0  32 29 2b 22 5f 63 6f 64  65 22 29 0d 05 78 06 20  |2)+"_code")..x. |
00000bc0  cc 0d 05 82 10 20 20 5b  4f 50 54 20 70 61 73 73  |.....  [OPT pass|
00000bd0  25 0d 05 8c 1b 20 20 20  20 20 20 20 20 4d 4f 56  |%....        MOV|
00000be0  20 20 20 20 20 70 63 2c  6c 69 6e 6b 0d 05 96 07  |     pc,link....|
00000bf0  20 20 5d 0d 05 a0 06 20  cd 0d 05 aa 05 ed 0d 05  |  ].... ........|
00000c00  b4 0e 5b 4f 50 54 20 70  61 73 73 25 0d 05 be 0b  |..[OPT pass%....|
00000c10  2e 64 69 76 69 64 65 0d  05 c8 23 20 20 20 20 20  |.divide...#     |
00000c20  20 20 20 53 54 4d 46 44  20 20 20 28 73 70 29 21  |   STMFD   (sp)!|
00000c30  2c 7b 72 33 2c 6c 69 6e  6b 7d 0d 05 d2 1a 20 20  |,{r3,link}....  |
00000c40  20 20 20 20 20 20 82 20  20 20 20 20 72 33 2c 72  |      .     r3,r|
00000c50  30 2c 72 31 0d 05 dc 19  20 20 20 20 20 20 20 20  |0,r1....        |
00000c60  43 4d 50 20 20 20 20 20  72 30 2c 23 30 0d 05 e6  |CMP     r0,#0...|
00000c70  1c 20 20 20 20 20 20 20  20 52 53 42 4c 54 20 20  |.        RSBLT  |
00000c80  20 72 30 2c 72 30 2c 23  30 0d 05 f0 19 20 20 20  | r0,r0,#0....   |
00000c90  20 20 20 20 20 43 4d 50  20 20 20 20 20 72 31 2c  |     CMP     r1,|
00000ca0  23 30 0d 05 fa 1c 20 20  20 20 20 20 20 20 52 53  |#0....        RS|
00000cb0  42 4c 54 20 20 20 72 31  2c 72 31 2c 23 30 0d 06  |BLT   r1,r1,#0..|
00000cc0  04 1a 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |..        MOV   |
00000cd0  20 20 72 31 34 2c 72 31  0d 06 0e 21 20 20 20 20  |  r14,r1...!    |
00000ce0  20 20 20 20 43 4d 50 20  20 20 20 20 72 31 34 2c  |    CMP     r14,|
00000cf0  72 30 2c 4c 53 52 20 23  31 0d 06 18 22 2e 64 69  |r0,LSR #1...".di|
00000d00  76 31 20 20 20 4d 4f 56  4c 53 20 20 20 72 31 34  |v1   MOVLS   r14|
00000d10  2c 72 31 34 2c 4c 53 4c  20 23 31 0d 06 22 21 20  |,r14,LSL #1.."! |
00000d20  20 20 20 20 20 20 20 43  4d 50 4c 53 20 20 20 72  |       CMPLS   r|
00000d30  31 34 2c 72 30 2c 4c 53  52 20 23 31 0d 06 2c 18  |14,r0,LSR #1..,.|
00000d40  20 20 20 20 20 20 20 20  42 4c 53 20 20 20 20 20  |        BLS     |
00000d50  64 69 76 31 0d 06 36 19  20 20 20 20 20 20 20 20  |div1..6.        |
00000d60  4d 4f 56 20 20 20 20 20  72 32 2c 23 30 0d 06 40  |MOV     r2,#0..@|
00000d70  1a 2e 64 69 76 32 20 20  20 43 4d 50 20 20 20 20  |..div2   CMP    |
00000d80  20 72 30 2c 72 31 34 0d  06 4a 1d 20 20 20 20 20  | r0,r14..J.     |
00000d90  20 20 20 53 55 42 43 53  20 20 20 72 30 2c 72 30  |   SUBCS   r0,r0|
00000da0  2c 72 31 34 0d 06 54 1c  20 20 20 20 20 20 20 20  |,r14..T.        |
00000db0  41 44 43 20 20 20 20 20  72 32 2c 72 32 2c 72 32  |ADC     r2,r2,r2|
00000dc0  0d 06 5e 22 20 20 20 20  20 20 20 20 4d 4f 56 20  |..^"        MOV |
00000dd0  20 20 20 20 72 31 34 2c  72 31 34 2c 4c 53 52 20  |    r14,r14,LSR |
00000de0  23 31 0d 06 68 1a 20 20  20 20 20 20 20 20 43 4d  |#1..h.        CM|
00000df0  50 20 20 20 20 20 72 31  34 2c 72 31 0d 06 72 18  |P     r14,r1..r.|
00000e00  20 20 20 20 20 20 20 20  42 43 53 20 20 20 20 20  |        BCS     |
00000e10  64 69 76 32 0d 06 7c 1d  20 20 20 20 20 20 20 20  |div2..|.        |
00000e20  54 53 54 20 20 20 20 20  72 33 2c 23 31 3c 3c 33  |TST     r3,#1<<3|
00000e30  31 0d 06 86 1c 20 20 20  20 20 20 20 20 52 53 42  |1....        RSB|
00000e40  4e 45 20 20 20 72 32 2c  72 32 2c 23 30 0d 06 90  |NE   r2,r2,#0...|
00000e50  21 20 20 20 20 20 20 20  20 4c 44 4d 46 44 20 20  |!        LDMFD  |
00000e60  20 28 73 70 29 21 2c 7b  72 33 2c 70 63 7d 0d 06  | (sp)!,{r3,pc}..|
00000e70  9a 05 5d 0d 06 a4 0b ed  20 70 61 73 73 25 0d 06  |..]..... pass%..|
00000e80  ae 2a c8 99 20 22 4f 53  5f 46 69 6c 65 22 2c 31  |.*.. "OS_File",1|
00000e90  30 2c 22 42 41 55 33 44  22 2c 26 46 46 41 2c 2c  |0,"BAU3D",&FFA,,|
00000ea0  63 6f 64 65 25 2c 4f 25  0d 06 b8 05 e0 0d 06 c2  |code%,O%........|
00000eb0  05 3a 0d 06 cc 13 dd 20  a4 74 61 62 6c 65 28 73  |.:..... .table(s|
00000ec0  69 7a 65 25 29 0d 06 d6  0d 50 25 2b 3d 73 69 7a  |ize%)....P%+=siz|
00000ed0  65 25 0d 06 e0 0d 4f 25  2b 3d 73 69 7a 65 25 0d  |e%....O%+=size%.|
00000ee0  06 ea 06 3d 30 0d 06 f4  05 3a 0d 06 fe 10 dd 20  |...=0....:..... |
00000ef0  a4 73 77 61 70 28 61 2c  62 29 0d 07 08 0e 5b 4f  |.swap(a,b)....[O|
00000f00  50 54 20 70 61 73 73 25  0d 07 12 17 20 20 20 20  |PT pass%....    |
00000f10  20 20 20 20 82 20 20 20  20 20 61 2c 61 2c 62 0d  |    .     a,a,b.|
00000f20  07 1c 17 20 20 20 20 20  20 20 20 82 20 20 20 20  |...        .    |
00000f30  20 62 2c 61 2c 62 0d 07  26 17 20 20 20 20 20 20  | b,a,b..&.      |
00000f40  20 20 82 20 20 20 20 20  61 2c 61 2c 62 0d 07 30  |  .     a,a,b..0|
00000f50  05 5d 0d 07 3a 06 3d 30  0d 07 44 05 3a 0d 07 4e  |.]..:.=0..D.:..N|
00000f60  14 dd 20 a4 61 64 72 6c  28 72 65 67 2c 6f 66 66  |.. .adrl(reg,off|
00000f70  29 0d 07 58 0e 5b 4f 50  54 20 70 61 73 73 25 0d  |)..X.[OPT pass%.|
00000f80  07 62 27 20 20 20 20 20  20 20 20 41 44 44 20 20  |.b'        ADD  |
00000f90  20 20 20 72 65 67 2c 77  70 2c 23 28 6f 66 66 20  |   reg,wp,#(off |
00000fa0  80 20 26 46 46 29 0d 07  6c 2a 20 20 20 20 20 20  |. &FF)..l*      |
00000fb0  20 20 41 44 44 20 20 20  20 20 72 65 67 2c 72 65  |  ADD     reg,re|
00000fc0  67 2c 23 28 6f 66 66 20  80 20 26 46 46 30 30 29  |g,#(off . &FF00)|
00000fd0  0d 07 76 05 5d 0d 07 80  06 3d 30 0d 07 8a 05 3a  |..v.]....=0....:|
00000fe0  0d 07 94 16 dd 20 a4 61  64 72 65 71 6c 28 72 65  |..... .adreql(re|
00000ff0  67 2c 6f 66 66 29 0d 07  9e 0e 5b 4f 50 54 20 70  |g,off)....[OPT p|
00001000  61 73 73 25 0d 07 a8 27  20 20 20 20 20 20 20 20  |ass%...'        |
00001010  41 44 44 45 51 20 20 20  72 65 67 2c 77 70 2c 23  |ADDEQ   reg,wp,#|
00001020  28 6f 66 66 20 80 20 26  46 46 29 0d 07 b2 2a 20  |(off . &FF)...* |
00001030  20 20 20 20 20 20 20 41  44 44 45 51 20 20 20 72  |       ADDEQ   r|
00001040  65 67 2c 72 65 67 2c 23  28 6f 66 66 20 80 20 26  |eg,reg,#(off . &|
00001050  46 46 30 30 29 0d 07 bc  05 5d 0d 07 c6 06 3d 30  |FF00)....]....=0|
00001060  0d 07 d0 05 3a 0d 07 da  0e dd 20 a4 77 6b 28 72  |....:..... .wk(r|
00001070  65 71 29 0d 07 e4 0b 77  6b 2b 3d 72 65 71 0d 07  |eq)....wk+=req..|
00001080  ee 0b 3d 77 6b 2d 72 65  71 0d 07 f8 05 3a 0d 08  |..=wk-req....:..|
00001090  02 0d dd 20 a4 6c 63 28  61 24 29 0d 08 0c 0c ea  |... .lc(a$).....|
000010a0  20 62 24 2c 69 2c 63 0d  08 16 11 e3 20 69 3d 31  | b$,i,c..... i=1|
000010b0  20 b8 20 a9 28 61 24 29  0d 08 20 0e 20 63 3d 97  | . .(a$).. . c=.|
000010c0  c1 61 24 2c 69 29 0d 08  2a 1e 20 e7 20 63 3e 3d  |.a$,i)..*. . c>=|
000010d0  97 22 41 22 20 80 20 63  3c 3d 97 22 5a 22 20 63  |."A" . c<=."Z" c|
000010e0  2b 3d 33 32 0d 08 34 0b  20 62 24 2b 3d bd 63 0d  |+=32..4. b$+=.c.|
000010f0  08 3e 05 ed 0d 08 48 07  3d 62 24 0d ff           |.>....H.=b$..|
000010fd