Searching \ for 'Shortforms for radix specification?' in subject line. ()
Help us get a faster server
FAQ page: techref.massmind.org/techref/method/math/radixs.htm?key=radix
Search entire site for: 'Shortforms for radix specification?'.

Truncated match.
PICList Thread
'Shortforms for radix specification?'
1998\01\26@174125 by

In a program example I learned that a simple dot can be used as prefix for
decimal radix. Like:
ten  EQU  .10   ;Works OK

Are there such shortforms for other radix?
(I«m using MPLAB 3.30, and can only find clumsier things like d'157' for
decimal 157)

I«ve tried:
0b10111011 and 10111011b for specifying binary but I don«t work
0d10 and 10d for specifying decimal but I don«t work

Thanks in advance
/Morgan

Morgan Olsson, MORGANS REGLERTEKNIK, Sweden, ph: +46 (0)414 70741; fax 70331
============================================================================
> -----Original Message-----
> From: pic microcontroller discussion list
> [PICLISTMITVMA.MIT.EDU]On Behalf Of Morgan Olsson
> Sent: January 26, 1998 16:22
> To: PICLISTMITVMA.MIT.EDU
> Subject: Shortforms for radix specification?
>
>
> In a program example I learned that a simple dot can be used as prefix for
> decimal radix. Like:
> ten  EQU  .10   ;Works OK
>
> Are there such shortforms for other radix?
> (I4m using MPLAB 3.30, and can only find clumsier things like d'157' for
> decimal 157)
>
> I4ve tried:
> 0b10111011 and 10111011b for specifying binary but I don4t work
> 0d10 and 10d for specifying decimal but I don4t work

I beleive for binary one uses b'10111011'. As for the rest, I don't know
, I
usually set radix to decimal, use 0x for hex when I need it, and when I have
a different base I usually convert with my trusty calculator. Hope this
helps, TTYL
Morgan Olsson <PICLISTMITVMA.MIT.EDU> wrote:

> In a program example I learned that a simple dot can be used as
> prefix for decimal radix. Like:
>
>     ten  EQU  .10   ;Works OK
>
> Are there such shortforms for other radix? (I'm using MPLAB 3.30,
> and can only find clumsier things like d'157' for decimal 157)

Morgan:

Yes, there are...

Hexadecimal:

0xAB
0ABH (note that the first digit of the hex value must be
numeric; "ABH" won't work)

Binary:

10101010B (note that this only works if the default radix has
been set to something other than hexadecimal)

Octal:

I could tell you, but octal on an 8-bit processor is an
abomination before God, so I won't.

Many of us have wished for unambiguous radix specifiers (like a
preceding "%" for binary or "\$" for hexadecimal), but Microchip has
decided not to add them.

The bizarre, often-ambiguous trailing-B and trailing-H format is in
MPASM only to provide compatibility with Microchip's earlier
assemblers... Just as the PIC instruction-set mnemonics were
apparently developed by someone who'd never seen a microprocessor
before, that early assembler's radix-specifiers were apparently
chosen in an absolute vacuum.

-Andy

=== Andrew Warren - fastfwdix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499
At 15:30 1998-01-26 -0800, you wrote:
{Quote hidden}

Wonderful!:
Just to set default to decimal (and maybe use . as prefix for decimal)
Using 10110101B for binary (small b work too?)
and 0xADB for hex

I hope Microchip will listen to their users whishes about mnemonics etc soon.
...And will Microsoft listen to theirs for that matter...
...Does "Micro" mean ... ?  ;)
/Morgan .O
Morgan Olsson, MORGANS REGLERTEKNIK, Sweden, ph: +46 (0)414 70741; fax 70331
-

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...