Real Time Computer Systems 3 LAB

2.1.1, 3. Push {LR, r4} creates context 4.
POP {LR,R4} restores context BX lr returns from function

  1. r0, as we can see with line 0x08000348, which is ADDS r0,r0#1, and then our conditional cmp r0, # 0x0a
  2. MULS r2,r0,r2:
    1. The line before loaded the value 2000 (0x07D0) into r2 to be multiplied by.
  3. the paramater passed in is stored as r0
  4. If list[i]==key then it immediately sends you to address 0x08000318, which is a BX command that sets the PC to the value of LR, and restores context, otherwise, if not found, we load in 0xFFFFFFFF into r0 and run the BX line anyway, which means that r0 is the variable that stores the return value no matter what
  5. r1 stores key
  6. three lines:
    ADDS r0,r0,#1
    CMP r0, #0x0A
    BCC 0x08000306
    So we add 1 to r0 (i), then we compare r0 to the value 10 (0A), and if it is less than 10, then we jump back to the address 0x08000306

11 main - 0x08000359 - 34 list_init - 0x08000321 -48 list_find - 0x08000301 - 26 list - 0x20000028 - 40 offset - 0x20000000 - 40

12 Exec Ad, List Ad, Size, Type, Attr, Idx, Sextion Name, Object 0,0,0x00000020, code, RO, NA, i.list_find, main.o NA,NA, 0x00000038, code, RO, NA, i.list_init, main.o NA, NA, 0x00000022, code, RO, NA, i.main, main.o NA,NA, 0x00000028 Data, RW, NA,.data, main.o NA,NA, 0x00000028 Zero, RW, NA, .bss, main.o

Size, Attr, Sextion Name, Object 0x00000020, RO , i.list_find, main.o 0x00000038, RO , i.list_init, main.o 0x00000022, RO , i.main, main.o 0x00000028, RW ,.data, main.o 0x00000028, RW , .bss, main.o 13. Stack size is 0x00000400, it matches

Code - 122 inc,data 14 RO - 0 RW - 40 ZI - 40 debug = 3489 main.o

main 0x0900033d 34 list_init 0x08000305 48 list_find 0x080002e5 26 list 0x20000000 40 offset 0x08000368 40

list has moved to the old position of data that held offset offset is now in an address much closer to main etc.. which means main, list_init, list_find have all had the address positions moved in some way

before const Code - 122 inc,data 14 RO - 0 RW - 40 ZI - 40 debug = 3489 main.o

after const. code - 122 data -14 RO -40 RW-0 ZI-40 debug 3493 main.o

RO, read only now is logically 40, and RW is no longer 40 as it is now const. debug also appears to have changed for some reason

2640142S EMAIL!!!!!