nsemu/test/test/test_simple_disas.S
rkx1209 cb6c19f046 Fixed determination logic of which x31 is 'Zero register' or 'Stack Pointer'
According to C6.1.3 Use of the stack pointer, X31 must be Stack pointer,
when Add/Sub, Logical with Imm and base index of address used by Load/Store.
2018-03-10 01:30:18 +09:00

20 lines
399 B
ArmAsm

.section .text, "e"
.global main
main:
eor x2, x2, x2
movz x1, 0xbeef
mov x2, x1
movk x2, 0xdead, lsl 16
sub x3, x1, #0x431 // x3 = 0xbabe
movk x4, 0xcafe, lsl 16 // x4 = 0xcafe0000
orr x3, x3, x4 // x3 = 0xcafebabe
cmp w9, 0
subs wzr, w9, #0
subs w31, w9, #0
cmp x9, 0
subs xzr, x9, #0
subs x31, x9, #0
//subs sp, x9, #0 assembler error!
sub sp, x9, #0
b main