#: 8975 S12/OS9/68000 (OSK)
31-Dec-90 20:44:50
Sb: #8966-#68000 ASM Language
Fm: Jack Crenshaw 72325,1327
To: Kevin Darling (UG Pres) 76703,4227 (X)
Kev, I remember a project at work on the Z8000, which has 16 general-purpose
registers. The program had to be super fast ... among other things, it had to
compute one sine, one cosine, an arctan, and a square root, in a millisecond.
So I had to write almost all in-line code, and keep everything possible in
registers. What an ordeal! Basically, I was doing global register
optimization by hand. Had to keep a map of what was in each register, and
deciding where to put the next item was like working out a chinese puzzle. It
sure would have been nice for me to have been able to identify the registers by
their contents, too.
Which brings me to a thought: You'd need error messages to tell you when
something's been overlaid, wouldn't you?
Well, I guess that would be taken care of by the assembler: If you declare a
variable x to be in D0, and then later declare it to be y, the assembler must
remove x from the symbol table. Unless, of course, you redeclare it as RAM.
Hm. Have to think about implementation on that one. I'd been thinking of a
syntax something like
assign x to d0
.
.
release d0
Perhaps I could set it up so that if there is an assignment x=d0 somewhere in
between, x would be automatically set to refer to the RAM variable rather than
the register. Sounds feasible.
Jack
There is 1 Reply.
|