diff --git a/macros/README.md b/macros/README.md index 5e8591e..90e580f 100644 --- a/macros/README.md +++ b/macros/README.md @@ -209,3 +209,11 @@ on Mac versus Linux. To get the address of `errno` use: This macro makes the correct CRT call and leaves the address of `errno` in `x0`. + +## AASCIZ + +`AASCIZ label, string` + +This macro invokes `.asciz` with the string set to `string` and the +label set to `label`. In addition, this macro ensures that the string +begins on a 4-byte-aligned boundary. diff --git a/macros/README.pdf b/macros/README.pdf index dd12446..96e2e30 100644 Binary files a/macros/README.pdf and b/macros/README.pdf differ diff --git a/macros/apple-linux-convergence.S b/macros/apple-linux-convergence.S index f804854..c60d2da 100644 --- a/macros/apple-linux-convergence.S +++ b/macros/apple-linux-convergence.S @@ -144,3 +144,8 @@ main: cmp \src_a, \src_b csel \dest, \src_a, \src_b, GT .endm + +.macro AASCIZ label, string + .p2align 2 +\label: .asciz "\string" +.endm diff --git a/macros/minmax.S b/macros/minmax.S index d1f1563..07dff6f 100644 --- a/macros/minmax.S +++ b/macros/minmax.S @@ -86,11 +86,8 @@ PrintLegend: ret END_PROC - .p2align 2 -fmt: .asciz "Values to compare: %d and %d\n" - .p2align 2 -fmtgt: .asciz "Greater value is: %d\n" - .p2align 2 -fmtls: .asciz "Lesser value is: %d\n" + AASCIZ fmt, "Values to compare: %d and %d\n" + AASCIZ fmtgt, "Greater value is: %d\n" + AASCIZ fmtls, "Lesser value is: %d\n" .end diff --git a/more/apple_silicon/apple-linux-convergence.S b/more/apple_silicon/apple-linux-convergence.S index f804854..c60d2da 100644 --- a/more/apple_silicon/apple-linux-convergence.S +++ b/more/apple_silicon/apple-linux-convergence.S @@ -144,3 +144,8 @@ main: cmp \src_a, \src_b csel \dest, \src_a, \src_b, GT .endm + +.macro AASCIZ label, string + .p2align 2 +\label: .asciz "\string" +.endm diff --git a/python/apple-linux-convergence.S b/python/apple-linux-convergence.S index f804854..c60d2da 100644 --- a/python/apple-linux-convergence.S +++ b/python/apple-linux-convergence.S @@ -144,3 +144,8 @@ main: cmp \src_a, \src_b csel \dest, \src_a, \src_b, GT .endm + +.macro AASCIZ label, string + .p2align 2 +\label: .asciz "\string" +.endm diff --git a/section_1/hello_world/apple-linux-convergence.S b/section_1/hello_world/apple-linux-convergence.S index f804854..c60d2da 100644 --- a/section_1/hello_world/apple-linux-convergence.S +++ b/section_1/hello_world/apple-linux-convergence.S @@ -144,3 +144,8 @@ main: cmp \src_a, \src_b csel \dest, \src_a, \src_b, GT .endm + +.macro AASCIZ label, string + .p2align 2 +\label: .asciz "\string" +.endm diff --git a/section_2/float/apple-linux-convergence.S b/section_2/float/apple-linux-convergence.S index f804854..c60d2da 100644 --- a/section_2/float/apple-linux-convergence.S +++ b/section_2/float/apple-linux-convergence.S @@ -144,3 +144,8 @@ main: cmp \src_a, \src_b csel \dest, \src_a, \src_b, GT .endm + +.macro AASCIZ label, string + .p2align 2 +\label: .asciz "\string" +.endm