Colin MK II

Basic Operating System

Hitachi Basic Operating System commands
HBOS v1.81

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

Purpose:
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.




Syntax:
B(n)<Addr><CR> - Set Breakpoint
B(n)<CR>       - Clear Breakpoint

Example(s)
B1 090A<CR>
This sets breakpoint 1 at address 090AH, which displayed the contents of the user registers.

B1<CR>
This resets breakpoint 1, allowing the program to run normally.
Command: C - Copy memory up / down

Purpose:
The 'C' command allows the user to copy a block of memory from one point in the memory map to another.









Syntax:
C<Srce Addr><Dest Addr><Byte Count><CR>


Example(s)
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

Purpose:
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'.







Syntax:
D<CR>


Example(s)
D<CR>

If successful, after loading the CP/M operating system, the screen will be cleared and the following prompt will be displayed:

CP/M 2.2

A>
Command: E - Execute a program

Purpose:
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.

Syntax:
E<Addr><CR> - Run new program      
E<CR>       - Re-run / continue program

Example(s)
E800<CR>
This command runs a user program starting at 0800H.

E<CR>
This command runs a program from the original starting address, or continues an interrupted program.
Command: F - Fill memory

Purpose:
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.



Syntax:
F<Start Addr><End Addr><Data Byte><CR>


Example(s)
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

Purpose:
The 'H' command is used to carry out 16 bit Hexadecimal arithmetic.

Pretty useful for calculating relative jump addresses when writing machine code.

Syntax:
H<Word 0>+<Word 1><CR> - Addition
H<Word 0>-<Word 1><CR> - Subtraction

Example(s)
H9AE-800<CR>
01AE
Here, 0800H has been subtracted from 09AEH to give an answer of 01AE.

H-700<CR>
F900
Here, the value 0700H has been negated giving the result of 0F900H.
Command: I - Input from I/O port

Purpose:
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






Syntax:
I<Port number><CR>


Example(s)
I12<CR>
20

In this case, a read from port 12H has resulted in the value 20H.
Command: J - FDC chip setup

Purpose:
The 'J' command is used to setup the WD2797 floppy disk interface chip for reliable operation.









Syntax:
J<CR>


Example(s)
J<CR>

To be completed.
Command: M - Modify / Examine memory

Purpose:
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>.


Syntax:
M<Addr><CR>


Example(s)
M0800<CR>
0800 3E

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

Purpose:
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.







Syntax:
O<Port number><Data byte><CR>


Example(s)
O26 5E<CR>

In this example, the Hex byte 5E is sent to I/O port 26H.
Command: R - List user register contents

Purpose:
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.

Syntax:
R<CR>


Example(s)
R<CR>

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

Purpose:
The 'S' is used to set the time and date within the MM58274 Real Time Clock (RTC) chip.










Syntax:
S<CR>


Example(s)
S<CR>

To be completed.
Command: T - Tabulate memory

Purpose:
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 (.).


Syntax:
T<Start Addr><End Addr><CR>


Example(s)
TD400 D40F<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