
Naviagtion
Home
|
ST6 Cross Overlay Overview
Introduction
If you compare the ST6 MCU with the Motorola 6804 you will find many striking resemblances.
Apart from a different assembler syntax there are a few improvements to be found in the ST6.
The most welcome one is the ability to use lookup tables in ROM memory.
There are many different microcontrollers built around the ST6 MCU. I'm not going to make a list of all the derivatives that exist. From the assembler's point of view they mainly differ in the Special Function Register definition, the stack depth, RAM, ROM and EEPROM size and the availability of an NMI input. Programming ModelThe programming model in the picture below shows the modest register set of the ST6 processor family. I only include a little summary about the features of the ST6's programming model here. It is not my intention to make the original documentation obsolete, so please refer to the original documentation for further details (ST document 2341.pdf).
The ST6 has separate addressing space for Program and Data memory. Data address space is only 256 bytes long which allows it to be addressed with only 1 byte. Bank switching is used to extend the addressing range in case there is more RAM available. Data address space does also include a ROM read window, EEPROM memory and Special Function Registers. The Accumulator A The Accumulator is used for all arithmetic operations. The Accumulator can also be reached through memory address $FF. The Index registers X and Y These registers can be used as 8-bit unsigned indexes to point to any address in Data memory. Because you can read ROM memory through a window mapped in the Data memory area you can now also read from lookup tables, something which could not be done with Motorola's 6804. The index registers X and Y can also be reached through Data memory addresses $80 and $81 respectively. These memory locations can be addressed with a Short Direct Addressing mode by some instructions. The registers V and W
The registers V and W can also be reached through Data memory addresses $82 and $83 respectively.
Like the registers X and Y these memory locations can also be addressed with a Short Direct Addressing mode by some instructions.
The Condition Codes
Unlike other microcontrollers the ST6 doesn't have a condition code register.
There are only 2 system flags, which are set by most mathematical instructions and can be tested with branch instructions.
Only the Zero and Carry flags are implemented.
After a reset the processor will use the NMI flag set (or the interrupt flag set if NMI is not implemented). This is to prevent interrupts while the system is initializing itself. After initialization the program should execute a RETI instruction to enable interrupts which also swaps in the normal system flags. The Program Counter
The program counter PC is normally incremented after fetching each instruction or operand byte during program execution.
The only way you can change this behaviour is with the jump, subroutine and return instructions.
Also interrupts can change the program counter's value.
Please note that the stack pointer is not included in the programming model.
The stack of the ST6 consists of 4 or 6 dedicated 12 bit memory locations, not directly addressable in any other way.
Also the stack pointer is not accessible.
The only way to manipulate the stack is by using the CALL, RET, RETI instructions and by interrupts.
TimingSB-Assmebler Version 3 can show you the cycle times of each instruction when the TON list flag is switched on. The numbers presented are the number of clock cycles each instruction takes. Reserved Words
The SB-Assembler ST6 cross overlay family has just a few reserved words.
You better don't use these words as label names to avoid unpredictable behaviour by the assembler.
The reserved words are: A, X, Y, V and W.
Special Features
Originally the ST6 assembler does not require any prefixes for immediate operands.
This is also true for the SB-Assembler.
In case no prefix is given the low byte of the expression is used as operand.
Overlay InitializationTwo things are set while initializing the ST6 overlay family every time it is loaded by the .CR directive.
Differences With Other AssemblersThere are some differences between the SB-Assembler and other assemblers for the ST6 family of processors. These differences require you to adapt existing source files before they can be assembled by the SB-Assembler. This is not too difficult though, and is the (small) price you have to pay for having a very universal cross assembler.
|