[Unix-jun72] status on disassembler

Tim Newsham newsham at lava.net
Tue May 20 15:49:09 EDT 2008


> My first approach to "temporary labels" (1f/1b, see Knuth) failed badly;
> if anyone has insights on how such things should be disassembled,
> please tell me; I'm still mentally going through various possible
> algorithms.

This is a standard register allocation problem (ie. assigning registers to 
variables when compiling a program).  You need to figure out over which 
ranges of the program the labels are "live".  Then you need to figure out 
which ones are live at the same time and build a graph of which labels 
cannot share the same label.  Then you go through and start assigning 
labels in a way that fits this constraint.

http://en.wikipedia.org/wiki/Register_allocation
http://en.wikipedia.org/wiki/Graph_coloring

Should be covered in compilers text books.

>   Doug

Tim Newsham
http://www.thenewsh.com/~newsham/



More information about the Unix-jun72 mailing list