Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an assembly program that converts every Fahrenheit temperature element in Fahrs array into a Celsius temperature and stores the result at the corresponding element
Write an assembly program that converts every Fahrenheit temperature element in Fahrs array into a Celsius temperature and stores the result at the corresponding element in Cels array. Use this relation: C = (5 / 9) * (F - 32) for conversion. Because temperatures are signed, you will have to use signed multiplication and division instructions in your work.
; export symbols XDEF Entry, _Startup ; export 'Entry' symbol ABSENTRY Entry ; for absolute assembly: mark this as application entry point ROMStart: EQU $4000 Temps_Count: EQU 10 ; variable data goes in RAM ORG $1000 Cels: DS.W 10 ; an array of 10 words! ; code section ORG ROMStart Entry: _Startup: ; for every F in Fahrs ; convert F into C ; store C into the corresponding location in Cels Here: BRA Here ; an array of 10 constant words! Fahrs: dc.w 0,20,40,60,80,100,120,140,160,180 ;************************************************************** ;* Interrupt Vectors * ;************************************************************** ORG $FFFE DC.W Entry ; Reset Vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started