Embedded System..
1. Analyze the instruction sets below.
LDR R1, [R0, #0x08]
SUB R1, R1, R2, LSR R3
LDR R1,[R0,R2,LSL#2]!
LDR R1, [R0],R2, LSL #1
Memory: Think of as single one-dimensional array where each cell v Stores a byte size value v Is referred to by a 32 bit address e.g. value at 0x4000 is 0x0a vData is stored in memory as: variables, arrays, structures vBut ARM arithmetic instructions only operate on registers, never directly on memory. vData transfer instructions transfer data between registers and memory: vMemory to register or LOAD from memory to register vRegister to memory or STORE from register to memory
Embedded System.. 1. Analyze the instruction sets below. LDR R1, [R0, #0x08] SUB R1, R1, R2,...
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...
2. Encode the following four TM4C Thumb-2 instructions using 16-bit instructions if possible: LDR R3,[R0] MOV R2,R3 STR R6, [SP, #0x08] RSB R11,R7,R7, LSL #2 Note: uVision may NOT give the 16-bit answer for encoding when you check.
3) (5) What value will the carry flag contain after these instructions: a) MOV R1,#3 MOVS R2, R1, LSR #1 b) MOV R1,#2 MOVS R2, R1, LSR #1 4) (5) Will this instruction update the flags in the CPSR? ADD R1, R0, #1 Alo it Why or why not?
Problem: On an ARM processor using big endian format, given the following memory map and [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C, predict [R1] and [R2] and draw the updated memory map after an ARM data transfer instruction is executed in EACH case. (hint: (1) in this map, each memory location is a word long and occupies 4 bytes; also you only need to draw the section of the memory including the changed word and...
; assumed A is in r0, B is in r1, ? is in r2, D is in r3 : increment is put into r4, carry2 into r5, low into r6 and high into r MOV r4, #0 MOV r5, r4 ADDS r6, r1, r3 BCC no incr MOV r4,#1 ; initialise incremen t 0 ; initialise carry2 ; low=B+D ; skip if not over 32-bits ; set increment 1 ; high:: A+C ; skip if not over 32-bits no-incr ADDS...
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...
(1) Having the following sets: [2 marks] P: P1, P2, P3 R: R1, R2, R3 E: P1→R2, P2→R1 R1→P1, R2→P2, R3→P3 Draw the resource allocation graph of the previous system? Examine if the system deadlocked or not and list all the cycles?
Assignment 4: Answer the following questions with reference to the assembly program below. Before the code is executed, the initial content of memory and registers is shown in the figure below memory 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 address Use BIG ENDIAN, and 0x2000.0000 0x2000.0001 0x2000.0002 show all steps register 0x2000.0000RO Ox2000.0003 0x2000.0004 0x2000.0005 0xFFFF.FFFF R2 ox2000.0006 0x1234.5678 R3 0x2000.0007 Ox0000.0000 R1 LDRH R1, [R0 , #2]! LDRH R2 , [R0 , #2)! ADD R3, R1, R2 STR...
Write an embedded (continuous input) e-LMC little man program using bubble sort. Zero to end. Constant registers ( R0 = 0, R1 = 1, R2 = 2, R3 = 999)?
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...