summaryrefslogtreecommitdiff
path: root/riscv/sections/sections.s
blob: 8e83ec184e13851ef502bc37b06cecd978a705fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Messing up with ASM sections

.section .data
	x: .word 10

.section .text
	update_x:
		la t1, x
		sw a0, (t1)
		ret

# We can mix sections in different parts of the source
# The assembler will take care of merging them together in
# the object file

.section .data
	y: .word 99

.section .text
	update_y:
		la t1, y
		sw a0, (t1)
		ret