Software JL8 Rev 0.1

The SiMON6800 monitor code comes pre-loaded on the HC908JL8. You are free, of course, to burn whatever code you like to the flash, but we do not make our code available – i.e. what we supply is what is available.

Because the code is burnt into flash, we cannot offer upgrade (if I get sufficient demand for upgrades, I might offer a flashing service in the future).

Basic parameters

The JL8 has 256 bytes of RAM from 0060 to 015f, and 8kb of flash from DC00.

The SP (stack pointer) is set at 0138, so there is over 200 bytes of RAM available for your use (including the stack).

By default, all IO ports are set as inputs (for safety), and are available for you to use except for PTD7/RxD and PTD6/TxD which are used for serial communications.

SiMON6800 uses RAM space from 0140 to 015f for its own program variables.

Functions

Many of the functions are similar to MIKBUG functions, but it works differently. It used different command keys, and has more basic functions. Of course, we drop the paper tape IO…..

We use a method name “working address” which you can set, and then many of the functions use that address. This saves you having to repeatedly type addresses for everything you want to do.

The core commands are:

  • H : Help, a reminder of the available commands (shows here)
  • S : Show pointers, which shows key pointer data lie the CCR and working address
  • A : set Address which allows you set the working address
  • R : Read a byte at the working address
  • N : read Next, which allows you to read subsequent bytes after the working address
  • W : Write bytes. this allows you to type in bytes from the working address. it works sequentially so  you can just keep typing bytes for sequential addresses
  • X : eXecute (run) you user program
  • L : List a block of memory
  • P :  show (IO) Ports
  • F : Fill a block of RAM with 00 or FF (first 128 RAM bytes)
  • O : Output to flash, i.e. save your program (first 128 RAM bytes)*
  • I : Input from flash, i.e. load your program (first 128 RAM bytes)*

Flash user program storage

*The flash has four reserved storage locations for saving and loading your programs. You can save 128 bytes (RAM 0060 to 00DF) into any of the four locations. Or course, you can also recall a saved programs from the four flash locations into RAM.

As supplied, one location contain a copy of the included SWI testing code, to make it easier to load into RAM and modify. Once you store your own code into that storage location, you will overwrite that, but you can use the SWI testing code also stored elsewhere in Flash, but you cannot modify that. Another storage location contains a copy of an Echo Test code snippet, again to make it easy to load and modify in RAM. Once you store your own code into that storage location, you will overwrite that, but you can use the Echo Test code also stored elsewhere in Flash, but you cannot modify that.

Event handlers

  • Interrupts are enabled (unmasked).
  • Reset (RST) is available and there is a RST button on the PCB.
  • IRQ is exposed with a button and there is IRQ handler code built in, although you can change the vector for IRQ (the vector is in RAM).
  • SWI is available, and by default is used for the included Break/Debugging routine. You can change the SWI vector (in RAM) if you want to use SWI for your program code.
  • All other INTs direct to a single vector (in RAM, so you can change it). You can differentiate which peripheral caused the INT by examining registers.

Flashy functions

Given there is about 200 bytes of usable RAM, and you have to type your programs in byte-by-byte, the Flash contains User Functions (like timing loops etc) to make life a little easier.

These are:

  • Delay loops for 1ms, 10ms, 100ms and 1 second.
  • An echo test routine for testing serial IO. This routine is also located in flash storage at F200 so you can load it into RAM if you want to modify it.
  • A SWI test routing to test the function of the SWI handler. This routine is also located in flash storage at F300 so you can load it into RAM if you want to modify it.
  • Routines for handling INT and IRQ, but you can change the vectors if you want to write your own handlers.
  • A looping Port Test routine, to test the ports.
  • A routine to output a CR and LF to the serial port.
  • Routines to send and receive bytes from the serial port.
  • Routine to send strings to the serial port.
  • Routines to send raw hex data to the serial port (displayed in character) or in binary representation.

 

Scroll to Top