Home » CEEFAX disks » telesoftware2.adl » OS\BITS/B\OSB24

OS\BITS/B\OSB24

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 » CEEFAX disks » telesoftware2.adl
Filename: OS\BITS/B\OSB24
Read OK:
File size: 24F0 bytes
Load address: 1900
Exec address: 8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM  OSbits Module B/osb24
   20REM  Sideways ROM
   30REM  Version 1.4 30.5.87
   40 
   50Version$ = "V1.4"
   60Date$ = "30th May 1987"
   70 
   80*KEY1MO.3|M|NL.|M
   90 
  100REM Memory usage in Zero Page is zp to zp+3, always preserved
  110REM During *command processing workspace start is in (zp)
  120 
  130osbyte=&FFF4
  140osword=&FFF1
  150oswrch=&FFEE
  160osrdch=&FFE0
  170osnewl=&FFE7
  180osasci=&FFE3
  190gsinit=&FFC2
  200gsread=&FFC5
  210 
  220REM  Operating system call workspace
  230zp=&A8
  240REM  Flag for service call display
  250service_flag=&28A
  260 
  270code%=&FFFF8000
  280 
  290DIM temp% &300
  300 
  310FOR pass%=4 TO 6 STEP 2
  320 
  330P%=code%
  340O%=temp%
  350 
  360[OPT pass%
  370 
  380EQUW 0
  390EQUB 0                   \ Set first 3 bytes to zero (Service only)
  400 
  410JMP service_entry_point
  420 
  430EQUB &82                 \ Define ROM type (Service, 6502 mcode)
  440EQUB copyright - code%   \ Copyright string offset
  450EQUB 0                   \ Version
  460 
  470.rom_title        EQUS "OSbits Demo ROM "+Version$
  480 
  490.copyright        EQUS CHR$0+"(C)BBC "+Date$+CHR$0
  500 
  510.service_entry_point
  520 
  530JSR show_service_calls
  540 
  550PHA
  560\  CMP #2                   \ Claim private work space
  570\  BNE not_sc2
  580\  TYA                      \ Y - OSHWM X - ROM number
  590\  STA &DF0,X               \ Index into ROM workspace table
  600\  INY                      \ We need only 1 page of space
  610\  JMP out
  620 
  630.not_sc2
  640 
  650CMP #3                   \ Use service call 3 to print ident
  660BNE not_sc3
  670TXA
  680PHA
  690LDX #(title-text)
  700DEX
  710JSR print_text
  720JSR osnewl
  730PLA
  740TAX
  750\  LDA zp+2
  760\  PHA
  770\  LDA zp+3
  780\  PHA
  790\  TYA
  800\  PHA
  810\  LDA &DF0, X
  820\  STA zp+3
  830\  LDA #0
  840\  STA zp+2
  850\  LDY #15                  \ No of workspace bytes to clear
  860 
  870\  .clear_workspace
  880 
  890\  DEY
  900\  STA (zp+2), Y            \ Reset bytes of workspace
  910\  BNE clear_workspace
  920\  PLA
  930\  TAY
  940\  PLA
  950\  STA zp+3
  960\  PLA
  970\  STA zp+2
  980JMP out
  990 
 1000.not_sc3
 1010 
 1020CMP #4                   \ Unrecognised commands
 1030BNE not_sc4
 1040JMP commands
 1050 
 1060.not_sc4
 1070 
 1080CMP #9                   \ Service call 9 is *HELP
 1090BNE not_sc9
 1100JMP help_processing
 1110 
 1120.not_sc9
 1130.out
 1140 
 1150PLA
 1160RTS
 1170 
 1180.help_processing
 1190 
 1200TXA
 1210PHA
 1220LDA (&F2), Y             \ Look at character following HELP
 1230CMP #13
 1240BNE specific_help        \ If not CR then respond to next word
 1250JSR osnewl
 1260LDX #(title-text)
 1270DEX
 1280JSR print_text           \ Print out title
 1290JSR print_text           \ and print out key words
 1300PLA
 1310TAX
 1320JMP out
 1330 
 1340.specific_help
 1350 
 1360PLA
 1370TAX
 1380LDA zp+2
 1390PHA
 1400LDA zp+3
 1410PHA
 1420TXA
 1430PHA                      \ Save X
 1440DEY
 1450TYA
 1460PHA                      \ Save Y-1 on stack
 1470LDX #&FF
 1480 
 1490.help_loop
 1500 
 1510INX
 1520INY
 1530LDA help_list, X         \ Load character from help command list
 1540BEQ help_recognised
 1550CMP #&FF
 1560BEQ not_this_help
 1570LDA (&F2), Y             \ Look at character following HELP
 1580AND #&DF                 \ Make it case proof
 1590CMP help_list, X
 1600BEQ help_loop
 1610 
 1620.another_search
 1630 
 1640INX
 1650LDA help_list, X
 1660BNE another_search       \ Looking for next null
 1670INX
 1680INX                      \ Skip 2 bytes
 1690PLA                      \ Pull Y-1 from stack
 1700TAY                      \ Put back in Y register
 1710PHA                      \ Return to stack for next try
 1720JMP help_loop            \ See if this next command is recognised
 1730 
 1740.not_this_help
 1750 
 1760PLA
 1770TAY
 1780INY
 1790PLA
 1800TAX
 1810PLA
 1820STA zp+3
 1830PLA
 1840STA zp+2
 1850PLA                      \ Restore all registers before quitting
 1860RTS
 1870 
 1880.help_recognised
 1890 
 1900JSR osnewl
 1910INX                      \ Make X point to response address in table
 1920LDA help_list, X
 1930STA zp+2
 1940INX
 1950LDA help_list, X
 1960STA zp+3                 \ Store response text address in (zp+2)
 1970LDY #&FF
 1980LDX #(title-text)        \ Print out title
 1990DEX
 2000JSR print_text
 2010 
 2020.help_recognised_loop
 2030 
 2040INY
 2050LDA (zp+2), Y
 2060JSR osasci               \ Print out response (Null=EOT)
 2070BNE help_recognised_loop
 2080PLA
 2090TAY                      \ Restore all registers before quitting
 2100INY
 2110PLA
 2120TAX
 2130PLA
 2140STA zp+3
 2150PLA
 2160STA zp+2
 2170PLA
 2180RTS
 2190 
 2200.print_text              \ Print text offset from 'text' by X
 2210 
 2220INX
 2230LDA text, X
 2240JSR osasci
 2250BNE print_text           \ Null = End of text
 2260RTS
 2270 
 2280.commands
 2290 
 2300LDA zp
 2310PHA
 2320LDA zp+1
 2330PHA
 2340LDA zp+2
 2350PHA
 2360LDA zp+3
 2370PHA                      \ Store values held in zp/zp+3 on stack
 2380LDA &DF0, X              \ MSB of start of workspace
 2390STA zp+1
 2400LDA #0
 2410STA zp                   \ W'space now stored in (zp)
 2420TXA
 2430PHA
 2440DEY
 2450TYA
 2460PHA                      \ Store Y-1 on the stack
 2470LDX #&FF
 2480 
 2490.commands_loop
 2500 
 2510INX
 2520INY
 2530LDA command_list,X
 2540BEQ this_rom             \ A null byte means a command is recognised
 2550CMP #&FF
 2560BEQ not_this_rom         \ &FF is end of command table
 2570LDA (&F2),Y              \ String is held from ?&F2 onwards to CR
 2580AND #&DF                 \ Make it case proof!
 2590CMP command_list,X
 2600BEQ commands_loop
 2610 
 2620.repeat_search           \ Command is not recognised
 2630 
 2640INX
 2650LDA command_list,X
 2660BNE repeat_search        \ Look for the next null
 2670INX
 2680INX                      \ When found skip two bytes
 2690PLA                      \ Pull Y-1 from stack
 2700TAY                      \ Put it back in Y register
 2710PHA                      \ Return to stack for next try
 2720JMP commands_loop        \ See if this next command is recognised
 2730 
 2740.not_this_rom
 2750 
 2760PLA
 2770TAY
 2780INY
 2790PLA
 2800TAX
 2810PLA
 2820STA zp+3
 2830PLA
 2840STA zp+2
 2850PLA
 2860STA zp+1
 2870PLA
 2880STA zp
 2890PLA                      \ Restore all registers before quitting
 2900RTS
 2910 
 2920.this_rom
 2930 
 2940INX
 2950LDA command_list,X
 2960STA zp+2
 2970INX
 2980LDA command_list,X
 2990STA zp+3
 3000JMP (zp+2)               \ Table address jump
 3010 
 3020.command_list   EQUS "BEEP"
 3030                EQUB 0
 3040                EQUW beep
 3050                EQUS "SEND"
 3060                EQUB 0
 3070                EQUW send
 3080                EQUS "SERVICE"
 3090                EQUB 0
 3100                EQUW service_on
 3110                EQUS "NOSERVICE"
 3120                EQUB 0
 3130                EQUW service_off
 3140                EQUS "WHATSYOURS"
 3150                EQUB 0
 3160                EQUW whatsyours
 3170                EQUB &FF
 3180.help_list      EQUS "OSBITS"
 3190                EQUB 0
 3200                EQUW help_text_1
 3210                EQUB &FF
 3220.text
 3230.title          EQUS "Demonstration ROM for OSbits Module 24"
 3240                EQUW 13
 3250                EQUS "  OSBITS"
 3260                EQUW 13
 3270.help_text
 3280.help_text_1    EQUB 13
 3290                EQUS "*BEEP makes a beep"
 3300                EQUB 13
 3310                EQUS "*SEND prints the argument to output"
 3320                EQUB 13
 3330                EQUS "*SERVICE turns on service call display"
 3340                EQUB 13
 3350                EQUS "*NOSERVICE turns it off again"
 3360                EQUB 13
 3370                EQUS "You can add more commands if you wish"
 3380                EQUD &0D0D
 3390 
 3400.show_service_calls
 3410 
 3420PHA                      \ Save A safely on stack
 3430LDA service_flag
 3440BEQ no_show
 3450 
 3460PLA
 3470PHA
 3480JSR print_hex            \ Print out hex value of A
 3490JSR print_space
 3500TXA
 3510JSR print_hex            \ Print out hex value of X
 3520JSR print_space
 3530TYA
 3540JSR print_hex            \ Print out hex value of Y
 3550JSR osnewl
 3560 
 3570.no_show
 3580PLA                      \ Retrieve A
 3590RTS
 3600 
 3610.print_space
 3620 
 3630LDA #32
 3640JSR oswrch
 3650RTS
 3660 
 3670.print_hex
 3680 
 3690PHA
 3700LSR A
 3710LSR A
 3720LSR A
 3730LSR A                    \ A now contains higher nybble
 3740JSR print_nybble         \ Sends the HEX value of the nybble
 3750PLA
 3760AND #&F                  \ A now contains lower nybble
 3770JSR print_nybble         \ Sends the HEX value of the nybble
 3780RTS
 3790  
 3800.print_nybble
 3810 
 3820ORA #48                  \ This effectively adds 48 in less code
 3830CMP #58
 3840BCC dont_add
 3850ADC #6                   \ Carry is set so this is +7
 3860 
 3870.dont_add
 3880 
 3890JSR oswrch
 3900RTS
 3910 
 3920.beep                    \ Dummy routine
 3930 
 3940LDA #7
 3950JSR oswrch               \ Just sends a VDU7
 3960JMP exit
 3970 
 3980.send                    \ Prints argument to output
 3990 
 4000SEC                      \ Terminate with CR or second quotes
 4010JSR gsinit               \ Initialise string
 4020BEQ send_ended           \ Zero set if a null string
 4030 
 4040.send_loop
 4050 
 4060JSR gsread               \ Read next character
 4070BCS send_ended           \ Carry set if terminator
 4080JSR osasci
 4090JMP send_loop
 4100 
 4110.send_ended
 4120 
 4130JSR osnewl
 4140JMP exit
 4150 
 4160.service_on
 4170 
 4180LDA #1
 4190STA service_flag
 4200JMP exit
 4210 
 4220.service_off
 4230 
 4240LDA #0
 4250STA service_flag
 4260JMP exit
 4270 
 4280.whatsyours              \ Replace with your own routine
 4290 
 4300JMP beep
 4310 
 4320.exit                    \ Exit from all commands
 4330 
 4340PLA                      \ Pull Y and discard
 4350PLA                      \ Pull X and discard
 4360PLA
 4370STA zp+3
 4380PLA
 4390STA zp+2
 4400PLA
 4410STA zp+1
 4420PLA
 4430STA zp
 4440PLA
 4450LDA #0                   \ Claim command
 4460RTS
 4470 
 4480]
 4490NEXT
 4500PRINT '" *SAVE osbrom ";~temp%;" +";~P%-code%;" ";~code%;" ";~code%

�  OSbits Module B/osb24
�  Sideways ROM
�  Version 1.4 30.5.87
( 
2Version$ = "V1.4"
<Date$ = "30th May 1987"
F 
P*KEY1MO.3|M|NL.|M
Z 
d?� Memory usage in Zero Page is zp to zp+3, always preserved
n;� During *command processing workspace start is in (zp)
x 
�osbyte=&FFF4
�osword=&FFF1
�oswrch=&FFEE
�osrdch=&FFE0
�osnewl=&FFE7
�osasci=&FFE3
�gsinit=&FFC2
�gsread=&FFC5
� 
�&�  Operating system call workspace
�
zp=&A8
�$�  Flag for service call display
�service_flag=&28A
 
code%=&FFFF8000
 
"� temp% &300
, 
6� pass%=4 � 6 � 2
@ 
JP%=code%
TO%=temp%
^ 
h[OPT pass%
r 
|
EQUW 0
�GEQUB 0                   \ Set first 3 bytes to zero (Service only)
� 
�JMP service_entry_point
� 
�DEQUB &82                 \ Define ROM type (Service, 6502 mcode)
�6EQUB copyright - code%   \ Copyright string offset
�&EQUB 0                   \ Version
� 
�6.rom_title        EQUS "OSbits Demo ROM "+Version$
� 
�0.copyright        EQUS �0+"(C)BBC "+Date$+�0
� 
�.service_entry_point
 
JSR show_service_calls
 
&PHA
0:\  CMP #2                   \ Claim private work space
:\  BNE not_sc2
D:\  TYA                      \ Y - OSHWM X - ROM number
N@\  STA &DF0,X               \ Index into ROM workspace table
X>\  INY                      \ We need only 1 page of space
b\  JMP out
l 
v.not_sc2
� 
�@CMP #3                   \ Use service call 3 to print ident
�BNE not_sc3
�TXA
�PHA
�LDX #(title-text)
�DEX
�JSR print_text
�JSR osnewl
�PLA
�TAX
�\  LDA zp+2
�
\  PHA
\  LDA zp+3

\  PHA

\  TYA
 
\  PHA
*\  LDA &DF0, X
4\  STA zp+3
>
\  LDA #0
H\  STA zp+2
R@\  LDY #15                  \ No of workspace bytes to clear
\ 
f\  .clear_workspace
p 
z
\  DEY
�:\  STA (zp+2), Y            \ Reset bytes of workspace
�\  BNE clear_workspace
�
\  PLA
�
\  TAY
�
\  PLA
�\  STA zp+3
�
\  PLA
�\  STA zp+2
�JMP out
� 
�.not_sc3
� 
�4CMP #4                   \ Unrecognised commands
BNE not_sc4
JMP commands
 
$.not_sc4
. 
86CMP #9                   \ Service call 9 is *HELP
BBNE not_sc9
LJMP help_processing
V 
`.not_sc9
j.out
t 
~PLA
�RTS
� 
�.help_processing
� 
�TXA
�PHA
�?LDA (&F2), Y             \ Look at character following HELP
�CMP #13
�BBNE specific_help        \ If not CR then respond to next word
�JSR osnewl
�LDX #(title-text)
�DEX
.JSR print_text           \ Print out title

6JSR print_text           \ and print out key words
PLA
TAX
(JMP out
2 
<.specific_help
F 
PPLA
ZTAX
dLDA zp+2
nPHA
xLDA zp+3
�PHA
�TXA
�%PHA                      \ Save X
�DEY
�TYA
�0PHA                      \ Save Y-1 on stack
�LDX #&FF
� 
�.help_loop
� 
�INX
�INY
�DLDA help_list, X         \ Load character from help command list
BEQ help_recognised
CMP #&FF
BEQ not_this_help
"?LDA (&F2), Y             \ Look at character following HELP
,/� #&DF                 \ Make it case proof
6CMP help_list, X
@BEQ help_loop
J 
T.another_search
^ 
hINX
rLDA help_list, X
|4BNE another_search       \ Looking for next null
�INX
�+INX                      \ Skip 2 bytes
�2PLA                      \ Pull Y-1 from stack
�5TAY                      \ Put back in Y register
�;PHA                      \ Return to stack for next try
�EJMP help_loop            \ See if this next command is recognised
� 
�.not_this_help
� 
�PLA
�TAY
�INY
�PLA
TAX
PLA
STA zp+3
&PLA
0STA zp+2
:DPLA                      \ Restore all registers before quitting
DRTS
N 
X.help_recognised
b 
lJSR osnewl
vHINX                      \ Make X point to response address in table
�LDA help_list, X
�STA zp+2
�INX
�LDA help_list, X
�DSTA zp+3                 \ Store response text address in (zp+2)
�LDY #&FF
�.LDX #(title-text)        \ Print out title
�DEX
�JSR print_text
� 
�.help_recognised_loop
� 
�INY
LDA (zp+2), Y
<JSR osasci               \ Print out response (Null=EOT)
BNE help_recognised_loop
 PLA
*DTAY                      \ Restore all registers before quitting
4INY
>PLA
HTAX
RPLA
\STA zp+3
fPLA
pSTA zp+2
zPLA
�RTS
� 
�A.print_text              \ Print text offset from 'text' by X
� 
�INX
�LDA text, X
�JSR osasci
�1BNE print_text           \ Null = End of text
�RTS
� 
�
.commands
� 
�
LDA zp
	PHA
	LDA zp+1
	PHA
	$LDA zp+2
	.PHA
	8LDA zp+3
	BDPHA                      \ Store values held in zp/zp+3 on stack
	L8LDA &DF0, X              \ MSB of start of workspace
	VSTA zp+1
	`
LDA #0
	j9STA zp                   \ W'space now stored in (zp)
	tTXA
	~PHA
	�DEY
	�TYA
	�5PHA                      \ Store Y-1 on the stack
	�LDX #&FF
	� 
	�.commands_loop
	� 
	�INX
	�INY
	�LDA command_list,X
	�HBEQ this_rom             \ A null byte means a command is recognised
	�CMP #&FF
:BEQ not_this_rom         \ &FF is end of command table

ELDA (&F2),Y              \ String is held from ?&F2 onwards to CR
0� #&DF                 \ Make it case proof!
CMP command_list,X
(BEQ commands_loop
2 
<8.repeat_search           \ Command is not recognised
F 
PINX
ZLDA command_list,X
d5BNE repeat_search        \ Look for the next null
nINX
x8INX                      \ When found skip two bytes
�2PLA                      \ Pull Y-1 from stack
�8TAY                      \ Put it back in Y register
�;PHA                      \ Return to stack for next try
�EJMP commands_loop        \ See if this next command is recognised
� 
�.not_this_rom
� 
�PLA
�TAY
�INY
�PLA
�TAX
�PLA
STA zp+3
PLA
STA zp+2
"PLA
,STA zp+1
6PLA
@
STA zp
JDPLA                      \ Restore all registers before quitting
TRTS
^ 
h
.this_rom
r 
|INX
�LDA command_list,X
�STA zp+2
�INX
�LDA command_list,X
�STA zp+3
�1JMP (zp+2)               \ Table address jump
� 
�.command_list   EQUS "BEEP"
�                EQUB 0
�                EQUW beep
�                EQUS "SEND"
�                EQUB 0
�                EQUW send
"                EQUS "SERVICE"
                EQUB 0
#                EQUW service_on
&$                EQUS "NOSERVICE"
0                EQUB 0
:$                EQUW service_off
D%                EQUS "WHATSYOURS"
N                EQUB 0
X#                EQUW whatsyours
b                EQUB &FF
l!.help_list      EQUS "OSBITS"
v                EQUB 0
�$                EQUW help_text_1
�                EQUB &FF
�	.text
�A.title          EQUS "Demonstration ROM for OSbits Module 24"
�                EQUW 13
�#                EQUS "  OSBITS"
�                EQUW 13
�.help_text
�.help_text_1    EQUB 13
�-                EQUS "*BEEP makes a beep"
�                EQUB 13
�>                EQUS "*SEND prints the argument to output"
�                EQUB 13

A                EQUS "*SERVICE turns on service call display"

                EQUB 13

8                EQUS "*NOSERVICE turns it off again"

                 EQUB 13

*@                EQUS "You can add more commands if you wish"

4                EQUD &0D0D

> 

H.show_service_calls

R 

\5PHA                      \ Save A safely on stack

fLDA service_flag

pBEQ no_show

z 

�PLA

�PHA

�7JSR print_hex            \ Print out hex value of A

�JSR print_space

�TXA

�7JSR print_hex            \ Print out hex value of X

�JSR print_space

�TYA

�7JSR print_hex            \ Print out hex value of Y

�JSR osnewl

� 

�.no_show

�)PLA                      \ Retrieve A
RTS
 
.print_space
$ 
.LDA #32
8JSR oswrch
BRTS
L 
V.print_hex
` 
jPHA
t	LSR A
~	LSR A
�	LSR A
�;LSR A                    \ A now contains higher nybble
�@JSR print_nybble         \ Sends the HEX value of the nybble
�PLA
�8� #&F                  \ A now contains lower nybble
�@JSR print_nybble         \ Sends the HEX value of the nybble
�RTS
�  
�.print_nybble
� 
�C�A #48                  \ This effectively adds 48 in less code
�CMP #58
BCC dont_add

9ADC #6                   \ Carry is set so this is +7
 

.dont_add
( 
2JSR oswrch
<RTS
F 
P,.beep                    \ Dummy routine
Z 
d
LDA #7
n.JSR oswrch               \ Just sends a �7
xJMP exit
� 
�8.send                    \ Prints argument to output
� 
�ASEC                      \ Terminate with CR or second quotes
�0JSR gsinit               \ Initialise string
�8BEQ send_ended           \ Zero set if a null string
� 
�.send_loop
� 
�2JSR gsread               \ Read next character
�6BCS send_ended           \ Carry set if terminator
�JSR osasci
�JMP send_loop
 
.send_ended
 
"JSR osnewl
,JMP exit
6 
@.service_on
J 
T
LDA #1
^STA service_flag
hJMP exit
r 
|.service_off
� 
�
LDA #0
�STA service_flag
�JMP exit
� 
�<.whatsyours              \ Replace with your own routine
� 
�JMP beep
� 
�5.exit                    \ Exit from all commands
� 
�1PLA                      \ Pull Y and discard
�1PLA                      \ Pull X and discard
PLA
STA zp+3
PLA
&STA zp+2
0PLA
:STA zp+1
DPLA
N
STA zp
XPLA
b,LDA #0                   \ Claim command
lRTS
v 
�]
��
�C� '" *SAVE osbrom ";~temp%;" +";~P%-code%;" ";~code%;" ";~code%
�
00000000  0d 00 0a 1c f4 20 20 4f  53 62 69 74 73 20 4d 6f  |.....  OSbits Mo|
00000010  64 75 6c 65 20 42 2f 6f  73 62 32 34 0d 00 14 13  |dule B/osb24....|
00000020  f4 20 20 53 69 64 65 77  61 79 73 20 52 4f 4d 0d  |.  Sideways ROM.|
00000030  00 1e 1a f4 20 20 56 65  72 73 69 6f 6e 20 31 2e  |....  Version 1.|
00000040  34 20 33 30 2e 35 2e 38  37 0d 00 28 05 20 0d 00  |4 30.5.87..(. ..|
00000050  32 15 56 65 72 73 69 6f  6e 24 20 3d 20 22 56 31  |2.Version$ = "V1|
00000060  2e 34 22 0d 00 3c 1b 44  61 74 65 24 20 3d 20 22  |.4"..<.Date$ = "|
00000070  33 30 74 68 20 4d 61 79  20 31 39 38 37 22 0d 00  |30th May 1987"..|
00000080  46 05 20 0d 00 50 15 2a  4b 45 59 31 4d 4f 2e 33  |F. ..P.*KEY1MO.3|
00000090  7c 4d 7c 4e 4c 2e 7c 4d  0d 00 5a 05 20 0d 00 64  ||M|NL.|M..Z. ..d|
000000a0  3f f4 20 4d 65 6d 6f 72  79 20 75 73 61 67 65 20  |?. Memory usage |
000000b0  69 6e 20 5a 65 72 6f 20  50 61 67 65 20 69 73 20  |in Zero Page is |
000000c0  7a 70 20 74 6f 20 7a 70  2b 33 2c 20 61 6c 77 61  |zp to zp+3, alwa|
000000d0  79 73 20 70 72 65 73 65  72 76 65 64 0d 00 6e 3b  |ys preserved..n;|
000000e0  f4 20 44 75 72 69 6e 67  20 2a 63 6f 6d 6d 61 6e  |. During *comman|
000000f0  64 20 70 72 6f 63 65 73  73 69 6e 67 20 77 6f 72  |d processing wor|
00000100  6b 73 70 61 63 65 20 73  74 61 72 74 20 69 73 20  |kspace start is |
00000110  69 6e 20 28 7a 70 29 0d  00 78 05 20 0d 00 82 10  |in (zp)..x. ....|
00000120  6f 73 62 79 74 65 3d 26  46 46 46 34 0d 00 8c 10  |osbyte=&FFF4....|
00000130  6f 73 77 6f 72 64 3d 26  46 46 46 31 0d 00 96 10  |osword=&FFF1....|
00000140  6f 73 77 72 63 68 3d 26  46 46 45 45 0d 00 a0 10  |oswrch=&FFEE....|
00000150  6f 73 72 64 63 68 3d 26  46 46 45 30 0d 00 aa 10  |osrdch=&FFE0....|
00000160  6f 73 6e 65 77 6c 3d 26  46 46 45 37 0d 00 b4 10  |osnewl=&FFE7....|
00000170  6f 73 61 73 63 69 3d 26  46 46 45 33 0d 00 be 10  |osasci=&FFE3....|
00000180  67 73 69 6e 69 74 3d 26  46 46 43 32 0d 00 c8 10  |gsinit=&FFC2....|
00000190  67 73 72 65 61 64 3d 26  46 46 43 35 0d 00 d2 05  |gsread=&FFC5....|
000001a0  20 0d 00 dc 26 f4 20 20  4f 70 65 72 61 74 69 6e  | ...&.  Operatin|
000001b0  67 20 73 79 73 74 65 6d  20 63 61 6c 6c 20 77 6f  |g system call wo|
000001c0  72 6b 73 70 61 63 65 0d  00 e6 0a 7a 70 3d 26 41  |rkspace....zp=&A|
000001d0  38 0d 00 f0 24 f4 20 20  46 6c 61 67 20 66 6f 72  |8...$.  Flag for|
000001e0  20 73 65 72 76 69 63 65  20 63 61 6c 6c 20 64 69  | service call di|
000001f0  73 70 6c 61 79 0d 00 fa  15 73 65 72 76 69 63 65  |splay....service|
00000200  5f 66 6c 61 67 3d 26 32  38 41 0d 01 04 05 20 0d  |_flag=&28A.... .|
00000210  01 0e 13 63 6f 64 65 25  3d 26 46 46 46 46 38 30  |...code%=&FFFF80|
00000220  30 30 0d 01 18 05 20 0d  01 22 10 de 20 74 65 6d  |00.... ..".. tem|
00000230  70 25 20 26 33 30 30 0d  01 2c 05 20 0d 01 36 15  |p% &300..,. ..6.|
00000240  e3 20 70 61 73 73 25 3d  34 20 b8 20 36 20 88 20  |. pass%=4 . 6 . |
00000250  32 0d 01 40 05 20 0d 01  4a 0c 50 25 3d 63 6f 64  |2..@. ..J.P%=cod|
00000260  65 25 0d 01 54 0c 4f 25  3d 74 65 6d 70 25 0d 01  |e%..T.O%=temp%..|
00000270  5e 05 20 0d 01 68 0e 5b  4f 50 54 20 70 61 73 73  |^. ..h.[OPT pass|
00000280  25 0d 01 72 05 20 0d 01  7c 0a 45 51 55 57 20 30  |%..r. ..|.EQUW 0|
00000290  0d 01 86 47 45 51 55 42  20 30 20 20 20 20 20 20  |...GEQUB 0      |
000002a0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 53  |             \ S|
000002b0  65 74 20 66 69 72 73 74  20 33 20 62 79 74 65 73  |et first 3 bytes|
000002c0  20 74 6f 20 7a 65 72 6f  20 28 53 65 72 76 69 63  | to zero (Servic|
000002d0  65 20 6f 6e 6c 79 29 0d  01 90 05 20 0d 01 9a 1b  |e only).... ....|
000002e0  4a 4d 50 20 73 65 72 76  69 63 65 5f 65 6e 74 72  |JMP service_entr|
000002f0  79 5f 70 6f 69 6e 74 0d  01 a4 05 20 0d 01 ae 44  |y_point.... ...D|
00000300  45 51 55 42 20 26 38 32  20 20 20 20 20 20 20 20  |EQUB &82        |
00000310  20 20 20 20 20 20 20 20  20 5c 20 44 65 66 69 6e  |         \ Defin|
00000320  65 20 52 4f 4d 20 74 79  70 65 20 28 53 65 72 76  |e ROM type (Serv|
00000330  69 63 65 2c 20 36 35 30  32 20 6d 63 6f 64 65 29  |ice, 6502 mcode)|
00000340  0d 01 b8 36 45 51 55 42  20 63 6f 70 79 72 69 67  |...6EQUB copyrig|
00000350  68 74 20 2d 20 63 6f 64  65 25 20 20 20 5c 20 43  |ht - code%   \ C|
00000360  6f 70 79 72 69 67 68 74  20 73 74 72 69 6e 67 20  |opyright string |
00000370  6f 66 66 73 65 74 0d 01  c2 26 45 51 55 42 20 30  |offset...&EQUB 0|
00000380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000390  20 20 20 5c 20 56 65 72  73 69 6f 6e 0d 01 cc 05  |   \ Version....|
000003a0  20 0d 01 d6 36 2e 72 6f  6d 5f 74 69 74 6c 65 20  | ...6.rom_title |
000003b0  20 20 20 20 20 20 20 45  51 55 53 20 22 4f 53 62  |       EQUS "OSb|
000003c0  69 74 73 20 44 65 6d 6f  20 52 4f 4d 20 22 2b 56  |its Demo ROM "+V|
000003d0  65 72 73 69 6f 6e 24 0d  01 e0 05 20 0d 01 ea 30  |ersion$.... ...0|
000003e0  2e 63 6f 70 79 72 69 67  68 74 20 20 20 20 20 20  |.copyright      |
000003f0  20 20 45 51 55 53 20 bd  30 2b 22 28 43 29 42 42  |  EQUS .0+"(C)BB|
00000400  43 20 22 2b 44 61 74 65  24 2b bd 30 0d 01 f4 05  |C "+Date$+.0....|
00000410  20 0d 01 fe 18 2e 73 65  72 76 69 63 65 5f 65 6e  | .....service_en|
00000420  74 72 79 5f 70 6f 69 6e  74 0d 02 08 05 20 0d 02  |try_point.... ..|
00000430  12 1a 4a 53 52 20 73 68  6f 77 5f 73 65 72 76 69  |..JSR show_servi|
00000440  63 65 5f 63 61 6c 6c 73  0d 02 1c 05 20 0d 02 26  |ce_calls.... ..&|
00000450  07 50 48 41 0d 02 30 3a  5c 20 20 43 4d 50 20 23  |.PHA..0:\  CMP #|
00000460  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
00000470  20 20 20 20 5c 20 43 6c  61 69 6d 20 70 72 69 76  |    \ Claim priv|
00000480  61 74 65 20 77 6f 72 6b  20 73 70 61 63 65 0d 02  |ate work space..|
00000490  3a 12 5c 20 20 42 4e 45  20 6e 6f 74 5f 73 63 32  |:.\  BNE not_sc2|
000004a0  0d 02 44 3a 5c 20 20 54  59 41 20 20 20 20 20 20  |..D:\  TYA      |
000004b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000004c0  5c 20 59 20 2d 20 4f 53  48 57 4d 20 58 20 2d 20  |\ Y - OSHWM X - |
000004d0  52 4f 4d 20 6e 75 6d 62  65 72 0d 02 4e 40 5c 20  |ROM number..N@\ |
000004e0  20 53 54 41 20 26 44 46  30 2c 58 20 20 20 20 20  | STA &DF0,X     |
000004f0  20 20 20 20 20 20 20 20  20 20 5c 20 49 6e 64 65  |          \ Inde|
00000500  78 20 69 6e 74 6f 20 52  4f 4d 20 77 6f 72 6b 73  |x into ROM works|
00000510  70 61 63 65 20 74 61 62  6c 65 0d 02 58 3e 5c 20  |pace table..X>\ |
00000520  20 49 4e 59 20 20 20 20  20 20 20 20 20 20 20 20  | INY            |
00000530  20 20 20 20 20 20 20 20  20 20 5c 20 57 65 20 6e  |          \ We n|
00000540  65 65 64 20 6f 6e 6c 79  20 31 20 70 61 67 65 20  |eed only 1 page |
00000550  6f 66 20 73 70 61 63 65  0d 02 62 0e 5c 20 20 4a  |of space..b.\  J|
00000560  4d 50 20 6f 75 74 0d 02  6c 05 20 0d 02 76 0c 2e  |MP out..l. ..v..|
00000570  6e 6f 74 5f 73 63 32 0d  02 80 05 20 0d 02 8a 40  |not_sc2.... ...@|
00000580  43 4d 50 20 23 33 20 20  20 20 20 20 20 20 20 20  |CMP #3          |
00000590  20 20 20 20 20 20 20 20  20 5c 20 55 73 65 20 73  |         \ Use s|
000005a0  65 72 76 69 63 65 20 63  61 6c 6c 20 33 20 74 6f  |ervice call 3 to|
000005b0  20 70 72 69 6e 74 20 69  64 65 6e 74 0d 02 94 0f  | print ident....|
000005c0  42 4e 45 20 6e 6f 74 5f  73 63 33 0d 02 9e 07 54  |BNE not_sc3....T|
000005d0  58 41 0d 02 a8 07 50 48  41 0d 02 b2 15 4c 44 58  |XA....PHA....LDX|
000005e0  20 23 28 74 69 74 6c 65  2d 74 65 78 74 29 0d 02  | #(title-text)..|
000005f0  bc 07 44 45 58 0d 02 c6  12 4a 53 52 20 70 72 69  |..DEX....JSR pri|
00000600  6e 74 5f 74 65 78 74 0d  02 d0 0e 4a 53 52 20 6f  |nt_text....JSR o|
00000610  73 6e 65 77 6c 0d 02 da  07 50 4c 41 0d 02 e4 07  |snewl....PLA....|
00000620  54 41 58 0d 02 ee 0f 5c  20 20 4c 44 41 20 7a 70  |TAX....\  LDA zp|
00000630  2b 32 0d 02 f8 0a 5c 20  20 50 48 41 0d 03 02 0f  |+2....\  PHA....|
00000640  5c 20 20 4c 44 41 20 7a  70 2b 33 0d 03 0c 0a 5c  |\  LDA zp+3....\|
00000650  20 20 50 48 41 0d 03 16  0a 5c 20 20 54 59 41 0d  |  PHA....\  TYA.|
00000660  03 20 0a 5c 20 20 50 48  41 0d 03 2a 12 5c 20 20  |. .\  PHA..*.\  |
00000670  4c 44 41 20 26 44 46 30  2c 20 58 0d 03 34 0f 5c  |LDA &DF0, X..4.\|
00000680  20 20 53 54 41 20 7a 70  2b 33 0d 03 3e 0d 5c 20  |  STA zp+3..>.\ |
00000690  20 4c 44 41 20 23 30 0d  03 48 0f 5c 20 20 53 54  | LDA #0..H.\  ST|
000006a0  41 20 7a 70 2b 32 0d 03  52 40 5c 20 20 4c 44 59  |A zp+2..R@\  LDY|
000006b0  20 23 31 35 20 20 20 20  20 20 20 20 20 20 20 20  | #15            |
000006c0  20 20 20 20 20 20 5c 20  4e 6f 20 6f 66 20 77 6f  |      \ No of wo|
000006d0  72 6b 73 70 61 63 65 20  62 79 74 65 73 20 74 6f  |rkspace bytes to|
000006e0  20 63 6c 65 61 72 0d 03  5c 05 20 0d 03 66 17 5c  | clear..\. ..f.\|
000006f0  20 20 2e 63 6c 65 61 72  5f 77 6f 72 6b 73 70 61  |  .clear_workspa|
00000700  63 65 0d 03 70 05 20 0d  03 7a 0a 5c 20 20 44 45  |ce..p. ..z.\  DE|
00000710  59 0d 03 84 3a 5c 20 20  53 54 41 20 28 7a 70 2b  |Y...:\  STA (zp+|
00000720  32 29 2c 20 59 20 20 20  20 20 20 20 20 20 20 20  |2), Y           |
00000730  20 5c 20 52 65 73 65 74  20 62 79 74 65 73 20 6f  | \ Reset bytes o|
00000740  66 20 77 6f 72 6b 73 70  61 63 65 0d 03 8e 1a 5c  |f workspace....\|
00000750  20 20 42 4e 45 20 63 6c  65 61 72 5f 77 6f 72 6b  |  BNE clear_work|
00000760  73 70 61 63 65 0d 03 98  0a 5c 20 20 50 4c 41 0d  |space....\  PLA.|
00000770  03 a2 0a 5c 20 20 54 41  59 0d 03 ac 0a 5c 20 20  |...\  TAY....\  |
00000780  50 4c 41 0d 03 b6 0f 5c  20 20 53 54 41 20 7a 70  |PLA....\  STA zp|
00000790  2b 33 0d 03 c0 0a 5c 20  20 50 4c 41 0d 03 ca 0f  |+3....\  PLA....|
000007a0  5c 20 20 53 54 41 20 7a  70 2b 32 0d 03 d4 0b 4a  |\  STA zp+2....J|
000007b0  4d 50 20 6f 75 74 0d 03  de 05 20 0d 03 e8 0c 2e  |MP out.... .....|
000007c0  6e 6f 74 5f 73 63 33 0d  03 f2 05 20 0d 03 fc 34  |not_sc3.... ...4|
000007d0  43 4d 50 20 23 34 20 20  20 20 20 20 20 20 20 20  |CMP #4          |
000007e0  20 20 20 20 20 20 20 20  20 5c 20 55 6e 72 65 63  |         \ Unrec|
000007f0  6f 67 6e 69 73 65 64 20  63 6f 6d 6d 61 6e 64 73  |ognised commands|
00000800  0d 04 06 0f 42 4e 45 20  6e 6f 74 5f 73 63 34 0d  |....BNE not_sc4.|
00000810  04 10 10 4a 4d 50 20 63  6f 6d 6d 61 6e 64 73 0d  |...JMP commands.|
00000820  04 1a 05 20 0d 04 24 0c  2e 6e 6f 74 5f 73 63 34  |... ..$..not_sc4|
00000830  0d 04 2e 05 20 0d 04 38  36 43 4d 50 20 23 39 20  |.... ..86CMP #9 |
00000840  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000850  20 20 5c 20 53 65 72 76  69 63 65 20 63 61 6c 6c  |  \ Service call|
00000860  20 39 20 69 73 20 2a 48  45 4c 50 0d 04 42 0f 42  | 9 is *HELP..B.B|
00000870  4e 45 20 6e 6f 74 5f 73  63 39 0d 04 4c 17 4a 4d  |NE not_sc9..L.JM|
00000880  50 20 68 65 6c 70 5f 70  72 6f 63 65 73 73 69 6e  |P help_processin|
00000890  67 0d 04 56 05 20 0d 04  60 0c 2e 6e 6f 74 5f 73  |g..V. ..`..not_s|
000008a0  63 39 0d 04 6a 08 2e 6f  75 74 0d 04 74 05 20 0d  |c9..j..out..t. .|
000008b0  04 7e 07 50 4c 41 0d 04  88 07 52 54 53 0d 04 92  |.~.PLA....RTS...|
000008c0  05 20 0d 04 9c 14 2e 68  65 6c 70 5f 70 72 6f 63  |. .....help_proc|
000008d0  65 73 73 69 6e 67 0d 04  a6 05 20 0d 04 b0 07 54  |essing.... ....T|
000008e0  58 41 0d 04 ba 07 50 48  41 0d 04 c4 3f 4c 44 41  |XA....PHA...?LDA|
000008f0  20 28 26 46 32 29 2c 20  59 20 20 20 20 20 20 20  | (&F2), Y       |
00000900  20 20 20 20 20 20 5c 20  4c 6f 6f 6b 20 61 74 20  |      \ Look at |
00000910  63 68 61 72 61 63 74 65  72 20 66 6f 6c 6c 6f 77  |character follow|
00000920  69 6e 67 20 48 45 4c 50  0d 04 ce 0b 43 4d 50 20  |ing HELP....CMP |
00000930  23 31 33 0d 04 d8 42 42  4e 45 20 73 70 65 63 69  |#13...BBNE speci|
00000940  66 69 63 5f 68 65 6c 70  20 20 20 20 20 20 20 20  |fic_help        |
00000950  5c 20 49 66 20 6e 6f 74  20 43 52 20 74 68 65 6e  |\ If not CR then|
00000960  20 72 65 73 70 6f 6e 64  20 74 6f 20 6e 65 78 74  | respond to next|
00000970  20 77 6f 72 64 0d 04 e2  0e 4a 53 52 20 6f 73 6e  | word....JSR osn|
00000980  65 77 6c 0d 04 ec 15 4c  44 58 20 23 28 74 69 74  |ewl....LDX #(tit|
00000990  6c 65 2d 74 65 78 74 29  0d 04 f6 07 44 45 58 0d  |le-text)....DEX.|
000009a0  05 00 2e 4a 53 52 20 70  72 69 6e 74 5f 74 65 78  |...JSR print_tex|
000009b0  74 20 20 20 20 20 20 20  20 20 20 20 5c 20 50 72  |t           \ Pr|
000009c0  69 6e 74 20 6f 75 74 20  74 69 74 6c 65 0d 05 0a  |int out title...|
000009d0  36 4a 53 52 20 70 72 69  6e 74 5f 74 65 78 74 20  |6JSR print_text |
000009e0  20 20 20 20 20 20 20 20  20 20 5c 20 61 6e 64 20  |          \ and |
000009f0  70 72 69 6e 74 20 6f 75  74 20 6b 65 79 20 77 6f  |print out key wo|
00000a00  72 64 73 0d 05 14 07 50  4c 41 0d 05 1e 07 54 41  |rds....PLA....TA|
00000a10  58 0d 05 28 0b 4a 4d 50  20 6f 75 74 0d 05 32 05  |X..(.JMP out..2.|
00000a20  20 0d 05 3c 12 2e 73 70  65 63 69 66 69 63 5f 68  | ..<..specific_h|
00000a30  65 6c 70 0d 05 46 05 20  0d 05 50 07 50 4c 41 0d  |elp..F. ..P.PLA.|
00000a40  05 5a 07 54 41 58 0d 05  64 0c 4c 44 41 20 7a 70  |.Z.TAX..d.LDA zp|
00000a50  2b 32 0d 05 6e 07 50 48  41 0d 05 78 0c 4c 44 41  |+2..n.PHA..x.LDA|
00000a60  20 7a 70 2b 33 0d 05 82  07 50 48 41 0d 05 8c 07  | zp+3....PHA....|
00000a70  54 58 41 0d 05 96 25 50  48 41 20 20 20 20 20 20  |TXA...%PHA      |
00000a80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000a90  5c 20 53 61 76 65 20 58  0d 05 a0 07 44 45 59 0d  |\ Save X....DEY.|
00000aa0  05 aa 07 54 59 41 0d 05  b4 30 50 48 41 20 20 20  |...TYA...0PHA   |
00000ab0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ac0  20 20 20 5c 20 53 61 76  65 20 59 2d 31 20 6f 6e  |   \ Save Y-1 on|
00000ad0  20 73 74 61 63 6b 0d 05  be 0c 4c 44 58 20 23 26  | stack....LDX #&|
00000ae0  46 46 0d 05 c8 05 20 0d  05 d2 0e 2e 68 65 6c 70  |FF.... .....help|
00000af0  5f 6c 6f 6f 70 0d 05 dc  05 20 0d 05 e6 07 49 4e  |_loop.... ....IN|
00000b00  58 0d 05 f0 07 49 4e 59  0d 05 fa 44 4c 44 41 20  |X....INY...DLDA |
00000b10  68 65 6c 70 5f 6c 69 73  74 2c 20 58 20 20 20 20  |help_list, X    |
00000b20  20 20 20 20 20 5c 20 4c  6f 61 64 20 63 68 61 72  |     \ Load char|
00000b30  61 63 74 65 72 20 66 72  6f 6d 20 68 65 6c 70 20  |acter from help |
00000b40  63 6f 6d 6d 61 6e 64 20  6c 69 73 74 0d 06 04 17  |command list....|
00000b50  42 45 51 20 68 65 6c 70  5f 72 65 63 6f 67 6e 69  |BEQ help_recogni|
00000b60  73 65 64 0d 06 0e 0c 43  4d 50 20 23 26 46 46 0d  |sed....CMP #&FF.|
00000b70  06 18 15 42 45 51 20 6e  6f 74 5f 74 68 69 73 5f  |...BEQ not_this_|
00000b80  68 65 6c 70 0d 06 22 3f  4c 44 41 20 28 26 46 32  |help.."?LDA (&F2|
00000b90  29 2c 20 59 20 20 20 20  20 20 20 20 20 20 20 20  |), Y            |
00000ba0  20 5c 20 4c 6f 6f 6b 20  61 74 20 63 68 61 72 61  | \ Look at chara|
00000bb0  63 74 65 72 20 66 6f 6c  6c 6f 77 69 6e 67 20 48  |cter following H|
00000bc0  45 4c 50 0d 06 2c 2f 80  20 23 26 44 46 20 20 20  |ELP..,/. #&DF   |
00000bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000be0  4d 61 6b 65 20 69 74 20  63 61 73 65 20 70 72 6f  |Make it case pro|
00000bf0  6f 66 0d 06 36 14 43 4d  50 20 68 65 6c 70 5f 6c  |of..6.CMP help_l|
00000c00  69 73 74 2c 20 58 0d 06  40 11 42 45 51 20 68 65  |ist, X..@.BEQ he|
00000c10  6c 70 5f 6c 6f 6f 70 0d  06 4a 05 20 0d 06 54 13  |lp_loop..J. ..T.|
00000c20  2e 61 6e 6f 74 68 65 72  5f 73 65 61 72 63 68 0d  |.another_search.|
00000c30  06 5e 05 20 0d 06 68 07  49 4e 58 0d 06 72 14 4c  |.^. ..h.INX..r.L|
00000c40  44 41 20 68 65 6c 70 5f  6c 69 73 74 2c 20 58 0d  |DA help_list, X.|
00000c50  06 7c 34 42 4e 45 20 61  6e 6f 74 68 65 72 5f 73  |.|4BNE another_s|
00000c60  65 61 72 63 68 20 20 20  20 20 20 20 5c 20 4c 6f  |earch       \ Lo|
00000c70  6f 6b 69 6e 67 20 66 6f  72 20 6e 65 78 74 20 6e  |oking for next n|
00000c80  75 6c 6c 0d 06 86 07 49  4e 58 0d 06 90 2b 49 4e  |ull....INX...+IN|
00000c90  58 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |X               |
00000ca0  20 20 20 20 20 20 20 5c  20 53 6b 69 70 20 32 20  |       \ Skip 2 |
00000cb0  62 79 74 65 73 0d 06 9a  32 50 4c 41 20 20 20 20  |bytes...2PLA    |
00000cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000cd0  20 20 5c 20 50 75 6c 6c  20 59 2d 31 20 66 72 6f  |  \ Pull Y-1 fro|
00000ce0  6d 20 73 74 61 63 6b 0d  06 a4 35 54 41 59 20 20  |m stack...5TAY  |
00000cf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000d00  20 20 20 20 5c 20 50 75  74 20 62 61 63 6b 20 69  |    \ Put back i|
00000d10  6e 20 59 20 72 65 67 69  73 74 65 72 0d 06 ae 3b  |n Y register...;|
00000d20  50 48 41 20 20 20 20 20  20 20 20 20 20 20 20 20  |PHA             |
00000d30  20 20 20 20 20 20 20 20  20 5c 20 52 65 74 75 72  |         \ Retur|
00000d40  6e 20 74 6f 20 73 74 61  63 6b 20 66 6f 72 20 6e  |n to stack for n|
00000d50  65 78 74 20 74 72 79 0d  06 b8 45 4a 4d 50 20 68  |ext try...EJMP h|
00000d60  65 6c 70 5f 6c 6f 6f 70  20 20 20 20 20 20 20 20  |elp_loop        |
00000d70  20 20 20 20 5c 20 53 65  65 20 69 66 20 74 68 69  |    \ See if thi|
00000d80  73 20 6e 65 78 74 20 63  6f 6d 6d 61 6e 64 20 69  |s next command i|
00000d90  73 20 72 65 63 6f 67 6e  69 73 65 64 0d 06 c2 05  |s recognised....|
00000da0  20 0d 06 cc 12 2e 6e 6f  74 5f 74 68 69 73 5f 68  | .....not_this_h|
00000db0  65 6c 70 0d 06 d6 05 20  0d 06 e0 07 50 4c 41 0d  |elp.... ....PLA.|
00000dc0  06 ea 07 54 41 59 0d 06  f4 07 49 4e 59 0d 06 fe  |...TAY....INY...|
00000dd0  07 50 4c 41 0d 07 08 07  54 41 58 0d 07 12 07 50  |.PLA....TAX....P|
00000de0  4c 41 0d 07 1c 0c 53 54  41 20 7a 70 2b 33 0d 07  |LA....STA zp+3..|
00000df0  26 07 50 4c 41 0d 07 30  0c 53 54 41 20 7a 70 2b  |&.PLA..0.STA zp+|
00000e00  32 0d 07 3a 44 50 4c 41  20 20 20 20 20 20 20 20  |2..:DPLA        |
00000e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000e20  52 65 73 74 6f 72 65 20  61 6c 6c 20 72 65 67 69  |Restore all regi|
00000e30  73 74 65 72 73 20 62 65  66 6f 72 65 20 71 75 69  |sters before qui|
00000e40  74 74 69 6e 67 0d 07 44  07 52 54 53 0d 07 4e 05  |tting..D.RTS..N.|
00000e50  20 0d 07 58 14 2e 68 65  6c 70 5f 72 65 63 6f 67  | ..X..help_recog|
00000e60  6e 69 73 65 64 0d 07 62  05 20 0d 07 6c 0e 4a 53  |nised..b. ..l.JS|
00000e70  52 20 6f 73 6e 65 77 6c  0d 07 76 48 49 4e 58 20  |R osnewl..vHINX |
00000e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e90  20 20 20 20 20 5c 20 4d  61 6b 65 20 58 20 70 6f  |     \ Make X po|
00000ea0  69 6e 74 20 74 6f 20 72  65 73 70 6f 6e 73 65 20  |int to response |
00000eb0  61 64 64 72 65 73 73 20  69 6e 20 74 61 62 6c 65  |address in table|
00000ec0  0d 07 80 14 4c 44 41 20  68 65 6c 70 5f 6c 69 73  |....LDA help_lis|
00000ed0  74 2c 20 58 0d 07 8a 0c  53 54 41 20 7a 70 2b 32  |t, X....STA zp+2|
00000ee0  0d 07 94 07 49 4e 58 0d  07 9e 14 4c 44 41 20 68  |....INX....LDA h|
00000ef0  65 6c 70 5f 6c 69 73 74  2c 20 58 0d 07 a8 44 53  |elp_list, X...DS|
00000f00  54 41 20 7a 70 2b 33 20  20 20 20 20 20 20 20 20  |TA zp+3         |
00000f10  20 20 20 20 20 20 20 20  5c 20 53 74 6f 72 65 20  |        \ Store |
00000f20  72 65 73 70 6f 6e 73 65  20 74 65 78 74 20 61 64  |response text ad|
00000f30  64 72 65 73 73 20 69 6e  20 28 7a 70 2b 32 29 0d  |dress in (zp+2).|
00000f40  07 b2 0c 4c 44 59 20 23  26 46 46 0d 07 bc 2e 4c  |...LDY #&FF....L|
00000f50  44 58 20 23 28 74 69 74  6c 65 2d 74 65 78 74 29  |DX #(title-text)|
00000f60  20 20 20 20 20 20 20 20  5c 20 50 72 69 6e 74 20  |        \ Print |
00000f70  6f 75 74 20 74 69 74 6c  65 0d 07 c6 07 44 45 58  |out title....DEX|
00000f80  0d 07 d0 12 4a 53 52 20  70 72 69 6e 74 5f 74 65  |....JSR print_te|
00000f90  78 74 0d 07 da 05 20 0d  07 e4 19 2e 68 65 6c 70  |xt.... .....help|
00000fa0  5f 72 65 63 6f 67 6e 69  73 65 64 5f 6c 6f 6f 70  |_recognised_loop|
00000fb0  0d 07 ee 05 20 0d 07 f8  07 49 4e 59 0d 08 02 11  |.... ....INY....|
00000fc0  4c 44 41 20 28 7a 70 2b  32 29 2c 20 59 0d 08 0c  |LDA (zp+2), Y...|
00000fd0  3c 4a 53 52 20 6f 73 61  73 63 69 20 20 20 20 20  |<JSR osasci     |
00000fe0  20 20 20 20 20 20 20 20  20 20 5c 20 50 72 69 6e  |          \ Prin|
00000ff0  74 20 6f 75 74 20 72 65  73 70 6f 6e 73 65 20 28  |t out response (|
00001000  4e 75 6c 6c 3d 45 4f 54  29 0d 08 16 1c 42 4e 45  |Null=EOT)....BNE|
00001010  20 68 65 6c 70 5f 72 65  63 6f 67 6e 69 73 65 64  | help_recognised|
00001020  5f 6c 6f 6f 70 0d 08 20  07 50 4c 41 0d 08 2a 44  |_loop.. .PLA..*D|
00001030  54 41 59 20 20 20 20 20  20 20 20 20 20 20 20 20  |TAY             |
00001040  20 20 20 20 20 20 20 20  20 5c 20 52 65 73 74 6f  |         \ Resto|
00001050  72 65 20 61 6c 6c 20 72  65 67 69 73 74 65 72 73  |re all registers|
00001060  20 62 65 66 6f 72 65 20  71 75 69 74 74 69 6e 67  | before quitting|
00001070  0d 08 34 07 49 4e 59 0d  08 3e 07 50 4c 41 0d 08  |..4.INY..>.PLA..|
00001080  48 07 54 41 58 0d 08 52  07 50 4c 41 0d 08 5c 0c  |H.TAX..R.PLA..\.|
00001090  53 54 41 20 7a 70 2b 33  0d 08 66 07 50 4c 41 0d  |STA zp+3..f.PLA.|
000010a0  08 70 0c 53 54 41 20 7a  70 2b 32 0d 08 7a 07 50  |.p.STA zp+2..z.P|
000010b0  4c 41 0d 08 84 07 52 54  53 0d 08 8e 05 20 0d 08  |LA....RTS.... ..|
000010c0  98 41 2e 70 72 69 6e 74  5f 74 65 78 74 20 20 20  |.A.print_text   |
000010d0  20 20 20 20 20 20 20 20  20 20 20 5c 20 50 72 69  |           \ Pri|
000010e0  6e 74 20 74 65 78 74 20  6f 66 66 73 65 74 20 66  |nt text offset f|
000010f0  72 6f 6d 20 27 74 65 78  74 27 20 62 79 20 58 0d  |rom 'text' by X.|
00001100  08 a2 05 20 0d 08 ac 07  49 4e 58 0d 08 b6 0f 4c  |... ....INX....L|
00001110  44 41 20 74 65 78 74 2c  20 58 0d 08 c0 0e 4a 53  |DA text, X....JS|
00001120  52 20 6f 73 61 73 63 69  0d 08 ca 31 42 4e 45 20  |R osasci...1BNE |
00001130  70 72 69 6e 74 5f 74 65  78 74 20 20 20 20 20 20  |print_text      |
00001140  20 20 20 20 20 5c 20 4e  75 6c 6c 20 3d 20 45 6e  |     \ Null = En|
00001150  64 20 6f 66 20 74 65 78  74 0d 08 d4 07 52 54 53  |d of text....RTS|
00001160  0d 08 de 05 20 0d 08 e8  0d 2e 63 6f 6d 6d 61 6e  |.... .....comman|
00001170  64 73 0d 08 f2 05 20 0d  08 fc 0a 4c 44 41 20 7a  |ds.... ....LDA z|
00001180  70 0d 09 06 07 50 48 41  0d 09 10 0c 4c 44 41 20  |p....PHA....LDA |
00001190  7a 70 2b 31 0d 09 1a 07  50 48 41 0d 09 24 0c 4c  |zp+1....PHA..$.L|
000011a0  44 41 20 7a 70 2b 32 0d  09 2e 07 50 48 41 0d 09  |DA zp+2....PHA..|
000011b0  38 0c 4c 44 41 20 7a 70  2b 33 0d 09 42 44 50 48  |8.LDA zp+3..BDPH|
000011c0  41 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |A               |
000011d0  20 20 20 20 20 20 20 5c  20 53 74 6f 72 65 20 76  |       \ Store v|
000011e0  61 6c 75 65 73 20 68 65  6c 64 20 69 6e 20 7a 70  |alues held in zp|
000011f0  2f 7a 70 2b 33 20 6f 6e  20 73 74 61 63 6b 0d 09  |/zp+3 on stack..|
00001200  4c 38 4c 44 41 20 26 44  46 30 2c 20 58 20 20 20  |L8LDA &DF0, X   |
00001210  20 20 20 20 20 20 20 20  20 20 20 5c 20 4d 53 42  |           \ MSB|
00001220  20 6f 66 20 73 74 61 72  74 20 6f 66 20 77 6f 72  | of start of wor|
00001230  6b 73 70 61 63 65 0d 09  56 0c 53 54 41 20 7a 70  |kspace..V.STA zp|
00001240  2b 31 0d 09 60 0a 4c 44  41 20 23 30 0d 09 6a 39  |+1..`.LDA #0..j9|
00001250  53 54 41 20 7a 70 20 20  20 20 20 20 20 20 20 20  |STA zp          |
00001260  20 20 20 20 20 20 20 20  20 5c 20 57 27 73 70 61  |         \ W'spa|
00001270  63 65 20 6e 6f 77 20 73  74 6f 72 65 64 20 69 6e  |ce now stored in|
00001280  20 28 7a 70 29 0d 09 74  07 54 58 41 0d 09 7e 07  | (zp)..t.TXA..~.|
00001290  50 48 41 0d 09 88 07 44  45 59 0d 09 92 07 54 59  |PHA....DEY....TY|
000012a0  41 0d 09 9c 35 50 48 41  20 20 20 20 20 20 20 20  |A...5PHA        |
000012b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
000012c0  53 74 6f 72 65 20 59 2d  31 20 6f 6e 20 74 68 65  |Store Y-1 on the|
000012d0  20 73 74 61 63 6b 0d 09  a6 0c 4c 44 58 20 23 26  | stack....LDX #&|
000012e0  46 46 0d 09 b0 05 20 0d  09 ba 12 2e 63 6f 6d 6d  |FF.... .....comm|
000012f0  61 6e 64 73 5f 6c 6f 6f  70 0d 09 c4 05 20 0d 09  |ands_loop.... ..|
00001300  ce 07 49 4e 58 0d 09 d8  07 49 4e 59 0d 09 e2 16  |..INX....INY....|
00001310  4c 44 41 20 63 6f 6d 6d  61 6e 64 5f 6c 69 73 74  |LDA command_list|
00001320  2c 58 0d 09 ec 48 42 45  51 20 74 68 69 73 5f 72  |,X...HBEQ this_r|
00001330  6f 6d 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |om             \|
00001340  20 41 20 6e 75 6c 6c 20  62 79 74 65 20 6d 65 61  | A null byte mea|
00001350  6e 73 20 61 20 63 6f 6d  6d 61 6e 64 20 69 73 20  |ns a command is |
00001360  72 65 63 6f 67 6e 69 73  65 64 0d 09 f6 0c 43 4d  |recognised....CM|
00001370  50 20 23 26 46 46 0d 0a  00 3a 42 45 51 20 6e 6f  |P #&FF...:BEQ no|
00001380  74 5f 74 68 69 73 5f 72  6f 6d 20 20 20 20 20 20  |t_this_rom      |
00001390  20 20 20 5c 20 26 46 46  20 69 73 20 65 6e 64 20  |   \ &FF is end |
000013a0  6f 66 20 63 6f 6d 6d 61  6e 64 20 74 61 62 6c 65  |of command table|
000013b0  0d 0a 0a 45 4c 44 41 20  28 26 46 32 29 2c 59 20  |...ELDA (&F2),Y |
000013c0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 53  |             \ S|
000013d0  74 72 69 6e 67 20 69 73  20 68 65 6c 64 20 66 72  |tring is held fr|
000013e0  6f 6d 20 3f 26 46 32 20  6f 6e 77 61 72 64 73 20  |om ?&F2 onwards |
000013f0  74 6f 20 43 52 0d 0a 14  30 80 20 23 26 44 46 20  |to CR...0. #&DF |
00001400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001410  5c 20 4d 61 6b 65 20 69  74 20 63 61 73 65 20 70  |\ Make it case p|
00001420  72 6f 6f 66 21 0d 0a 1e  16 43 4d 50 20 63 6f 6d  |roof!....CMP com|
00001430  6d 61 6e 64 5f 6c 69 73  74 2c 58 0d 0a 28 15 42  |mand_list,X..(.B|
00001440  45 51 20 63 6f 6d 6d 61  6e 64 73 5f 6c 6f 6f 70  |EQ commands_loop|
00001450  0d 0a 32 05 20 0d 0a 3c  38 2e 72 65 70 65 61 74  |..2. ..<8.repeat|
00001460  5f 73 65 61 72 63 68 20  20 20 20 20 20 20 20 20  |_search         |
00001470  20 20 5c 20 43 6f 6d 6d  61 6e 64 20 69 73 20 6e  |  \ Command is n|
00001480  6f 74 20 72 65 63 6f 67  6e 69 73 65 64 0d 0a 46  |ot recognised..F|
00001490  05 20 0d 0a 50 07 49 4e  58 0d 0a 5a 16 4c 44 41  |. ..P.INX..Z.LDA|
000014a0  20 63 6f 6d 6d 61 6e 64  5f 6c 69 73 74 2c 58 0d  | command_list,X.|
000014b0  0a 64 35 42 4e 45 20 72  65 70 65 61 74 5f 73 65  |.d5BNE repeat_se|
000014c0  61 72 63 68 20 20 20 20  20 20 20 20 5c 20 4c 6f  |arch        \ Lo|
000014d0  6f 6b 20 66 6f 72 20 74  68 65 20 6e 65 78 74 20  |ok for the next |
000014e0  6e 75 6c 6c 0d 0a 6e 07  49 4e 58 0d 0a 78 38 49  |null..n.INX..x8I|
000014f0  4e 58 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |NX              |
00001500  20 20 20 20 20 20 20 20  5c 20 57 68 65 6e 20 66  |        \ When f|
00001510  6f 75 6e 64 20 73 6b 69  70 20 74 77 6f 20 62 79  |ound skip two by|
00001520  74 65 73 0d 0a 82 32 50  4c 41 20 20 20 20 20 20  |tes...2PLA      |
00001530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001540  5c 20 50 75 6c 6c 20 59  2d 31 20 66 72 6f 6d 20  |\ Pull Y-1 from |
00001550  73 74 61 63 6b 0d 0a 8c  38 54 41 59 20 20 20 20  |stack...8TAY    |
00001560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001570  20 20 5c 20 50 75 74 20  69 74 20 62 61 63 6b 20  |  \ Put it back |
00001580  69 6e 20 59 20 72 65 67  69 73 74 65 72 0d 0a 96  |in Y register...|
00001590  3b 50 48 41 20 20 20 20  20 20 20 20 20 20 20 20  |;PHA            |
000015a0  20 20 20 20 20 20 20 20  20 20 5c 20 52 65 74 75  |          \ Retu|
000015b0  72 6e 20 74 6f 20 73 74  61 63 6b 20 66 6f 72 20  |rn to stack for |
000015c0  6e 65 78 74 20 74 72 79  0d 0a a0 45 4a 4d 50 20  |next try...EJMP |
000015d0  63 6f 6d 6d 61 6e 64 73  5f 6c 6f 6f 70 20 20 20  |commands_loop   |
000015e0  20 20 20 20 20 5c 20 53  65 65 20 69 66 20 74 68  |     \ See if th|
000015f0  69 73 20 6e 65 78 74 20  63 6f 6d 6d 61 6e 64 20  |is next command |
00001600  69 73 20 72 65 63 6f 67  6e 69 73 65 64 0d 0a aa  |is recognised...|
00001610  05 20 0d 0a b4 11 2e 6e  6f 74 5f 74 68 69 73 5f  |. .....not_this_|
00001620  72 6f 6d 0d 0a be 05 20  0d 0a c8 07 50 4c 41 0d  |rom.... ....PLA.|
00001630  0a d2 07 54 41 59 0d 0a  dc 07 49 4e 59 0d 0a e6  |...TAY....INY...|
00001640  07 50 4c 41 0d 0a f0 07  54 41 58 0d 0a fa 07 50  |.PLA....TAX....P|
00001650  4c 41 0d 0b 04 0c 53 54  41 20 7a 70 2b 33 0d 0b  |LA....STA zp+3..|
00001660  0e 07 50 4c 41 0d 0b 18  0c 53 54 41 20 7a 70 2b  |..PLA....STA zp+|
00001670  32 0d 0b 22 07 50 4c 41  0d 0b 2c 0c 53 54 41 20  |2..".PLA..,.STA |
00001680  7a 70 2b 31 0d 0b 36 07  50 4c 41 0d 0b 40 0a 53  |zp+1..6.PLA..@.S|
00001690  54 41 20 7a 70 0d 0b 4a  44 50 4c 41 20 20 20 20  |TA zp..JDPLA    |
000016a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000016b0  20 20 5c 20 52 65 73 74  6f 72 65 20 61 6c 6c 20  |  \ Restore all |
000016c0  72 65 67 69 73 74 65 72  73 20 62 65 66 6f 72 65  |registers before|
000016d0  20 71 75 69 74 74 69 6e  67 0d 0b 54 07 52 54 53  | quitting..T.RTS|
000016e0  0d 0b 5e 05 20 0d 0b 68  0d 2e 74 68 69 73 5f 72  |..^. ..h..this_r|
000016f0  6f 6d 0d 0b 72 05 20 0d  0b 7c 07 49 4e 58 0d 0b  |om..r. ..|.INX..|
00001700  86 16 4c 44 41 20 63 6f  6d 6d 61 6e 64 5f 6c 69  |..LDA command_li|
00001710  73 74 2c 58 0d 0b 90 0c  53 54 41 20 7a 70 2b 32  |st,X....STA zp+2|
00001720  0d 0b 9a 07 49 4e 58 0d  0b a4 16 4c 44 41 20 63  |....INX....LDA c|
00001730  6f 6d 6d 61 6e 64 5f 6c  69 73 74 2c 58 0d 0b ae  |ommand_list,X...|
00001740  0c 53 54 41 20 7a 70 2b  33 0d 0b b8 31 4a 4d 50  |.STA zp+3...1JMP|
00001750  20 28 7a 70 2b 32 29 20  20 20 20 20 20 20 20 20  | (zp+2)         |
00001760  20 20 20 20 20 20 5c 20  54 61 62 6c 65 20 61 64  |      \ Table ad|
00001770  64 72 65 73 73 20 6a 75  6d 70 0d 0b c2 05 20 0d  |dress jump.... .|
00001780  0b cc 1f 2e 63 6f 6d 6d  61 6e 64 5f 6c 69 73 74  |....command_list|
00001790  20 20 20 45 51 55 53 20  22 42 45 45 50 22 0d 0b  |   EQUS "BEEP"..|
000017a0  d6 1a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
000017b0  20 20 45 51 55 42 20 30  0d 0b e0 1d 20 20 20 20  |  EQUB 0....    |
000017c0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 57  |            EQUW|
000017d0  20 62 65 65 70 0d 0b ea  1f 20 20 20 20 20 20 20  | beep....       |
000017e0  20 20 20 20 20 20 20 20  20 45 51 55 53 20 22 53  |         EQUS "S|
000017f0  45 4e 44 22 0d 0b f4 1a  20 20 20 20 20 20 20 20  |END"....        |
00001800  20 20 20 20 20 20 20 20  45 51 55 42 20 30 0d 0b  |        EQUB 0..|
00001810  fe 1d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00001820  20 20 45 51 55 57 20 73  65 6e 64 0d 0c 08 22 20  |  EQUW send..." |
00001830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00001840  51 55 53 20 22 53 45 52  56 49 43 45 22 0d 0c 12  |QUS "SERVICE"...|
00001850  1a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00001860  20 45 51 55 42 20 30 0d  0c 1c 23 20 20 20 20 20  | EQUB 0...#     |
00001870  20 20 20 20 20 20 20 20  20 20 20 45 51 55 57 20  |           EQUW |
00001880  73 65 72 76 69 63 65 5f  6f 6e 0d 0c 26 24 20 20  |service_on..&$  |
00001890  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
000018a0  55 53 20 22 4e 4f 53 45  52 56 49 43 45 22 0d 0c  |US "NOSERVICE"..|
000018b0  30 1a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0.              |
000018c0  20 20 45 51 55 42 20 30  0d 0c 3a 24 20 20 20 20  |  EQUB 0..:$    |
000018d0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 57  |            EQUW|
000018e0  20 73 65 72 76 69 63 65  5f 6f 66 66 0d 0c 44 25  | service_off..D%|
000018f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001900  45 51 55 53 20 22 57 48  41 54 53 59 4f 55 52 53  |EQUS "WHATSYOURS|
00001910  22 0d 0c 4e 1a 20 20 20  20 20 20 20 20 20 20 20  |"..N.           |
00001920  20 20 20 20 20 45 51 55  42 20 30 0d 0c 58 23 20  |     EQUB 0..X# |
00001930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00001940  51 55 57 20 77 68 61 74  73 79 6f 75 72 73 0d 0c  |QUW whatsyours..|
00001950  62 1c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |b.              |
00001960  20 20 45 51 55 42 20 26  46 46 0d 0c 6c 21 2e 68  |  EQUB &FF..l!.h|
00001970  65 6c 70 5f 6c 69 73 74  20 20 20 20 20 20 45 51  |elp_list      EQ|
00001980  55 53 20 22 4f 53 42 49  54 53 22 0d 0c 76 1a 20  |US "OSBITS"..v. |
00001990  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
000019a0  51 55 42 20 30 0d 0c 80  24 20 20 20 20 20 20 20  |QUB 0...$       |
000019b0  20 20 20 20 20 20 20 20  20 45 51 55 57 20 68 65  |         EQUW he|
000019c0  6c 70 5f 74 65 78 74 5f  31 0d 0c 8a 1c 20 20 20  |lp_text_1....   |
000019d0  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
000019e0  42 20 26 46 46 0d 0c 94  09 2e 74 65 78 74 0d 0c  |B &FF.....text..|
000019f0  9e 41 2e 74 69 74 6c 65  20 20 20 20 20 20 20 20  |.A.title        |
00001a00  20 20 45 51 55 53 20 22  44 65 6d 6f 6e 73 74 72  |  EQUS "Demonstr|
00001a10  61 74 69 6f 6e 20 52 4f  4d 20 66 6f 72 20 4f 53  |ation ROM for OS|
00001a20  62 69 74 73 20 4d 6f 64  75 6c 65 20 32 34 22 0d  |bits Module 24".|
00001a30  0c a8 1b 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00001a40  20 20 20 45 51 55 57 20  31 33 0d 0c b2 23 20 20  |   EQUW 13...#  |
00001a50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00001a60  55 53 20 22 20 20 4f 53  42 49 54 53 22 0d 0c bc  |US "  OSBITS"...|
00001a70  1b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00001a80  20 45 51 55 57 20 31 33  0d 0c c6 0e 2e 68 65 6c  | EQUW 13.....hel|
00001a90  70 5f 74 65 78 74 0d 0c  d0 1b 2e 68 65 6c 70 5f  |p_text.....help_|
00001aa0  74 65 78 74 5f 31 20 20  20 20 45 51 55 42 20 31  |text_1    EQUB 1|
00001ab0  33 0d 0c da 2d 20 20 20  20 20 20 20 20 20 20 20  |3...-           |
00001ac0  20 20 20 20 20 45 51 55  53 20 22 2a 42 45 45 50  |     EQUS "*BEEP|
00001ad0  20 6d 61 6b 65 73 20 61  20 62 65 65 70 22 0d 0c  | makes a beep"..|
00001ae0  e4 1b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00001af0  20 20 45 51 55 42 20 31  33 0d 0c ee 3e 20 20 20  |  EQUB 13...>   |
00001b00  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00001b10  53 20 22 2a 53 45 4e 44  20 70 72 69 6e 74 73 20  |S "*SEND prints |
00001b20  74 68 65 20 61 72 67 75  6d 65 6e 74 20 74 6f 20  |the argument to |
00001b30  6f 75 74 70 75 74 22 0d  0c f8 1b 20 20 20 20 20  |output"....     |
00001b40  20 20 20 20 20 20 20 20  20 20 20 45 51 55 42 20  |           EQUB |
00001b50  31 33 0d 0d 02 41 20 20  20 20 20 20 20 20 20 20  |13...A          |
00001b60  20 20 20 20 20 20 45 51  55 53 20 22 2a 53 45 52  |      EQUS "*SER|
00001b70  56 49 43 45 20 74 75 72  6e 73 20 6f 6e 20 73 65  |VICE turns on se|
00001b80  72 76 69 63 65 20 63 61  6c 6c 20 64 69 73 70 6c  |rvice call displ|
00001b90  61 79 22 0d 0d 0c 1b 20  20 20 20 20 20 20 20 20  |ay"....         |
00001ba0  20 20 20 20 20 20 20 45  51 55 42 20 31 33 0d 0d  |       EQUB 13..|
00001bb0  16 38 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.8              |
00001bc0  20 20 45 51 55 53 20 22  2a 4e 4f 53 45 52 56 49  |  EQUS "*NOSERVI|
00001bd0  43 45 20 74 75 72 6e 73  20 69 74 20 6f 66 66 20  |CE turns it off |
00001be0  61 67 61 69 6e 22 0d 0d  20 1b 20 20 20 20 20 20  |again".. .      |
00001bf0  20 20 20 20 20 20 20 20  20 20 45 51 55 42 20 31  |          EQUB 1|
00001c00  33 0d 0d 2a 40 20 20 20  20 20 20 20 20 20 20 20  |3..*@           |
00001c10  20 20 20 20 20 45 51 55  53 20 22 59 6f 75 20 63  |     EQUS "You c|
00001c20  61 6e 20 61 64 64 20 6d  6f 72 65 20 63 6f 6d 6d  |an add more comm|
00001c30  61 6e 64 73 20 69 66 20  79 6f 75 20 77 69 73 68  |ands if you wish|
00001c40  22 0d 0d 34 1e 20 20 20  20 20 20 20 20 20 20 20  |"..4.           |
00001c50  20 20 20 20 20 45 51 55  44 20 26 30 44 30 44 0d  |     EQUD &0D0D.|
00001c60  0d 3e 05 20 0d 0d 48 17  2e 73 68 6f 77 5f 73 65  |.>. ..H..show_se|
00001c70  72 76 69 63 65 5f 63 61  6c 6c 73 0d 0d 52 05 20  |rvice_calls..R. |
00001c80  0d 0d 5c 35 50 48 41 20  20 20 20 20 20 20 20 20  |..\5PHA         |
00001c90  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 53  |             \ S|
00001ca0  61 76 65 20 41 20 73 61  66 65 6c 79 20 6f 6e 20  |ave A safely on |
00001cb0  73 74 61 63 6b 0d 0d 66  14 4c 44 41 20 73 65 72  |stack..f.LDA ser|
00001cc0  76 69 63 65 5f 66 6c 61  67 0d 0d 70 0f 42 45 51  |vice_flag..p.BEQ|
00001cd0  20 6e 6f 5f 73 68 6f 77  0d 0d 7a 05 20 0d 0d 84  | no_show..z. ...|
00001ce0  07 50 4c 41 0d 0d 8e 07  50 48 41 0d 0d 98 37 4a  |.PLA....PHA...7J|
00001cf0  53 52 20 70 72 69 6e 74  5f 68 65 78 20 20 20 20  |SR print_hex    |
00001d00  20 20 20 20 20 20 20 20  5c 20 50 72 69 6e 74 20  |        \ Print |
00001d10  6f 75 74 20 68 65 78 20  76 61 6c 75 65 20 6f 66  |out hex value of|
00001d20  20 41 0d 0d a2 13 4a 53  52 20 70 72 69 6e 74 5f  | A....JSR print_|
00001d30  73 70 61 63 65 0d 0d ac  07 54 58 41 0d 0d b6 37  |space....TXA...7|
00001d40  4a 53 52 20 70 72 69 6e  74 5f 68 65 78 20 20 20  |JSR print_hex   |
00001d50  20 20 20 20 20 20 20 20  20 5c 20 50 72 69 6e 74  |         \ Print|
00001d60  20 6f 75 74 20 68 65 78  20 76 61 6c 75 65 20 6f  | out hex value o|
00001d70  66 20 58 0d 0d c0 13 4a  53 52 20 70 72 69 6e 74  |f X....JSR print|
00001d80  5f 73 70 61 63 65 0d 0d  ca 07 54 59 41 0d 0d d4  |_space....TYA...|
00001d90  37 4a 53 52 20 70 72 69  6e 74 5f 68 65 78 20 20  |7JSR print_hex  |
00001da0  20 20 20 20 20 20 20 20  20 20 5c 20 50 72 69 6e  |          \ Prin|
00001db0  74 20 6f 75 74 20 68 65  78 20 76 61 6c 75 65 20  |t out hex value |
00001dc0  6f 66 20 59 0d 0d de 0e  4a 53 52 20 6f 73 6e 65  |of Y....JSR osne|
00001dd0  77 6c 0d 0d e8 05 20 0d  0d f2 0c 2e 6e 6f 5f 73  |wl.... .....no_s|
00001de0  68 6f 77 0d 0d fc 29 50  4c 41 20 20 20 20 20 20  |how...)PLA      |
00001df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e00  5c 20 52 65 74 72 69 65  76 65 20 41 0d 0e 06 07  |\ Retrieve A....|
00001e10  52 54 53 0d 0e 10 05 20  0d 0e 1a 10 2e 70 72 69  |RTS.... .....pri|
00001e20  6e 74 5f 73 70 61 63 65  0d 0e 24 05 20 0d 0e 2e  |nt_space..$. ...|
00001e30  0b 4c 44 41 20 23 33 32  0d 0e 38 0e 4a 53 52 20  |.LDA #32..8.JSR |
00001e40  6f 73 77 72 63 68 0d 0e  42 07 52 54 53 0d 0e 4c  |oswrch..B.RTS..L|
00001e50  05 20 0d 0e 56 0e 2e 70  72 69 6e 74 5f 68 65 78  |. ..V..print_hex|
00001e60  0d 0e 60 05 20 0d 0e 6a  07 50 48 41 0d 0e 74 09  |..`. ..j.PHA..t.|
00001e70  4c 53 52 20 41 0d 0e 7e  09 4c 53 52 20 41 0d 0e  |LSR A..~.LSR A..|
00001e80  88 09 4c 53 52 20 41 0d  0e 92 3b 4c 53 52 20 41  |..LSR A...;LSR A|
00001e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ea0  20 20 20 20 5c 20 41 20  6e 6f 77 20 63 6f 6e 74  |    \ A now cont|
00001eb0  61 69 6e 73 20 68 69 67  68 65 72 20 6e 79 62 62  |ains higher nybb|
00001ec0  6c 65 0d 0e 9c 40 4a 53  52 20 70 72 69 6e 74 5f  |le...@JSR print_|
00001ed0  6e 79 62 62 6c 65 20 20  20 20 20 20 20 20 20 5c  |nybble         \|
00001ee0  20 53 65 6e 64 73 20 74  68 65 20 48 45 58 20 76  | Sends the HEX v|
00001ef0  61 6c 75 65 20 6f 66 20  74 68 65 20 6e 79 62 62  |alue of the nybb|
00001f00  6c 65 0d 0e a6 07 50 4c  41 0d 0e b0 38 80 20 23  |le....PLA...8. #|
00001f10  26 46 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |&F              |
00001f20  20 20 20 20 5c 20 41 20  6e 6f 77 20 63 6f 6e 74  |    \ A now cont|
00001f30  61 69 6e 73 20 6c 6f 77  65 72 20 6e 79 62 62 6c  |ains lower nybbl|
00001f40  65 0d 0e ba 40 4a 53 52  20 70 72 69 6e 74 5f 6e  |e...@JSR print_n|
00001f50  79 62 62 6c 65 20 20 20  20 20 20 20 20 20 5c 20  |ybble         \ |
00001f60  53 65 6e 64 73 20 74 68  65 20 48 45 58 20 76 61  |Sends the HEX va|
00001f70  6c 75 65 20 6f 66 20 74  68 65 20 6e 79 62 62 6c  |lue of the nybbl|
00001f80  65 0d 0e c4 07 52 54 53  0d 0e ce 06 20 20 0d 0e  |e....RTS....  ..|
00001f90  d8 11 2e 70 72 69 6e 74  5f 6e 79 62 62 6c 65 0d  |...print_nybble.|
00001fa0  0e e2 05 20 0d 0e ec 43  84 41 20 23 34 38 20 20  |... ...C.A #48  |
00001fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001fc0  5c 20 54 68 69 73 20 65  66 66 65 63 74 69 76 65  |\ This effective|
00001fd0  6c 79 20 61 64 64 73 20  34 38 20 69 6e 20 6c 65  |ly adds 48 in le|
00001fe0  73 73 20 63 6f 64 65 0d  0e f6 0b 43 4d 50 20 23  |ss code....CMP #|
00001ff0  35 38 0d 0f 00 10 42 43  43 20 64 6f 6e 74 5f 61  |58....BCC dont_a|
00002000  64 64 0d 0f 0a 39 41 44  43 20 23 36 20 20 20 20  |dd...9ADC #6    |
00002010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00002020  20 43 61 72 72 79 20 69  73 20 73 65 74 20 73 6f  | Carry is set so|
00002030  20 74 68 69 73 20 69 73  20 2b 37 0d 0f 14 05 20  | this is +7.... |
00002040  0d 0f 1e 0d 2e 64 6f 6e  74 5f 61 64 64 0d 0f 28  |.....dont_add..(|
00002050  05 20 0d 0f 32 0e 4a 53  52 20 6f 73 77 72 63 68  |. ..2.JSR oswrch|
00002060  0d 0f 3c 07 52 54 53 0d  0f 46 05 20 0d 0f 50 2c  |..<.RTS..F. ..P,|
00002070  2e 62 65 65 70 20 20 20  20 20 20 20 20 20 20 20  |.beep           |
00002080  20 20 20 20 20 20 20 20  20 5c 20 44 75 6d 6d 79  |         \ Dummy|
00002090  20 72 6f 75 74 69 6e 65  0d 0f 5a 05 20 0d 0f 64  | routine..Z. ..d|
000020a0  0a 4c 44 41 20 23 37 0d  0f 6e 2e 4a 53 52 20 6f  |.LDA #7..n.JSR o|
000020b0  73 77 72 63 68 20 20 20  20 20 20 20 20 20 20 20  |swrch           |
000020c0  20 20 20 20 5c 20 4a 75  73 74 20 73 65 6e 64 73  |    \ Just sends|
000020d0  20 61 20 ef 37 0d 0f 78  0c 4a 4d 50 20 65 78 69  | a .7..x.JMP exi|
000020e0  74 0d 0f 82 05 20 0d 0f  8c 38 2e 73 65 6e 64 20  |t.... ...8.send |
000020f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002100  20 20 20 5c 20 50 72 69  6e 74 73 20 61 72 67 75  |   \ Prints argu|
00002110  6d 65 6e 74 20 74 6f 20  6f 75 74 70 75 74 0d 0f  |ment to output..|
00002120  96 05 20 0d 0f a0 41 53  45 43 20 20 20 20 20 20  |.. ...ASEC      |
00002130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002140  5c 20 54 65 72 6d 69 6e  61 74 65 20 77 69 74 68  |\ Terminate with|
00002150  20 43 52 20 6f 72 20 73  65 63 6f 6e 64 20 71 75  | CR or second qu|
00002160  6f 74 65 73 0d 0f aa 30  4a 53 52 20 67 73 69 6e  |otes...0JSR gsin|
00002170  69 74 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |it              |
00002180  20 5c 20 49 6e 69 74 69  61 6c 69 73 65 20 73 74  | \ Initialise st|
00002190  72 69 6e 67 0d 0f b4 38  42 45 51 20 73 65 6e 64  |ring...8BEQ send|
000021a0  5f 65 6e 64 65 64 20 20  20 20 20 20 20 20 20 20  |_ended          |
000021b0  20 5c 20 5a 65 72 6f 20  73 65 74 20 69 66 20 61  | \ Zero set if a|
000021c0  20 6e 75 6c 6c 20 73 74  72 69 6e 67 0d 0f be 05  | null string....|
000021d0  20 0d 0f c8 0e 2e 73 65  6e 64 5f 6c 6f 6f 70 0d  | .....send_loop.|
000021e0  0f d2 05 20 0d 0f dc 32  4a 53 52 20 67 73 72 65  |... ...2JSR gsre|
000021f0  61 64 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ad              |
00002200  20 5c 20 52 65 61 64 20  6e 65 78 74 20 63 68 61  | \ Read next cha|
00002210  72 61 63 74 65 72 0d 0f  e6 36 42 43 53 20 73 65  |racter...6BCS se|
00002220  6e 64 5f 65 6e 64 65 64  20 20 20 20 20 20 20 20  |nd_ended        |
00002230  20 20 20 5c 20 43 61 72  72 79 20 73 65 74 20 69  |   \ Carry set i|
00002240  66 20 74 65 72 6d 69 6e  61 74 6f 72 0d 0f f0 0e  |f terminator....|
00002250  4a 53 52 20 6f 73 61 73  63 69 0d 0f fa 11 4a 4d  |JSR osasci....JM|
00002260  50 20 73 65 6e 64 5f 6c  6f 6f 70 0d 10 04 05 20  |P send_loop.... |
00002270  0d 10 0e 0f 2e 73 65 6e  64 5f 65 6e 64 65 64 0d  |.....send_ended.|
00002280  10 18 05 20 0d 10 22 0e  4a 53 52 20 6f 73 6e 65  |... ..".JSR osne|
00002290  77 6c 0d 10 2c 0c 4a 4d  50 20 65 78 69 74 0d 10  |wl..,.JMP exit..|
000022a0  36 05 20 0d 10 40 0f 2e  73 65 72 76 69 63 65 5f  |6. ..@..service_|
000022b0  6f 6e 0d 10 4a 05 20 0d  10 54 0a 4c 44 41 20 23  |on..J. ..T.LDA #|
000022c0  31 0d 10 5e 14 53 54 41  20 73 65 72 76 69 63 65  |1..^.STA service|
000022d0  5f 66 6c 61 67 0d 10 68  0c 4a 4d 50 20 65 78 69  |_flag..h.JMP exi|
000022e0  74 0d 10 72 05 20 0d 10  7c 10 2e 73 65 72 76 69  |t..r. ..|..servi|
000022f0  63 65 5f 6f 66 66 0d 10  86 05 20 0d 10 90 0a 4c  |ce_off.... ....L|
00002300  44 41 20 23 30 0d 10 9a  14 53 54 41 20 73 65 72  |DA #0....STA ser|
00002310  76 69 63 65 5f 66 6c 61  67 0d 10 a4 0c 4a 4d 50  |vice_flag....JMP|
00002320  20 65 78 69 74 0d 10 ae  05 20 0d 10 b8 3c 2e 77  | exit.... ...<.w|
00002330  68 61 74 73 79 6f 75 72  73 20 20 20 20 20 20 20  |hatsyours       |
00002340  20 20 20 20 20 20 20 5c  20 52 65 70 6c 61 63 65  |       \ Replace|
00002350  20 77 69 74 68 20 79 6f  75 72 20 6f 77 6e 20 72  | with your own r|
00002360  6f 75 74 69 6e 65 0d 10  c2 05 20 0d 10 cc 0c 4a  |outine.... ....J|
00002370  4d 50 20 62 65 65 70 0d  10 d6 05 20 0d 10 e0 35  |MP beep.... ...5|
00002380  2e 65 78 69 74 20 20 20  20 20 20 20 20 20 20 20  |.exit           |
00002390  20 20 20 20 20 20 20 20  20 5c 20 45 78 69 74 20  |         \ Exit |
000023a0  66 72 6f 6d 20 61 6c 6c  20 63 6f 6d 6d 61 6e 64  |from all command|
000023b0  73 0d 10 ea 05 20 0d 10  f4 31 50 4c 41 20 20 20  |s.... ...1PLA   |
000023c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000023d0  20 20 20 5c 20 50 75 6c  6c 20 59 20 61 6e 64 20  |   \ Pull Y and |
000023e0  64 69 73 63 61 72 64 0d  10 fe 31 50 4c 41 20 20  |discard...1PLA  |
000023f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002400  20 20 20 20 5c 20 50 75  6c 6c 20 58 20 61 6e 64  |    \ Pull X and|
00002410  20 64 69 73 63 61 72 64  0d 11 08 07 50 4c 41 0d  | discard....PLA.|
00002420  11 12 0c 53 54 41 20 7a  70 2b 33 0d 11 1c 07 50  |...STA zp+3....P|
00002430  4c 41 0d 11 26 0c 53 54  41 20 7a 70 2b 32 0d 11  |LA..&.STA zp+2..|
00002440  30 07 50 4c 41 0d 11 3a  0c 53 54 41 20 7a 70 2b  |0.PLA..:.STA zp+|
00002450  31 0d 11 44 07 50 4c 41  0d 11 4e 0a 53 54 41 20  |1..D.PLA..N.STA |
00002460  7a 70 0d 11 58 07 50 4c  41 0d 11 62 2c 4c 44 41  |zp..X.PLA..b,LDA|
00002470  20 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  | #0             |
00002480  20 20 20 20 20 20 5c 20  43 6c 61 69 6d 20 63 6f  |      \ Claim co|
00002490  6d 6d 61 6e 64 0d 11 6c  07 52 54 53 0d 11 76 05  |mmand..l.RTS..v.|
000024a0  20 0d 11 80 05 5d 0d 11  8a 05 ed 0d 11 94 43 f1  | ....]........C.|
000024b0  20 27 22 20 2a 53 41 56  45 20 6f 73 62 72 6f 6d  | '" *SAVE osbrom|
000024c0  20 22 3b 7e 74 65 6d 70  25 3b 22 20 2b 22 3b 7e  | ";~temp%;" +";~|
000024d0  50 25 2d 63 6f 64 65 25  3b 22 20 22 3b 7e 63 6f  |P%-code%;" ";~co|
000024e0  64 65 25 3b 22 20 22 3b  7e 63 6f 64 65 25 0d ff  |de%;" ";~code%..|
000024f0
OS\BITS/B\OSB24.m0
OS\BITS/B\OSB24.m1
OS\BITS/B\OSB24.m2
OS\BITS/B\OSB24.m4
OS\BITS/B\OSB24.m5