binutils-gdb/sim/testsuite/example-synacor/mem.s
Mike Frysinger 26da232cbd sim: example-synacor: a simple implementation for reference
Provide a simple example simulator for people porting to new targets
to use as a reference.  This one has the advantage of being used by
people and having a fun program available for it.

It doesn't require a special target -- the example simulators can be
built for any existing port.
2021-04-03 16:19:16 -04:00

26 lines
325 B
ArmAsm

# check the RMEM & WMEM insns.
# mach: example
.include "testutils.inc"
start
JMP 14
HALT
pass
# Read a constant address.
RMEM r0, 1
EQ r1, r0, 14
JF r1, 2
# Change the first JMP to skip HALT and hit the pass.
WMEM 1, 3
# Read an address in a register.
SET r2, 1
RMEM r0, r2
EQ r1, r0, 3
JF r1, 2
JMP 0