separate .text and .data for instruction and data memory
This commit is contained in:
33
test/test.S
33
test/test.S
@ -1,4 +1,7 @@
|
||||
# NOTE: .text .data .bss must occur in that order
|
||||
|
||||
.global _start
|
||||
|
||||
.text
|
||||
_start:
|
||||
|
||||
@ -206,8 +209,31 @@ test9:
|
||||
j fail
|
||||
|
||||
test10:
|
||||
# now for some memory stuff
|
||||
# # sw
|
||||
# la x9, someint # x9 = start of .bss
|
||||
# li x10, 0x12345678 # x10 = 0x12345678
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# sw x10, 0(x9) # someint = 0x12345678
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# lw x11, 0(x9) # x11 = 0x12345678
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
# nop
|
||||
|
||||
|
||||
done:
|
||||
|
||||
# set registers to known values before loop
|
||||
addi x2, x0, 1 # x1 = 1
|
||||
addi x3, x0, 1 # x1 = 1
|
||||
@ -257,4 +283,11 @@ fail:
|
||||
nop
|
||||
nop
|
||||
|
||||
|
||||
.data
|
||||
someint:
|
||||
.word 0xfedcba98
|
||||
|
||||
.bss
|
||||
anotherint:
|
||||
.word
|
Reference in New Issue
Block a user