From f4db32b3c103804944d1ab9b296096ac9047b7d6 Mon Sep 17 00:00:00 2001 From: Angelo Jacobo Date: Sun, 22 May 2022 23:53:34 +0800 Subject: [PATCH] fixed local to relative addressing --- extra/lhu.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/lhu.s b/extra/lhu.s index 3ab1620..623e561 100644 --- a/extra/lhu.s +++ b/extra/lhu.s @@ -16,7 +16,8 @@ _start: .global _start main: ### TEST CODE STARTS HERE ### # load halfword unsigned with zero imm - li x1, 0x1008 # set x1 to 0x1008 + lla x1, data # set x1 to data + addi x1,x1, 8 # set x1 to data + 8 lhu x2, 0(x1) # load halfword from address 0x1008 to x2, x2=0x00005577 # load halfword unsigned with positive imm