Question: I need to Write a program in Easy68K to fulfill the following functions: a) Read in two numbers from keyboard with instructions, one for index,
|
| I need to Write a program in Easy68K to fulfill the following functions: a) Read in two numbers from keyboard with instructions, one for index, one for the size of the array; b) Display the (index % size)th number in the initialized array [2 3 8 1 6 5 4]. I believe I have done this correctly, but my program lacks OUTPUT after I input the two numbers, any idea what is wrong with my program? START: lea array1,A0 for D2 = #0 to #1 do.s lea prompt,A1 move.b #13,D0 trap #15 move.b #4,D0 trap #15 move.l D1,(A0,D2) endf lea result,A1 move.b #13,D0 trap #15 for D2 = #0 to #2 do.s move.l (A0,D2),D1 move.b #3,D0 trap #15 lea crlf,A1 move.b #14,D0 trap #15 endf MOVE.B #9,D0 TRAP #15 array1 ds.l 2 2 prompt dc.b 'Enter the number: ',0 result dc.b 'The entered numbers are: ',0 crlf dc.b $d,$a,0 END START |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
