Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 1.42 KB

IR2ARM.md

File metadata and controls

29 lines (28 loc) · 1.42 KB
中间代码 ARM指令
LABEL x: x
x := #k mov reg(x), #k
x := y mov reg(x), reg(y)
x := y + #k add reg(x), reg(y), #k
x := y + z add reg(x), reg(y), reg(z)
x := y - #k sub reg(x), reg(y), #k
x := y - z sub reg(x), reg(y), reg(z)
x := y *z mul reg(x), reg(y), reg(z)
x := y / z div reg(x), reg(y), reg(z)
x := *y ldr reg(x), [reg(y)]
*x = y str reg(y), [reg(x)]
GOTO x B x
x := CALL f BL f
mov reg(x), r0
RETURN x mov pc, lr
IF x == y GOTO z cmp reg(x), reg(y)
beq z
IF x != y GOTO z cmp reg(x), reg(y)
bne z
IF x > y GOTO z cmp reg(x), reg(y)
bgt z
IF x < y GOTO z cmp reg(x), reg(y)
blt z
IF x >= y GOTO z cmp reg(x), reg(y)
bge z
IF x <= y GOTO z cmp reg(x), reg(y)
ble z
x := y % z div reg_tmp reg(y), reg(z)
mul reg_tmp0 reg_tmp0, reg(z)
sub reg(x), reg(y), reg_tmp0
FUNCTION f f
PARAM x