257,263c257,259
< def format Load(memacc_code, ea_code={{EA = Rs1 + offset;}}, mem_flags=[],
< inst_flags=[]) {{
< offset_code = """
< offset = IMM12;
< if (IMMSIGN > 0)
< offset |= ~((uint64_t)0xFFF);
< """
---
> def format Load(memacc_code, ea_code = {{EA = Rs1 + offset;}},
> offset_code={{offset = sext<12>(IMM12);}},
> mem_flags=[], inst_flags=[]) {{
269,275c265,267
< def format Store(memacc_code, ea_code={{EA = Rs1 + offset;}}, mem_flags=[],
< inst_flags=[]) {{
< offset_code = """
< offset = IMM5 | (IMM7 << 5);
< if (IMMSIGN > 0)
< offset |= ~((uint64_t)0xFFF);
< """
---
> def format Store(memacc_code, ea_code={{EA = Rs1 + offset;}},
> offset_code={{offset = sext<12>(IMM5 | (IMM7 << 5));}},
> mem_flags=[], inst_flags=[]) {{