Question: URGENT!! please convert this C code into x 8 6 - 6 4 Assembly. #include #include thermo.h extern short THERMO _ SENSOR _ PORT;
URGENT!! please convert this C code into x Assembly.
#include
#include "thermo.h
extern short THERMOSENSORPORT;
extern unsigned char THERMOSTATUSPORT;
const short MAXTRUSTEDVALUE ; Sensor value for deg C
int settempfromportstempt temp
Check if THERMOSENSORPORT is negative or above its maximum trusted value
if THERMOSENSORPORT THERMOSENSORPORT MAXTRUSTEDVALUE THERMOSTATUSPORT & x
temptenthsdegrees ;
temptempmode ; Error mode
return ; Return on error
Convert the sensor value to tenths of degrees Celsius
int celsius THERMOSENSORPORT ;
Round up if the remainder is high enough
if THERMOSENSORPORT
celsius;
Adjust for the offset from deg C
celsius ;
Check if conversion to Fahrenheit is needed
if THERMOSTATUSPORT & xx Bit set Fahrenheit mode
Convert to Fahrenheit using the integer formula
int fahrenheit celsius ;
Update temp fields
temptenthsdegrees fahrenheit;
temptempmode ; Fahrenheit mode
else
Update temp fields for Celsius
temptenthsdegrees celsius;
temptempmode ; Celsius mode
return ; Return on success
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
