GARTHWILSON wrote:
or putting a B after the 0's and 1's, as in ORA #00011100B, as a couple of assemblers I've used do. 0b and 0x are C language and its derivatives. It is apparently common for assemblers to accept multiple methods of specifying base.
Indeed. I ran into this recently when discussing base specification and symbol names with some MSX folks, as I was wanting to use the Motorola convention (
$nn) for hex numbers rather than the Intel (
0nnh).*
I was informed that many (most?) MSX assemblers do accept both, that it's not uncommon for MSX programmers to use the Motorola convention, and that there aren't really any technical issues with this. It's even safe to accept tokens matching
[A-F][0-9A-F]*h; you just try looking them up in the symbol table first and, if they're not there, you interpret them as a constant. Apparently experience has shown the theoretical conflicts in this scheme cause no serious problems in practice.
___________________
* I had technical reasons for this: I wanted to be able easily to use the same data files included in both 6502/6800 and 8080/Z80 assembly source files. That of course does not change the incontrovertable fact that the Intel convention is morally wrong, a Sin Against God, people who prefer it are evil, it will bring about the collapse of civilisation, etc. etc.