Embedded software is too important to trust to Computer Science grads. Of the 20 or so resumes forwarded from the personnel department of recent grads, not one had any experience outside of Microsoft Visual tools. I couldn't convince personnel to provide resumes of candidates with something other than a CS degree.
The actual operand is specified in the instruction. DIR direct The operand resides at an address whose most significant byte is 00 and whose least significant byte is specified in the instruction. This mode yields faster and denser code when the operands are contained at addresses 0x—0x00FF.
EXT The operand resides at the address specified in the instruction.
IND,X indexed, register X The operand resides at the address calculated by adding the single-byte positive offset specified in the instruction to the contents of the X register. IND,Y indexed, register Y The operand resides at the address calculated by adding the single-byte positive offset specified in the instruction to the contents of the Y register.
INH inherent The instruction does not need an operand. Specification of this mode is optional. The inherent addressing mode is not used; the assembler knows which words are inherent i. Please consult the Motorola 68HC11 Manual for a detailed discussion of the meanings of these address modes.
CODE also prints an error message if excess items were placed on or removed from the data stack during the course of the code definition. The 68HC11 has three bit registers available for programming use: Index register X, the D register which is made up of 2 8-bit accumulators: A most significant byte and B least significant byte There is also a return stack pointer register Sa condition code register CCRand a program counter PC ; these manage the execution of the instructions.
All mathematical operations use one or both of the accumulators that comprise the D register. The X and Y registers may be used as index registers which point to memory locations whose contents then become the operands of machine instructions.
The programming registers are fully explained in the 68HC11 manuals. Your assembly coded routines may freely use the D and X registers. Their contents need not be preserved, as QED-Forth uses them only as scratchpad registers. The contents of the Y register must be handled with care, however.
QED-Forth uses the Y register as the data stack pointer. Assembly coded words must not corrupt Y by leaving it in an arbitrary state. If an assembly routine does not need to access the data stack and needs to use the Y register to hold temporary data, it should save the data stack pointer on the return stack with a PSHY instruction, use the Y register as necessary, and restore the data stack pointer with a PULY instruction before exiting the routine.
This may cause hard-to-diagnose problems, however, if the assembly coded routine is interrupted after Y is modified; the interrupt routine may assume that Y is a valid data stack pointer. In addition, note that assembly code routines that do not use Y as a data stack pointer may be difficult to debug using the QED-Forth trace and debugging tools.
To ensure that code is fully pre-emptable and will not cause multitasking failures, follow these rules when putting items on or taking them off the data stack: When putting an item on the data stack, decrement the stack pointer first e.
The following code fragment puts the value on the data stack: This code fragment correctly removes an item from the stack and puts it in the X register: Executing these instructions causes the definition to be compiled into the dictionary: CODE delimit a set of assembly mnemonics that cause the compilation of assembly code into the dictionary.
Performing in-line assembly within high level definitions It is easy to assemble in-line code into a definition.
For example, the following word calculates a sum in assembler code and then calls high level Forth words to print the result. In fact, the CR and. If you need to preserve the contents of X or D while calling high level FORTH routines, push the register contents onto the return stack before invoking the high level commands, and pull the saved contents back into the registers after returning to the assembly coded portion of the routine.
Rely on high level routines to perform page changes When an address on a different page must be accessed from inside an assembly coded definition, it is best to use high level code to perform the page change.
The high level compiler correctly compiles page changes if necessary. CODE Note that the kernel word is used to perform the page change required to fetch from the specified address.
The branch and loop structures are similar to those used in high level FORTH, making assembly coding very straight-forward. There is an important difference between high-level and assembly-coded conditionals.
The high level words remove a flag from the data stack at run time and base their test on the value of the flag. In assembler code, on the other hand, the test is based on the value of the condition code register CCR at run time.
A conditional instruction typically follows an instruction that sets the CCR. The programmer specifies which condition should be tested for. AGAIN, which is an infinite loop.About the Technical Reviewer. Eric Evenchick is an embedded systems developer with a focus on security and automotive systems.
While studying electrical engineering at the University of Waterloo, he worked with the University of Waterloo Alternative Fuels Team to design and build a hydrogen electric vehicle for the EcoCAR Advanced Vehicle Technology Competition.
Up one level (Moto Index) Back to Home: The Motorola Saber Information Page Information from Scott Lichtsinn KBØNLY, Ric Letson NB2E, Skip Chestnut KC2MCV, and Duane Park N6DSP.
Roger's Embedded Microcontrollers Home Page. This page is intended to be a source of information for those interested in Motorola MC68HC05, MC68HC08, MC9S08, MC68HC11 and MC68HC12 Microcontrollers.. The Motorola Semiconductors Product Sector has been spun off into freescale semiconductor.
I will try to concentrate on sources of PC boards and development systems for . Jul 22, · hi all I am currently having problem in writing a 68HC11 assembly program which requires me to: Arrange an array of double byte signed numbers in ascending order.
68HC11 Assembly Language Programming This chapter introduces the inner workings of the 68HC11 microprocessor, and provides details on writing assembly language programs for the 68HC Since most, if not all, programming for ELEC will be in IC most ELEC readers can just skim this material for background information.
Read/Write Enable Data In Status I/O Unit INPUT/OUTPUT Device Address UNIT Control • This transformation process, called program assembly, can be done automatically by a computer program called an assembler (e.g., AS11).
GCPU, Comp Org, 68HC11, Assembly.