Add ES/Lab/LAB4/BCDtoHEX.asm
This commit is contained in:
parent
e23eac9996
commit
f13066ce58
1 changed files with 35 additions and 0 deletions
35
ES/Lab/LAB4/BCDtoHEX.asm
Normal file
35
ES/Lab/LAB4/BCDtoHEX.asm
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
AREA RESET, DATA, READONLY
|
||||||
|
EXPORT __Vectors
|
||||||
|
__Vectors
|
||||||
|
DCD 0x10001000
|
||||||
|
DCD Reset_Handler
|
||||||
|
ALIGN
|
||||||
|
|
||||||
|
AREA MYCODE, CODE, READONLY
|
||||||
|
ENTRY
|
||||||
|
EXPORT Reset_Handler
|
||||||
|
|
||||||
|
Reset_Handler
|
||||||
|
LDR R0, =SRR
|
||||||
|
MOV R10, #3
|
||||||
|
LDR R1, [R0]
|
||||||
|
MOV R2, #1
|
||||||
|
|
||||||
|
UP
|
||||||
|
AND R3, R1, #0x0F
|
||||||
|
MLA R4, R2, R3, R4
|
||||||
|
LSR R1, #4
|
||||||
|
MOV R5, #0x0A
|
||||||
|
MUL R2, R5
|
||||||
|
SUBS R10, #1
|
||||||
|
BNE UP
|
||||||
|
|
||||||
|
STOP
|
||||||
|
B STOP
|
||||||
|
|
||||||
|
SRR DCD 0x45
|
||||||
|
|
||||||
|
AREA mydata, DATA, READWRITE
|
||||||
|
SRC DCD 0x45
|
||||||
|
|
||||||
|
END
|
Loading…
Add table
Add a link
Reference in a new issue