Professional Documents
Culture Documents
Sorting Program
RCC_APB2ENR
GPIOE_CRH
GPIOE_ODR
EQU
EQU
EQU
0x40021018
0x40011804
0x4001180c
0x20000200
Reset_Handler
;<------------------------
DCB
DCB
0x12,0x34,0x56,0x78,0x21,0x43,0x65,0x87
0x93,0x39,0x05,0x50,0x75,0x57,0x21,0x81
Add
ress
Opera
nd
Instr
uctio
n
Just
prior
to BL
Result/Explanation.
Ie After instruction execution
R0 =0x00000034
R1 =0x00000021
R2 =0x2000000C
R3 =0x2000000D
LR =0xFFFFFFFF
SP =0x20000200
LR =0x0800001D
BL
Move
PUS SP = 0x200001F0
H
Contents of memory at SP =
{R0R3}
MOV Here the contents from the first table Tb1(in the read
etc
only area) is transferred 4 bytes (32 bits) at a time
(total 4 times, for 16 bytes) to a read/write area of
memory predefined as Tb2
Prior R0 =0x81215775
to
R1 =0x080000B0
POP R2 =0x20000010
R3 =0x00000004
LR =0x0800001D
SP =0x200001F0
POP R0 =0x00000093
{R0- R1 =0x00000005
R3}
R2 =0x20000000
R3 =0x20000001
LR =0x0800001D
SP =0x20000200
BX
Branching to the link register to go back from the
LR
Next
MoveData subroutine
Next, we added our own subroutine to sort the data
Period: 376us
Offtime:740ns
Ontime : 376us-740ns= 375us approximately
S32312504_EEET2096_LAB2.pdf
Time taken for 1 loop is 1563ns ( =375us/(15*16)).