Question: The following code demonstrates a simple look-up data table to quickly convert Celsius to Fahrenheit. (Assembly) Re-write the table program to sort 20 random values

The following code demonstrates a simple look-up data table to quickly convert Celsius to Fahrenheit.The following code demonstrates a simple look-up data table to quickly convert

(Assembly)

Re-write the table program to sort 20 random values stored in the internal FLASH. Use the sorting method of your choice; sort from max to min or min to max. Store the sorted numbers to SRAM as the output.

dseg org 0x100 .byte 1 .cseg org 0x0 mpmain org 0x100 ldi ZL, low (2 table) ldi ZH, high (2 table) ldi r16,celsius add ZL, r16 ldi r16,0 adc 2H, r16 1 output: ; student comment goes here ;partial vector table at address 0x0 MA IN entry point at address 0x200 step through the code) ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ; 1pm = 1pm ro, in r store look-up result to SRAM ;consider MAIN as a subroutine to return from - but back to where? ; Fahrenheit look-up table main eality, what does pm s mean output,r0 sts ret table .d 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 55, 57, 59, 61, 63, 64, 66 .eru celsius 5 imodify Celsius from 0 to 19 degrees for different results dseg org 0x100 .byte 1 .cseg org 0x0 mpmain org 0x100 ldi ZL, low (2 table) ldi ZH, high (2 table) ldi r16,celsius add ZL, r16 ldi r16,0 adc 2H, r16 1 output: ; student comment goes here ;partial vector table at address 0x0 MA IN entry point at address 0x200 step through the code) ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ;student comment goes here ; 1pm = 1pm ro, in r store look-up result to SRAM ;consider MAIN as a subroutine to return from - but back to where? ; Fahrenheit look-up table main eality, what does pm s mean output,r0 sts ret table .d 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 55, 57, 59, 61, 63, 64, 66 .eru celsius 5 imodify Celsius from 0 to 19 degrees for different results

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!