Rars1_5 "Store address not aligned to word boundary"

156 Views Asked by At

so as you see from the title im facing a problem where i use the sw command to initialize a "dummys" data to 0 so i can store letter something else. This is my code, i also used sb but i got the "out of range" error.

main:
            addi a7,x0,9  # Direction to ecall for memory allocation
            addi a0,x0,8  # a0 specifies size for allocation
            ecall
            # a7 contains the pointer to newly allocated Memory
            sw x0,0(a7) # dummy's data = zero
            sw x0,4(a7) # dummy's pointer = zero

im using .align 2 before main, can anybody tell me why im getting this error?

0

There are 0 best solutions below