Skip to content

Commit 1fcb941

Browse files
committed
Updated the addressing commands for Chapter 4
1 parent fa22481 commit 1fcb941

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Chapter 4/printdword.s

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ _start: MOV X4, #0x6E3A
1818
MOVK X4, #0xFEDC, LSL #32
1919
MOVK X4, #0x1234, LSL #48
2020

21-
adrp X1, hexstr@GOTPAGE // start of string
22-
// add X1, X1, hexstr@GOTPAGEOFF
21+
ADRP X1, hexstr@PAGE // start of string
22+
ADD X1, X1, hexstr@PAGEOFF
2323
ADD X1, X1, #17 // start at least sig digit
2424
// The loop is FOR W5 = 16 TO 1 STEP -1
2525
MOV W5, #16 // 16 digits to print
@@ -44,7 +44,8 @@ cont: // end if
4444
// Setup the parameters to print our hex number
4545
// and then call Linux to do it.
4646
MOV X0, #1 // 1 = StdOut
47-
adrp X1, hexstr@GOTPAGE // start of string
47+
ADRP X1, hexstr@PAGE // start of string
48+
ADD X1, X1, hexstr@PAGEOFF
4849
MOV X2, #19 // length of our string
4950
MOV X16, #4 // linux write system call
5051
SVC #0x80 // Call linux to output the string

0 commit comments

Comments
 (0)