Home » Archimedes archive » Micro User » MU 1991-03.adf » PD-Stuff » Misc/sysfont/SysFontSo

Misc/sysfont/SysFontSo

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 » Micro User » MU 1991-03.adf » PD-Stuff
Filename: Misc/sysfont/SysFontSo
Read OK:
File size: 2B5B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >SysFontSo          - SystemFont module source
   20REM by Joris RCALLling LEN 1990
   30:
   40REM This source generates a module called 'SystemFont', which will
   50REM add Alphabets to your system. These Alphabets can be used in
   60REM *Alphabet <alphabet name>
   70REM Below is a DATA list, add the required font names there, and when
   80REM run, this prog will generate the module containg the specified
   90REM fonts. The font files must be of type BBC Font (&FF7), and must
  100REM contain only 'VDU 23,<char>,n1,n2,n3,n4,n5,n6,n7,n8' sequences.
  110REM If not, this prog will complain. Defenitions of chars below
  120REM ASCII 32 and of ASCII 127 will be ignored.
  130:
  140font_dir$     ="@."         :REM Where the fonts can be found
  150version$      ="1.17"
  160number        =1024
  170alphabet_nr%  =25
  180code_size%    =20*1024      :REM increase this if neccesary
  190mod_name$     ="SystemFont"
  200:
  210PRINT"Generating ";mod_name$;" module v";version$;"  -  by Joris R�ling"'
  220:
  230DIM B% 2048
  240PROCassemble
  250PRINT 'mod_name$;" v";version$;" is ";P%-code%;" bytes long."
  260PRINT "Saving it to as 'SystemFont'"'
  270SYS "OS_File",10,mod_name$,&FFA,,code%,P%
  280OSCLI("RMLOAD "+mod_name$)
  290PRINT
  300END
  310:
  320REM The following lines contain the font files to be assembled,
  330REM and the name of the Alphabet (if empty, the name is same as file)
  340
  350DATA "Bold","Bold"
  360DATA "Courier",""
  370DATA "HiTech",""
  380DATA "Italic",""
  390DATA "OldIBM","IBM"
  400DATA "SmallCaps","SmallCaps"
  410DATA "Squad",""
  420DATA "Theatrical",""
  430DATA "Thin",""
  440DATA "$$$"         :REM Terminator, must be there
  450:
  460DEFPROCassemble
  470DIM code% code_size%
  480pc=15:link=14:sp=13
  490FOR pass%=0 TO 2 STEP 2
  500P%=code%
  510[OPT pass%
  520
  530;======Module Header==================================================
  540 EQUD 0
  550 EQUD 0
  560 EQUD 0
  570 EQUD service      -code%
  580 EQUD title        -code%
  590 EQUD helpstring   -code%
  600 EQUD 0
  610 EQUD 0
  620 EQUD 0
  630 EQUD 0
  640 EQUD 0
  650;=====================================================================
  660
  800.title
  810;======Title String===================================================
  820 EQUS "SystemFont":EQUB 0
  830 ALIGN
  840;=====================================================================
  850
  860;======Help String====================================================
  870.helpstring
  880 EQUS "System Font":EQUB 9
  890 EQUS version$+" ("+MID$(TIME$,5,11)+") Joris R�ling"
  900 EQUB 0
  910 ALIGN
  920;=====================================================================
  930
  940;======Service========================================================
  950.service
  960TEQ R1,#&43:MOVNES pc,link
  970TEQ R2,#1:BEQ conv_alphabet_name_to_alphabet_number
  980TEQ R2,#3:BEQ conv_alphabet_number_to_alphabet_name
  990TEQ R2,#5:BEQ define_range_of_characters
 1000MOVS pc,link
 1010;=====================================================================
 1020
 1030;======Conv alphabet name to alphabet number==========================
 1040;On entry  R3->Alphabet name
 1050;On exit   If alphabetname found, Claim call and R4=alphabet nr
 1060
 1070.conv_alphabet_name_to_alphabet_number
 1080  STMFD (sp)!,{R0-R3,link}
 1090  MOV R0,R3                 ;R0->Alphabet name
 1100  ADR R1,defenitions        ;R1->First font block
 1110.cn_ca_find_def_loop
 1120  LDR R2,[R1]               ;R2 First word of block
 1130  CMP R2,#0                 ;Is it null?
 1140  LDMEQFD (sp)!,{R0-R3,pc}^ ;Yes, so exit without claiming the call
 1150  BL str_cmp                ;Compare the two alphabet names
 1160  LDRNE R3,[R1,#16]         ;R3=Font block length
 1170  ADDNE R1,R1,R3            ;Not equal, so incr. r1
 1180  BNE cn_ca_find_def_loop   ;And check next
 1190  LDR R4,[R1,#12]           ;Alphabetnames are equal, r4=alphabet nr.
 1200  LDMFD (sp)!,{R0-R3,link}
 1210  MOV R1,#0                 ;Claim call
 1220  MOVS pc,link              ;bye, bye
 1230;=====================================================================
 1240
 1250;======Conv alphabet number to alphabet name==========================
 1260;On entry  R3=alphabet nr
 1270;On exit If alphabet nr found, Claim call, put name in buffer, R5=str len
 1280
 1290.conv_alphabet_number_to_alphabet_name
 1300  STMFD (sp)!,{R0-R4,link}  ;R3=Requested alphabet nr
 1310  ADR R1,defenitions        ;R1=First font block
 1320.ca_cn_find_def_loop
 1330  LDR R2,[R1]               ;R2=First word of font block
 1340  CMP R2,#0                 ;Is it Null ?
 1350  LDMEQFD (sp)!,{R0-R4,pc}  ;Yes, so exit without claiming the call
 1360  LDR R2,[R1,#12]           ;R2=Alphabet nr.
 1370  CMP R2,R3                 ;R3=Is R2 requested alphabet nr?
 1380  LDRNE R0,[R1,#16]         ;R0=Font block length
 1390  ADDNE R1,R1,R0            ;No, so inc.font block
 1400  BNE ca_cn_find_def_loop   ;And check next
 1410  ADD R5,R4,#1
 1420.str_cpy_loop
 1430  LDRB R2,[R1],#1          ;R2=char from source (R1)
 1440  STRB R2,[R4],#1          ;Store R2 at destination (R4)
 1450  CMP R2,#31               ;Is R2 CTRL char?
 1460  BGT str_cpy_loop         ;No, loop
 1470  SUB R5,R4,R5             ;R5=length of string
 1480  LDMFD (sp)!,{R0-R4,link}
 1490  MOV R1,#0                ;Claim call
 1500  MOVS pc,link             ;bye, bye
 1510;=====================================================================
 1520
 1530;======Define range of characters=====================================
 1540;On entry    R3=alphabet nr, R4=start ASCII nr, R5=end ASCII nr
 1550;On exit     If alphabet found, define chars, and claim call
 1560.define_range_of_characters
 1570  STMFD (sp)!,{R0-R9,link}
 1580  ADR R1,defenitions       ;R1->First font block
 1590.find_def_loop
 1600  LDR R2,[R1]              ;R2=First word of font block
 1610  CMP R2,#0                ;Is it Null ?
 1620  LDMEQFD (sp)!,{R0-R9,pc}^ ;Yes, so exit without claiming the call
 1630  LDR R2,[R1,#12]           ;R2=Alphabet nr.
 1640  CMP R2,R3                 ;R3=Is R2 requested alphabet nr?
 1650  LDRNE R0,[R1,#16]         ;R0=Font block length
 1660  ADDNE R1,R1,R0            ;No, so inc.font block
 1670  BNE find_def_loop         ;And check next
 1680.found
 1690  MOV R3,R4                 ;R3=First char to define
 1700  ADD R2,R1,#20             ;R2->Bits
 1710  ADD R1,R1,#52             ;R1->data in font block
 1720  MOV R3,#0                 ;R3=ASCII 0
 1730
 1740.find_data_loop
 1750  CMP R3,R4                 ;Is R3 start char?
 1760  BGE data_found            ;Yes, R1->good data, continue
 1770  BL tst_bit                ;Hs this char any data?
 1780  ADDNE R1,R1,#8            ;Yes, so data exists, incr. R1
 1790  ADD R3,R3,#1              ;Next char
 1800  BEQ find_data_loop        ;Loop
 1810
 1820.data_found
 1830  MOV R4,R1                 ;R4->data of first char to define
 1840
 1850  BL tst_bit                ;Does first char to define have any data?
 1860  BEQ no_data               ;No, so don"t define
 1870.next_char
 1880  SWI &100+23               ;VDU 23
 1890  MOV R0,R3                 ;R3=char to define
 1900  SWI "XOS_WriteC"          ;VDU char
 1910  MOV R0,R4                 ;R0->char defenition
 1920  MOV R1,#8                 ;R1=8 (char defenition is 8 bytes)
 1930  SWI "XOS_WriteN"          ;VDU n1,n2,n3,n4,n5,n6,n7,n8
 1940  ADD R4,R4,#8              ;No, R4->Next char defenition
 1950.no_data
 1960  ADD R3,R3,#1              ;Increment char
 1970  CMP R3,R5                 ;Is it higher than Last char to define
 1980  BGT def_exit              ;Yes, exit
 1990  BL tst_bit                ;Has current char to define have any data?
 2000  BEQ no_data               ;No, so don"t define
 2010  B next_char               ;And loop
 2020.def_exit
 2030  LDMFD (sp)!,{R0-R9,link}
 2040  MOV R1,#0                 ;Claim the call
 2050  MOVS pc,link              ;Bye, bye
 2060
 2070.tst_bit
 2080;R3=CHAR    R2->BITS
 2090  MOV R7,R3,LSR #3          ;R7 = R3 DIV 8
 2100  LDRB R8,[R2,R7]           ;R8 = relevant byte
 2110  AND R7,R3,#%111           ;R7 = R3 MOD 8
 2120  MOV R9,#1
 2130  MOV R9,R9,LSL R7          ;R9 = mask
 2140  TST R8,R9                 ;Is bit set in R8
 2150  MOV pc,link               ;Bye, bye
 2160;=====================================================================
 2170
 2180;======Str Cmp========================================================
 2190;This returns Z=1 if the trings are equal else Z=0
 2200;R0=text 1 ptr   R1=text 2 ptr
 2210.str_cmp
 2220  STMFD (sp)!,{R0-R3,link}
 2230.str_cmp_loop
 2240  LDRB R2,[R0],#1          ;R2=char from string 1
 2250  LDRB R3,[R1],#1          ;R3=char from string 2
 2260  CMP R2,#32:MOVLE R2,#0
 2270  CMP R3,#32:MOVLE R3,#0
 2280  ANDGE R2,R2,#&DF
 2290  ANDGE R3,R3,#&DF
 2300  CMP R2,R3                 ;Same ?
 2310  LDMNEFD (sp)!,{R0-R3,pc}  ;No, Exit
 2320  CMP R2,#31
 2330  BGE str_cmp_loop         ;No, loop
 2340  CMP R2,R3                ;Same ?
 2350  LDMFD (sp)!,{R0-R3,pc}  ;Exit
 2360;=====================================================================
 2370
 2380;======Alphabet defenitions===========================================
 2390.defenitions
 2400]
 2410RESTORE
 2420REPEAT
 2430  READ fontfile$
 2440  IF fontfile$<>"$$$" THEN
 2450    READ name$
 2460    [OPT pass%
 2470    FNfont(fontfile$,name$)
 2480    ]
 2490  ENDIF
 2500UNTIL fontfile$="$$$"
 2510
 2520[OPT pass%
 2530EQUD 0                        ;Terminator
 2540;=====================================================================
 2550]
 2560NEXT
 2570ENDPROC
 2580:
 2590DEFFNfont(f$,n$)
 2600REM f$=filename       n$=font name
 2610REM on the first assembly pass it will only create the font block header
 2620REM and reserve space for the font defenition.
 2630REM A font header is 3 words font name, 1 word font nr
 2640
 2650IF n$="" THEN n$=f$
 2660[OPT pass%
 2670FNallign12(n$)
 2680EQUD alphabet_nr%
 2690]
 2700length%=P%:P%+=4    :REM Later we will put the font block length here
 2710alphabet_nr%+=1
 2720f$=font_dir$+f$
 2730IF pass%>0 THEN
 2740  SYS "OS_File",5,f$ TO o%,,L%,,l%
 2750  IF o%=0 THEN ERROR 0,"Can't find '"+f$+"'"
 2760  IF o%=2 THEN ERROR 0,"'"+f$+"' is a directory"
 2770  IF ((L%>>8)AND&FFF)<>&FF7 ERROR 0,f$+" is not a BBC Font file"
 2780  IF l%>2000 THEN ERROR 0,"Font file '"+f$+"' too big"
 2790  SYS "OS_File",&FF,f$,B%,0      :REM Loading file at B%
 2800  FOR N%=0 TO 31: P%?N%=0:NEXT   :REM Clearing bits
 2810
 2820  ptr%=B%                                 :REM  This will set a char bit
 2830  WHILE (ptr%<B%+l%)                      :REM  if it has data
 2840    IF (ptr%?1)>31 AND (ptr%?1)<>127 THEN
 2850      sptr%=P%+((ptr%?1) DIV 8)
 2860      cb%=?sptr%
 2870      cb%=cb% OR (1<<((ptr%?1) MOD 8))
 2880      ?sptr%=cb%
 2890    ENDIF
 2900    ptr%+=10
 2910  ENDWHILE
 2920
 2930  x%=POS:y%=VPOS
 2940  PRINT;TAB(x%,y%);n$;
 2950  bits%=P%
 2960  P%+=32
 2970  C%=0
 2980  FOR N%=0 TO 256
 2990    sptr%=bits%+(N% DIV 8)
 3000    cb%=?sptr%
 3010    IF (cb% AND (1<<(N% MOD 8)))<>0 THEN
 3020      PRINTTAB(20,y%);"Char : ";N%;
 3030      PROCsearch(N%)
 3040    ENDIF
 3050  NEXT
 3060  !length%=52+C%
 3070PRINT
 3080ENDIF
 3090=pass%
 3100:
 3110DEFFNallign12(s$)
 3120REM This will store the string, padded with CHR$(0) (up to 12 chars)
 3130LOCAL fill$
 3140IF LENs$>11 THEN ERROR 0,"Fontname '"+n$+"'too big"
 3150fill$=STRING$(12-LENs$,CHR$(0))
 3160[OPT pass%
 3170EQUS s$+fill$
 3180]:=pass%
 3190:
 3200DEFPROCsearch(c%)
 3210REM This will search for the existing defenition of a char,
 3220REM and put it at P%. This has to be done< as in BBC Font files the
 3230REM defenitions can be in any order.
 3240LOCAL ptr%,found%,J%
 3250found%=FALSE
 3260ptr%=B%
 3270WHILE (ptr%<B%+l%) AND found%=FALSE
 3280  IF ?ptr%<>23 THEN PRINT?ptr%:ERROR 0,"Something wrong in this font file"
 3290  ptr%+=1
 3300  IF c%=?ptr% THEN
 3310    C%+=8
 3320    ptr%+=1
 3330    FOR J%=0 TO 7
 3340      P%?J%=ptr%?J%
 3350    NEXT
 3360    P%+=8
 3370    found%=TRUE
 3380  ELSE
 3390    ptr%+=1
 3400  ENDIF
 3410  ptr%+=8
 3420ENDWHILE
 3430ENDPROC

4� >SysFontSo          - SystemFont module source
� by Joris R�ling � 1990
:
(D� This source generates a module called 'SystemFont', which will
2B� add Alphabets to your system. These Alphabets can be used in
<� *Alphabet <alphabet name>
FG� Below is a DATA list, add the required font names there, and when
PD� run, this prog will generate the module containg the specified
ZE� fonts. The font files must be of type BBC Font (&FF7), and must
dE� contain only 'VDU 23,<char>,n1,n2,n3,n4,n5,n6,n7,n8' sequences.
nA� If not, this prog will complain. Defenitions of chars below
x0� ASCII 32 and of ASCII 127 will be ignored.
�:
�?font_dir$     ="@."         :� Where the fonts can be found
�version$      ="1.17"
�number        =1024
�alphabet_nr%  =25
�=code_size%    =20*1024      :� increase this if neccesary
�mod_name$     ="SystemFont"
�:
�I�"Generating ";mod_name$;" module v";version$;"  -  by Joris R�ling"'
�:
�
� B% 2048
�
�assemble
�=� 'mod_name$;" v";version$;" is ";P%-code%;" bytes long."
%� "Saving it to as 'SystemFont'"'
,ș "OS_File",10,mod_name$,&FFA,,code%,P%
�("RMLOAD "+mod_name$)
"�
,�
6:
@A� The following lines contain the font files to be assembled,
JG� and the name of the Alphabet (if empty, the name is same as file)
T
^� "Bold","Bold"
h� "Courier",""
r� "HiTech",""
|� "Italic",""
�� "OldIBM","IBM"
�� "SmallCaps","SmallCaps"
�� "Squad",""
�� "Theatrical",""
�� "Thin",""
�2� "$$$"         :REM Terminator, must be there
�:
���assemble
�� code% code_size%
�pc=15:link=14:sp=13
�� pass%=0 � 2 � 2
�P%=code%
�[OPT pass%

J;======Module Header==================================================
 EQUD 0
& EQUD 0
0 EQUD 0
: EQUD service      -code%
D EQUD title        -code%
N EQUD helpstring   -code%
X EQUD 0
b EQUD 0
l EQUD 0
v EQUD 0
� EQUD 0
�J;=====================================================================
�
 
.title
*J;======Title String===================================================
4 EQUS "SystemFont":EQUB 0
>
 ALIGN
HJ;=====================================================================
R
\J;======Help String====================================================
f.helpstring
p EQUS "System Font":EQUB 9
z2 EQUS version$+" ("+��$,5,11)+") Joris R�ling"
� EQUB 0
�
 ALIGN
�J;=====================================================================
�
�J;======Service========================================================
�.service
�TEQ R1,#&43:MOVNES pc,link
�7TEQ R2,#1:BEQ conv_alphabet_name_to_alphabet_number
�7TEQ R2,#3:BEQ conv_alphabet_number_to_alphabet_name
�,TEQ R2,#5:BEQ define_range_of_characters
�MOVS pc,link
�J;=====================================================================
�
J;======Conv alphabet name to alphabet number==========================
 ;On entry  R3->Alphabet name
C;On exit   If alphabetname found, Claim call and R4=alphabet nr
$
.*.conv_alphabet_name_to_alphabet_number
8  STMFD (sp)!,{R0-R3,link}
B2  MOV R0,R3                 ;R0->Alphabet name
L5  ADR R1,defenitions        ;R1->First font block
V.cn_ca_find_def_loop
`7  LDR R2,[R1]               ;R2 First word of block
j,  CMP R2,#0                 ;Is it null?
tG  LDMEQFD (sp)!,{R0-R3,pc}^ ;Yes, so exit without claiming the call
~?  BL str_cmp                ;Compare the two alphabet names
�5  LDRNE R3,[R1,#16]         ;R3=Font block length
�7  ADDNE R1,R1,R3            ;Not equal, so incr. r1
�/  BNE cn_ca_find_def_loop   ;And check next
�I  LDR R4,[R1,#12]           ;Alphabetnames are equal, r4=alphabet nr.
�  LDMFD (sp)!,{R0-R3,link}
�+  MOV R1,#0                 ;Claim call
�)  MOVS pc,link              ;bye, bye
�J;=====================================================================
�
�J;======Conv alphabet number to alphabet name==========================
�;On entry  R3=alphabet nr
�M;On exit If alphabet nr found, Claim call, put name in buffer, R5=str len


*.conv_alphabet_number_to_alphabet_name
9  STMFD (sp)!,{R0-R4,link}  ;R3=Requested alphabet nr
4  ADR R1,defenitions        ;R1=First font block
(.ca_cn_find_def_loop
2<  LDR R2,[R1]               ;R2=First word of font block
<-  CMP R2,#0                 ;Is it Null ?
FG  LDMEQFD (sp)!,{R0-R4,pc}  ;Yes, so exit without claiming the call
P0  LDR R2,[R1,#12]           ;R2=Alphabet nr.
Z@  CMP R2,R3                 ;R3=Is R2 requested alphabet nr?
d5  LDRNE R0,[R1,#16]         ;R0=Font block length
n6  ADDNE R1,R1,R0            ;No, so inc.font block
x/  BNE ca_cn_find_def_loop   ;And check next
�  ADD R5,R4,#1
�.str_cpy_loop
�8  LDRB R2,[R1],#1          ;R2=char from source (R1)
�<  STRB R2,[R4],#1          ;Store R2 at destination (R4)
�0  CMP R2,#31               ;Is R2 CTRL char?
�(  BGT str_cpy_loop         ;No, loop
�3  SUB R5,R4,R5             ;R5=length of string
�  LDMFD (sp)!,{R0-R4,link}
�*  MOV R1,#0                ;Claim call
�(  MOVS pc,link             ;bye, bye
�J;=====================================================================
�
�J;======Define range of characters=====================================
?;On entry    R3=alphabet nr, R4=start �II nr, R5=end �II nr
@;On exit     If alphabet found, define chars, and claim call
.define_range_of_characters
"  STMFD (sp)!,{R0-R9,link}
,4  ADR R1,defenitions       ;R1->First font block
6.find_def_loop
@;  LDR R2,[R1]              ;R2=First word of font block
J,  CMP R2,#0                ;Is it Null ?
TG  LDMEQFD (sp)!,{R0-R9,pc}^ ;Yes, so exit without claiming the call
^0  LDR R2,[R1,#12]           ;R2=Alphabet nr.
h@  CMP R2,R3                 ;R3=Is R2 requested alphabet nr?
r5  LDRNE R0,[R1,#16]         ;R0=Font block length
|6  ADDNE R1,R1,R0            ;No, so inc.font block
�/  BNE find_def_loop         ;And check next
�
.found
�8  MOV R3,R4                 ;R3=First char to define
�)  ADD R2,R1,#20             ;R2->Bits
�7  ADD R1,R1,#52             ;R1->data in font block
�)  MOV R3,#0                 ;R3=�II 0
�
�.find_data_loop
�2  CMP R3,R4                 ;Is R3 start char?
�=  BGE data_found            ;Yes, R1->good data, continue
�7  BL tst_bit                ;Hs this char any data?
�>  ADDNE R1,R1,#8            ;Yes, so data exists, incr. R1
�*  ADD R3,R3,#1              ;Next char
%  BEQ find_data_loop        ;Loop

.data_found
&A  MOV R4,R1                 ;R4->data of first char to define
0
:I  BL tst_bit                ;Does first char to define have any data?
D4  BEQ no_data               ;No, so don"t define
N.next_char
X%  SWI &100+23               ;� 23
b2  MOV R0,R3                 ;R3=char to define
l'  SWI "XOS_WriteC"          ;� char
v4  MOV R0,R4                 ;R0->char defenition
�B  MOV R1,#8                 ;R1=8 (char defenition is 8 bytes)
�:  SWI "XOS_WriteN"          ;� n1,n2,n3,n4,n5,n6,n7,n8
�=  ADD R4,R4,#8              ;No, R4->Next char defenition
�.no_data
�/  ADD R3,R3,#1              ;Increment char
�F  CMP R3,R5                 ;Is it higher than Last char to define
�*  BGT def_exit              ;Yes, exit
�J  BL tst_bit                ;Has current char to define have any data?
�4  BEQ no_data               ;No, so don"t define
�)  B next_char               ;And loop
�
.def_exit
�  LDMFD (sp)!,{R0-R9,link}
�/  MOV R1,#0                 ;Claim the call
)  MOVS pc,link              ;Bye, bye

.tst_bit
 ;R3=CHAR    R2->BITS
*,  MOV R7,R3,LSR #3          ;R7 = R3 � 8
43  LDRB R8,[R2,R7]           ;R8 = relevant byte
>*  � R7,R3,#%111           ;R7 = R3 � 8
H  MOV R9,#1
R*  MOV R9,R9,LSL R7          ;R9 = mask
\1  TST R8,R9                 ;Is bit set in R8
f)  MOV pc,link               ;Bye, bye
pJ;=====================================================================
z
�J;======Str Cmp========================================================
�6;This returns Z=1 if the trings are equal else Z=0
�";R0=text 1 ptr   R1=text 2 ptr
�.str_cmp
�  STMFD (sp)!,{R0-R3,link}
�.str_cmp_loop
�5  LDRB R2,[R0],#1          ;R2=char from string 1
�5  LDRB R3,[R1],#1          ;R3=char from string 2
�  CMP R2,#32:MOVLE R2,#0
�  CMP R3,#32:MOVLE R3,#0
�  �GE R2,R2,#&DF
�  �GE R3,R3,#&DF
�'  CMP R2,R3                 ;Same ?
	)  LDMNEFD (sp)!,{R0-R3,pc}  ;No, Exit
	  CMP R2,#31
	(  BGE str_cmp_loop         ;No, loop
	$&  CMP R2,R3                ;Same ?
	.#  LDMFD (sp)!,{R0-R3,pc}  ;Exit
	8J;=====================================================================
	B
	LJ;======Alphabet defenitions===========================================
	V.defenitions
	`]
	j�
	t�
	~  � fontfile$
	�  � fontfile$<>"$$$" �
	�    � name$
	�    [OPT pass%
	�    �font(fontfile$,name$)
	�	    ]
	�  �
	�� fontfile$="$$$"
	�
	�[OPT pass%
	�-EQUD 0                        ;Terminator
	�J;=====================================================================
	�]
�

�
:
ݤfont(f$,n$)
($� f$=filename       n$=font name
2J� on the first assembly pass it will only create the font block header
<0� and reserve space for the font defenition.
F8� A font header is 3 words font name, 1 word font nr
P
Z� n$="" � n$=f$
d[OPT pass%
n�allign12(n$)
xEQUD alphabet_nr%
�]
�Glength%=P%:P%+=4    :� Later we will put the font block length here
�alphabet_nr%+=1
�f$=font_dir$+f$
�� pass%>0 �
�$  ș "OS_File",5,f$ � o%,,L%,,l%
�(  � o%=0 � � 0,"Can't find '"+f$+"'"
�,  � o%=2 � � 0,"'"+f$+"' is a directory"
�=  � ((L%>>8)�&FFF)<>&FF7 � 0,f$+" is not a BBC Font file"
�2  � l%>2000 � � 0,"Font file '"+f$+"' too big"
�9  ș "OS_File",&FF,f$,B%,0      :� Loading file at B%
�/  � N%=0 � 31: P%?N%=0:�   :� Clearing bits
�
J  ptr%=B%                                 :�  This will set a char bit
=  ȕ (ptr%<B%+l%)                      :�  if it has data
'    � (ptr%?1)>31 � (ptr%?1)<>127 �
"!      sptr%=P%+((ptr%?1) � 8)
,      cb%=?sptr%
6'      cb%=cb% � (1<<((ptr%?1) � 8))
@      ?sptr%=cb%
J	    �
T    ptr%+=10
^  �
h
r  x%=�:y%=�
|  �;�x%,y%);n$;
�  bits%=P%
�  P%+=32
�
  C%=0
�  � N%=0 � 256
�    sptr%=bits%+(N% � 8)
�    cb%=?sptr%
�$    � (cb% � (1<<(N% � 8)))<>0 �
�       �20,y%);"Char : ";N%;
�      �search(N%)
�	    �
�  �
�  !length%=52+C%
��
�

=pass%
:
&ݤallign12(s$)
0F� This will store the string, padded with CHR$(0) (up to 12 chars)
:� fill$
D-� �s$>11 � � 0,"Fontname '"+n$+"'too big"
Nfill$=�12-�s$,�(0))
X[OPT pass%
bEQUS s$+fill$
l]:=pass%
v:
���search(c%)
�=� This will search for the existing defenition of a char,
�E� and put it at P%. This has to be done< as in BBC Font files the
�&� defenitions can be in any order.
�� ptr%,found%,J%
�found%=�
�ptr%=B%
�ȕ (ptr%<B%+l%) � found%=�
�B  � ?ptr%<>23 � �?ptr%:� 0,"Something wrong in this font file"
�
  ptr%+=1
�  � c%=?ptr% �
�
    C%+=8
�    ptr%+=1

    � J%=0 � 7

      P%?J%=ptr%?J%

	    �

 
    P%+=8

*    found%=�

4  �

>    ptr%+=1

H  �

R
  ptr%+=8

\�

f�
�
00000000  0d 00 0a 34 f4 20 3e 53  79 73 46 6f 6e 74 53 6f  |...4. >SysFontSo|
00000010  20 20 20 20 20 20 20 20  20 20 2d 20 53 79 73 74  |          - Syst|
00000020  65 6d 46 6f 6e 74 20 6d  6f 64 75 6c 65 20 73 6f  |emFont module so|
00000030  75 72 63 65 0d 00 14 1c  f4 20 62 79 20 4a 6f 72  |urce..... by Jor|
00000040  69 73 20 52 d6 6c 69 6e  67 20 a9 20 31 39 39 30  |is R.ling . 1990|
00000050  0d 00 1e 05 3a 0d 00 28  44 f4 20 54 68 69 73 20  |....:..(D. This |
00000060  73 6f 75 72 63 65 20 67  65 6e 65 72 61 74 65 73  |source generates|
00000070  20 61 20 6d 6f 64 75 6c  65 20 63 61 6c 6c 65 64  | a module called|
00000080  20 27 53 79 73 74 65 6d  46 6f 6e 74 27 2c 20 77  | 'SystemFont', w|
00000090  68 69 63 68 20 77 69 6c  6c 0d 00 32 42 f4 20 61  |hich will..2B. a|
000000a0  64 64 20 41 6c 70 68 61  62 65 74 73 20 74 6f 20  |dd Alphabets to |
000000b0  79 6f 75 72 20 73 79 73  74 65 6d 2e 20 54 68 65  |your system. The|
000000c0  73 65 20 41 6c 70 68 61  62 65 74 73 20 63 61 6e  |se Alphabets can|
000000d0  20 62 65 20 75 73 65 64  20 69 6e 0d 00 3c 1f f4  | be used in..<..|
000000e0  20 2a 41 6c 70 68 61 62  65 74 20 3c 61 6c 70 68  | *Alphabet <alph|
000000f0  61 62 65 74 20 6e 61 6d  65 3e 0d 00 46 47 f4 20  |abet name>..FG. |
00000100  42 65 6c 6f 77 20 69 73  20 61 20 44 41 54 41 20  |Below is a DATA |
00000110  6c 69 73 74 2c 20 61 64  64 20 74 68 65 20 72 65  |list, add the re|
00000120  71 75 69 72 65 64 20 66  6f 6e 74 20 6e 61 6d 65  |quired font name|
00000130  73 20 74 68 65 72 65 2c  20 61 6e 64 20 77 68 65  |s there, and whe|
00000140  6e 0d 00 50 44 f4 20 72  75 6e 2c 20 74 68 69 73  |n..PD. run, this|
00000150  20 70 72 6f 67 20 77 69  6c 6c 20 67 65 6e 65 72  | prog will gener|
00000160  61 74 65 20 74 68 65 20  6d 6f 64 75 6c 65 20 63  |ate the module c|
00000170  6f 6e 74 61 69 6e 67 20  74 68 65 20 73 70 65 63  |ontaing the spec|
00000180  69 66 69 65 64 0d 00 5a  45 f4 20 66 6f 6e 74 73  |ified..ZE. fonts|
00000190  2e 20 54 68 65 20 66 6f  6e 74 20 66 69 6c 65 73  |. The font files|
000001a0  20 6d 75 73 74 20 62 65  20 6f 66 20 74 79 70 65  | must be of type|
000001b0  20 42 42 43 20 46 6f 6e  74 20 28 26 46 46 37 29  | BBC Font (&FF7)|
000001c0  2c 20 61 6e 64 20 6d 75  73 74 0d 00 64 45 f4 20  |, and must..dE. |
000001d0  63 6f 6e 74 61 69 6e 20  6f 6e 6c 79 20 27 56 44  |contain only 'VD|
000001e0  55 20 32 33 2c 3c 63 68  61 72 3e 2c 6e 31 2c 6e  |U 23,<char>,n1,n|
000001f0  32 2c 6e 33 2c 6e 34 2c  6e 35 2c 6e 36 2c 6e 37  |2,n3,n4,n5,n6,n7|
00000200  2c 6e 38 27 20 73 65 71  75 65 6e 63 65 73 2e 0d  |,n8' sequences..|
00000210  00 6e 41 f4 20 49 66 20  6e 6f 74 2c 20 74 68 69  |.nA. If not, thi|
00000220  73 20 70 72 6f 67 20 77  69 6c 6c 20 63 6f 6d 70  |s prog will comp|
00000230  6c 61 69 6e 2e 20 44 65  66 65 6e 69 74 69 6f 6e  |lain. Defenition|
00000240  73 20 6f 66 20 63 68 61  72 73 20 62 65 6c 6f 77  |s of chars below|
00000250  0d 00 78 30 f4 20 41 53  43 49 49 20 33 32 20 61  |..x0. ASCII 32 a|
00000260  6e 64 20 6f 66 20 41 53  43 49 49 20 31 32 37 20  |nd of ASCII 127 |
00000270  77 69 6c 6c 20 62 65 20  69 67 6e 6f 72 65 64 2e  |will be ignored.|
00000280  0d 00 82 05 3a 0d 00 8c  3f 66 6f 6e 74 5f 64 69  |....:...?font_di|
00000290  72 24 20 20 20 20 20 3d  22 40 2e 22 20 20 20 20  |r$     ="@."    |
000002a0  20 20 20 20 20 3a f4 20  57 68 65 72 65 20 74 68  |     :. Where th|
000002b0  65 20 66 6f 6e 74 73 20  63 61 6e 20 62 65 20 66  |e fonts can be f|
000002c0  6f 75 6e 64 0d 00 96 19  76 65 72 73 69 6f 6e 24  |ound....version$|
000002d0  20 20 20 20 20 20 3d 22  31 2e 31 37 22 0d 00 a0  |      ="1.17"...|
000002e0  17 6e 75 6d 62 65 72 20  20 20 20 20 20 20 20 3d  |.number        =|
000002f0  31 30 32 34 0d 00 aa 15  61 6c 70 68 61 62 65 74  |1024....alphabet|
00000300  5f 6e 72 25 20 20 3d 32  35 0d 00 b4 3d 63 6f 64  |_nr%  =25...=cod|
00000310  65 5f 73 69 7a 65 25 20  20 20 20 3d 32 30 2a 31  |e_size%    =20*1|
00000320  30 32 34 20 20 20 20 20  20 3a f4 20 69 6e 63 72  |024      :. incr|
00000330  65 61 73 65 20 74 68 69  73 20 69 66 20 6e 65 63  |ease this if nec|
00000340  63 65 73 61 72 79 0d 00  be 1f 6d 6f 64 5f 6e 61  |cesary....mod_na|
00000350  6d 65 24 20 20 20 20 20  3d 22 53 79 73 74 65 6d  |me$     ="System|
00000360  46 6f 6e 74 22 0d 00 c8  05 3a 0d 00 d2 49 f1 22  |Font"....:...I."|
00000370  47 65 6e 65 72 61 74 69  6e 67 20 22 3b 6d 6f 64  |Generating ";mod|
00000380  5f 6e 61 6d 65 24 3b 22  20 6d 6f 64 75 6c 65 20  |_name$;" module |
00000390  76 22 3b 76 65 72 73 69  6f 6e 24 3b 22 20 20 2d  |v";version$;"  -|
000003a0  20 20 62 79 20 4a 6f 72  69 73 20 52 d6 6c 69 6e  |  by Joris R.lin|
000003b0  67 22 27 0d 00 dc 05 3a  0d 00 e6 0d de 20 42 25  |g"'....:..... B%|
000003c0  20 32 30 34 38 0d 00 f0  0d f2 61 73 73 65 6d 62  | 2048.....assemb|
000003d0  6c 65 0d 00 fa 3d f1 20  27 6d 6f 64 5f 6e 61 6d  |le...=. 'mod_nam|
000003e0  65 24 3b 22 20 76 22 3b  76 65 72 73 69 6f 6e 24  |e$;" v";version$|
000003f0  3b 22 20 69 73 20 22 3b  50 25 2d 63 6f 64 65 25  |;" is ";P%-code%|
00000400  3b 22 20 62 79 74 65 73  20 6c 6f 6e 67 2e 22 0d  |;" bytes long.".|
00000410  01 04 25 f1 20 22 53 61  76 69 6e 67 20 69 74 20  |..%. "Saving it |
00000420  74 6f 20 61 73 20 27 53  79 73 74 65 6d 46 6f 6e  |to as 'SystemFon|
00000430  74 27 22 27 0d 01 0e 2c  c8 99 20 22 4f 53 5f 46  |t'"'...,.. "OS_F|
00000440  69 6c 65 22 2c 31 30 2c  6d 6f 64 5f 6e 61 6d 65  |ile",10,mod_name|
00000450  24 2c 26 46 46 41 2c 2c  63 6f 64 65 25 2c 50 25  |$,&FFA,,code%,P%|
00000460  0d 01 18 1a ff 28 22 52  4d 4c 4f 41 44 20 22 2b  |.....("RMLOAD "+|
00000470  6d 6f 64 5f 6e 61 6d 65  24 29 0d 01 22 05 f1 0d  |mod_name$).."...|
00000480  01 2c 05 e0 0d 01 36 05  3a 0d 01 40 41 f4 20 54  |.,....6.:..@A. T|
00000490  68 65 20 66 6f 6c 6c 6f  77 69 6e 67 20 6c 69 6e  |he following lin|
000004a0  65 73 20 63 6f 6e 74 61  69 6e 20 74 68 65 20 66  |es contain the f|
000004b0  6f 6e 74 20 66 69 6c 65  73 20 74 6f 20 62 65 20  |ont files to be |
000004c0  61 73 73 65 6d 62 6c 65  64 2c 0d 01 4a 47 f4 20  |assembled,..JG. |
000004d0  61 6e 64 20 74 68 65 20  6e 61 6d 65 20 6f 66 20  |and the name of |
000004e0  74 68 65 20 41 6c 70 68  61 62 65 74 20 28 69 66  |the Alphabet (if|
000004f0  20 65 6d 70 74 79 2c 20  74 68 65 20 6e 61 6d 65  | empty, the name|
00000500  20 69 73 20 73 61 6d 65  20 61 73 20 66 69 6c 65  | is same as file|
00000510  29 0d 01 54 04 0d 01 5e  13 dc 20 22 42 6f 6c 64  |)..T...^.. "Bold|
00000520  22 2c 22 42 6f 6c 64 22  0d 01 68 12 dc 20 22 43  |","Bold"..h.. "C|
00000530  6f 75 72 69 65 72 22 2c  22 22 0d 01 72 11 dc 20  |ourier",""..r.. |
00000540  22 48 69 54 65 63 68 22  2c 22 22 0d 01 7c 11 dc  |"HiTech",""..|..|
00000550  20 22 49 74 61 6c 69 63  22 2c 22 22 0d 01 86 14  | "Italic",""....|
00000560  dc 20 22 4f 6c 64 49 42  4d 22 2c 22 49 42 4d 22  |. "OldIBM","IBM"|
00000570  0d 01 90 1d dc 20 22 53  6d 61 6c 6c 43 61 70 73  |..... "SmallCaps|
00000580  22 2c 22 53 6d 61 6c 6c  43 61 70 73 22 0d 01 9a  |","SmallCaps"...|
00000590  10 dc 20 22 53 71 75 61  64 22 2c 22 22 0d 01 a4  |.. "Squad",""...|
000005a0  15 dc 20 22 54 68 65 61  74 72 69 63 61 6c 22 2c  |.. "Theatrical",|
000005b0  22 22 0d 01 ae 0f dc 20  22 54 68 69 6e 22 2c 22  |""..... "Thin","|
000005c0  22 0d 01 b8 32 dc 20 22  24 24 24 22 20 20 20 20  |"...2. "$$$"    |
000005d0  20 20 20 20 20 3a 52 45  4d 20 54 65 72 6d 69 6e  |     :REM Termin|
000005e0  61 74 6f 72 2c 20 6d 75  73 74 20 62 65 20 74 68  |ator, must be th|
000005f0  65 72 65 0d 01 c2 05 3a  0d 01 cc 0e dd f2 61 73  |ere....:......as|
00000600  73 65 6d 62 6c 65 0d 01  d6 16 de 20 63 6f 64 65  |semble..... code|
00000610  25 20 63 6f 64 65 5f 73  69 7a 65 25 0d 01 e0 17  |% code_size%....|
00000620  70 63 3d 31 35 3a 6c 69  6e 6b 3d 31 34 3a 73 70  |pc=15:link=14:sp|
00000630  3d 31 33 0d 01 ea 15 e3  20 70 61 73 73 25 3d 30  |=13..... pass%=0|
00000640  20 b8 20 32 20 88 20 32  0d 01 f4 0c 50 25 3d 63  | . 2 . 2....P%=c|
00000650  6f 64 65 25 0d 01 fe 0e  5b 4f 50 54 20 70 61 73  |ode%....[OPT pas|
00000660  73 25 0d 02 08 04 0d 02  12 4a 3b 3d 3d 3d 3d 3d  |s%.......J;=====|
00000670  3d 4d 6f 64 75 6c 65 20  48 65 61 64 65 72 3d 3d  |=Module Header==|
00000680  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000006b0  0d 02 1c 0b 20 45 51 55  44 20 30 0d 02 26 0b 20  |.... EQUD 0..&. |
000006c0  45 51 55 44 20 30 0d 02  30 0b 20 45 51 55 44 20  |EQUD 0..0. EQUD |
000006d0  30 0d 02 3a 1d 20 45 51  55 44 20 73 65 72 76 69  |0..:. EQUD servi|
000006e0  63 65 20 20 20 20 20 20  2d 63 6f 64 65 25 0d 02  |ce      -code%..|
000006f0  44 1d 20 45 51 55 44 20  74 69 74 6c 65 20 20 20  |D. EQUD title   |
00000700  20 20 20 20 20 2d 63 6f  64 65 25 0d 02 4e 1d 20  |     -code%..N. |
00000710  45 51 55 44 20 68 65 6c  70 73 74 72 69 6e 67 20  |EQUD helpstring |
00000720  20 20 2d 63 6f 64 65 25  0d 02 58 0b 20 45 51 55  |  -code%..X. EQU|
00000730  44 20 30 0d 02 62 0b 20  45 51 55 44 20 30 0d 02  |D 0..b. EQUD 0..|
00000740  6c 0b 20 45 51 55 44 20  30 0d 02 76 0b 20 45 51  |l. EQUD 0..v. EQ|
00000750  55 44 20 30 0d 02 80 0b  20 45 51 55 44 20 30 0d  |UD 0.... EQUD 0.|
00000760  02 8a 4a 3b 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |..J;============|
00000770  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000007a0  3d 3d 3d 3d 3d 3d 3d 3d  3d 0d 02 94 04 0d 03 20  |=========...... |
000007b0  0a 2e 74 69 74 6c 65 0d  03 2a 4a 3b 3d 3d 3d 3d  |..title..*J;====|
000007c0  3d 3d 54 69 74 6c 65 20  53 74 72 69 6e 67 3d 3d  |==Title String==|
000007d0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000800  3d 0d 03 34 1d 20 45 51  55 53 20 22 53 79 73 74  |=..4. EQUS "Syst|
00000810  65 6d 46 6f 6e 74 22 3a  45 51 55 42 20 30 0d 03  |emFont":EQUB 0..|
00000820  3e 0a 20 41 4c 49 47 4e  0d 03 48 4a 3b 3d 3d 3d  |>. ALIGN..HJ;===|
00000830  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000870  3d 3d 0d 03 52 04 0d 03  5c 4a 3b 3d 3d 3d 3d 3d  |==..R...\J;=====|
00000880  3d 48 65 6c 70 20 53 74  72 69 6e 67 3d 3d 3d 3d  |=Help String====|
00000890  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000008c0  0d 03 66 0f 2e 68 65 6c  70 73 74 72 69 6e 67 0d  |..f..helpstring.|
000008d0  03 70 1e 20 45 51 55 53  20 22 53 79 73 74 65 6d  |.p. EQUS "System|
000008e0  20 46 6f 6e 74 22 3a 45  51 55 42 20 39 0d 03 7a  | Font":EQUB 9..z|
000008f0  32 20 45 51 55 53 20 76  65 72 73 69 6f 6e 24 2b  |2 EQUS version$+|
00000900  22 20 28 22 2b c1 91 24  2c 35 2c 31 31 29 2b 22  |" ("+..$,5,11)+"|
00000910  29 20 4a 6f 72 69 73 20  52 d6 6c 69 6e 67 22 0d  |) Joris R.ling".|
00000920  03 84 0b 20 45 51 55 42  20 30 0d 03 8e 0a 20 41  |... EQUB 0.... A|
00000930  4c 49 47 4e 0d 03 98 4a  3b 3d 3d 3d 3d 3d 3d 3d  |LIGN...J;=======|
00000940  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000970  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 0d 03  |==============..|
00000980  a2 04 0d 03 ac 4a 3b 3d  3d 3d 3d 3d 3d 53 65 72  |.....J;======Ser|
00000990  76 69 63 65 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |vice============|
000009a0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000009c0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 0d 03 b6 0c  |============....|
000009d0  2e 73 65 72 76 69 63 65  0d 03 c0 1e 54 45 51 20  |.service....TEQ |
000009e0  52 31 2c 23 26 34 33 3a  4d 4f 56 4e 45 53 20 70  |R1,#&43:MOVNES p|
000009f0  63 2c 6c 69 6e 6b 0d 03  ca 37 54 45 51 20 52 32  |c,link...7TEQ R2|
00000a00  2c 23 31 3a 42 45 51 20  63 6f 6e 76 5f 61 6c 70  |,#1:BEQ conv_alp|
00000a10  68 61 62 65 74 5f 6e 61  6d 65 5f 74 6f 5f 61 6c  |habet_name_to_al|
00000a20  70 68 61 62 65 74 5f 6e  75 6d 62 65 72 0d 03 d4  |phabet_number...|
00000a30  37 54 45 51 20 52 32 2c  23 33 3a 42 45 51 20 63  |7TEQ R2,#3:BEQ c|
00000a40  6f 6e 76 5f 61 6c 70 68  61 62 65 74 5f 6e 75 6d  |onv_alphabet_num|
00000a50  62 65 72 5f 74 6f 5f 61  6c 70 68 61 62 65 74 5f  |ber_to_alphabet_|
00000a60  6e 61 6d 65 0d 03 de 2c  54 45 51 20 52 32 2c 23  |name...,TEQ R2,#|
00000a70  35 3a 42 45 51 20 64 65  66 69 6e 65 5f 72 61 6e  |5:BEQ define_ran|
00000a80  67 65 5f 6f 66 5f 63 68  61 72 61 63 74 65 72 73  |ge_of_characters|
00000a90  0d 03 e8 10 4d 4f 56 53  20 70 63 2c 6c 69 6e 6b  |....MOVS pc,link|
00000aa0  0d 03 f2 4a 3b 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |...J;===========|
00000ab0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000ae0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 0d 03 fc 04 0d 04  |==========......|
00000af0  06 4a 3b 3d 3d 3d 3d 3d  3d 43 6f 6e 76 20 61 6c  |.J;======Conv al|
00000b00  70 68 61 62 65 74 20 6e  61 6d 65 20 74 6f 20 61  |phabet name to a|
00000b10  6c 70 68 61 62 65 74 20  6e 75 6d 62 65 72 3d 3d  |lphabet number==|
00000b20  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00000b30  3d 3d 3d 3d 3d 3d 3d 3d  0d 04 10 20 3b 4f 6e 20  |========... ;On |
00000b40  65 6e 74 72 79 20 20 52  33 2d 3e 41 6c 70 68 61  |entry  R3->Alpha|
00000b50  62 65 74 20 6e 61 6d 65  0d 04 1a 43 3b 4f 6e 20  |bet name...C;On |
00000b60  65 78 69 74 20 20 20 49  66 20 61 6c 70 68 61 62  |exit   If alphab|
00000b70  65 74 6e 61 6d 65 20 66  6f 75 6e 64 2c 20 43 6c  |etname found, Cl|
00000b80  61 69 6d 20 63 61 6c 6c  20 61 6e 64 20 52 34 3d  |aim call and R4=|
00000b90  61 6c 70 68 61 62 65 74  20 6e 72 0d 04 24 04 0d  |alphabet nr..$..|
00000ba0  04 2e 2a 2e 63 6f 6e 76  5f 61 6c 70 68 61 62 65  |..*.conv_alphabe|
00000bb0  74 5f 6e 61 6d 65 5f 74  6f 5f 61 6c 70 68 61 62  |t_name_to_alphab|
00000bc0  65 74 5f 6e 75 6d 62 65  72 0d 04 38 1e 20 20 53  |et_number..8.  S|
00000bd0  54 4d 46 44 20 28 73 70  29 21 2c 7b 52 30 2d 52  |TMFD (sp)!,{R0-R|
00000be0  33 2c 6c 69 6e 6b 7d 0d  04 42 32 20 20 4d 4f 56  |3,link}..B2  MOV|
00000bf0  20 52 30 2c 52 33 20 20  20 20 20 20 20 20 20 20  | R0,R3          |
00000c00  20 20 20 20 20 20 20 3b  52 30 2d 3e 41 6c 70 68  |       ;R0->Alph|
00000c10  61 62 65 74 20 6e 61 6d  65 0d 04 4c 35 20 20 41  |abet name..L5  A|
00000c20  44 52 20 52 31 2c 64 65  66 65 6e 69 74 69 6f 6e  |DR R1,defenition|
00000c30  73 20 20 20 20 20 20 20  20 3b 52 31 2d 3e 46 69  |s        ;R1->Fi|
00000c40  72 73 74 20 66 6f 6e 74  20 62 6c 6f 63 6b 0d 04  |rst font block..|
00000c50  56 18 2e 63 6e 5f 63 61  5f 66 69 6e 64 5f 64 65  |V..cn_ca_find_de|
00000c60  66 5f 6c 6f 6f 70 0d 04  60 37 20 20 4c 44 52 20  |f_loop..`7  LDR |
00000c70  52 32 2c 5b 52 31 5d 20  20 20 20 20 20 20 20 20  |R2,[R1]         |
00000c80  20 20 20 20 20 20 3b 52  32 20 46 69 72 73 74 20  |      ;R2 First |
00000c90  77 6f 72 64 20 6f 66 20  62 6c 6f 63 6b 0d 04 6a  |word of block..j|
00000ca0  2c 20 20 43 4d 50 20 52  32 2c 23 30 20 20 20 20  |,  CMP R2,#0    |
00000cb0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 49 73  |             ;Is|
00000cc0  20 69 74 20 6e 75 6c 6c  3f 0d 04 74 47 20 20 4c  | it null?..tG  L|
00000cd0  44 4d 45 51 46 44 20 28  73 70 29 21 2c 7b 52 30  |DMEQFD (sp)!,{R0|
00000ce0  2d 52 33 2c 70 63 7d 5e  20 3b 59 65 73 2c 20 73  |-R3,pc}^ ;Yes, s|
00000cf0  6f 20 65 78 69 74 20 77  69 74 68 6f 75 74 20 63  |o exit without c|
00000d00  6c 61 69 6d 69 6e 67 20  74 68 65 20 63 61 6c 6c  |laiming the call|
00000d10  0d 04 7e 3f 20 20 42 4c  20 73 74 72 5f 63 6d 70  |..~?  BL str_cmp|
00000d20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000d30  3b 43 6f 6d 70 61 72 65  20 74 68 65 20 74 77 6f  |;Compare the two|
00000d40  20 61 6c 70 68 61 62 65  74 20 6e 61 6d 65 73 0d  | alphabet names.|
00000d50  04 88 35 20 20 4c 44 52  4e 45 20 52 33 2c 5b 52  |..5  LDRNE R3,[R|
00000d60  31 2c 23 31 36 5d 20 20  20 20 20 20 20 20 20 3b  |1,#16]         ;|
00000d70  52 33 3d 46 6f 6e 74 20  62 6c 6f 63 6b 20 6c 65  |R3=Font block le|
00000d80  6e 67 74 68 0d 04 92 37  20 20 41 44 44 4e 45 20  |ngth...7  ADDNE |
00000d90  52 31 2c 52 31 2c 52 33  20 20 20 20 20 20 20 20  |R1,R1,R3        |
00000da0  20 20 20 20 3b 4e 6f 74  20 65 71 75 61 6c 2c 20  |    ;Not equal, |
00000db0  73 6f 20 69 6e 63 72 2e  20 72 31 0d 04 9c 2f 20  |so incr. r1.../ |
00000dc0  20 42 4e 45 20 63 6e 5f  63 61 5f 66 69 6e 64 5f  | BNE cn_ca_find_|
00000dd0  64 65 66 5f 6c 6f 6f 70  20 20 20 3b 41 6e 64 20  |def_loop   ;And |
00000de0  63 68 65 63 6b 20 6e 65  78 74 0d 04 a6 49 20 20  |check next...I  |
00000df0  4c 44 52 20 52 34 2c 5b  52 31 2c 23 31 32 5d 20  |LDR R4,[R1,#12] |
00000e00  20 20 20 20 20 20 20 20  20 20 3b 41 6c 70 68 61  |          ;Alpha|
00000e10  62 65 74 6e 61 6d 65 73  20 61 72 65 20 65 71 75  |betnames are equ|
00000e20  61 6c 2c 20 72 34 3d 61  6c 70 68 61 62 65 74 20  |al, r4=alphabet |
00000e30  6e 72 2e 0d 04 b0 1e 20  20 4c 44 4d 46 44 20 28  |nr.....  LDMFD (|
00000e40  73 70 29 21 2c 7b 52 30  2d 52 33 2c 6c 69 6e 6b  |sp)!,{R0-R3,link|
00000e50  7d 0d 04 ba 2b 20 20 4d  4f 56 20 52 31 2c 23 30  |}...+  MOV R1,#0|
00000e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e70  20 3b 43 6c 61 69 6d 20  63 61 6c 6c 0d 04 c4 29  | ;Claim call...)|
00000e80  20 20 4d 4f 56 53 20 70  63 2c 6c 69 6e 6b 20 20  |  MOVS pc,link  |
00000e90  20 20 20 20 20 20 20 20  20 20 20 20 3b 62 79 65  |            ;bye|
00000ea0  2c 20 62 79 65 0d 04 ce  4a 3b 3d 3d 3d 3d 3d 3d  |, bye...J;======|
00000eb0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000ee0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 0d  |===============.|
00000ef0  04 d8 04 0d 04 e2 4a 3b  3d 3d 3d 3d 3d 3d 43 6f  |......J;======Co|
00000f00  6e 76 20 61 6c 70 68 61  62 65 74 20 6e 75 6d 62  |nv alphabet numb|
00000f10  65 72 20 74 6f 20 61 6c  70 68 61 62 65 74 20 6e  |er to alphabet n|
00000f20  61 6d 65 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |ame=============|
00000f30  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 0d 04 ec  |=============...|
00000f40  1d 3b 4f 6e 20 65 6e 74  72 79 20 20 52 33 3d 61  |.;On entry  R3=a|
00000f50  6c 70 68 61 62 65 74 20  6e 72 0d 04 f6 4d 3b 4f  |lphabet nr...M;O|
00000f60  6e 20 65 78 69 74 20 49  66 20 61 6c 70 68 61 62  |n exit If alphab|
00000f70  65 74 20 6e 72 20 66 6f  75 6e 64 2c 20 43 6c 61  |et nr found, Cla|
00000f80  69 6d 20 63 61 6c 6c 2c  20 70 75 74 20 6e 61 6d  |im call, put nam|
00000f90  65 20 69 6e 20 62 75 66  66 65 72 2c 20 52 35 3d  |e in buffer, R5=|
00000fa0  73 74 72 20 6c 65 6e 0d  05 00 04 0d 05 0a 2a 2e  |str len.......*.|
00000fb0  63 6f 6e 76 5f 61 6c 70  68 61 62 65 74 5f 6e 75  |conv_alphabet_nu|
00000fc0  6d 62 65 72 5f 74 6f 5f  61 6c 70 68 61 62 65 74  |mber_to_alphabet|
00000fd0  5f 6e 61 6d 65 0d 05 14  39 20 20 53 54 4d 46 44  |_name...9  STMFD|
00000fe0  20 28 73 70 29 21 2c 7b  52 30 2d 52 34 2c 6c 69  | (sp)!,{R0-R4,li|
00000ff0  6e 6b 7d 20 20 3b 52 33  3d 52 65 71 75 65 73 74  |nk}  ;R3=Request|
00001000  65 64 20 61 6c 70 68 61  62 65 74 20 6e 72 0d 05  |ed alphabet nr..|
00001010  1e 34 20 20 41 44 52 20  52 31 2c 64 65 66 65 6e  |.4  ADR R1,defen|
00001020  69 74 69 6f 6e 73 20 20  20 20 20 20 20 20 3b 52  |itions        ;R|
00001030  31 3d 46 69 72 73 74 20  66 6f 6e 74 20 62 6c 6f  |1=First font blo|
00001040  63 6b 0d 05 28 18 2e 63  61 5f 63 6e 5f 66 69 6e  |ck..(..ca_cn_fin|
00001050  64 5f 64 65 66 5f 6c 6f  6f 70 0d 05 32 3c 20 20  |d_def_loop..2<  |
00001060  4c 44 52 20 52 32 2c 5b  52 31 5d 20 20 20 20 20  |LDR R2,[R1]     |
00001070  20 20 20 20 20 20 20 20  20 20 3b 52 32 3d 46 69  |          ;R2=Fi|
00001080  72 73 74 20 77 6f 72 64  20 6f 66 20 66 6f 6e 74  |rst word of font|
00001090  20 62 6c 6f 63 6b 0d 05  3c 2d 20 20 43 4d 50 20  | block..<-  CMP |
000010a0  52 32 2c 23 30 20 20 20  20 20 20 20 20 20 20 20  |R2,#0           |
000010b0  20 20 20 20 20 20 3b 49  73 20 69 74 20 4e 75 6c  |      ;Is it Nul|
000010c0  6c 20 3f 0d 05 46 47 20  20 4c 44 4d 45 51 46 44  |l ?..FG  LDMEQFD|
000010d0  20 28 73 70 29 21 2c 7b  52 30 2d 52 34 2c 70 63  | (sp)!,{R0-R4,pc|
000010e0  7d 20 20 3b 59 65 73 2c  20 73 6f 20 65 78 69 74  |}  ;Yes, so exit|
000010f0  20 77 69 74 68 6f 75 74  20 63 6c 61 69 6d 69 6e  | without claimin|
00001100  67 20 74 68 65 20 63 61  6c 6c 0d 05 50 30 20 20  |g the call..P0  |
00001110  4c 44 52 20 52 32 2c 5b  52 31 2c 23 31 32 5d 20  |LDR R2,[R1,#12] |
00001120  20 20 20 20 20 20 20 20  20 20 3b 52 32 3d 41 6c  |          ;R2=Al|
00001130  70 68 61 62 65 74 20 6e  72 2e 0d 05 5a 40 20 20  |phabet nr...Z@  |
00001140  43 4d 50 20 52 32 2c 52  33 20 20 20 20 20 20 20  |CMP R2,R3       |
00001150  20 20 20 20 20 20 20 20  20 20 3b 52 33 3d 49 73  |          ;R3=Is|
00001160  20 52 32 20 72 65 71 75  65 73 74 65 64 20 61 6c  | R2 requested al|
00001170  70 68 61 62 65 74 20 6e  72 3f 0d 05 64 35 20 20  |phabet nr?..d5  |
00001180  4c 44 52 4e 45 20 52 30  2c 5b 52 31 2c 23 31 36  |LDRNE R0,[R1,#16|
00001190  5d 20 20 20 20 20 20 20  20 20 3b 52 30 3d 46 6f  |]         ;R0=Fo|
000011a0  6e 74 20 62 6c 6f 63 6b  20 6c 65 6e 67 74 68 0d  |nt block length.|
000011b0  05 6e 36 20 20 41 44 44  4e 45 20 52 31 2c 52 31  |.n6  ADDNE R1,R1|
000011c0  2c 52 30 20 20 20 20 20  20 20 20 20 20 20 20 3b  |,R0            ;|
000011d0  4e 6f 2c 20 73 6f 20 69  6e 63 2e 66 6f 6e 74 20  |No, so inc.font |
000011e0  62 6c 6f 63 6b 0d 05 78  2f 20 20 42 4e 45 20 63  |block..x/  BNE c|
000011f0  61 5f 63 6e 5f 66 69 6e  64 5f 64 65 66 5f 6c 6f  |a_cn_find_def_lo|
00001200  6f 70 20 20 20 3b 41 6e  64 20 63 68 65 63 6b 20  |op   ;And check |
00001210  6e 65 78 74 0d 05 82 12  20 20 41 44 44 20 52 35  |next....  ADD R5|
00001220  2c 52 34 2c 23 31 0d 05  8c 11 2e 73 74 72 5f 63  |,R4,#1.....str_c|
00001230  70 79 5f 6c 6f 6f 70 0d  05 96 38 20 20 4c 44 52  |py_loop...8  LDR|
00001240  42 20 52 32 2c 5b 52 31  5d 2c 23 31 20 20 20 20  |B R2,[R1],#1    |
00001250  20 20 20 20 20 20 3b 52  32 3d 63 68 61 72 20 66  |      ;R2=char f|
00001260  72 6f 6d 20 73 6f 75 72  63 65 20 28 52 31 29 0d  |rom source (R1).|
00001270  05 a0 3c 20 20 53 54 52  42 20 52 32 2c 5b 52 34  |..<  STRB R2,[R4|
00001280  5d 2c 23 31 20 20 20 20  20 20 20 20 20 20 3b 53  |],#1          ;S|
00001290  74 6f 72 65 20 52 32 20  61 74 20 64 65 73 74 69  |tore R2 at desti|
000012a0  6e 61 74 69 6f 6e 20 28  52 34 29 0d 05 aa 30 20  |nation (R4)...0 |
000012b0  20 43 4d 50 20 52 32 2c  23 33 31 20 20 20 20 20  | CMP R2,#31     |
000012c0  20 20 20 20 20 20 20 20  20 20 3b 49 73 20 52 32  |          ;Is R2|
000012d0  20 43 54 52 4c 20 63 68  61 72 3f 0d 05 b4 28 20  | CTRL char?...( |
000012e0  20 42 47 54 20 73 74 72  5f 63 70 79 5f 6c 6f 6f  | BGT str_cpy_loo|
000012f0  70 20 20 20 20 20 20 20  20 20 3b 4e 6f 2c 20 6c  |p         ;No, l|
00001300  6f 6f 70 0d 05 be 33 20  20 53 55 42 20 52 35 2c  |oop...3  SUB R5,|
00001310  52 34 2c 52 35 20 20 20  20 20 20 20 20 20 20 20  |R4,R5           |
00001320  20 20 3b 52 35 3d 6c 65  6e 67 74 68 20 6f 66 20  |  ;R5=length of |
00001330  73 74 72 69 6e 67 0d 05  c8 1e 20 20 4c 44 4d 46  |string....  LDMF|
00001340  44 20 28 73 70 29 21 2c  7b 52 30 2d 52 34 2c 6c  |D (sp)!,{R0-R4,l|
00001350  69 6e 6b 7d 0d 05 d2 2a  20 20 4d 4f 56 20 52 31  |ink}...*  MOV R1|
00001360  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00001370  20 20 20 3b 43 6c 61 69  6d 20 63 61 6c 6c 0d 05  |   ;Claim call..|
00001380  dc 28 20 20 4d 4f 56 53  20 70 63 2c 6c 69 6e 6b  |.(  MOVS pc,link|
00001390  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 62 79  |             ;by|
000013a0  65 2c 20 62 79 65 0d 05  e6 4a 3b 3d 3d 3d 3d 3d  |e, bye...J;=====|
000013b0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000013f0  0d 05 f0 04 0d 05 fa 4a  3b 3d 3d 3d 3d 3d 3d 44  |.......J;======D|
00001400  65 66 69 6e 65 20 72 61  6e 67 65 20 6f 66 20 63  |efine range of c|
00001410  68 61 72 61 63 74 65 72  73 3d 3d 3d 3d 3d 3d 3d  |haracters=======|
00001420  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00001430  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 0d 06  |==============..|
00001440  04 3f 3b 4f 6e 20 65 6e  74 72 79 20 20 20 20 52  |.?;On entry    R|
00001450  33 3d 61 6c 70 68 61 62  65 74 20 6e 72 2c 20 52  |3=alphabet nr, R|
00001460  34 3d 73 74 61 72 74 20  97 49 49 20 6e 72 2c 20  |4=start .II nr, |
00001470  52 35 3d 65 6e 64 20 97  49 49 20 6e 72 0d 06 0e  |R5=end .II nr...|
00001480  40 3b 4f 6e 20 65 78 69  74 20 20 20 20 20 49 66  |@;On exit     If|
00001490  20 61 6c 70 68 61 62 65  74 20 66 6f 75 6e 64 2c  | alphabet found,|
000014a0  20 64 65 66 69 6e 65 20  63 68 61 72 73 2c 20 61  | define chars, a|
000014b0  6e 64 20 63 6c 61 69 6d  20 63 61 6c 6c 0d 06 18  |nd claim call...|
000014c0  1f 2e 64 65 66 69 6e 65  5f 72 61 6e 67 65 5f 6f  |..define_range_o|
000014d0  66 5f 63 68 61 72 61 63  74 65 72 73 0d 06 22 1e  |f_characters..".|
000014e0  20 20 53 54 4d 46 44 20  28 73 70 29 21 2c 7b 52  |  STMFD (sp)!,{R|
000014f0  30 2d 52 39 2c 6c 69 6e  6b 7d 0d 06 2c 34 20 20  |0-R9,link}..,4  |
00001500  41 44 52 20 52 31 2c 64  65 66 65 6e 69 74 69 6f  |ADR R1,defenitio|
00001510  6e 73 20 20 20 20 20 20  20 3b 52 31 2d 3e 46 69  |ns       ;R1->Fi|
00001520  72 73 74 20 66 6f 6e 74  20 62 6c 6f 63 6b 0d 06  |rst font block..|
00001530  36 12 2e 66 69 6e 64 5f  64 65 66 5f 6c 6f 6f 70  |6..find_def_loop|
00001540  0d 06 40 3b 20 20 4c 44  52 20 52 32 2c 5b 52 31  |..@;  LDR R2,[R1|
00001550  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |]              ;|
00001560  52 32 3d 46 69 72 73 74  20 77 6f 72 64 20 6f 66  |R2=First word of|
00001570  20 66 6f 6e 74 20 62 6c  6f 63 6b 0d 06 4a 2c 20  | font block..J, |
00001580  20 43 4d 50 20 52 32 2c  23 30 20 20 20 20 20 20  | CMP R2,#0      |
00001590  20 20 20 20 20 20 20 20  20 20 3b 49 73 20 69 74  |          ;Is it|
000015a0  20 4e 75 6c 6c 20 3f 0d  06 54 47 20 20 4c 44 4d  | Null ?..TG  LDM|
000015b0  45 51 46 44 20 28 73 70  29 21 2c 7b 52 30 2d 52  |EQFD (sp)!,{R0-R|
000015c0  39 2c 70 63 7d 5e 20 3b  59 65 73 2c 20 73 6f 20  |9,pc}^ ;Yes, so |
000015d0  65 78 69 74 20 77 69 74  68 6f 75 74 20 63 6c 61  |exit without cla|
000015e0  69 6d 69 6e 67 20 74 68  65 20 63 61 6c 6c 0d 06  |iming the call..|
000015f0  5e 30 20 20 4c 44 52 20  52 32 2c 5b 52 31 2c 23  |^0  LDR R2,[R1,#|
00001600  31 32 5d 20 20 20 20 20  20 20 20 20 20 20 3b 52  |12]           ;R|
00001610  32 3d 41 6c 70 68 61 62  65 74 20 6e 72 2e 0d 06  |2=Alphabet nr...|
00001620  68 40 20 20 43 4d 50 20  52 32 2c 52 33 20 20 20  |h@  CMP R2,R3   |
00001630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 52  |              ;R|
00001640  33 3d 49 73 20 52 32 20  72 65 71 75 65 73 74 65  |3=Is R2 requeste|
00001650  64 20 61 6c 70 68 61 62  65 74 20 6e 72 3f 0d 06  |d alphabet nr?..|
00001660  72 35 20 20 4c 44 52 4e  45 20 52 30 2c 5b 52 31  |r5  LDRNE R0,[R1|
00001670  2c 23 31 36 5d 20 20 20  20 20 20 20 20 20 3b 52  |,#16]         ;R|
00001680  30 3d 46 6f 6e 74 20 62  6c 6f 63 6b 20 6c 65 6e  |0=Font block len|
00001690  67 74 68 0d 06 7c 36 20  20 41 44 44 4e 45 20 52  |gth..|6  ADDNE R|
000016a0  31 2c 52 31 2c 52 30 20  20 20 20 20 20 20 20 20  |1,R1,R0         |
000016b0  20 20 20 3b 4e 6f 2c 20  73 6f 20 69 6e 63 2e 66  |   ;No, so inc.f|
000016c0  6f 6e 74 20 62 6c 6f 63  6b 0d 06 86 2f 20 20 42  |ont block.../  B|
000016d0  4e 45 20 66 69 6e 64 5f  64 65 66 5f 6c 6f 6f 70  |NE find_def_loop|
000016e0  20 20 20 20 20 20 20 20  20 3b 41 6e 64 20 63 68  |         ;And ch|
000016f0  65 63 6b 20 6e 65 78 74  0d 06 90 0a 2e 66 6f 75  |eck next.....fou|
00001700  6e 64 0d 06 9a 38 20 20  4d 4f 56 20 52 33 2c 52  |nd...8  MOV R3,R|
00001710  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
00001720  20 20 3b 52 33 3d 46 69  72 73 74 20 63 68 61 72  |  ;R3=First char|
00001730  20 74 6f 20 64 65 66 69  6e 65 0d 06 a4 29 20 20  | to define...)  |
00001740  41 44 44 20 52 32 2c 52  31 2c 23 32 30 20 20 20  |ADD R2,R1,#20   |
00001750  20 20 20 20 20 20 20 20  20 20 3b 52 32 2d 3e 42  |          ;R2->B|
00001760  69 74 73 0d 06 ae 37 20  20 41 44 44 20 52 31 2c  |its...7  ADD R1,|
00001770  52 31 2c 23 35 32 20 20  20 20 20 20 20 20 20 20  |R1,#52          |
00001780  20 20 20 3b 52 31 2d 3e  64 61 74 61 20 69 6e 20  |   ;R1->data in |
00001790  66 6f 6e 74 20 62 6c 6f  63 6b 0d 06 b8 29 20 20  |font block...)  |
000017a0  4d 4f 56 20 52 33 2c 23  30 20 20 20 20 20 20 20  |MOV R3,#0       |
000017b0  20 20 20 20 20 20 20 20  20 20 3b 52 33 3d 97 49  |          ;R3=.I|
000017c0  49 20 30 0d 06 c2 04 0d  06 cc 13 2e 66 69 6e 64  |I 0.........find|
000017d0  5f 64 61 74 61 5f 6c 6f  6f 70 0d 06 d6 32 20 20  |_data_loop...2  |
000017e0  43 4d 50 20 52 33 2c 52  34 20 20 20 20 20 20 20  |CMP R3,R4       |
000017f0  20 20 20 20 20 20 20 20  20 20 3b 49 73 20 52 33  |          ;Is R3|
00001800  20 73 74 61 72 74 20 63  68 61 72 3f 0d 06 e0 3d  | start char?...=|
00001810  20 20 42 47 45 20 64 61  74 61 5f 66 6f 75 6e 64  |  BGE data_found|
00001820  20 20 20 20 20 20 20 20  20 20 20 20 3b 59 65 73  |            ;Yes|
00001830  2c 20 52 31 2d 3e 67 6f  6f 64 20 64 61 74 61 2c  |, R1->good data,|
00001840  20 63 6f 6e 74 69 6e 75  65 0d 06 ea 37 20 20 42  | continue...7  B|
00001850  4c 20 74 73 74 5f 62 69  74 20 20 20 20 20 20 20  |L tst_bit       |
00001860  20 20 20 20 20 20 20 20  20 3b 48 73 20 74 68 69  |         ;Hs thi|
00001870  73 20 63 68 61 72 20 61  6e 79 20 64 61 74 61 3f  |s char any data?|
00001880  0d 06 f4 3e 20 20 41 44  44 4e 45 20 52 31 2c 52  |...>  ADDNE R1,R|
00001890  31 2c 23 38 20 20 20 20  20 20 20 20 20 20 20 20  |1,#8            |
000018a0  3b 59 65 73 2c 20 73 6f  20 64 61 74 61 20 65 78  |;Yes, so data ex|
000018b0  69 73 74 73 2c 20 69 6e  63 72 2e 20 52 31 0d 06  |ists, incr. R1..|
000018c0  fe 2a 20 20 41 44 44 20  52 33 2c 52 33 2c 23 31  |.*  ADD R3,R3,#1|
000018d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4e  |              ;N|
000018e0  65 78 74 20 63 68 61 72  0d 07 08 25 20 20 42 45  |ext char...%  BE|
000018f0  51 20 66 69 6e 64 5f 64  61 74 61 5f 6c 6f 6f 70  |Q find_data_loop|
00001900  20 20 20 20 20 20 20 20  3b 4c 6f 6f 70 0d 07 12  |        ;Loop...|
00001910  04 0d 07 1c 0f 2e 64 61  74 61 5f 66 6f 75 6e 64  |......data_found|
00001920  0d 07 26 41 20 20 4d 4f  56 20 52 34 2c 52 31 20  |..&A  MOV R4,R1 |
00001930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001940  3b 52 34 2d 3e 64 61 74  61 20 6f 66 20 66 69 72  |;R4->data of fir|
00001950  73 74 20 63 68 61 72 20  74 6f 20 64 65 66 69 6e  |st char to defin|
00001960  65 0d 07 30 04 0d 07 3a  49 20 20 42 4c 20 74 73  |e..0...:I  BL ts|
00001970  74 5f 62 69 74 20 20 20  20 20 20 20 20 20 20 20  |t_bit           |
00001980  20 20 20 20 20 3b 44 6f  65 73 20 66 69 72 73 74  |     ;Does first|
00001990  20 63 68 61 72 20 74 6f  20 64 65 66 69 6e 65 20  | char to define |
000019a0  68 61 76 65 20 61 6e 79  20 64 61 74 61 3f 0d 07  |have any data?..|
000019b0  44 34 20 20 42 45 51 20  6e 6f 5f 64 61 74 61 20  |D4  BEQ no_data |
000019c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4e  |              ;N|
000019d0  6f 2c 20 73 6f 20 64 6f  6e 22 74 20 64 65 66 69  |o, so don"t defi|
000019e0  6e 65 0d 07 4e 0e 2e 6e  65 78 74 5f 63 68 61 72  |ne..N..next_char|
000019f0  0d 07 58 25 20 20 53 57  49 20 26 31 30 30 2b 32  |..X%  SWI &100+2|
00001a00  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
00001a10  3b ef 20 32 33 0d 07 62  32 20 20 4d 4f 56 20 52  |;. 23..b2  MOV R|
00001a20  30 2c 52 33 20 20 20 20  20 20 20 20 20 20 20 20  |0,R3            |
00001a30  20 20 20 20 20 3b 52 33  3d 63 68 61 72 20 74 6f  |     ;R3=char to|
00001a40  20 64 65 66 69 6e 65 0d  07 6c 27 20 20 53 57 49  | define..l'  SWI|
00001a50  20 22 58 4f 53 5f 57 72  69 74 65 43 22 20 20 20  | "XOS_WriteC"   |
00001a60  20 20 20 20 20 20 20 3b  ef 20 63 68 61 72 0d 07  |       ;. char..|
00001a70  76 34 20 20 4d 4f 56 20  52 30 2c 52 34 20 20 20  |v4  MOV R0,R4   |
00001a80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 52  |              ;R|
00001a90  30 2d 3e 63 68 61 72 20  64 65 66 65 6e 69 74 69  |0->char defeniti|
00001aa0  6f 6e 0d 07 80 42 20 20  4d 4f 56 20 52 31 2c 23  |on...B  MOV R1,#|
00001ab0  38 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |8               |
00001ac0  20 20 3b 52 31 3d 38 20  28 63 68 61 72 20 64 65  |  ;R1=8 (char de|
00001ad0  66 65 6e 69 74 69 6f 6e  20 69 73 20 38 20 62 79  |fenition is 8 by|
00001ae0  74 65 73 29 0d 07 8a 3a  20 20 53 57 49 20 22 58  |tes)...:  SWI "X|
00001af0  4f 53 5f 57 72 69 74 65  4e 22 20 20 20 20 20 20  |OS_WriteN"      |
00001b00  20 20 20 20 3b ef 20 6e  31 2c 6e 32 2c 6e 33 2c  |    ;. n1,n2,n3,|
00001b10  6e 34 2c 6e 35 2c 6e 36  2c 6e 37 2c 6e 38 0d 07  |n4,n5,n6,n7,n8..|
00001b20  94 3d 20 20 41 44 44 20  52 34 2c 52 34 2c 23 38  |.=  ADD R4,R4,#8|
00001b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 4e  |              ;N|
00001b40  6f 2c 20 52 34 2d 3e 4e  65 78 74 20 63 68 61 72  |o, R4->Next char|
00001b50  20 64 65 66 65 6e 69 74  69 6f 6e 0d 07 9e 0c 2e  | defenition.....|
00001b60  6e 6f 5f 64 61 74 61 0d  07 a8 2f 20 20 41 44 44  |no_data.../  ADD|
00001b70  20 52 33 2c 52 33 2c 23  31 20 20 20 20 20 20 20  | R3,R3,#1       |
00001b80  20 20 20 20 20 20 20 3b  49 6e 63 72 65 6d 65 6e  |       ;Incremen|
00001b90  74 20 63 68 61 72 0d 07  b2 46 20 20 43 4d 50 20  |t char...F  CMP |
00001ba0  52 33 2c 52 35 20 20 20  20 20 20 20 20 20 20 20  |R3,R5           |
00001bb0  20 20 20 20 20 20 3b 49  73 20 69 74 20 68 69 67  |      ;Is it hig|
00001bc0  68 65 72 20 74 68 61 6e  20 4c 61 73 74 20 63 68  |her than Last ch|
00001bd0  61 72 20 74 6f 20 64 65  66 69 6e 65 0d 07 bc 2a  |ar to define...*|
00001be0  20 20 42 47 54 20 64 65  66 5f 65 78 69 74 20 20  |  BGT def_exit  |
00001bf0  20 20 20 20 20 20 20 20  20 20 20 20 3b 59 65 73  |            ;Yes|
00001c00  2c 20 65 78 69 74 0d 07  c6 4a 20 20 42 4c 20 74  |, exit...J  BL t|
00001c10  73 74 5f 62 69 74 20 20  20 20 20 20 20 20 20 20  |st_bit          |
00001c20  20 20 20 20 20 20 3b 48  61 73 20 63 75 72 72 65  |      ;Has curre|
00001c30  6e 74 20 63 68 61 72 20  74 6f 20 64 65 66 69 6e  |nt char to defin|
00001c40  65 20 68 61 76 65 20 61  6e 79 20 64 61 74 61 3f  |e have any data?|
00001c50  0d 07 d0 34 20 20 42 45  51 20 6e 6f 5f 64 61 74  |...4  BEQ no_dat|
00001c60  61 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |a               |
00001c70  3b 4e 6f 2c 20 73 6f 20  64 6f 6e 22 74 20 64 65  |;No, so don"t de|
00001c80  66 69 6e 65 0d 07 da 29  20 20 42 20 6e 65 78 74  |fine...)  B next|
00001c90  5f 63 68 61 72 20 20 20  20 20 20 20 20 20 20 20  |_char           |
00001ca0  20 20 20 20 3b 41 6e 64  20 6c 6f 6f 70 0d 07 e4  |    ;And loop...|
00001cb0  0d 2e 64 65 66 5f 65 78  69 74 0d 07 ee 1e 20 20  |..def_exit....  |
00001cc0  4c 44 4d 46 44 20 28 73  70 29 21 2c 7b 52 30 2d  |LDMFD (sp)!,{R0-|
00001cd0  52 39 2c 6c 69 6e 6b 7d  0d 07 f8 2f 20 20 4d 4f  |R9,link}.../  MO|
00001ce0  56 20 52 31 2c 23 30 20  20 20 20 20 20 20 20 20  |V R1,#0         |
00001cf0  20 20 20 20 20 20 20 20  3b 43 6c 61 69 6d 20 74  |        ;Claim t|
00001d00  68 65 20 63 61 6c 6c 0d  08 02 29 20 20 4d 4f 56  |he call...)  MOV|
00001d10  53 20 70 63 2c 6c 69 6e  6b 20 20 20 20 20 20 20  |S pc,link       |
00001d20  20 20 20 20 20 20 20 3b  42 79 65 2c 20 62 79 65  |       ;Bye, bye|
00001d30  0d 08 0c 04 0d 08 16 0c  2e 74 73 74 5f 62 69 74  |.........tst_bit|
00001d40  0d 08 20 18 3b 52 33 3d  43 48 41 52 20 20 20 20  |.. .;R3=CHAR    |
00001d50  52 32 2d 3e 42 49 54 53  0d 08 2a 2c 20 20 4d 4f  |R2->BITS..*,  MO|
00001d60  56 20 52 37 2c 52 33 2c  4c 53 52 20 23 33 20 20  |V R7,R3,LSR #3  |
00001d70  20 20 20 20 20 20 20 20  3b 52 37 20 3d 20 52 33  |        ;R7 = R3|
00001d80  20 81 20 38 0d 08 34 33  20 20 4c 44 52 42 20 52  | . 8..43  LDRB R|
00001d90  38 2c 5b 52 32 2c 52 37  5d 20 20 20 20 20 20 20  |8,[R2,R7]       |
00001da0  20 20 20 20 3b 52 38 20  3d 20 72 65 6c 65 76 61  |    ;R8 = releva|
00001db0  6e 74 20 62 79 74 65 0d  08 3e 2a 20 20 80 20 52  |nt byte..>*  . R|
00001dc0  37 2c 52 33 2c 23 25 31  31 31 20 20 20 20 20 20  |7,R3,#%111      |
00001dd0  20 20 20 20 20 3b 52 37  20 3d 20 52 33 20 83 20  |     ;R7 = R3 . |
00001de0  38 0d 08 48 0f 20 20 4d  4f 56 20 52 39 2c 23 31  |8..H.  MOV R9,#1|
00001df0  0d 08 52 2a 20 20 4d 4f  56 20 52 39 2c 52 39 2c  |..R*  MOV R9,R9,|
00001e00  4c 53 4c 20 52 37 20 20  20 20 20 20 20 20 20 20  |LSL R7          |
00001e10  3b 52 39 20 3d 20 6d 61  73 6b 0d 08 5c 31 20 20  |;R9 = mask..\1  |
00001e20  54 53 54 20 52 38 2c 52  39 20 20 20 20 20 20 20  |TST R8,R9       |
00001e30  20 20 20 20 20 20 20 20  20 20 3b 49 73 20 62 69  |          ;Is bi|
00001e40  74 20 73 65 74 20 69 6e  20 52 38 0d 08 66 29 20  |t set in R8..f) |
00001e50  20 4d 4f 56 20 70 63 2c  6c 69 6e 6b 20 20 20 20  | MOV pc,link    |
00001e60  20 20 20 20 20 20 20 20  20 20 20 3b 42 79 65 2c  |           ;Bye,|
00001e70  20 62 79 65 0d 08 70 4a  3b 3d 3d 3d 3d 3d 3d 3d  | bye..pJ;=======|
00001e80  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001eb0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 0d 08  |==============..|
00001ec0  7a 04 0d 08 84 4a 3b 3d  3d 3d 3d 3d 3d 53 74 72  |z....J;======Str|
00001ed0  20 43 6d 70 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  | Cmp============|
00001ee0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001f00  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 0d 08 8e 36  |============...6|
00001f10  3b 54 68 69 73 20 72 65  74 75 72 6e 73 20 5a 3d  |;This returns Z=|
00001f20  31 20 69 66 20 74 68 65  20 74 72 69 6e 67 73 20  |1 if the trings |
00001f30  61 72 65 20 65 71 75 61  6c 20 65 6c 73 65 20 5a  |are equal else Z|
00001f40  3d 30 0d 08 98 22 3b 52  30 3d 74 65 78 74 20 31  |=0...";R0=text 1|
00001f50  20 70 74 72 20 20 20 52  31 3d 74 65 78 74 20 32  | ptr   R1=text 2|
00001f60  20 70 74 72 0d 08 a2 0c  2e 73 74 72 5f 63 6d 70  | ptr.....str_cmp|
00001f70  0d 08 ac 1e 20 20 53 54  4d 46 44 20 28 73 70 29  |....  STMFD (sp)|
00001f80  21 2c 7b 52 30 2d 52 33  2c 6c 69 6e 6b 7d 0d 08  |!,{R0-R3,link}..|
00001f90  b6 11 2e 73 74 72 5f 63  6d 70 5f 6c 6f 6f 70 0d  |...str_cmp_loop.|
00001fa0  08 c0 35 20 20 4c 44 52  42 20 52 32 2c 5b 52 30  |..5  LDRB R2,[R0|
00001fb0  5d 2c 23 31 20 20 20 20  20 20 20 20 20 20 3b 52  |],#1          ;R|
00001fc0  32 3d 63 68 61 72 20 66  72 6f 6d 20 73 74 72 69  |2=char from stri|
00001fd0  6e 67 20 31 0d 08 ca 35  20 20 4c 44 52 42 20 52  |ng 1...5  LDRB R|
00001fe0  33 2c 5b 52 31 5d 2c 23  31 20 20 20 20 20 20 20  |3,[R1],#1       |
00001ff0  20 20 20 3b 52 33 3d 63  68 61 72 20 66 72 6f 6d  |   ;R3=char from|
00002000  20 73 74 72 69 6e 67 20  32 0d 08 d4 1c 20 20 43  | string 2....  C|
00002010  4d 50 20 52 32 2c 23 33  32 3a 4d 4f 56 4c 45 20  |MP R2,#32:MOVLE |
00002020  52 32 2c 23 30 0d 08 de  1c 20 20 43 4d 50 20 52  |R2,#0....  CMP R|
00002030  33 2c 23 33 32 3a 4d 4f  56 4c 45 20 52 33 2c 23  |3,#32:MOVLE R3,#|
00002040  30 0d 08 e8 14 20 20 80  47 45 20 52 32 2c 52 32  |0....  .GE R2,R2|
00002050  2c 23 26 44 46 0d 08 f2  14 20 20 80 47 45 20 52  |,#&DF....  .GE R|
00002060  33 2c 52 33 2c 23 26 44  46 0d 08 fc 27 20 20 43  |3,R3,#&DF...'  C|
00002070  4d 50 20 52 32 2c 52 33  20 20 20 20 20 20 20 20  |MP R2,R3        |
00002080  20 20 20 20 20 20 20 20  20 3b 53 61 6d 65 20 3f  |         ;Same ?|
00002090  0d 09 06 29 20 20 4c 44  4d 4e 45 46 44 20 28 73  |...)  LDMNEFD (s|
000020a0  70 29 21 2c 7b 52 30 2d  52 33 2c 70 63 7d 20 20  |p)!,{R0-R3,pc}  |
000020b0  3b 4e 6f 2c 20 45 78 69  74 0d 09 10 10 20 20 43  |;No, Exit....  C|
000020c0  4d 50 20 52 32 2c 23 33  31 0d 09 1a 28 20 20 42  |MP R2,#31...(  B|
000020d0  47 45 20 73 74 72 5f 63  6d 70 5f 6c 6f 6f 70 20  |GE str_cmp_loop |
000020e0  20 20 20 20 20 20 20 20  3b 4e 6f 2c 20 6c 6f 6f  |        ;No, loo|
000020f0  70 0d 09 24 26 20 20 43  4d 50 20 52 32 2c 52 33  |p..$&  CMP R2,R3|
00002100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002110  3b 53 61 6d 65 20 3f 0d  09 2e 23 20 20 4c 44 4d  |;Same ?...#  LDM|
00002120  46 44 20 28 73 70 29 21  2c 7b 52 30 2d 52 33 2c  |FD (sp)!,{R0-R3,|
00002130  70 63 7d 20 20 3b 45 78  69 74 0d 09 38 4a 3b 3d  |pc}  ;Exit..8J;=|
00002140  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00002180  3d 3d 3d 3d 0d 09 42 04  0d 09 4c 4a 3b 3d 3d 3d  |====..B...LJ;===|
00002190  3d 3d 3d 41 6c 70 68 61  62 65 74 20 64 65 66 65  |===Alphabet defe|
000021a0  6e 69 74 69 6f 6e 73 3d  3d 3d 3d 3d 3d 3d 3d 3d  |nitions=========|
000021b0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000021d0  3d 3d 0d 09 56 10 2e 64  65 66 65 6e 69 74 69 6f  |==..V..defenitio|
000021e0  6e 73 0d 09 60 05 5d 0d  09 6a 05 f7 0d 09 74 05  |ns..`.]..j....t.|
000021f0  f5 0d 09 7e 11 20 20 f3  20 66 6f 6e 74 66 69 6c  |...~.  . fontfil|
00002200  65 24 0d 09 88 1a 20 20  e7 20 66 6f 6e 74 66 69  |e$....  . fontfi|
00002210  6c 65 24 3c 3e 22 24 24  24 22 20 8c 0d 09 92 0f  |le$<>"$$$" .....|
00002220  20 20 20 20 f3 20 6e 61  6d 65 24 0d 09 9c 12 20  |    . name$.... |
00002230  20 20 20 5b 4f 50 54 20  70 61 73 73 25 0d 09 a6  |   [OPT pass%...|
00002240  1e 20 20 20 20 a4 66 6f  6e 74 28 66 6f 6e 74 66  |.    .font(fontf|
00002250  69 6c 65 24 2c 6e 61 6d  65 24 29 0d 09 b0 09 20  |ile$,name$).... |
00002260  20 20 20 5d 0d 09 ba 07  20 20 cd 0d 09 c4 15 fd  |   ]....  ......|
00002270  20 66 6f 6e 74 66 69 6c  65 24 3d 22 24 24 24 22  | fontfile$="$$$"|
00002280  0d 09 ce 04 0d 09 d8 0e  5b 4f 50 54 20 70 61 73  |........[OPT pas|
00002290  73 25 0d 09 e2 2d 45 51  55 44 20 30 20 20 20 20  |s%...-EQUD 0    |
000022a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000022b0  20 20 20 20 3b 54 65 72  6d 69 6e 61 74 6f 72 0d  |    ;Terminator.|
000022c0  09 ec 4a 3b 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |..J;============|
000022d0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00002300  3d 3d 3d 3d 3d 3d 3d 3d  3d 0d 09 f6 05 5d 0d 0a  |=========....]..|
00002310  00 05 ed 0d 0a 0a 05 e1  0d 0a 14 05 3a 0d 0a 1e  |............:...|
00002320  11 dd a4 66 6f 6e 74 28  66 24 2c 6e 24 29 0d 0a  |...font(f$,n$)..|
00002330  28 24 f4 20 66 24 3d 66  69 6c 65 6e 61 6d 65 20  |($. f$=filename |
00002340  20 20 20 20 20 20 6e 24  3d 66 6f 6e 74 20 6e 61  |      n$=font na|
00002350  6d 65 0d 0a 32 4a f4 20  6f 6e 20 74 68 65 20 66  |me..2J. on the f|
00002360  69 72 73 74 20 61 73 73  65 6d 62 6c 79 20 70 61  |irst assembly pa|
00002370  73 73 20 69 74 20 77 69  6c 6c 20 6f 6e 6c 79 20  |ss it will only |
00002380  63 72 65 61 74 65 20 74  68 65 20 66 6f 6e 74 20  |create the font |
00002390  62 6c 6f 63 6b 20 68 65  61 64 65 72 0d 0a 3c 30  |block header..<0|
000023a0  f4 20 61 6e 64 20 72 65  73 65 72 76 65 20 73 70  |. and reserve sp|
000023b0  61 63 65 20 66 6f 72 20  74 68 65 20 66 6f 6e 74  |ace for the font|
000023c0  20 64 65 66 65 6e 69 74  69 6f 6e 2e 0d 0a 46 38  | defenition...F8|
000023d0  f4 20 41 20 66 6f 6e 74  20 68 65 61 64 65 72 20  |. A font header |
000023e0  69 73 20 33 20 77 6f 72  64 73 20 66 6f 6e 74 20  |is 3 words font |
000023f0  6e 61 6d 65 2c 20 31 20  77 6f 72 64 20 66 6f 6e  |name, 1 word fon|
00002400  74 20 6e 72 0d 0a 50 04  0d 0a 5a 13 e7 20 6e 24  |t nr..P...Z.. n$|
00002410  3d 22 22 20 8c 20 6e 24  3d 66 24 0d 0a 64 0e 5b  |="" . n$=f$..d.[|
00002420  4f 50 54 20 70 61 73 73  25 0d 0a 6e 11 a4 61 6c  |OPT pass%..n..al|
00002430  6c 69 67 6e 31 32 28 6e  24 29 0d 0a 78 15 45 51  |lign12(n$)..x.EQ|
00002440  55 44 20 61 6c 70 68 61  62 65 74 5f 6e 72 25 0d  |UD alphabet_nr%.|
00002450  0a 82 05 5d 0d 0a 8c 47  6c 65 6e 67 74 68 25 3d  |...]...Glength%=|
00002460  50 25 3a 50 25 2b 3d 34  20 20 20 20 3a f4 20 4c  |P%:P%+=4    :. L|
00002470  61 74 65 72 20 77 65 20  77 69 6c 6c 20 70 75 74  |ater we will put|
00002480  20 74 68 65 20 66 6f 6e  74 20 62 6c 6f 63 6b 20  | the font block |
00002490  6c 65 6e 67 74 68 20 68  65 72 65 0d 0a 96 13 61  |length here....a|
000024a0  6c 70 68 61 62 65 74 5f  6e 72 25 2b 3d 31 0d 0a  |lphabet_nr%+=1..|
000024b0  a0 13 66 24 3d 66 6f 6e  74 5f 64 69 72 24 2b 66  |..f$=font_dir$+f|
000024c0  24 0d 0a aa 0f e7 20 70  61 73 73 25 3e 30 20 8c  |$..... pass%>0 .|
000024d0  0d 0a b4 24 20 20 c8 99  20 22 4f 53 5f 46 69 6c  |...$  .. "OS_Fil|
000024e0  65 22 2c 35 2c 66 24 20  b8 20 6f 25 2c 2c 4c 25  |e",5,f$ . o%,,L%|
000024f0  2c 2c 6c 25 0d 0a be 28  20 20 e7 20 6f 25 3d 30  |,,l%...(  . o%=0|
00002500  20 8c 20 85 20 30 2c 22  43 61 6e 27 74 20 66 69  | . . 0,"Can't fi|
00002510  6e 64 20 27 22 2b 66 24  2b 22 27 22 0d 0a c8 2c  |nd '"+f$+"'"...,|
00002520  20 20 e7 20 6f 25 3d 32  20 8c 20 85 20 30 2c 22  |  . o%=2 . . 0,"|
00002530  27 22 2b 66 24 2b 22 27  20 69 73 20 61 20 64 69  |'"+f$+"' is a di|
00002540  72 65 63 74 6f 72 79 22  0d 0a d2 3d 20 20 e7 20  |rectory"...=  . |
00002550  28 28 4c 25 3e 3e 38 29  80 26 46 46 46 29 3c 3e  |((L%>>8).&FFF)<>|
00002560  26 46 46 37 20 85 20 30  2c 66 24 2b 22 20 69 73  |&FF7 . 0,f$+" is|
00002570  20 6e 6f 74 20 61 20 42  42 43 20 46 6f 6e 74 20  | not a BBC Font |
00002580  66 69 6c 65 22 0d 0a dc  32 20 20 e7 20 6c 25 3e  |file"...2  . l%>|
00002590  32 30 30 30 20 8c 20 85  20 30 2c 22 46 6f 6e 74  |2000 . . 0,"Font|
000025a0  20 66 69 6c 65 20 27 22  2b 66 24 2b 22 27 20 74  | file '"+f$+"' t|
000025b0  6f 6f 20 62 69 67 22 0d  0a e6 39 20 20 c8 99 20  |oo big"...9  .. |
000025c0  22 4f 53 5f 46 69 6c 65  22 2c 26 46 46 2c 66 24  |"OS_File",&FF,f$|
000025d0  2c 42 25 2c 30 20 20 20  20 20 20 3a f4 20 4c 6f  |,B%,0      :. Lo|
000025e0  61 64 69 6e 67 20 66 69  6c 65 20 61 74 20 42 25  |ading file at B%|
000025f0  0d 0a f0 2f 20 20 e3 20  4e 25 3d 30 20 b8 20 33  |.../  . N%=0 . 3|
00002600  31 3a 20 50 25 3f 4e 25  3d 30 3a ed 20 20 20 3a  |1: P%?N%=0:.   :|
00002610  f4 20 43 6c 65 61 72 69  6e 67 20 62 69 74 73 0d  |. Clearing bits.|
00002620  0a fa 04 0d 0b 04 4a 20  20 70 74 72 25 3d 42 25  |......J  ptr%=B%|
00002630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002650  20 3a f4 20 20 54 68 69  73 20 77 69 6c 6c 20 73  | :.  This will s|
00002660  65 74 20 61 20 63 68 61  72 20 62 69 74 0d 0b 0e  |et a char bit...|
00002670  3d 20 20 c8 95 20 28 70  74 72 25 3c 42 25 2b 6c  |=  .. (ptr%<B%+l|
00002680  25 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |%)              |
00002690  20 20 20 20 20 20 20 20  3a f4 20 20 69 66 20 69  |        :.  if i|
000026a0  74 20 68 61 73 20 64 61  74 61 0d 0b 18 27 20 20  |t has data...'  |
000026b0  20 20 e7 20 28 70 74 72  25 3f 31 29 3e 33 31 20  |  . (ptr%?1)>31 |
000026c0  80 20 28 70 74 72 25 3f  31 29 3c 3e 31 32 37 20  |. (ptr%?1)<>127 |
000026d0  8c 0d 0b 22 21 20 20 20  20 20 20 73 70 74 72 25  |..."!      sptr%|
000026e0  3d 50 25 2b 28 28 70 74  72 25 3f 31 29 20 81 20  |=P%+((ptr%?1) . |
000026f0  38 29 0d 0b 2c 14 20 20  20 20 20 20 63 62 25 3d  |8)..,.      cb%=|
00002700  3f 73 70 74 72 25 0d 0b  36 27 20 20 20 20 20 20  |?sptr%..6'      |
00002710  63 62 25 3d 63 62 25 20  84 20 28 31 3c 3c 28 28  |cb%=cb% . (1<<((|
00002720  70 74 72 25 3f 31 29 20  83 20 38 29 29 0d 0b 40  |ptr%?1) . 8))..@|
00002730  14 20 20 20 20 20 20 3f  73 70 74 72 25 3d 63 62  |.      ?sptr%=cb|
00002740  25 0d 0b 4a 09 20 20 20  20 cd 0d 0b 54 10 20 20  |%..J.    ...T.  |
00002750  20 20 70 74 72 25 2b 3d  31 30 0d 0b 5e 07 20 20  |  ptr%+=10..^.  |
00002760  ce 0d 0b 68 04 0d 0b 72  0f 20 20 78 25 3d b1 3a  |...h...r.  x%=.:|
00002770  79 25 3d bc 0d 0b 7c 13  20 20 f1 3b 8a 78 25 2c  |y%=...|.  .;.x%,|
00002780  79 25 29 3b 6e 24 3b 0d  0b 86 0e 20 20 62 69 74  |y%);n$;....  bit|
00002790  73 25 3d 50 25 0d 0b 90  0c 20 20 50 25 2b 3d 33  |s%=P%....  P%+=3|
000027a0  32 0d 0b 9a 0a 20 20 43  25 3d 30 0d 0b a4 12 20  |2....  C%=0.... |
000027b0  20 e3 20 4e 25 3d 30 20  b8 20 32 35 36 0d 0b ae  | . N%=0 . 256...|
000027c0  1c 20 20 20 20 73 70 74  72 25 3d 62 69 74 73 25  |.    sptr%=bits%|
000027d0  2b 28 4e 25 20 81 20 38  29 0d 0b b8 12 20 20 20  |+(N% . 8)....   |
000027e0  20 63 62 25 3d 3f 73 70  74 72 25 0d 0b c2 24 20  | cb%=?sptr%...$ |
000027f0  20 20 20 e7 20 28 63 62  25 20 80 20 28 31 3c 3c  |   . (cb% . (1<<|
00002800  28 4e 25 20 83 20 38 29  29 29 3c 3e 30 20 8c 0d  |(N% . 8)))<>0 ..|
00002810  0b cc 20 20 20 20 20 20  20 f1 8a 32 30 2c 79 25  |..       ..20,y%|
00002820  29 3b 22 43 68 61 72 20  3a 20 22 3b 4e 25 3b 0d  |);"Char : ";N%;.|
00002830  0b d6 15 20 20 20 20 20  20 f2 73 65 61 72 63 68  |...      .search|
00002840  28 4e 25 29 0d 0b e0 09  20 20 20 20 cd 0d 0b ea  |(N%)....    ....|
00002850  07 20 20 ed 0d 0b f4 14  20 20 21 6c 65 6e 67 74  |.  .....  !lengt|
00002860  68 25 3d 35 32 2b 43 25  0d 0b fe 05 f1 0d 0c 08  |h%=52+C%........|
00002870  05 cd 0d 0c 12 0a 3d 70  61 73 73 25 0d 0c 1c 05  |......=pass%....|
00002880  3a 0d 0c 26 12 dd a4 61  6c 6c 69 67 6e 31 32 28  |:..&...allign12(|
00002890  73 24 29 0d 0c 30 46 f4  20 54 68 69 73 20 77 69  |s$)..0F. This wi|
000028a0  6c 6c 20 73 74 6f 72 65  20 74 68 65 20 73 74 72  |ll store the str|
000028b0  69 6e 67 2c 20 70 61 64  64 65 64 20 77 69 74 68  |ing, padded with|
000028c0  20 43 48 52 24 28 30 29  20 28 75 70 20 74 6f 20  | CHR$(0) (up to |
000028d0  31 32 20 63 68 61 72 73  29 0d 0c 3a 0b ea 20 66  |12 chars)..:.. f|
000028e0  69 6c 6c 24 0d 0c 44 2d  e7 20 a9 73 24 3e 31 31  |ill$..D-. .s$>11|
000028f0  20 8c 20 85 20 30 2c 22  46 6f 6e 74 6e 61 6d 65  | . . 0,"Fontname|
00002900  20 27 22 2b 6e 24 2b 22  27 74 6f 6f 20 62 69 67  | '"+n$+"'too big|
00002910  22 0d 0c 4e 17 66 69 6c  6c 24 3d c4 31 32 2d a9  |"..N.fill$=.12-.|
00002920  73 24 2c bd 28 30 29 29  0d 0c 58 0e 5b 4f 50 54  |s$,.(0))..X.[OPT|
00002930  20 70 61 73 73 25 0d 0c  62 11 45 51 55 53 20 73  | pass%..b.EQUS s|
00002940  24 2b 66 69 6c 6c 24 0d  0c 6c 0c 5d 3a 3d 70 61  |$+fill$..l.]:=pa|
00002950  73 73 25 0d 0c 76 05 3a  0d 0c 80 10 dd f2 73 65  |ss%..v.:......se|
00002960  61 72 63 68 28 63 25 29  0d 0c 8a 3d f4 20 54 68  |arch(c%)...=. Th|
00002970  69 73 20 77 69 6c 6c 20  73 65 61 72 63 68 20 66  |is will search f|
00002980  6f 72 20 74 68 65 20 65  78 69 73 74 69 6e 67 20  |or the existing |
00002990  64 65 66 65 6e 69 74 69  6f 6e 20 6f 66 20 61 20  |defenition of a |
000029a0  63 68 61 72 2c 0d 0c 94  45 f4 20 61 6e 64 20 70  |char,...E. and p|
000029b0  75 74 20 69 74 20 61 74  20 50 25 2e 20 54 68 69  |ut it at P%. Thi|
000029c0  73 20 68 61 73 20 74 6f  20 62 65 20 64 6f 6e 65  |s has to be done|
000029d0  3c 20 61 73 20 69 6e 20  42 42 43 20 46 6f 6e 74  |< as in BBC Font|
000029e0  20 66 69 6c 65 73 20 74  68 65 0d 0c 9e 26 f4 20  | files the...&. |
000029f0  64 65 66 65 6e 69 74 69  6f 6e 73 20 63 61 6e 20  |defenitions can |
00002a00  62 65 20 69 6e 20 61 6e  79 20 6f 72 64 65 72 2e  |be in any order.|
00002a10  0d 0c a8 14 ea 20 70 74  72 25 2c 66 6f 75 6e 64  |..... ptr%,found|
00002a20  25 2c 4a 25 0d 0c b2 0c  66 6f 75 6e 64 25 3d a3  |%,J%....found%=.|
00002a30  0d 0c bc 0b 70 74 72 25  3d 42 25 0d 0c c6 1e c8  |....ptr%=B%.....|
00002a40  95 20 28 70 74 72 25 3c  42 25 2b 6c 25 29 20 80  |. (ptr%<B%+l%) .|
00002a50  20 66 6f 75 6e 64 25 3d  a3 0d 0c d0 42 20 20 e7  | found%=....B  .|
00002a60  20 3f 70 74 72 25 3c 3e  32 33 20 8c 20 f1 3f 70  | ?ptr%<>23 . .?p|
00002a70  74 72 25 3a 85 20 30 2c  22 53 6f 6d 65 74 68 69  |tr%:. 0,"Somethi|
00002a80  6e 67 20 77 72 6f 6e 67  20 69 6e 20 74 68 69 73  |ng wrong in this|
00002a90  20 66 6f 6e 74 20 66 69  6c 65 22 0d 0c da 0d 20  | font file".... |
00002aa0  20 70 74 72 25 2b 3d 31  0d 0c e4 12 20 20 e7 20  | ptr%+=1....  . |
00002ab0  63 25 3d 3f 70 74 72 25  20 8c 0d 0c ee 0d 20 20  |c%=?ptr% .....  |
00002ac0  20 20 43 25 2b 3d 38 0d  0c f8 0f 20 20 20 20 70  |  C%+=8....    p|
00002ad0  74 72 25 2b 3d 31 0d 0d  02 12 20 20 20 20 e3 20  |tr%+=1....    . |
00002ae0  4a 25 3d 30 20 b8 20 37  0d 0d 0c 17 20 20 20 20  |J%=0 . 7....    |
00002af0  20 20 50 25 3f 4a 25 3d  70 74 72 25 3f 4a 25 0d  |  P%?J%=ptr%?J%.|
00002b00  0d 16 09 20 20 20 20 ed  0d 0d 20 0d 20 20 20 20  |...    ... .    |
00002b10  50 25 2b 3d 38 0d 0d 2a  10 20 20 20 20 66 6f 75  |P%+=8..*.    fou|
00002b20  6e 64 25 3d b9 0d 0d 34  07 20 20 cc 0d 0d 3e 0f  |nd%=...4.  ...>.|
00002b30  20 20 20 20 70 74 72 25  2b 3d 31 0d 0d 48 07 20  |    ptr%+=1..H. |
00002b40  20 cd 0d 0d 52 0d 20 20  70 74 72 25 2b 3d 38 0d  | ...R.  ptr%+=8.|
00002b50  0d 5c 05 ce 0d 0d 66 05  e1 0d ff                 |.\....f....|
00002b5b