Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Copy the following into the Code Warrior editor. Then assemble, and step through the debugger to answer all questions. ORG $1000 DATA1 FCB $12

1. Copy the following into the Code Warrior editor. Then assemble, and step through the debugger to answer all questions. ORG $1000 DATA1 FCB $12 DATA2 FCB $34,$56 TEMP RMB 4 JOBO RMB 2 CLEM FCB $77 BOBO FCB $22 JIMI FCB $66 ORG $2000 CODE NOP ; line 1 LDAA #$01 ; 2 ADDA DATA1 ; 3 STAA TEMP ; 4 NOP ; 5 LDAB DATA2 ; 6 LDX #$1111 ; 7 ABX ; 8 STX JOBO ; 9 NOP ; 10 LDY #CLEM ; 11 LDAA 0,Y ; 12 LDAB 1,Y ; 13 ABA ; 14 STAA TEMP+1 ; 15 NOP ; 16 LDAB CLEM ; 17 LDX #JIMI ; 18 ADDB 0,X ;19 BCS BADADD ; 20 STAB TEMP+2 ; 21 BRA DONE ;22 BADADD BRA BADADD ; 23 DONE NOP NOP QUESTIONS a) Fill in the address of: DATA1_________ DATA2_________ TEMP________ JOBO________ CLEM _________ BOBO _________ JIMI ________ CODE _______ BADADD _______ b) Before the code runs, identify the contents of each DATA memory location listed below: DATA1_________ DATA2_________ TEMP________ TEMP+1 ________ TEMP+2 ________ JOBO________ CLEM _________ BOBO _________ JIMI ________ c) d) Describe and verify using the simulator, the operation occurring in line 3. e) What are the contents of DATA1 after line 4? f) Describe the operation of line 8. (Watch what happens to register X.) g) After line 9, what are the contents of JOBO and JOBO+1? h) After line 13, what are register A, B, X, and Y equal to? i) After line 15, what data is in TEMP+1? j) Describe the operation of line 19. k) Identify the condition code flag settings after line 19. N= Z= V= C= l) Is the branch in line 20 taken or ignored? Why? m) After the code has run, identify the contents of each DATA memory location listed below: DATA1_________ DATA2_________ TEMP________ TEMP+1 ________ TEMP+2 ________ JOBO________ CLEM _________ BOBO _________ JIMI ________ 2. Write a program with the following characteristics: Data memory starts at $D000 Code memory starts at $A000 Two constants, ($24, $35) should be placed into data memory using the FCB directive and the symbol names INPUT1, INPUT2. Two memory bytes, (SUM, DIFF) should be reserved using the RMB directive. PART1 of the program code should perform an addition of the two constants and store the result in SUM. This part should be done using EXTENDED addressing mode for all memory access operations. PART2 of the program should perform a subtraction of the constants, where the contents of INPUT1 are subtracted from that of INPUT2. This part should use INDEXED addressing mode for all memory access operations.

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