#include <stdio.h>
#include <stdlib.h>

int main () {
 /* Make this volatile, so that its initial value isn't cached in a register.
  */
 volatile int result = 0;

 printf ("enter 4 characters: ");
 fflush (stdout);

 /* Make these volatile, because the order is important. 
  */
 asm volatile ("leal %0,%%eax" : : "m" (result));

 asm volatile ("pushl $4 ; pushl %eax ; pushl $0 ; call read ;"
  "/*cleanup stack */ addl $12,%esp ;"
  "cmpl $4,%eax ; je valid ;"
  "call abort ;"
  "valid: ");

 printf ("%x\n", result);


 return EXIT_SUCCESS;
}
