Hex Constants

Top  Previous  Next

Integers can also be written in hexadecimal form. A hex number is an integer in base 16. Hex numbers are indicated by a dollar sign ($). They range from $0000 through $FFFF. Hex is very useful when programming at the machine level. Here are some examples:


        $123            $1e0

        $FFC0           $00ff


Note that both upper and lower case letters (A-F and a-f) can be used.