Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer only part b and c using putchar getchar out2hex and printf codewarrior software 4.1 Part (a) Save the following numbers in memory starting from

image text in transcribedimage text in transcribedimage text in transcribed

Answer only part b and c using putchar getchar out2hex and printf

codewarrior software

4.1 Part (a) Save the following numbers in memory starting from 0x1000. $3A,$3B,$5F,$6F,$8E,$9D,$8B,$81,$1B,$10,$1E,$16,$18,$19,$18,$18,$2A,$1 $3,$4 Write a program that will print the contents of 20 successive memory locations (data values) starting at 0x1000. The output (data values) should be in hexadecimal, there must be $ before each hexadecimal number and there must be a comma printed between the values. Save this project folder as Lab2A. 4.2 Part (b) Make a copy of Project folder Lab2A. The requirement is same as in part(a), except you should pause for the user to press the space bar between the outputs. Your program should print a value, wait for the user to press the space bar and then print the next value and so on. Note that your program should ignore all the keystrokes except the space bar. Save this project folder as Lab2B. 4.3 Part (c) Make a copy of Project folder Lab2B. Same requirement as above (a) and (b)), except you should maintain a counter. The counter should be initially one, and incremented after each output. Your program should print the value of the counter in decimal and then print the value in memory (in hexadecimal) with the character : as separator. e.g. Prints 01:$34,02:$3B,03:$5F,$04:6F,05:$8E.... Submit the code from your well commented .asm le from your project in your report. You must also have in your report a flowchart for your program. Please note that your report consists of a single document as.PDF. ; INI TRG= $0 CLR $11 ; set ram to end at $3FFF LDAB #$39 STAB $10 ; INITRM- $39 ; set eeprom to end at $OFFF LDAA #$9 STAA $12 ; INITEE= $9 JSR PLL_init initialize PLL endif Insert your code here lds #ROMStartload stack pointer JSR Terminit ; initialize the terminal LDX #$1000; load X with $1000 LDAA #0 load A with 0 (counter) PRINT_NUMBER : print numbers to the screen LDAB #36: load $ to register B JSR putchar print $ to the terminal LDAB X : load accumulator B with X JSR out 2hex : print digits that represent the hex number in the array LDAB #44 load to register B JSR putchar : print, to the terminal INX: increment register X INCA ; increment counter by 1 CMPA #20 : compare count in accumulator A with 20 (total elements) BNE PRINT_NUMBER : branch to PRINT_NUMBER if not equal jmp here : if equal, jump to end here jmp here: jmp here ********* ** * ' * * * * * * * ****** ************* Interrupt Vectors ************************ ** 4.1 Part (a) Save the following numbers in memory starting from 0x1000. $3A,$3B,$5F,$6F,$8E,$9D,$8B,$81,$1B,$10,$1E,$16,$18,$19,$18,$18,$2A,$1 $3,$4 Write a program that will print the contents of 20 successive memory locations (data values) starting at 0x1000. The output (data values) should be in hexadecimal, there must be $ before each hexadecimal number and there must be a comma printed between the values. Save this project folder as Lab2A. 4.2 Part (b) Make a copy of Project folder Lab2A. The requirement is same as in part(a), except you should pause for the user to press the space bar between the outputs. Your program should print a value, wait for the user to press the space bar and then print the next value and so on. Note that your program should ignore all the keystrokes except the space bar. Save this project folder as Lab2B. 4.3 Part (c) Make a copy of Project folder Lab2B. Same requirement as above (a) and (b)), except you should maintain a counter. The counter should be initially one, and incremented after each output. Your program should print the value of the counter in decimal and then print the value in memory (in hexadecimal) with the character : as separator. e.g. Prints 01:$34,02:$3B,03:$5F,$04:6F,05:$8E.... Submit the code from your well commented .asm le from your project in your report. You must also have in your report a flowchart for your program. Please note that your report consists of a single document as.PDF. ; INI TRG= $0 CLR $11 ; set ram to end at $3FFF LDAB #$39 STAB $10 ; INITRM- $39 ; set eeprom to end at $OFFF LDAA #$9 STAA $12 ; INITEE= $9 JSR PLL_init initialize PLL endif Insert your code here lds #ROMStartload stack pointer JSR Terminit ; initialize the terminal LDX #$1000; load X with $1000 LDAA #0 load A with 0 (counter) PRINT_NUMBER : print numbers to the screen LDAB #36: load $ to register B JSR putchar print $ to the terminal LDAB X : load accumulator B with X JSR out 2hex : print digits that represent the hex number in the array LDAB #44 load to register B JSR putchar : print, to the terminal INX: increment register X INCA ; increment counter by 1 CMPA #20 : compare count in accumulator A with 20 (total elements) BNE PRINT_NUMBER : branch to PRINT_NUMBER if not equal jmp here : if equal, jump to end here jmp here: jmp here ********* ** * ' * * * * * * * ****** ************* Interrupt Vectors ************************ **

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

=+Are you pregnant?

Answered: 1 week ago

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago