Skip to content

Commit daf4340

Browse files
authored
Merge pull request below#53 from fyellin/main
Initialize X1 to destination
2 parents cd0f37c + 94e7263 commit daf4340

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Chapter 04/printdword.s

Lines changed: 5 additions & 0 deletions
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)