home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TASMSWAN.ZIP / CFLAGS.C < prev    next >
Text File  |  1989-07-17  |  558b  |  34 lines

  1. /******************************************************************
  2. cflags.c
  3.     displays flags
  4.        NOTE: you must use the TCC comand-line compiler for this.
  5.           See book.
  6. ********/
  7.  
  8. #pragma inline
  9. #include <stdio.h>
  10.  
  11. void showflags();
  12.  
  13. main()
  14. {
  15.     showflags();
  16. }
  17.  
  18. void showflags()
  19. {
  20.     unsigned int theflags;
  21.  
  22.     printf("- - - - O D I T S Z - A - P - C\n");
  23.     asm    pushf
  24.     asm    pop    [theflags]
  25.     asm    mov    cx,16
  26. Again:
  27.     asm    rol    [Word ptr theflags],1
  28.     asm    push    cx
  29.     printf("%d ", (theflags & 1));
  30.     asm    pop    cx
  31.     asm    loop    Again
  32.     printf("\n");
  33. }
  34.