------------ ------------------------------------------------------------

.RADIX selects the bas in which numbers without suffixes are assumed to be specified. For example,

```  .RADIX 16
```

selects base 16, or hexadecimal, as the default notation. The following code illustrates the effect of the .RADIX directive:

```.
.
.
mov    ax,100   ;=100h, or 256 decimal
.RADIX 10       ;select base 10, decimal, as the default
sub    ax,100   ;-100d decimal, result is 256 - 100 = 156 decimal
.RADIX 2        ;select base 2, binary, as the default
add    as,100   ;+100b, or 4 decimal, result is 156 + 6 = 160 decimal
.
.
.
```

.RADIX can select base 2, 8, 10, or 16 as the default. Incidentally, the operand to .RADIX is always decimal, no matter what default noation is selected; in other words, one .RADIX directive doesn't affect the notaion of the next .RADIX directive's operand.

There is a potential problem to consider when you use the .RADIX directive. No matter what default notation is selected, values specified with DD, DQ, and
DT are assumed to be decimal values unless a suffix is used. This means that in

```.
.
.
DD 1E7
.
.
.
```

1E7 is taken to be 1 times 10 to the seventh power, not 1E7h. In fact, you're best advised to place the h suffix on all hexadecimal values even after a .RADIX 16 directive. Why? Remember that b and d are valid suffixes, specifying binary and decimal notation, respectively. Unfortunately, b and d are also valid hexadecimal digits. If .RADIX 16 is in effect, what is Turbo Assembler to make of numbers like 129D and 101B?

As it happens, Turbo Assembler always pays attention to valid suffixes, so 129D is 129 decimal and 101B is 101 binary, or 5 decimal. What this means is that even when .RADIX 16 is in effect, any hexadecimal number ending in D or B must have an h suffix. Given that, it's simplest just to put h suffixes on all hexadecimal numbers, and given that, if becomes clear that, in general, it's not particularly useful to use .RADIX 16.

 file: /Techref/language/tasm/radix.htm, 2KB, , updated: 1999/4/21 08:22, local time: 2023/2/2 09:40, TOP NEW HELP FIND:  44.212.99.248:LOG IN

 ©2023 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?Please DO link to this page! Digg it! / MAKE! *** Your Title Here ***

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
 Did you find what you needed? "No. I'm looking for: " "No. Take me to the search page." "No. Take me to the top so I can drill down by catagory" "No. I'm willing to pay for help, please refer me to a qualified consultant"

.