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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!