Embedded Firmware Design and Development
Embedded Firmware Design and Development
Development
Embedded Firmware Design Approaches
optional mandatory
• Opcodes
– reserved symbols that correspond to LC-3 instructions
– listed in Appendix A
• ex: ADD, AND, LD, LDR, …
• Operands
– registers -- specified by Rn, where n is the register number
– numbers -- indicated by # (decimal) or x (hex)
– label -- symbolic name of memory location
– separated by comma
– number, order, and type correspond to instruction format
• ex:
ADD R1,R1,R3
ADD R1,R1,#3
LD R6,NUMBER
BRz LOOP
• Label
– placed at the beginning of the line
– assigns a symbolic name to the address corresponding to line
• ex:
LOOP ADD R1,R1,#-1
BRp LOOP
• Comment
– anything after a semicolon is a comment
– ignored by assembler
– used by humans to document/understand programs
– tips for useful comments:
• avoid restating the obvious, as “decrement R1”
• provide additional insight, as in “accumulate product in R6”
• use comments to separate pieces of program