We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7f99f6 commit 9590757Copy full SHA for 9590757
samples/asmhello/asmhello.S
@@ -26,11 +26,13 @@ app_entry:
26
ldr r3, [r0, #8]
27
// Set up file handle
28
movs r0, #1
29
- // Set up data pointer
+ // Get address of string
30
ldr r1, =message
31
- // Set up data length
+ // Get address of data length
32
ldr r4, =message_len
33
- ldr r2, [r4]
+ // Read data length (might not be aligned, as it follows the string, so only
34
+ // read one byte)
35
+ ldrb r2, [r4]
36
// Call write function
37
blx r3
38
// Set return value
@@ -55,6 +57,6 @@ message:
55
57
// Must come immediately after `message:`
56
58
.type message_len,%object
59
message_len:
-.long . - message
60
+.byte . - message
61
62
// End of file
0 commit comments