Thursday, June 22, 2006

Assembling the knights

Today I "learned" X86 assembly language. I am studying X86 to see how I must insert xor instructions in order to eliminate phi functions. This program here, for example, prints "Black knight" if the number of command line arguments is exactly 2, and prints "White knight" otherwise. The pointer to the string that must be printed, and the string size, are stored in registers. Xor instructions are used to eliminate the phi function in edge B2-B3, and move instructions are used to eliminate the phi function in edge B1-B3.

0 Comments:

Post a Comment

<< Home