home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 405.lha / AppleII_Emulators_src / src-2 / cpu_flags.c < prev    next >
C/C++ Source or Header  |  1990-06-28  |  935b  |  59 lines

  1. #include <cpu_prog_model.h>
  2. #include <cpu6502_addrm.h>
  3.  
  4. #define FALSE  0
  5. #define TRUE   1
  6.  
  7. #define Process_status( code)                        \
  8.    code->Ne << 6 | code->Ov << 5 | code->Br << 4 |   \
  9.    code->De << 3 | code->In << 2 | code->Ze << 1 |   \
  10.    code->Ca
  11.  
  12. void reg_dump( code)
  13. PM *code;
  14. {
  15.    printf(" A=%02x X=%02x Y=%02x P=%02x S=%02x\n", code->Ac,
  16.                                                    code->Xr,
  17.                                                    code->Yr,
  18.                                                    Process_status(code),
  19.                                                    code->SP );
  20. }
  21.  
  22.  
  23. void CLC( code)
  24. PM *code;
  25. {
  26.    code->Ca = FALSE;
  27. }
  28.  
  29. void CLD( code)
  30. PM *code;
  31. {
  32.    code->De = FALSE;
  33. }
  34.  
  35. void CLI( code)
  36. PM *code;
  37. {
  38.    code->In = FALSE;
  39. }
  40.  
  41. void CLV( code)
  42. PM *code;
  43. {
  44.    code->Ov = FALSE;
  45. }
  46.  
  47. void SEC( code)
  48. PM *code;
  49. {
  50.    code->Ca = TRUE;
  51. }
  52.  
  53. void SEI( code)
  54. PM *code;
  55. {
  56.    code->In = TRUE;
  57. }
  58.  
  59.