Skip to content

Commit b4018eb

Browse files
committed
Updated comments
1 parent 1f56c11 commit b4018eb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

kernel.list

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Disassembly of section .init:
1010
800c: e5801004 str r1, [r0, #4]
1111
8010: e1a01121 lsr r1, r1, #2
1212

13-
00008014 <loop$>:
13+
00008014 <main$>:
1414
8014: e5801028 str r1, [r0, #40]
1515
8018: e3a0283f mov r2, #4128768 ; 0x3f0000
1616

@@ -25,5 +25,5 @@ Disassembly of section .init:
2525
8030: e2422001 sub r2, r2, #1 ; 0x1
2626
8034: e3520000 cmp r2, #0 ; 0x0
2727
8038: 1afffffc bne 8030 <wait2$>
28-
803c: eafffff4 b 8014 <loop$>
28+
803c: eafffff4 b 8014 <main$>
2929
8040: 20200000 .word 0x20200000

src/main.s

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,33 @@ mov r1,#1
1818
lsl r1,#18
1919
str r1,[r0,#4]
2020

21-
# Turn off (#40) the 16th pin (#16) of the GPIO to turn on the ACT LED.
21+
# Preselect the 16th pin (#16) of the GPIO to turn on/off the ACT LED.
2222
#mov r1,#1 // These two lines can be factorised in `lsr r1,#2`
2323
#lsl r1,#16 // since r1 currently contains 2^18
2424
lsr r1,#2
2525

26-
# Infinite loop
27-
loop$:
26+
# Main loop
27+
main$:
2828

29+
# Turn off (#40) the pin to turn on the ACT LED
2930
str r1,[r0,#40]
3031

32+
# Wait a few time
3133
mov r2,#0x3F0000
3234
wait1$:
3335
sub r2,#1
3436
cmp r2,#0
3537
bne wait1$
3638

39+
# Turn on (#28) the pin to turn off the ACT LED
3740
str r1,[r0,#28]
3841

42+
# Wait a few time
3943
mov r2,#0x3F0000
4044
wait2$:
4145
sub r2,#1
4246
cmp r2,#0
4347
bne wait2$
4448

45-
b loop$
49+
b main$
4650

0 commit comments

Comments
 (0)