Question: This program needs to be built in Keil uVision. So the required programming language is embedded C. Below is an example that might help in
This program needs to be built in Keil uVision. So the required programming language is embedded C. Below is an example that might help in solving the question posted in the picture. The question given below in the picture needs to be solved
Another Example
;The semicolon is used to lead an inline documentation
;When you write your program, you could have your info at the top document block
;For Example: Your Name, Student Number, what the program is for, and what it does etc.
;;; Directives
PRESERVE8
THUMB
; Vector Table Mapped to Address 0 at Reset
; Linker requires __Vectors to be exported
AREA RESET, DATA, READONLY
EXPORT __Vectors
__Vectors
DCD 0x20001000 ; stack pointer value when stack is empty
DCD Reset_Handler ; reset vector
ALIGN
;Your Data section
;AREA DATA
SUM DCD 0
SUMP DCD SUM
; The DCD directive allocates one or more words of memory,
; aligned on four-byte boundaries,
; and defines the initial runtime contents of the memory.
;
; For example, data1 DCD 1,5,20
; Defines 3 words containing decimal values 1, 5, and 20
NUM1 DCD 8 ; define one word containing decimal value 8
NUM2 DCD 7
; The program Linker requires Reset_Handler
AREA MYCODE, CODE, READONLY
ENTRY
EXPORT Reset_Handler
Reset_Handler
;;;;;;;;;;User Code Start from the next line;;;;;;;;;;;;
LDR R1, NUM1
LDR R2, NUM2
MOV R0, #0
ADD R0, R1, R2
SUBS R0, R0, #1
LSLS R3, R0, #2 ; Logical shift left by 2 bits with flag update
LDR R4, SUMP
STR R3, [R4]
ALIGN
STOP
B STOP
END
Arithmetic Operations Objective of this lab: To investigate Arithmetic Operations and implement them in Keil uvision5 Preparation Read lab lecture notes. Lab Assignment Assignment#1: You can convert tempretures from Celsius to Fahrenheit or from Fahrenheit to Celsius. Here are the two formulas for your reference. C = 5 * (F - 32) / 9 F = (9* c/ 5) + 32 Write an ARM assembly language program convertF2CandC2F.s. You will do the following: 1. You can put the Fahrenheit tempreture, say 70, in the register RO; 2. and have the converted tempreture in Celsius in the register R1. 3. You can put a Celsius tempreture, say 22 in register R2; 4. and have the converted tempreture in Fahrenhei in the register R3. 5. Build the program if there are any bugs, fix them. 6. Run the program step by step and see how values are changing in the registers. 7. Make a screenshot to capture the results in your designated registers. You will hand in the following: 1. The source code in the file convertF2CandC2F.s 2. The print out of the screen shot (print screen) to show the program has been successfully built 3. The print out of the screen shot showing the converted tempretures in the registers Arithmetic Operations Objective of this lab: To investigate Arithmetic Operations and implement them in Keil uvision5 Preparation Read lab lecture notes. Lab Assignment Assignment#1: You can convert tempretures from Celsius to Fahrenheit or from Fahrenheit to Celsius. Here are the two formulas for your reference. C = 5 * (F - 32) / 9 F = (9* c/ 5) + 32 Write an ARM assembly language program convertF2CandC2F.s. You will do the following: 1. You can put the Fahrenheit tempreture, say 70, in the register RO; 2. and have the converted tempreture in Celsius in the register R1. 3. You can put a Celsius tempreture, say 22 in register R2; 4. and have the converted tempreture in Fahrenhei in the register R3. 5. Build the program if there are any bugs, fix them. 6. Run the program step by step and see how values are changing in the registers. 7. Make a screenshot to capture the results in your designated registers. You will hand in the following: 1. The source code in the file convertF2CandC2F.s 2. The print out of the screen shot (print screen) to show the program has been successfully built 3. The print out of the screen shot showing the converted tempretures in the registers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
