I have to translate this C code to assembly code:

 #include &lt;stdio.h&gt;

 int main(){

 int a, b,c;
 scanf("%d",&amp;a);
 scanf("%d",&amp;b);
 if (a == b){
   b++;
 } 
 if (a &gt; b){
  c = a;
  a = b;
  b = c;    
 }
 printf("%d\n",b-a);
 return 0;
 }  


My code is below, and incomplete.

    rdint %eax        # reading a
    rdint %ebx        # reading b
    irmovl $1, %edi

    subl %eax,%ebx
    addl %ebx, %edi
    je Equal


    irmov1 %eax, %efx  #flagged as invalid line
    irmov1 %ebx, %egx
    irmov1 %ecx, %ehx
    irmovl $0, %eax
    irmovl $0, %ebx
    irmovl $0, %ecx

    addl %eax, %efx    #flagged as invalid line
    addl %ebx, %egx
    addl %ecx, %ehx



    halt


Basically I think it is mostly done, but I have commented next to two lines flagged as invalid when I try to run it, but I'm not sure why they are invalid.  I'm also not sure how to do an if statment for  a > b.  I could use any suggestions from people who know about y86 assembly language.


Question: How to remove color cast from HSV information
Answer: It is not necessary that your device's color mismatch can be corrected with a simple shifting of the Hue component (except of course if you are absolutely sure that this is the case with your equipment).

In general, to correct the response of the device you somehow need to recover the mapping that it already performs between reference and observed colors and then see how it can be corrected by some curve (monotonic or not). 

For this purpose you will need a colour chart (and ideally, an instrument such as this one).

(Please note that it is best that this correction is applied at the system level, i.e. your application will still be sending some "color demand" normally, without correcting it but that demand would undergo some correction prior to display automatically by the system.)

At the very basic level, you can send a simple reference image to your display and then try to adjust its R,G,B settings (if there are any) so that the colours seem to display properly (according to your eyes that is)

If you have a system that is not capable of applying such profiles but you still must apply some color-correction you could try matching the relative distances of the colours with a known target (or image in your case) and then (if required) try to correct towards absolute colours by shifting (with trial and error). 

Take an evenly lit image of the colour chart with a good digital camera, color correct it (to reduce any effects of the lighting or sensor used to acquire your "reference" image) and feed it to your display. Take an image of the display (ideally in the same lighting conditions), apply the same color correction with the profile from the first step (and for the same reasons) and then examine the relative color correspondence between any two colors from the color chart image and two colors from the color chart display image to recover the mapping. (A piece of software that might be of help in this process is LPROF)