home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / MAGAZINE / NEWS / PCE021.ZIP / Pce021 / Src / cpu / hdr / common < prev    next >
Text File  |  1998-07-24  |  2KB  |  78 lines

  1. ;    common.hdr
  2. ;    ----------
  3. ;    Common header shared between all Hu6280 opcode emulations
  4.  
  5.  
  6.     GET    hdr.TempRegs
  7.     GET    ^.hdr.defines
  8.     GET    hdr.workspace
  9.  
  10.     TEMPORARY r0
  11.     TEMPORARY r1
  12.     TEMPORARY r2
  13.     TEMPORARY r3
  14.     TEMPORARY r14
  15.  
  16.     GBLS    op_byte
  17.     GBLS    current_opcode
  18.     GBLS    area_name
  19.  
  20.  
  21. C_FLAG        *    0x01    ; carry flag
  22. Z_FLAG        *    0x02    ; zero flag
  23. I_FLAG        *    0x04    ; interrupt disable
  24. D_FLAG        *    0x08    ; decimal mode
  25. B_FLAG        *    0x10    ; break
  26. T_FLAG        *    0x20    ; memory flag
  27. V_FLAG        *    0x40    ; overflow
  28. N_FLAG        *    0x80    ; negative
  29.  
  30.  
  31.     MACRO
  32.     DEF_OPCODE $opcode
  33. ;area_name SETS ("$opcode.xxxxxxxx":LEFT:8)
  34. ;current_opcode SETS "AREA |cpu$$"
  35. ;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
  36. ;    $current_opcode
  37. $opcode
  38.     EXPORT    $opcode
  39. current_opcode SETS "$opcode"
  40.     MEND
  41.  
  42.     MACRO
  43.     END_OPCODE
  44.     b    Next_Opcode
  45.     ASSERT    (. - $current_opcode) < 256
  46. current_opcode SETS ""
  47.     MEND
  48.  
  49.     MACRO
  50.     OPCODE_R $name, $mode, $instruction
  51. ;area_name SETS ("$name._$mode.xxxxxxx":LEFT:8)
  52. ;current_opcode SETS "AREA |cpu$$"
  53. ;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
  54. ;    $current_opcode
  55. $name._$mode
  56.     EXPORT    $name._$mode
  57.     NEW    op_byte
  58.     mr_$mode $op_byte
  59.     $instruction $op_byte
  60.     DELETE    op_byte
  61.     b    Next_Opcode
  62.     MEND
  63.  
  64.     MACRO
  65.     OPCODE_RW $name, $mode, $instruction
  66. ;area_name SETS ("$name._$mode.xxxxxxx":LEFT:8)
  67. ;current_opcode SETS "AREA |cpu$$"
  68. ;current_opcode SETS "$current_opcode.$area_name|, CODE, READONLY, ALIGN=8"
  69. ;    $current_opcode
  70. $name._$mode
  71.     EXPORT    $name._$mode
  72.     mm_$mode "$instruction"
  73.     b    Next_Opcode
  74.     MEND
  75.  
  76.  
  77.     END
  78.