1. Translate the following tasks into a single ARM instruction:
a. Add 32 times of the content of registers r0 and the content of r1 only if N is clear. Store the result in register r2
b. Subtract the content of register r0 from 0x990 and put the results in register r3 only if C is set and Z is clear.
c. Clear the 2nd least significant byte of the content of register r1, i.e., store (00000000)2 in it, and put the results in register r4. The result of the instruction must affect the value of the Current Program Status Register (CPSR).
MOV R5,#32 ;initializing counter
loop: ADDPL R2,R0,R1 ;adding contents of RO and R1 and saving the result in R2 only if N is clear
SUB R5,R5,#01 ;decrementing counter
BNE loop ;if Z is not set,that is ,counter is not zero then the branch will take place
RSBHI R3,R0,0x990 ; if C is set and Z is clear,contents of R0 will be subtracted from 0x990
BIC R4,R1,0b0000000011111111 ;getting content of the 2nd least significant byte of the content of register r1 and storing it into R4 by bit clearing the least significant byte.
SUB R4,R4,R1 ;this instruction will make the 2nd least significant byte of the content of register r1 zero and assuming that the least significant byte of the content of register r1 is not 00000000,N flag in the CPSR will be set. ;
1. Translate the following tasks into a single ARM instruction: a. Add 32 times of the...
Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...
Exercise 1 (9 pts) We have seen that ARM has 16*32 bits registers (plus floating point registers) There is also a status register: CPSR. It contains, among other things, the following important status bits N Negative, set when the result of an arithmetic operation is negative (according to the two's complement encoding of the natural numbers . Z- Zero, set when the result of an operation is zero . C Carry, set when an operation results in a carry bit...
1. The following instruction(s),--, is (are) ARM® Cortex®-M4 assembly instructions. a. ui32int uiLoop c. void_WFI(void); d. WFI 2. The ARM® Cortex-M4 assembly instructions contain. a. Label field b. Operation field and operands field c. Operation field, op erands field and comment field d. Both a and c Copyrighted material Homework 245 3. The pseudo instruction DCW 2 is to a. Reserve 2-byte space for a data item in the program b. Reserve 2 hal f-word space for a data item...
Consider the following operations: A B- C The corresponding assembly code instruction list generated by a compiler are 1 load [%r0 +4], %r1 2 load [%r0 + 8], %r2 3 sub %r1, %r2,%r3 4 load [ZrO + 12], %r4 5 add %r3, %r4 , %r5 6 store %r3, [%r0 + 16] 7 store %r5, [%r0 + 20] a) Identify the potential pipeline hazards. (10 points) b) State if the found hazards can be eliminated and if so propose a scheme...
You are given a homework processor (HPro) capable of addressing 32 8-bit (1 byte) wide registers. However, it has only 29 physical registers. Register RO, R1 and R31 are not physically implemented. Instead, every read from RO, R1 and R31 will return a constant zero (00000000), constant one (00000001) and all ones (11111111), respectively. Every write to RO, R1 and R31 will go to null (dummy write). Assume that all other registers have initially unknown (X) state (This in fact...
Assembly lang multiple choice Suppose we have the following pseudo-instruction in our program: push {r0, r2, r4} ..... Which of the following instructions would be the appropriate instruction to use when cleaning up the stack space used by the three register values that were pushed onto the stack? Group of answer choices sub sp, #12 add sp, #12 add lr, #12 2) Suppose we are comparing registers R1 and R2 and we want to branch if equal to the label...
Question 2 ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper. (5 marks) Explain the difference between eor and eors instruction. Use an example to show why both forms are useful. а. b. (5 marks) Explain using an example what the "Idr r3, [r7,#4]" instruction does. c. (10 marks) The following is the assembly language generated by a C compile type mystery, %function mystery: args 0, pretend = 0, frame =...
its microprocessors help please Im sorry but thats the picture i can provide and all i cam say is that its microprocessors with ARM assembly lamguage.. 1) Draw a flow chart and an assemble program to Note: the reader is serial a. Open a save box b. Press the number 96357 on the save box key c. If the number pressed is not the corresponding number rest d. After three fail, the save box will be locked for a long...
Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...
third photo is problem 8 pt 2. anything would help please Problem 7 (15pts) Convert this following pseudo-code in high level language into a piece of an assembly code (NIOS 2). In the following pseudo-code in high level language, r4, r5, r6, and r10 represent registers 4,5, 6, and 10, respectively Consider this pseudo-code in high level language: If ! (r4 >r5 or rs <r6) r10=r10+1 else r10- r10-1 This becomes the following piece in assembly code (put you answers...