Specifications
• Using the absolute address:
subprogram address "14D4"
• Using a positive hexadecimal offset relative to the entry point of Rerun:
subprogram "Rerun" offset "28"
• Using a negative hexadecimal offset relative to the entry point of Abandon:
subprogram "Abandon" offset "-CC"
Note that the sign, if used, is placed within the string quotes, not before the string.
Variables, registers, memory locations
Assertions can name H8/300 storage cells directly, without using a source-level symbolic
identifier. This is done by using the "address" keyword, followed by a quoted string that defines
the storage cell. The syntax is described in the table below. The syntax is not case-sensitive, so
"r4" is the same as "R4".
Table 5: Naming storage cells
Storage cell Syntax (without quotes) Example Meaning
Word register
R<number 0 .. 7>
R0
Word register R0.
Octet register
R<number 0 .. 7 ><L or H>
R4L
Low octet of R4.
Octet in memory
B<hex address>
B34a
Octet at memory address 34A hex.
Word in memory
W<hex address>
W12C4
Word at memory address 12C4 hex.
Octet parameter
PB<decimal offset>
PB3
Octet parameter in the stack, at an
address 3 octets higher than the
address of the stacked return address.
Word parameter
PW<decimal offset>
PW2
Word parameter in the stack, at an
address 2 octets higher than the
address of the stacked return address.
Octet local variable
LB<decimal offset>
LB1
Local octet in the stack, at at an address
1 (one) octets less than the address of
the stacked return address.
Word local variable
LW<decimal offset>
LW2
Local word in the stack, at an address 2
(two) octets less than the address of
the stacked return address.
Some examples of assertions on storage cells:
variable address "R3" 0 .. 100; -- Register R3 bounded.
variable address "r3" 0 .. 100; -- Same thing.
variable address "b3fa7" 20;
-- The octet at the nemory address hex 3FA7 (= decimal 16295)
-- has the value 20 (decimal).
14 Writing Assertions Bound-T for H8/300