annotate lab4/fixup.s @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
rev   line source
0
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
1 @ fixup.s
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
2
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
3 @ "set reg, #val" is a synonym for a PC-relative load instruction. The same
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
4 @ goes for the conditional versions seths and seteq, which are used in the
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
5 @ Lab 4 compiler to translate runtime checks.
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
6
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
7 .macro set, reg, val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
8 ldr \reg, =\val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
9 .endm
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
10
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
11 .macro seths, reg, val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
12 ldrhs \reg, =\val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
13 .endm
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
14
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
15 .macro seteq, reg, val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
16 ldreq \reg, =\val
Mike Spivey <mike@cs.ox.ac.uk>
parents:
diff changeset
17 .endm