numeric - BCPL octal numerical constants -
i've been digging history of bcpl due question asked reasoning behind using prefix "0x" representation hexadecimal numbers.
in search stumbled upon explanation of history behind token. (why hexadecimal numbers prefixed 0x?)
from post, however, questions sparked:
for octal constants, did bcpl use 8 <digit>
(as per specs: http://cm.bell-labs.com/cm/cs/who/dmr/bcpl.pdf) or did use #<digit>
(as per http://rabbit.eng.miami.edu/info/bcpl_reference_manual.pdf) or both of these syntaxes valid in different implementations of language?
i've been able find second answer here used # syntax further intrigued me in subject. (why leading zeroes used represent octal numbers?)
any historical insights appreciated.
there many slight variations on syntax in bcpl.
for example, while 1 used had 16-bit cells (so x!y
gave 16-bit word word address @ x + y
(a word address being half of byte address), had need extract byte address , byte values (since creating os , control software on 6809 byte-addressable cpu).
hence in addition to:
x!y - word byte address (x + y) * 2
we had
x!%y - byte byte address (x * 2) + y x%!y - word byte address x + (y * 2) x%%y - byte byte address x + y
i'm pretty implementation-specific never saw them anywhere else. , bcpl around long before language standards important today.
the canonical language specification have been earlier 1 richards since wrote language (and second document essex bcpl implementation decade later). keep in mind project mac earliest iteration - there plenty of advancements after well.
for example, there's 2013 revision of bcpl user guide (see martin's home page) specifies #b
, #o
, #x
prefixes various non-decimal bases.
Comments
Post a Comment