Skip to content

Commit

Permalink
Some more style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mauri870 committed Dec 14, 2017
1 parent 61d5a17 commit 3de2248
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
22 changes: 11 additions & 11 deletions src/ok01/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@; A simple program to turn on the OK/ACT LED on Raspberry Pi 3
@;

.global _start @; define _start label globally available for the linker
.global _start @; define _start label globally available for the linker

.section .text
_start:
Expand All @@ -21,17 +21,17 @@ _start:
b loop$

.section .data
.align 4 @; last 4 bits of the next label set to 0 (16-byte alligned)
.align 4 @; last 4 bits of the next label set to 0 (16-byte alligned)
message:
.int size @; message header contains the size of the message
.int 0 @; request code 0
.int size @; message header contains the size of the message
.int 0 @; request code 0

.int 0x00038041 @; header tag ID
.int 8 @; size of tag data
.int 0 @; request/response size
.int 0x00038041 @; header tag ID
.int 8 @; size of tag data
.int 0 @; request/response size

.int 130 @; pin number
.int 1 @; pin state
.int 0 @; signal the GPU that the message is over
.int 130 @; pin number
.int 1 @; pin state
.int 0 @; signal the GPU that the message is over
size:
.int . - message @; size of the message
.int . - message @; size of the message
32 changes: 16 additions & 16 deletions src/ok02/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@; A simple program to blink the OK/ACT LED on Raspberry Pi 3
@;

.global _start @; define _start label globally available for the linker
.global _start @; define _start label globally available for the linker

.section .text
_start:
Expand All @@ -25,12 +25,12 @@ _start:
b loop$ @; branch to main loop$

delay:
mov r0, #0xF0000 @; start counter with a large value
mov r0, #0xF0000 @; start counter with a large value
delay1$:
sub r0, #1 @; subtract 1 from the counter
cmp r0, #0 @; check if counter reaches zero
bne delay1$ @; if not, branch to the delay1$ label
mov pc, lr @; return
sub r0, #1 @; subtract 1 from the counter
cmp r0, #0 @; check if counter reaches zero
bne delay1$ @; if not, branch to the delay1$ label
mov pc, lr @; return

set_led_state:
push {lr} @; save address the function should return to
Expand Down Expand Up @@ -59,17 +59,17 @@ mailbox_write:
mov pc, lr @; return

.section .data
.align 4 @; last 4 bits of the next label set to 0 (16-byte alligned)
.align 4 @; last 4 bits of the next label set to 0 (16-byte alligned)
message:
.int size @; message header contains the size of the message
.int 0 @; request code 0
.int size @; message header contains the size of the message
.int 0 @; request code 0

.int 0x00038041 @; header tag ID
.int 8 @; size of tag data
.int 0 @; request/response size
.int 0x00038041 @; header tag ID
.int 8 @; size of tag data
.int 0 @; request/response size

.int 130 @; pin number
.int 1 @; pin state
.int 0 @; signal the GPU that the message is over
.int 130 @; pin number
.int 1 @; pin state
.int 0 @; signal the GPU that the message is over
size:
.int . - message @; size of the message
.int . - message @; size of the message

0 comments on commit 3de2248

Please sign in to comment.