h a l f b a k e r yWhy not imagine it in a way that works?
add, search, annotate, link, view, overview, recent, by name, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
By using macros to substitute descriptive names for register names, an assembler could determine when each named value was needed and when it could be discarded to allow another named value to be stored there.
This would allow assemblers to optimize register allocations, and perhaps other aspects
of the code. The programmer would use the macros to tell the assembler his preferred registers for each value, with the expectation that the assembler might have a better choice after its analysis of the code. He would also have an easier time of keeping track of the values he's working with. Something like this:
NormalBakingTime TEXTEQU <40>
BakingTime TEXTEQU <ecx>
mov BakingTime, NormalBakingTime ; Load normal baking time
shr BakingTime, 1 ; Divide baking time in half
Edit: Fixed sample code.
Please log in.
If you're not logged in,
you can see what this page
looks like, but you will
not be able to add anything.
Annotation:
|
|
Baked. The assembler for the DEC LSI-11 bitslice CPU can do this. |
|
|
Probably not WKTE any more though, as the number of programmers who remember LSI-11s diminishes year by year ... |
|
|
Old programmers never forget - they just decompile ... |
|
| |