




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Dr. Bradley J. BazuinAssociate Professor
Department of Electrical and Computer Engineering
College of Engineering and Applied SciencesCollege of Engineering and Applied Sciences
-^
-^
ICC12 Compiler/Assembler/Linker/Loader
-^
D-Bug12 Microcontroller Resident Debugger
-^
Assembly Language Code SyntaxAssembly Language Code Syntax
-^
Assembler Directives
-^
Assembly Language Command Utilization
-^
Multiple Byte/Word Precision Math
-^
Multiple Byte/Word Precision Math
-^
Binary Coded Decimals (BCD)
-^
BranchingOth
I^
t^
ti
-^
Other Instructions
-^
Loops for time delay
-^
Problem presented by the application must be fully understoodbefore any program can be written
-^
The plan is also called an algorithm
-^
Algorithm is a sequence of computational steps that transforms theinput into the outputinput into the output
-^
An algorithm can be expressed in pseudo code that is very muchlike C or Pascal (or the target language for the code)
-^
An algorithm provides not only the overall plan for solving the
-^
An
algorithm provides not only the overall plan for solving the problem but also documentation for the S/W to be developed
-^
A flowcharts shows the way a program operatesIt illustrates the logic flow of the program
-^
It illustrates the logic flow of the program
-^
Terminal
-^
ProcessI^
t^
O t
t
Input or Output
-^
Decision
-^
Subroutine
i^
l^
d^
h^
b^
i^
i^
d h
d^
f^
h
Terminal – Used at the beginning and the end of each program–
When used at the beginning of a program, the word start is written insidethe symbolWh
d^
t th
d^
f^
th
d^
t^
i^
itt
i^
id
it
-^
When used at the end of a program, the word stop is written inside it
Process – Indicates what must be done at this point in the program
i
execution–
Operations specified by the process box could be
-^
Shifting the contents of one general purpose register to a peripheral registerD
ti^
l^
t^
t
-^
Decrementing a loop count, etc
Input/Output – Used to represent data that are either read or displayedb^
h by the computer
Decision
yes
A
off-
-^
Decision – Contains a question that can be answered yes or no Decision
no
A on-page connector
-^
A decision box has two exits, also marked yes or no
-^
Computer will take one action if the answer is yes and will take a different action ifthe answer is no
-^
On-page connector – Indicates that the flowchart continues elsewhere on theOn page connector
Indicates that the flowchart continues elsewhere on the
same page. The place where it is continued will have same label as the on-pageconnector
-^
Off-page connector – Indicates that the flowchart continues on another page
-^
After the programmer is satisfied with the flowchart, it is converted to sourcecode using assembly or C language
S^
u^ b
r o
u^
t i n
e
A
S^
u^ b
r o
u^
t i n
e
B
o^ f f - p
a^
g^ e
c^ o
n^
n^ e
c^
t o^
r
-^
.area prog (abs)text
; Start of the program
.text
; Start of the program
_main::Ldaa $
Adda $
Adda $
Staa $
swi
-^
Testing a program means testing for anomaliesThe first test is for normal inputs that are always expected
-^
The first test is for normal inputs that are always expected
-^
If the results are as expected, then the border line inputs are tested
-^
Then maximum and minimum values are tested
-^
Then illegal input values are tested
-^
This is to make sure program will operate correctly under allpossible circumstances
-^
-^
-^
-^
-^
-^
-^
For development: Use a monitor program or debugger to runmachine codeFor users: Execute machine resident code
-^
For users: Execute machine resident code
-^
-^
The Imagecraft Freescale CPU12 Development Tools
-^
ICCV7 for CPU12 – refereed to as ICC12 around WMU
-^
http://www imagecraft com/
-^
http://www.imagecraft.com/
-^
Freescale D-Bug
-^
ICE refers to an “In-Circuit Emulator”
-^
Assembly Language directives
-^
Instruction to the assembler about the code Assembly Language Code
-^
Assembly Language Code
-^
C language “PRAGMA”
-^
Instructions to the compiler/assembler about the code
C Language Code
g^
g
Assembly Program Elements
y
g
-^
Defines data and symbol
-^
Reserves and initializes memory locationsSets assembler and linking condition
-^
Sets assembler and linking condition
-^
Specifies output format
-^
Specifies the end of a program
-^
HCS12/MC9S12 instructions
-^
-^
Explains the function of a single or a group of instructions
Label field–
OptionalStarts with a letter and followed by
Operand field–
Follows the operation field and is
-^
Starts with a letter and followed byletters, digits, or special symbols
-^
Can start from any column if endedwith “:”
p
separated from the operation field byat least one space
-^
Contains operands for instructions or
f^
bl
di
i
-^
Must start from column 1 if notended with “:”
Operation field (opcode)
arguments for assembler directives
Comment field–
Any line starts with an * or ; is a
p^
( p
-^
Contains the mnemonic of a machineinstruction or an assembler directive
-^
Separated from the label by at least
comment
-^
Separated from the operand andoperation field for at least one spaceOptional
ECE 2510
one space
-^
Optional