Question
I need help with this: Part II: Use CodeWarrior to find out execution history Use the Single Step button to execute your program one instruction
I need help with this:
Part II: Use CodeWarrior to find out execution history
Use the Single Step button to execute your program one instruction at a time. After executing each instruction, use the Register Window and Memory Window to fill out following table:
see below for code: I actually need help identifying the H_byte and L_byte.
After executing the Instruction of | A | C-bit | H_Byte M[$1006] | L_Byte M[$1007] |
Before the execution | $CB | 0 | uu | uu |
After CLRA | 0 | |||
After STAA H_Byte | 0 | |||
After ADDA number1 | 7D | |||
After BCC Case1 | 7D | |||
After INC H_Byte | ||||
After Case1 ADDA number2 | 68 | |||
After BCC Case2 | 68 | |||
After INC H_Byte | 68 | |||
After Case2 ADDA number3 | 2D | |||
After BCC Case3 | 2D | |||
After INC H_Byte | 2D | |||
After Case3 ADDA number4 | 88 | |||
After BCC Case4 | ||||
After INC H_Byte | 88 | |||
After STAA L_Byte | 88 | |||
After Here BRA Here | 88 |
I have gotten up to this:
***************************************************************** ; export symbols ;***************************************************************** ;For absolute assembly: this is the application entry point ABSENTRY Main
;***************************************************************** ; Include derivative-specific definitions ;***************************************************************** ;The microcontroller chip used by Dragon12-plus2 board INCLUDE 'mc9s12dg256.inc'
;***************************************************************** ; Symbolic constant(EQU) section ;***************************************************************** DATA EQU RAMStart ;use $1000 - $1FFF for data STACK EQU RAMEnd+1 ;use $2000 - $3FFF for stack CODE EQU $4000 ;use flash ROM $4000 - $7FFF for code
L_Byte EQU $1007 H_Byte EQU $1006
;***************************************************************** ; Data section ;***************************************************************** ORG RAMStart number1 DC.B $7D number2 DC.B $EB number3 DC.B $C5 number4 DC.B $5B
;***************************************************************** ; Main program section ;***************************************************************** ORG $4000 Main: LDS #RAMEnd+1 CLRA STAA H_Byte ADDA number1 BCC Case1 INC H_Byte Case1 ADDA number2 BCC Case2 INC H_Byte Case2 ADDA number3
BCC Case3 INC H_Byte Case3 ADDA number4 BCC Case4 INC H_Byte Case4 STAA L_Byte Here BRA Here
;***************************************************************** ; Subroutine section ;***************************************************************** ;***************************************************************** ; Interrupt Vectors ;***************************************************************** ORG $FFFE DC.W Main ;Reset Vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started