Need documentation on 2500 A.D. Software 8051 Macro Assembler

Thread Starter

cmartinez

Joined Jan 17, 2007
8,765
Yeah, it doesn't look like a 'text substitution' macro was part of the standard 8051 assembler definition. Poking around I found these different ways of doing the same thing:
LIT is used by Kiel/Franklin et. al.
%DEFINE is used by Altium - note that the % has to be in column 1.
Kiel C uses the sfr construct which may or may not work in assembler:


Pretty sure that you'll need to use some text substitution facility at the preprocessor level since R5 is a SFR.

Sorry I don't have anything more specific. I've not used 8051 for a long time and when I did I used Keil and Archemedies.
Good luck.
Thank you so much for your help. Have a great 2017!
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,765
%DEFINE is used by Altium - note that the % has to be in column 1.
It seems that the compiler is accepting the %DEFINE directive. But if I use, for instance, either "%DEFINE ABC, DEF" or "%DEFINE ABC DEF" then the compiler reports an "***** ILLEGAL LABEL 1ST CHARACTER *****" error.

Would you happen to know the correct syntax?
 

JohnInTX

Joined Jun 26, 2012
4,787
Sorry, I don't. You wouldn't want quotes or the comma but beyond that, I don't know.
You say the compiler is accepting the DEFINE but it still throws an error at the first character. Maybe it doesn't accept define at all and is throwing out the entire line...

..and best wishes to you and yours for a great 2017 as well!
 

JohnInTX

Joined Jun 26, 2012
4,787
Is there a register definition header file or startup assembler file available to look at? Maybe see how they define the registers there.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,765
So I kept on searching using different keywords, and combinations (yeah... I'm that stubborn... but I like to call it perseverance :D) ... and browsed through Chinese websites and some long-forgotten FTP servers and extinct BBS mirror sites... until I finally found a very small word document in Russian (of all languages) that appeared to be a small synopsis of the original reference manual...

Within it I found this paragraph (translated using MS Translator) that hit the bulls eye right at ground zero of what I was looking for:

Code:
2500 A.D. Macro Assembler-21-
Version 4.02

LABEL: REG ARG
REGISTER

This directive allows the user to specify the name of the Register and name directly addressable bits. The name can have up to ten characters length. Register name is stored in a separate buffer so What character does not contain it and cannot be retrieved.

Table of registers is populated in the following order:
the first predefined register names;
second-user-defined register names;
some user-defined names.

Bits are defined as numbers or register bits are separated point as shown below. The number can be either absolute character values or their mixture. Maximum may be 512 defined registers. Some may register names used only once, however, registers can equated with other registers.

REG0: REG R4        ; Define REG0 register R4
Reg1: REG P3        ; Define REG1 port P3
REG2: REG REG1 REG2 ; REG2 equals REG1, which is the same as P3
BIT0: REG 20h.0     ; Define BIT0 for addressing bit #0 of memory byte #20H
BIT1: REG REG1.1    ; Define BIT1 bit 1 port 3
The holy grail instruction that I've been looking for is called REG! ... So I tested it with my compiler... and lo and behold!!!! it worked!... :) plus it also applies to naming BIT registers, which is something that I was also looking for....

This pretty much solves my original inquiry... but I'll still keep looking for the original user's manual... 'cause I'm that stubborn... :D

I've attached both the original document in Russian, and its translation into English.
 

Attachments

Top