Question
; Code for the MC9S08QG8 Microcontroller INCLUDE 'derivative.inc' XDEF _Startup, main XREF __SEG_END_SSTACK ;symbol defined by linker for the end of stack TEMP EQU $0075
; Code for the MC9S08QG8 Microcontroller
INCLUDE 'derivative.inc'
XDEF _Startup, main
XREF __SEG_END_SSTACK ;symbol defined by linker for the end of stack
TEMP EQU $0075 ; address of start location of RAM
main:
_Startup:
mainLoop:
MOV #18, TEMP
LDA TEMP
STA $60
BRA mainLoop
//END//
Step One: Starting with the code given above, use LDHX and STHX commands to move a larger value than $FF into
a user defined memory location. (Hint create TEMP1 and watch Temp1, TEMP1 + 1)
Step Two:
Part a) Use the MOV command and a branch loop to store values 1-8 into
the first 8 memory locations of RAM(Hint: use the lower half of the index register)
Part b) Modify your code from part a using the MOV command and a branch loop to store the
first 7 values of 2^n starting with n=1 in the first 7 memory locations of RAM
Programming in assembly language, for the MCS908QG8 microcontroller. Please comment code with basic explanation for all 3 parts. Thanks
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