[A83] Re: Hex in Ion


[Prev][Next][Index][Thread]

[A83] Re: Hex in Ion






Aaron Fineman wrote:

> In the below program, my compiler doesn't like the hex tokens. (BF,20,etc...) Anyone know why?

Hex constants which begin with a letter must be prefixed with either a zero or '$.. Hex constants
consisting only of numbers must be prefixed by a '$' or have a 'h' appended to them:

ie:

1234h, $1234
$DF, 0DF

It is good practise to prefix all hex digits with a '$', regardless of wether they need it, since
it makes your program clearer.

Also note that every hex constant in a .DB directive should be prefixed, not just the first. So
".DB $BB,6D" should become ".DB $BB,$6D". Although the former should still work (since the first
digit of 6D is a number), the latter makes your intention much clearer.





References: