w1.1_lab1.1
This commit is contained in:
33
lab1.1/main.asm
Normal file
33
lab1.1/main.asm
Normal file
@@ -0,0 +1,33 @@
|
||||
@ this code produces the same binary as listing 1
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m4
|
||||
.thumb
|
||||
.text
|
||||
.global main
|
||||
main:
|
||||
MOVS.N R0, #8
|
||||
LDR.N R1, =0X40023830
|
||||
STR.N R0, [R1, #0]
|
||||
|
||||
MOVS.N R0, #0X55
|
||||
LSLS.N R0, R0, #24
|
||||
LDR.N R1, =0X40020C00
|
||||
STR.N R0, [R1, #0]
|
||||
|
||||
MOVS.N R0, #0
|
||||
LDR.N R1, =0X40020C14
|
||||
STR.N R0, [R1, #0]
|
||||
|
||||
MOVS.N R3, #15
|
||||
LSLS.N R3, R3, #12
|
||||
|
||||
loop:
|
||||
LDR.N R2, =0X00145854
|
||||
delay:
|
||||
SUBS.N R2, #1
|
||||
BNE.N delay
|
||||
updateLed:
|
||||
EORS.N R0, R3
|
||||
STR.N R0, [R1, #0]
|
||||
B.N loop
|
||||
Reference in New Issue
Block a user