mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
26da232cbd
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.
26 lines
325 B
ArmAsm
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
|