separate .text and .data for instruction and data memory

This commit is contained in:
2020-11-10 00:19:42 -07:00
parent 32d0a2dcaa
commit caf9a6f4f7
4 changed files with 74 additions and 10 deletions

View File

@ -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