Skip to content

Commit aa0e729

Browse files
committed
aarch32: Use alias program counter for PC
1 parent 347ffec commit aa0e729

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

sys/aarch32/aarch32.vadl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ instruction set architecture AArch32v6 = {
3131
register R : Index -> Word // general purpose register file
3232

3333
[next next] // PC points to the end of the following instruction
34-
program counter PC : Addr // program counter TODO alias R(15)
35-
//alias program counter PC : Addr = R(15) // program counter
34+
alias program counter PC : Addr = R(15) // program counter
3635
alias register LR : Addr = R(14) // link register
3736
alias register SP : Addr = R(13) // stack pointer
3837

sys/aarch32/virt.vadl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ processor Virt implements A32 = {
1616
[ size : 0x08000000 ]
1717
memory region [ROM] FLASH in MEM = {
1818
// TODO: use this instead once mov instructions work
19-
//MEM<4>(0x0) := 0xe3a00101 // mov r0, 0x40000000
20-
//MEM<4>(0x4) := 0xe12fff10 // bx r0
19+
//MEM<4>(0x0) := 0xe3a0f101 // mov pc, #0x40000000
2120

22-
// branch currently only works with b and bx, not writes to r15
2321
MEM<4>(0x0) := 0xe0200000 // eor r0, r0, r0
24-
MEM<4>(0x4) := 0xe590000c // ldr r0, [r0, #12]
25-
MEM<4>(0x8) := 0xe12fff10 // bx r0
22+
MEM<4>(0x4) := 0xe590f00c // ldr pc, [r0, #12]
2623
MEM<4>(0xc) := 0x40000000 // target address
2724
}
2825

0 commit comments

Comments
 (0)