Skip to content

Commit 94e7263

Browse files
committed
Initialize X1 to destination
1 parent 4bbbc0b commit 94e7263

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Chapter 04/printdword.s

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ _start: MOV X4, #0x6E3A
1818
MOVK X4, #0xFEDC, LSL #32
1919
MOVK X4, #0x1234, LSL #48
2020

21+
// Set X1 to the end of the destination
22+
ADRP X1, hexstr@PAGE
23+
ADD X1, X1, hexstr@PAGEOFF
24+
ADD X1, X1, #17
25+
2126
// The loop is FOR W5 = 16 TO 1 STEP -1
2227
MOV W5, #16 // 16 digits to print
2328
loop: AND W6, W4, #0xf // mask of least sig digit

0 commit comments

Comments
 (0)