
| Please Note |
| When entering values in any notation, it is not necessary to have a certain number of digits. E.g., (decimal) 00012 can be written 12. However, there are limits to the value that can be entered. JTT is predominantly 16-bit, so for each value entered, the minimum is 0 and the maximum 2^16 (i.e. a range of 0 to 65535 (decimal), $0 to $1111 1111 1111 1111 (binary) or 0x0 to 0xffff (hex). |
| Sometimes, for clarity, large decimal values are separated by series
of commas, and binary and hex values by spaces. However, it should be
noted that they should be typed without such spacers, as if a fluent
value, or the result will be a syntax error. Of course, decimal 00012 equals 12, whilst 12000 does not, since trailing digits denote ever increasing values. In the same way, remember that binary $001 equals $1 but not $100, and hex 0x0f equals 0xf but not 0xf0, for example. |
| Notation | Template | Example | Details |
| Decimal | 123 | This is the default, no symbol needed. | |
| Binary | $ |
$01011 | The dollar sign precedes binary values. |
| Hex | 0x |
0xff | '0x' precedes hex values. It is an old convention, used in many languages. |
| Dec. | Bin. | Dec. | Bin. | Dec. | Bin. | ||
| 0 | $0 | 15 | $1111 | 255 | $1111 1111 | ||
| 1 | $1 | 16 | $1 0000 | 512 | $10 0000 0000 | ||
| 2 | $10 | 31 | $1 1111 | 1024 | $100 0000 0000 | ||
| 3 | $11 | 32 | $10 0000 | 2048 | $1000 0000 0000 | ||
| 6 | $110 | 63 | $11 1111 | 4096 | $1 0000 0000 0000 | ||
| 7 | $111 | 64 | $100 0000 | 8192 | $10 0000 0000 0000 | ||
| 8 | $1000 | 127 | $111 1111 | 65535 | $1111 1111 1111 1111 |
| Dec. | Hex. | Dec. | Hex. | |
| 0 | 0x0 | 16 | 0x10 | |
| 1 | 0x1 | 17 | 0x11 | |
| 9 | 0x9 | 18 | 0x12 | |
| 10 | 0xa | 255 | 0xff | |
| 11 | 0xb | 256 | 0x1 00 | |
| 12 | 0xc | 4095 | 0xfff | |
| 13 | 0xd | 4096 | 0x10 00 | |
| 14 | 0xe | 65534 | 0xfffe | |
| 15 | 0xf | 65535 | 0xffff |
| Dec. | Bin. | Hex. | Dec. | Bin. | Hex. | |
| 0 | $0 | 0x0 | 63 | $11111 | 0x3f | |
| 1 | $1 | 0x1 | 64 | $100000 | 0x40 | |
| 2 | $10 | 0x2 | 255 | $1111111 | 0xff | |
| 7 | $111 | 0x7 | 256 | $10000000 | 0x100 | |
| 8 | $1000 | 0x8 | 4095 | $111111111111 | 0x3ff | |
| 15 | $1111 | 0xf | 8191 | $1111111111111 | 0x7ff | |
| 16 | $10000 | 0x10 | 16384 | $11111111111111 | 0xfff | |
| 31 | $11111 | 0x1f | 32767 | $111111111111111 | 0x7fff | |
| 32 | $10000 | 0x20 | 65535 | $1111111111111111 | 0xffff |
| Binary Value: | $11010111011110 | |
| Step 1: | Binary Group: | 0011 0101 1101 1110 |
| Step 2: | Equivalent Hex: | 3 5 d e |
| Step 3: | Hex Value: | 0x35de |
| Hex Value: | 0x35de | |
| Step 1: | Hex group: | 3 5 d e |
| Step 2: | Equivalent Binary: | 0011 0101 1101 1110 |
| Step 3: | Binary Value: | $11010111011110 |
| Addr | Dec. | Bin. | Hex. |
| A | 15 | $0000000000001111 | 0xf |
| B | 5 | $0000000000000101 | 0x5 |
| AB | 1,966,053 | $0000 0000 0000 1111 0000 0000 0000 0101 | 0xf005 |
|
You should note that, in the 16-bit to 32-bit conversion (i.e. both Words
and DWords), values are treated as binary and ALL 16 bits are taken into
account. These two values are then juxtaposed together to make the 32-bit
value. As a result, (decimal) 15+5 is not 20 as you would expect. Instead,
it is 1,966,053.
When dealing with 32-bit numbers, the number range obviously change. The range of acceptable values (excluding in twos-complement - see Section 3.7) are shown in the table below. The maximum values are split into groups for readability. |
| Notation | Min. | Maximum Range |
| Decimal | 0 | 4,294,967,295 |
| Binary | $0 | $1111 1111 1111 1111 1111 1111 1111 1111 |
| Hex. | 0x0 | 0xffff ffff |
| Dec. | Binary | Dec. | Binary | |
| 0 | $0000 0000 0000 0000 | -0 | $N/A | |
| 1 | $0000 0000 0000 0001 | -1 | $1111 1111 1111 1111 | |
| 2 | $0000 0000 0000 0010 | -2 | $1111 1111 1111 1110 | |
| 3 | $0000 0000 0000 0011 | -3 | $1111 1111 1111 1101 | |
| 4 | $0000 0000 0000 0100 | -4 | $1111 1111 1111 1100 | |
| ... | ... | ... | ... | |
| 65532 | $1111 1111 1111 1100 | -65532 | $0000 0000 0000 0100 | |
| 65533 | $1111 1111 1111 1101 | -65533 | $0000 0000 0000 0011 | |
| 65534 | $1111 1111 1111 1110 | -65534 | $0000 0000 0000 0010 | |
| 65535 | $1111 1111 1111 1111 | -65535 | $0000 0000 0000 0001 |
|
Each positive value (e.g. (decimal) 40) therefore has its relative negative
counterpart (e.g. (decimal) -40), which can be reached by the same two-point
rule.
Consider the rule. It can be seen in the table above that every negative number is the logical opposite (NOT) of its previous positive counterpart. For example, the binary representation of -4 is the NOT of +3, and -65534 is the NOT of +65533. Notice also that there are negative zero is not catered for, because it is addressed as positive zero. Therefore, -65535 minus 1 = +0. You can decide whether to treat a 32-bit value as 2s-comp or not within your JTT program by using or ignoring these protocols (and using your brain) accordingly. JTT itself is not capable of distinguishing between positive and negative values, and care should be taken to treat a value in the correct way (usually be employing use of the negative flag). |
| Please Note |
| Although JTT does not directly aware of the use of 2s-comp, flags 4-7 of the Status Word do cater for it indirectly, by assuming that the last result was to be used in a twos-complement arrangement by the user. |
| Out of interest, another way of performing 2s-complement is to decrement the value by 1 before performing logical-OR on each bit. |
![]() |
![]() |
![]() |
![]() |
![]() |