Question: IN AVR ASSEMBLY INSTRUCTION SET. Re-write the table program to sort 20 random values stored in the internal FLASH. Use the sorting method of your
IN AVR ASSEMBLY INSTRUCTION SET.
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 output: byte 1 istudent comment goes here cseg rg 0xo jmp main ;partial vector table at address 0x0 MAIN entry point at address 0x200 (step through the code) ;student comment goes here :student comment goes here i student comment goes here i student comment goes here org 0x100 ldi 2L, low (2 table) ldi ZH , high (2*table) ldi r16,celsius add 2L, r16 ldi r16,0 adc ZH, r16 lpm ts output, ro ret main student comment goes here i student comment goes here 1pm1pm ro,z in reality, store look-up result to SRAM consider MAIN as a subroutine to return from ; Fahrenheit look-up table an ere table: .db 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 55, 57,59, 61, 63, 64, 66 modify celsius from 0 to 19 degrees for different results equ celsius= 5 exit dseg org 0x100 output: byte 1 istudent comment goes here cseg rg 0xo jmp main ;partial vector table at address 0x0 MAIN entry point at address 0x200 (step through the code) ;student comment goes here :student comment goes here i student comment goes here i student comment goes here org 0x100 ldi 2L, low (2 table) ldi ZH , high (2*table) ldi r16,celsius add 2L, r16 ldi r16,0 adc ZH, r16 lpm ts output, ro ret main student comment goes here i student comment goes here 1pm1pm ro,z in reality, store look-up result to SRAM consider MAIN as a subroutine to return from ; Fahrenheit look-up table an ere table: .db 32, 34, 36, 37, 39, 41, 43, 45, 46, 48, 50, 52, 54, 55, 57,59, 61, 63, 64, 66 modify celsius from 0 to 19 degrees for different results equ celsius= 5 exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
