Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
OK, we're here. Now what?

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.

user:
pass:
register,


     

Machine-Optimizable Assembler

Substitute descriptive names for register names
  (+3)
(+3)
  [vote for,
against]

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.

Alvin, Sep 05 2016

[link]






       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 ...
8th of 7, Sep 05 2016
  

       Old programmers never forget - they just decompile ...
8th of 7, Sep 05 2016
  
      
[annotate]
  


 

back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle