On 1/8/2017 9:10 PM, Brent Hilpert wrote:
OK, what was the standard (if there was one)
number-base syntax for PDP-11 assembler?
Despite all the PDP-11 assembly info on web sites, this seems to be a buried bit of
info.
One assembler doc uses a prefix of "&o", another specifies octal as default
and prefix of zero for decimal (opposite of the common C-derived standard . . great).
Is this for example standard?:
BIT #&o200, @#&o177564 ; test 2^7 bit at address octal 177564
(I'm just trying to make some written commentary consistent with common policy.)
MACRO11 Language Manual v5.5 section 6.4
All numbers are octal radix, unless the default radix is changed via the .RADIX
N directive (N can be 2, 8, 10, or 16). N blank resets the radix to octal.
So 0100, 100 would be octal 100, decimal value 64.
Any number followed by a period (decimal point) is forced to be base 10.
So 100. would be decimal 100, octal 144.
Prefix operators ^B (binary), ^O (octal), ^D (decimal), ^X (hexadecimal) force
the following digits/characters to the designated radix.
So ^B101000 == ^O50 == ^D40 == ^X28 all represent the same value (decimal 40.)
irrespective of the current .RADIX N setting.