M80 : How to use decimal numbers with default radix set to 16 ?

59 views
Skip to first unread message

Peter Onion

unread,
Oct 24, 2025, 7:25:11 AM (11 days ago) Oct 24
to retro-comp
I'm using M80 with ".radix 16" as I'm converting some of the hex-machine code I've been writing into assembler source code.

I've run into a little problem to do with using decimal numbers.  In the M80 manual Section1-4 "Numeric Constants" is shows "nnnnD" as a way to force a decimal number, but (for example) 0100D is a valid hex number so the assembler produces "100Dh" not "96h".

I know I can use the hex values I need, but was there ever a fix or work around for this "feature interaction" ?

PeterO
 

Tom Storey

unread,
Oct 24, 2025, 3:15:11 PM (11 days ago) Oct 24
to Peter Onion, retro-comp
What happens if you leave off the leading zero?

i.e. 100D

With some assemblers I have worked with, a leading zero means "treat the following digits as something other than decimal".

--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/retro-comp/f3affbc7-3bdf-405c-bba9-2ff1d8bf1a89n%40googlegroups.com.

Peter Onion

unread,
Oct 24, 2025, 3:22:58 PM (11 days ago) Oct 24
to retro-comp
I've tried that, but no difference. :-(
PeterO

Jaap van Ganswijk

unread,
Oct 24, 2025, 5:43:40 PM (11 days ago) Oct 24
to Peter Onion, retro-comp
There are many ways to note non decimal numbers but I think you should use the C-standard. See Dennis and Richie. But when dumping memory you can't put 0x before every byte or word of course!


Peter Onion

unread,
Oct 24, 2025, 5:58:22 PM (11 days ago) Oct 24
to retro-comp
Just to be clear, I'm asking about how to use the Microsoft M80 assembler from 1979. I don't see any thing relevant to that in your answer.
PeterO

Douglas Miller

unread,
Oct 24, 2025, 5:59:11 PM (11 days ago) Oct 24
to retro-comp
I think this is just an oversight/bug in M80. The answer is probably to not use ".radix 16" and just be specific about your constants.

Since M80 pre-dates the popularity of C, it does not support C-style constants.
Reply all
Reply to author
Forward
0 new messages