home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / MAGAZINE / NEWS / PCE021.ZIP / Pce021 / Src / cpu / s / compares < prev    next >
Text File  |  1998-01-31  |  940b  |  55 lines

  1. ;    compares.s
  2. ;    ----------
  3. ;    Comparison opcodes
  4.  
  5.  
  6.     GET    hdr.common
  7.     GET    hdr.memory
  8.     GET    hdr.addressing
  9.  
  10.  
  11.     GBLS    data1
  12.     GBLS    data2
  13.     GBLS    byte
  14.  
  15.  
  16. ;    Compare two bytes
  17.     MACRO
  18.     m_cmp    $cmp_reg1, $cmp_reg2
  19.     cmp    $cmp_reg1, $cmp_reg2
  20.     bic    r_p, r_p, #N_FLAG + Z_FLAG + C_FLAG
  21.     orrcs    r_p, r_p, #C_FLAG
  22.     orreq    r_p, r_p, #Z_FLAG
  23.     orrmi    r_p, r_p, #N_FLAG
  24.     MEND
  25.  
  26.  
  27.     AREA    |cpu$$opcodes|, CODE, READONLY
  28.  
  29.  
  30.     IMPORT    Read_Register
  31.     IMPORT    Write_Register
  32.     IMPORT    Next_Opcode
  33.  
  34.  
  35.     OPCODE_R cmp, im, "m_cmp r_a,"
  36.     OPCODE_R cmp, zp, "m_cmp r_a,"
  37.     OPCODE_R cmp, zx, "m_cmp r_a,"
  38.     OPCODE_R cmp, in, "m_cmp r_a,"
  39.     OPCODE_R cmp, ix, "m_cmp r_a,"
  40.     OPCODE_R cmp, iy, "m_cmp r_a,"
  41.     OPCODE_R cmp, ab, "m_cmp r_a,"
  42.     OPCODE_R cmp, ax, "m_cmp r_a,"
  43.     OPCODE_R cmp, ay, "m_cmp r_a,"
  44.  
  45.     OPCODE_R cpx, im, "m_cmp r_x,"
  46.     OPCODE_R cpx, zp, "m_cmp r_x,"
  47.     OPCODE_R cpx, ab, "m_cmp r_x,"
  48.  
  49.     OPCODE_R cpy, im, "m_cmp r_y,"
  50.     OPCODE_R cpy, zp, "m_cmp r_y,"
  51.     OPCODE_R cpy, ab, "m_cmp r_y,"
  52.  
  53.  
  54.     END
  55.