Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the first 3 pics are the code: please help with the following questions: : export symbols XDEF Entry. _Startup : export 'Entry' symbol ABSENTRY Entry

the first 3 pics are the code: image text in transcribed
image text in transcribed
image text in transcribed
please help with the following questions:
image text in transcribed
: export symbols XDEF Entry. _Startup : export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as appl Include derivative-specific definitions INCLUDE 'derivative.inc' : Equates Section ROMStart EQU $2000 : absolute address to place my code : Variable/Data Section ORG RAMStart loc $1000 (RAMEnd - $3FFF) : Insert here your data definitions here PROMPT dc.b SOA, SOD CR LF dc.b "Type a character: YNM" do.b 0 using zero terminated strings YESSTRG deb YES - dc.b 0 NOSTRG dc.b - NO dc.b 0 MAYBESTRG dc.b - MAYBE - dc.b 0 INCLUDE 'utilities, inc' INCLUDE 'LCD. inc' : Code Section ORG ROMStart ; loc $2000 Entry: _Startup: remap the RAM &: EEPROM here. See EB386.pdf ifdef _HCS12_SERIALMON : set registers at $0000 CLR $11 INITRG- $0 set ram to end at $3FFF LDAB #$39 STAB $10 INITRM= $39 : Code Section ORG ROMStart : loc $2000 Entry: _Startup: : remap the RAM & EEPROM here. See EB386.pdf ifdef _HCS12_SERILMON : set registers at $0000 CLR $11 INITRG= $0 ; set ram to end at $3FFF LDAB #$39 STAB $10 | ; INITRM= $39 : set eeprom to end at SOFFF LDAA #$9 STAA $12 INITEE- $9 JSR PLL_init ; initialize PLL endit Insert your code here LDS FROMStart ; load stack pointer JSR TermInit ; needed for Simulator only JSR led_enable ; enable PORTB for LED's LOOP LDD #PROMPT pass the adr of the string JSR printf ; print the string JSR getchar call getchar function -result is: character in B JSR ClearLeds clear LED's when starting over YCASE CMPB #'Y' ; is it a Y ? BNE NCASE jump ahead if not JSR YFCN ; else do corresponding function for Y NCASE CMPB IN ; is it a N ? BNE MCASE : jump ahead if not JSR NFCN ; else do corresponding function for N MCASE CMPB # M' : is it a M ? BNE NEXT jump ahead if not JSR MFCN ; else do corresponding function for M NEXT JMP LOOP ; loop for more input : Note: main program is an endless loop and subroutines follow : (Must press reset to quit.) : FUNCTIONS CALLED BY MAIN LOOP YFCN PSHD LDD YESSTRG ; pass the address of the string JSR printf ; print the string JSR getchar call getchar function -result is: character in B JSR ClearLeds clear LED's when starting over YCASE CMPB #Y' is it a Y? BNE NCASE : jump ahead if not JSR YFCN ; else do corresponding function for Y NCASE CMPB #'N' ; is it a N? BNE MCASE : jump ahead if not JSR NFCN; else do corresponding function for N MCASE CMPB #'M' ; is it a M? BNE NEXT jump ahead if not JSR MFCN ; else do corresponding function for M NEXT JMP LOOP ; loop for more input ; Note: main program is an endless loop and subroutines follov : (Must press reset to quit.) : FUNCTIONS CALLED BY MAIN LOOP YFCN PSHD LDD JSR BSET PULD RTS #YESSTRG printf PORTB. $01 ; pass the address of the string ; print the string : light LEDO NFCN PSHD LDD JSR BSET PULD RTS #NOSTRG printf PORTB. $02 ; pass adr. of string : call printf light LED1 MFCN PSHD LDD JSR BSET PULD RTS #MAYBESTRG printf PORTB. $04 ; pass adr. of string print the string : light LED2 Clear Leds CLR PORTB ; clear all LED's ************** ** ***** *** * * ** * Interrupt Vectors ; ORG Vreset DC.W Entry Reset Vector 5. Subroutine 2: a) What are the contents of stack when JSR NFCN is executed before cpu executes the first instruction of NFCN Stack Address Contents b) What is SP in part (a) c) What are the contents of stack and PC after RTS instruction in NFCN is executed. 6. Subroutine 3: a) What are the contents of stack when JSR MFCN is executed before cpu executes the first instruction of MFCN Stack Address Contents b) What is SP in part (a) c) What are the contents of stack and PC after RTS instruction in MFCN is executed. : export symbols XDEF Entry. _Startup : export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as appl Include derivative-specific definitions INCLUDE 'derivative.inc' : Equates Section ROMStart EQU $2000 : absolute address to place my code : Variable/Data Section ORG RAMStart loc $1000 (RAMEnd - $3FFF) : Insert here your data definitions here PROMPT dc.b SOA, SOD CR LF dc.b "Type a character: YNM" do.b 0 using zero terminated strings YESSTRG deb YES - dc.b 0 NOSTRG dc.b - NO dc.b 0 MAYBESTRG dc.b - MAYBE - dc.b 0 INCLUDE 'utilities, inc' INCLUDE 'LCD. inc' : Code Section ORG ROMStart ; loc $2000 Entry: _Startup: remap the RAM &: EEPROM here. See EB386.pdf ifdef _HCS12_SERIALMON : set registers at $0000 CLR $11 INITRG- $0 set ram to end at $3FFF LDAB #$39 STAB $10 INITRM= $39 : Code Section ORG ROMStart : loc $2000 Entry: _Startup: : remap the RAM & EEPROM here. See EB386.pdf ifdef _HCS12_SERILMON : set registers at $0000 CLR $11 INITRG= $0 ; set ram to end at $3FFF LDAB #$39 STAB $10 | ; INITRM= $39 : set eeprom to end at SOFFF LDAA #$9 STAA $12 INITEE- $9 JSR PLL_init ; initialize PLL endit Insert your code here LDS FROMStart ; load stack pointer JSR TermInit ; needed for Simulator only JSR led_enable ; enable PORTB for LED's LOOP LDD #PROMPT pass the adr of the string JSR printf ; print the string JSR getchar call getchar function -result is: character in B JSR ClearLeds clear LED's when starting over YCASE CMPB #'Y' ; is it a Y ? BNE NCASE jump ahead if not JSR YFCN ; else do corresponding function for Y NCASE CMPB IN ; is it a N ? BNE MCASE : jump ahead if not JSR NFCN ; else do corresponding function for N MCASE CMPB # M' : is it a M ? BNE NEXT jump ahead if not JSR MFCN ; else do corresponding function for M NEXT JMP LOOP ; loop for more input : Note: main program is an endless loop and subroutines follow : (Must press reset to quit.) : FUNCTIONS CALLED BY MAIN LOOP YFCN PSHD LDD YESSTRG ; pass the address of the string JSR printf ; print the string JSR getchar call getchar function -result is: character in B JSR ClearLeds clear LED's when starting over YCASE CMPB #Y' is it a Y? BNE NCASE : jump ahead if not JSR YFCN ; else do corresponding function for Y NCASE CMPB #'N' ; is it a N? BNE MCASE : jump ahead if not JSR NFCN; else do corresponding function for N MCASE CMPB #'M' ; is it a M? BNE NEXT jump ahead if not JSR MFCN ; else do corresponding function for M NEXT JMP LOOP ; loop for more input ; Note: main program is an endless loop and subroutines follov : (Must press reset to quit.) : FUNCTIONS CALLED BY MAIN LOOP YFCN PSHD LDD JSR BSET PULD RTS #YESSTRG printf PORTB. $01 ; pass the address of the string ; print the string : light LEDO NFCN PSHD LDD JSR BSET PULD RTS #NOSTRG printf PORTB. $02 ; pass adr. of string : call printf light LED1 MFCN PSHD LDD JSR BSET PULD RTS #MAYBESTRG printf PORTB. $04 ; pass adr. of string print the string : light LED2 Clear Leds CLR PORTB ; clear all LED's ************** ** ***** *** * * ** * Interrupt Vectors ; ORG Vreset DC.W Entry Reset Vector 5. Subroutine 2: a) What are the contents of stack when JSR NFCN is executed before cpu executes the first instruction of NFCN Stack Address Contents b) What is SP in part (a) c) What are the contents of stack and PC after RTS instruction in NFCN is executed. 6. Subroutine 3: a) What are the contents of stack when JSR MFCN is executed before cpu executes the first instruction of MFCN Stack Address Contents b) What is SP in part (a) c) What are the contents of stack and PC after RTS instruction in MFCN is executed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions