Add abort() for benefit of benchmark code
[riscv-tests.git] / debug / programs / step.S
1 // Test stepping over a variety of instructions.
2
3 .global main
4
5 main:
6 la t0, trap_entry // 0, 4
7 csrw mtvec, t0 // 0x8
8
9 li t0, 5 // 0xc
10 beq zero, zero, one // 0x10
11 nop // 0x14
12 one:
13 beq zero, t0, one // 0x18
14 // Use t0 instead of ra to force a 32-bit opcode in C mode. Otherwise
15 // 32-bit and 64-bit binaries end up with different instructions (I
16 // didn't pursue this).
17 jal t0, two // 0x1c
18
19 three:
20 .word 0 // 0x20
21 nop // 0x24
22
23 two:
24 jr t0 // 0x28
25
26 .align 2
27 trap_entry:
28 j trap_entry // 0x2c