From 375dff6a3a83c794b399f3d6a077d9691995748e Mon Sep 17 00:00:00 2001 From: LinuxerFlying Date: Sun, 1 Mar 2020 16:27:35 +0800 Subject: [PATCH] fix compile error for store-ele. --- chapter3/code/store-ele/store-ele.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter3/code/store-ele/store-ele.s b/chapter3/code/store-ele/store-ele.s index 13440203..3b6b3f03 100644 --- a/chapter3/code/store-ele/store-ele.s +++ b/chapter3/code/store-ele/store-ele.s @@ -15,7 +15,8 @@ store_ele: addq %rsi, %rdi # t3 = i*65 addq %rax, %rdi # t3 = i*65 + j*13 addq %rdi, %rdx # t4 = i*65 + j*13 + k - movq A(,%rdx,8), %rax # t1 = *(A + 8*t4) + leaq A(%rip), %rax # calculate A PIC code + movq (%rax, %rdx, 8), %rax # t1 = *(A + 8*t4) movq %rax, (%rcx) # *dest = t1 movl $3640, %eax # return 3640 ret