Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Stack_Size EQU 0x00000400
- AREA STACK, NOINIT, READWRITE, ALIGN=3
- Stack_Mem SPACE Stack_Size
- __initial_sp
- Heap_Size EQU 0x00000200
- AREA HEAP, NOINIT, READWRITE, ALIGN=3
- __heap_base
- Heap_Mem SPACE Heap_Size
- __heap_limit
- AREA RESET, DATA, READONLY
- EXPORT __Vectors
- __Vectors DCD __initial_sp ; Top of Stack
- DCD Reset_Handler ; Reset Handler
- __Vectors_End
- AREA |.data|, DATA, NOINIT, READWRITE
- input_vars
- s DCD 0x0
- t DCD 0x0
- u DCD 0x0
- v DCD 0x0
- h DCD 0x0
- output_vars
- lx DCD 0x0
- hx DCD 0x0
- y DCD 0x0
- z DCD 0x0
- AREA |.text|, CODE, READONLY
- Const_c DCD 2 ;Constant in memory
- Const_e DCD 7 ;Constant in memory
- main PROC
- MOV R0, #15
- CONST_A EQU -10 ;Macro constant
- CONST_B EQU 3 ;Macro constant
- MOV R0, #CONST_A ;R0 = CONST_A = a
- MOV R1, #CONST_B ;R1 = CONST_B = b
- ADD R2, R0, R1 ;R2 = R0 + R1 = CONST_A + CONST_B
- BX LR
- ENDP
- LDR R4, =Const_c ;R4 = &Const_c
- LDR R2, [R4] ;R2 = *(R4) =Const_c
- LDR R3, =Const_e ;R3 = &Const_e
- LDR R3, [R3] ;R3 = *(&Const_e) = Const_e
- Reset_Handler PROC
- EXPORT Reset_Handler [WEAK]
- BL main
- B Reset_Handler
- ENDP
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement