; Code for the MC9S08QG8 Microcontroller INCLUDE \'derivative.inc\' XDEF _Startu
ID: 3888507 • Letter: #
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 ; 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. Thank
Explanation / Answer
the code has done
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//
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.