-
Notifications
You must be signed in to change notification settings - Fork 0
Example Code
Nathan Pennie edited this page Mar 30, 2019
·
1 revision
This is just a collection of examples that I have lying around. If you have any others, feel free to add them.
mov r0, #-5 ; The input in degrees C
smul r0, r0, #18 ; These two instructions multiply by 1.8...
sdiv r0, r0, #10 ; ... this allows me to use decimals without floating point types
add r0, r0, #32 ; Apply the 32 degree offset for the freezing temp
halt ; r0 is now in degrees Fahrenheit