| The way I handle this situation is something like this:
.PSECT DATA,.....
VARIABLE:: .BLKL 256. ;Data area
JUNK:: .LONG 0
.PSECT CODE,.....
.
.
MOVAL VARIABLE, R5 ;Put starting address in R5
MOVL JUNK, 12(R5) ;Move JUNK to VARIABLE+12
Hope this answers your question.
|
| That's pretty much what I'm doing, but my question was if there's
any way to say "base_addr" or "start" instead of "R7". I learned
back in my TOPS-20 days that doing that is a much more readable
form of doing exactly the same thing, and now I'm in VMSland and
wanted to use my old coding practices. Thanks anyhoo.
And BTW, why the 2 colons after the labels?
|
| re: -1
Yeah, I seem to remember that the string %r (where r is the register
number, e.g. %5) was the "real" symbol for a register. The assembler (RSX)
did the old: R0 == %0
.
.
R5 == %5
SP == %6
PC == %7
for you. I have never tried this on a VAX. Now I understand what .0
meant by "aliasing". But hey, for a real challenge, try to emulate the
DECsystem 10/20 SKIP instructions! Ha, ha!
|
| Dejavu city ! I wanted to do *exactly* the same thing.
I was implementing a bunch of routines in macro. For instance, one
called
MACRO_DEVICELOCK
This routine takes a bunch of input parameters in registers, which is
an efficient interface. The parameters are known as
LOCKADDR, SAVIPL, CONDITION
The code is much less readable if it says R1 all over the place instead
of LOCKADDR, R2 instead of SAVIPL etc.
I implemented a macro call PARAMS. So I start my routine with
MACRO_DEVICELOCK::
PARAMS LOCKADDR, SAVIPL, CONDITION
So, if there were a way to assign the name LOCKADDR to R1, SAVIPL, to R2,
CONDITION to R3, I'd design the PARAMS macro to do that.
But, as you say, there doesn't seem to be.
So, I've settled for next best, which is, I pass the parameters on the stack
instead. The PARAMS macro defines LOCKADDR as 4, SAVIPL as 8, CONDITION
as 12.
My routines all start out like the DEVICE_LOCK one, like this:
MACRO_DEVICELOCK::
PARAMS LOCKADDR, SAVIPL, CONDITION
MOVAL SP, R1 ; Use R1 as access to params
...
MOVL SAVIPL(R1),R3 ; for example
So, to refer to a parameter, for instance SAVIPL, instead of just saying
"SAVIPL", I have to say "SAVIPL(R1)". Plus I need that one extra instruction
at the beginning of the routine.
I've found this to be second best to true register naming. Anyone like
this idea ? Or have a better idea ?
/Eric
p.s. The reason I just don't say "SAVIPL(SP)" is that sometimes things
are pushed on stack, which would screw up the offsets
|