Colin MK I
Basic Operating System
Basic Operating System commands
View command details
Use the scroll boxes to cClick
on the commands below to view a detailed description of what they do, with brief examples.
Command: B - Set / Clear Breakpoints
This command is used to set ‘breakpoints’ in the user's code.
Originally, only one breakpoint was allowed in the C-SYS firmware. Whilst re-writing the firmware as my
own Basic Operating System, I extended the capability to 5 usable breakpoints.
B(n)<Addr><CR> - Set Breakpoint
B(n)<CR> - Clear Breakpoint
This sets breakpoint 1 at address 090AH, which displayed the contents of the user registers.
This resets breakpoint 1, allowing the program to run normally.
Command: C - Copy memory up / down
The 'C' command allows the user to copy a block of memory from one point in the memory
map to another.
C<Srce Addr><Dest Addr><Byte Count><CR>
C900 901 100<CR>
In this example, the contents of location 0900H is copied to 0901H. 0100H bytes will be moved
in this manner.
Command: D - Disk boot
To load and run an operating system from disk. In our case, the operating system is CP/M 2.2.
The 'D' command loads the CP/M operating system from the 1st two tracks of drive 'A'.
If successful, after loading the CP/M operating system, the screen will be cleared and the following
prompt will be displayed:
Command: E - Execute a program
Used to run a user program which has been loaded into memory.
There are two uses of this command.
1 - Run a program from a user selected address.
2 - Re-run the same program as before, using the original run address.
- Continue from a breakpoint.
- Continue from a program suspended by typing <CTRL-C> at the keyboard.
E<Addr><CR> - Run new program
E<CR> - Re-run / continue program
This command runs a user program starting at 0800H.
This command runs a program from the original starting address, or continues an interrupted program.
Command: F - Fill memory
The 'F' command is used to set a block of memory to a specified value.
Note 1: The data byte defaults to 00H if not specified.
Note 2: A quirk of the system means that if FF<CR> is typed, the whole of memory
is filled with zeros.
F<Start Addr><End Addr><Data Byte><CR>
F1000 1FFF 55<CR>
In this example, the memory locations from 1000H to 1FFFH are filled with the Hex byte 55.
Command: H - Hexadecimal arithmetic
The 'H' command is used to carry out 16 bit Hexadecimal arithmetic.
Pretty useful for calculating relative jump addresses when writing machine code.
H<Word 0>+<Word 1><CR> - Addition
H<Word 0>-<Word 1><CR> - Subtraction
Here, 0800H has been subtracted from 09AEH to give an answer of 01AE.
Here, the value 0700H has been negated giving the result of 0F900H.
Command: I - Input from I/O port
The 'I' command is used to read data from the specified input port and display
the value in Hex.
Note: <Port number> specifies an I/O port number in the range 00H to 0FFH
In this case, a read from port 12H has resulted in the value 20H.
Command: M - Modify / Examine memory
The 'M' command is used to examine and modify the contents of memory. By entering a memory
address, the user is shown the current contents as a Hex byte. Data is entered in Hex.
If the user wished to leave the contents the same, then <CR> is entered.
To exit the modify mode, the user simply types a period (.) and <CR>.
In this example, the contents of memory address 0800H are 3EH. The user can either modify the
contents or leave them as is.
Command: O - Output to I/O port
The 'O' command is used to send a data byte to the specified I/O port.
Note: <Port number> specifies an I/O port number in the range 00H to 0FFH.
O<Port number><Data byte><CR>
In this example, the Hex byte 5E is sent to I/O port 26H.
Command: R - List user register contents
The 'R' command is used to display the contents of the user registers which are listed in
the order SP, PC, HL, IX, IY, DE, BC & AF.
In the example shown, the SP is set at 0FBFFH, the highest address available below the
data block in a 64kB system.
The PC is shown at 2000H, the first available memory address
above the 8kB firmware address space.
This command displays the user registers in the following format:
FBFF 2000 0000 0000 0000 0000 0000 0000
SP PC HL IX
IY DE BC AF
Command: S - Set Real Time Clock
The 'S' is used to set the time and date within the MM58274 Real Time Clock (RTC) chip.
To be completed.
Command: T - Tabulate memory
This command is used to display the comtents of memory, RAM or ROM.
Due to the initial design of the Teletext VDU output, display of characters was limited to 40x24.
Because of this, memory tabulation was carried out 8 bytes per line. Any non-printing ASCII characters
were shown as a period (.).
T<Start Addr><End Addr><CR>
The command above results in the following display on the Custom 80 screen:
D400 41 42 1B 00 45 46 47 48 AB..EFGH
D408 30 31 32 33 34 2B 0A 37 01234+.7