SEC56K3         equ    * 
        section sec56k3
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;*******************************************************************
;       56300 Opcodes
;       READ REGISTERS
;       There are 66 registers in the 56300 which are programmer
;       accessible. All other registers are considered memory
;       locations in X memory.  There are 18 registers total in
;       the OnCE port.  The following moves are register moves to
;       the OGDB which is a memory mapped register in X I/O space.
;       movep reg,x:xx instructions are all zeros.
;*******************************************************************
GETPREG dc      $000000                 ;0 dump A0
        dc      $000000
        dc      $c83c00                 ;1  movep a0,x:$fffc
        dc      $000800
        dc      $cc3c00                 ;2  movep a1,x:$fffc
        dc      $000800
        dc      $ca3c00                 ;3  movep a2,x:$fffc
	dc      $000800
        dc      $000000                 ;4  movep B,x:$fffc dummy
        dc      $000000
        dc      $c93c00                 ;5  movep b0,x:$fffc
        dc      $000800
        dc      $cd3c00                 ;6  movep b1,x:$fffc
        dc      $000800
        dc      $cb3c00                 ;7  movep b2,x:$fffc
	dc      $000800
        dc      $000000
        dc      $000000                 ;8  movep bcr,x:$fffc dummy
        dc      $000000
        dc      $000000                 ;9  movep ipr,x:$fffc dummy
        dc      $fe3c00                 ;10  movep la,x:$fffc
        dc      $000800
        dc      $ff3c00                 ;11  movep lc,x:$fffc
        dc      $000800
        dc      $e03c00                 ;12  movep m0,x:$fffc
        dc      $000800
        dc      $e13c00                 ;13 movep m1,x:$fffc
        dc      $000800
        dc      $e23c00                 ;14 movep m2,x:$fffc
        dc      $000800
        dc      $e33c00                 ;15 movep m3,x:$fffc
        dc      $000800
        dc      $e43c00                 ;16 movep m4,x:$fffc
        dc      $000800
        dc      $e53c00                 ;17 movep m5,x:$fffc
        dc      $000800
        dc      $e63c00                 ;18 movep m6,x:$fffc
        dc      $000800
        dc      $e73c00                 ;19 movep m7,x:$fffc
        dc      $000800
        dc      $d83c00                 ;20 movep n0,x:$fffc
        dc      $000800
        dc      $D93c00                 ;21 movep n1,x:$fffc
        dc      $000800
        dc      $da3c00                 ;22 movep n2,x:$fffc
        dc      $000800
        dc      $db3c00                 ;23 movep n3,x:$fffc
        dc      $000800
        dc      $dc3c00                 ;24 movep n4,x:$fffc
        dc      $000800
        dc      $dd3c00                 ;25 movep n5,x:$fffc
        dc      $000800
        dc      $de3c00                 ;26 movep n6,x:$fffc
        dc      $000800
        dc      $df3c00                 ;27 movep n7,x:$fffc
        dc      $000800
        dc      $fa3c00                 ;28 movep omr,x:$fffc
	dc      $000800
        dc      $000000                 ;29 movep pc,x:$fffc
        dc      $000000
        dc      $d03c00                 ;30 movep r0,x:$fffc
        dc      $000800
        dc      $d13c00                 ;31 movep r1,x:$fffc
        dc      $000800
        dc      $d23c00                 ;32 movep r2,x:$fffc
        dc      $000800
        dc      $d33c00                 ;33 movep r3,x:$fffc
        dc      $000800
        dc      $d43c00                 ;34 movep r4,x:$fffc
        dc      $000800
        dc      $d53c00                 ;35 movep r5,x:$fffc
        dc      $000800
        dc      $d63c00                 ;36 movep r6,x:$fffc
        dc      $000800
        dc      $d73c00                 ;37 movep r7,x:$fffc
        dc      $000800
        dc      $fb3c00                 ;38 movep sp,x:$fffc
        dc      $000800
        dc      $f93c00                 ;39 movep sr,x:$fffc
        dc      $000800
        dc      $fc3c00                 ;40 movep ssh,x:$fffc
        dc      $000800
        dc      $fd3c00                 ;41 movep ssl,x:$fffc
	dc      $000800
        dc      $000000                 ;42 movep X,x:$fffc
        dc      $000000
        dc      $c43c00                 ;43 movep x0,x:$fffc
        dc      $000800
        dc      $c53c00                 ;44 movep x1,x:$fffc
	dc      $000800
        dc      $000000                 ;45 movep Y,x:$fffc
        dc      $000000
        dc      $c63c00                 ;46 movep y0,x:$fffc
        dc      $000800
        dc      $c73c00                 ;47 movep y1,x:$fffc
        dc      $000800
        dc      $ea3c00                 ;48 movep ep,x:$fffffc (56300 reg)
        dc      $000800
        dc      $f83c00                 ;49 movep sz,x:$fffffc (56300 reg)
        dc      $000800
        dc      $f13c00                 ;50 movep sc,x:$fffffc (56300 reg)
        dc      $000800
        dc      $f03c00                 ;51 movep vba,x:$ffffc (56300 reg)
	dc      $000800
;****************************************************************
;       56300 Opcodes
;       WRITE REGISTER
;       All programmer registers except SR,LA,LC,SSH,SSL,SP, and OMR
;       have 24 bit opcodes. The last seven registers have
;       to be 32 bit opcode loads.
;****************************************************************
PUTPREG dc      $000000                 ;0 move #$xxxx,A dummy opcode
	dc	$000000
        dc      $f40000			;1 move #xxxx,a0
        dc      $005000 
        dc      $f40000			;2 move #xxxx,a1
        dc      $005400 
        dc      $f40000			;3 move #>xxxx,a2
        dc      $005200 
        dc      $000000			;4 move #xxxx,B dummy opcode
        dc      $000000
        dc      $f40000			;5 move #>xxxx,b0
        dc      $005100 
	dc      $f40000			;6 move #>xxxx,b1
        dc      $005500 
	dc      $f40000			;7 move #>xxxx,b2
        dc      $005300 
        dc      $000000			;8 move #>xxxx,bcr dummy opcode
        dc      $000000
        dc      $000000			;9 move #>xxxx,ipr dummy opcode
        dc      $000000 
        dc      $f43e00                 ;10  move #>xxxx,la
	dc      $000500
        dc      $f43f00                 ;11  move #>xxxx,lc
	dc      $000500
        dc      $f42000                 ;12 move #>xxxx,m0
        dc      $000500
        dc      $f42100                 ;13 move #>xxxx,m1
        dc      $000500
        dc      $f42200                 ;14 move #>xxxx,m2
        dc      $000500
        dc      $f42300                 ;15 move #>xxxx,m3
        dc      $000500
        dc      $f42400                 ;16 move #>xxxx,m4
        dc      $000500
        dc      $f42500                 ;17 move #>xxxx,m5
        dc      $000500
        dc      $f42600                 ;18 move #>xxxx,m6
        dc      $000500
        dc      $f42700                 ;19 move #>xxxx,m7
        dc      $000500
        dc      $f40000                 ;20 move #>xxxx,n0
	dc      $007000
        dc      $f40000                 ;21 move #>xxxx,n1
        dc      $007100
        dc      $f40000                 ;22 move #>xxxx,n2
        dc      $007200
        dc      $f40000                 ;23 move #>xxxx,n3
        dc      $007300
        dc      $f40000                 ;24 move #>xxxx,n4
        dc      $007400
        dc      $f40000                 ;25 move #>xxxx,n5
        dc      $007500
        dc      $f40000                 ;26 move #>xxxx,n6
        dc      $007600
        dc      $f40000                 ;27 move #>xxxx,n7
	dc      $007700
        dc      $f43a00                 ;28 move #>xxxx,omr
	dc      $000500
        dc      $000000			;29 move #>xxxx,pc dummy
        dc      $000000 
        dc      $f40000                 ;30 move #>xxxx,r0
        dc      $006000
        dc      $f40000                 ;31 move #>xxxx,r1
        dc      $006100
        dc      $f40000                 ;32 move #>xxxx,r2
        dc      $006200
        dc      $f40000                 ;33 move #>xxxx,r3
        dc      $006300
        dc      $f40000                 ;34 move #>xxxx,r4
        dc      $006400
        dc      $f40000                 ;35 move #>xxxx,r5
        dc      $006500
        dc      $f40000                 ;36 move #>xxxx,r6
        dc      $006600
        dc      $f40000                 ;37 move #>xxxx,r7
	dc      $006700
        dc      $f43b00                 ;38 move #>xxxx,sp
        dc      $000500
        dc      $f43900                 ;39 move #>xxxx,sr
        dc      $000500
        dc      $f43c00                 ;40 move #>xxxx,ssh
        dc      $000500
        dc      $f43d00                 ;41 move #>xxxx,ssl
	dc      $000500
        dc      $000000			;42 move #>xxxx,X dummy
        dc      $000000
        dc      $f40000                 ;43 move #>xxxx,x0
        dc      $004400
        dc      $f40000                 ;44 move #>xxxx,x1
	dc      $004500
        dc      $000000			;45 move #>xxxx,Y dummy
        dc      $000000 
        dc      $f40000                 ;46 move #>xxxx,y0
        dc      $004600
        dc      $f40000                 ;47 move #>xxxx,y1
	dc      $004700
        dc      $f42a00                 ;48 move #$123456,ep (56300 reg)
	dc      $000500
        dc      $f43800                 ;49 move #$xxxxxx,sz (56300 reg)
        dc      $000500
        dc      $f43100                 ;50 move #$xxxxxx,sc (56300 reg)
        dc      $000500
        dc      $f43000                 ;51 move #$xxxxxx,vba (56300 reg)
	dc      $000500
;*********************************************************************
;       56300
;       This sequence is used to read the OnCE controller registers
;       one at a time or in groups.  This routine is normally called
;       when the debug mode is entered from a user program or when
;       the user wishes to read the OnCE controller registers similar
;       to a 56300 register.
;*********************************************************************
GETOREG
        dc      $8002                 ;0 read OnCE status/control- OSCR
        dc      $8102                 ;1 memory breakpoint ctr0 - OMBC
        dc      $8202                 ;2 breakpoint control reg0 - OBCR
        dc      $8502                 ;3 memory limit reg0 - OMLR0
        dc      $8602                 ;4 memory limit reg1 - OMLR1
        dc      $8902                 ;5 gdb register (OGDBR)
        dc      $8d02                 ;6 trace counter (OTC)

        dc      $8e02                 ;7 tags buffer 0 - OTAGB0
        dc      $8e02                 ;8 tags buffer 1 - OTAGB1
        dc      $8e02                 ;9 tags buffer 2 -OTAGB2
        dc      $8e02                 ;10 tags buffer 3 -OTAGB3
        dc      $8e02                 ;11 tags buffer 4 -OTAGB4
        dc      $8e02                 ;12 tags buffer 5 -OTAGB5
        dc      $8e02                 ;13 tags buffer 6 -OTAGB6
        dc      $8e02                 ;14 tags buffer 7 -OTAGB7
        dc      $8e02                 ;15 LRU/LOCK status-OTAGBSR

PIPE    dc      $8a02                 ;16 pdb register (OPDBR)
        dc      $8b02                 ;17 pil register (OPILR)
        dc      $8f02                 ;18 pab register for fetch(OPABFR)
	dc	$9002			;19 pab register for decode(OBABDR)
        dc      $9102                 ;20 pab register for execute(OPABEX)
;
;	Temporarily read oscr
;
        dc      $9202                 ;21 read FIFO0
        dc      $9202                 ;22 read FIFO1
        dc      $9202                 ;23 read FIFO2
        dc      $9202                 ;24 read FIFO3
        dc      $9202                 ;25 read FIFO4
        dc      $9202                 ;26 read FIFO5
        dc      $9202                 ;27 read FIFO6
        dc      $9202                 ;28 read FIFO7
        dc      $9202                 ;29 read FIFO8
        dc      $9202                 ;30 read FIFO9
        dc      $9202                 ;31 read FIFO10
        dc      $9202                 ;32 read FIFO11
	dc	$9202		      ;33 read FIFO12

        dc      $000001                 ;eos

;**********************************************************************
;       56300
;       This sequence is used to write the OnCE controller registers
;       one at a time or in groups.  This routine is normally called
;       when the debug mode is entered from a user program or when
;       the user wishes to read the OnCE controller registers similar
;       to a 56300 register.
;
;**********************************************************************
PUTOREG  
        dc      $0004                 ;0 read OnCE status/control (OSCR)
        dc      $0104                 ;1 memory breakpoint ctr0 (OMBC)
        dc      $0204                 ;2 breakpoint control reg (OBCR)
        dc      $0504                 ;3 memory limit reg0 (OMLR0)
        dc      $0604                 ;4 memory limit reg1 (OMLR1)
        dc      $0904                 ;5 gdb register (OGDBR)
        dc      $0d04                 ;6 trace counter (OTC)
 
        dc      $0e04                 ;7 tags buffer 0  OTAGB0
        dc      $0e04                 ;8 tags buffer 1  OTAGB1
        dc      $0e04                 ;9 tags buffer 2 OTAGB2
        dc      $0e04                 ;10 tags buffer 3 OTAGB3
        dc      $0e04                 ;11 tags buffer 4 OTAGB4
        dc      $0e04                 ;12 tags buffer 5 OTAGB5
        dc      $0e04                 ;13 tags buffer 6 OTAGB6
        dc      $0e04                 ;14 tags buffer 7 OTAGB7
        dc      $0e04                 ;15 LRU/LOCK status OTAGBSR
 
	dc	$0a04		      ;16 pdb register (OPDBR)
        dc      $0b04                 ;17 pil register (OPILR)
        dc      $0f04                 ;18 pab register for fetch (OPABF)
        dc      $1004                 ;19 pab register for decode (OPABD)
        dc      $1104                 ;20 pab register for execute (OPABEX)
;
;	FIFO is read only so a no register select is used.
;
        dc      $0f04                 ;21 write FIFO0
        dc      $0f04                 ;22 write FIFO1
        dc      $0f04                 ;23 write FIFO2
        dc      $0f04                 ;24 write FIFO3
        dc      $0f04                 ;25 write FIFO4
        dc      $0f04                 ;26 write FIFO5
        dc      $0f04                 ;27 write FIFO6
        dc      $0f04                 ;28 write FIFO7
        dc      $0f04                 ;29 write FIFO8
        dc      $0f04                 ;30 write FIFO9
        dc      $0f04                 ;31 write FIFO10
        dc      $0f04                 ;32 write FIFO11
	dc	$0f04		      ;33 write FIFO12
 
        dc      $000001                 ;eos
 

;**********************************************************************
;       56300
;       This sequence is used to read 56300 programming model register
;       values to display.
;
;**********************************************************************
REGREAD dc      $4a04                 ;write PDB
REGROPCOD dc    $000000                 ;opcode hi
        dc      $000000                 ;opcode lo
        dc      $8902                 ;read GDB
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to write to 56300 programming model registers.
;
;**********************************************************************
REGWRITE dc     $0a04                 ;write PDB
REGWOPCOD  dc   $000000                 ;opcode hi
        dc      $000000                 ;opcode lo
        dc      $4a04                 ;write PDB
REGVAL  dc      $000000                 ;operand hi
        dc      $000000                 ;operand lo
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to read Program memory.
;
;**********************************************************************
OPREAD  dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
PREADPTR dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
PRDLOOP dc      $4a04                 ;write PDB
        dc      $d87c00                 ;opcode lo
	dc      $000800                 ;movep p:(r0)+,x:OGDB - opcode hi
        dc      $8902                 ;Read GDB
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to read X Data memory.
;
;**********************************************************************
OXREAD  dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
XREADPTR dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
XRDLOOP dc      $4a04                 ;write PDB
        dc      $d8bc00                 ;opcode lo
	dc      $000800                 ;movep x:(r0)+,x:OGDB
        dc      $8902                 ;Read GDB
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to read Y Data memory.
;
;**********************************************************************
OYREAD  dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
YREADPTR dc     $000000                 ;#$xxxxxxxx operand hi
        dc      $000000                 ;operand lo
YRDLOOP dc      $4a04                 ;write PDB
        dc      $d8fc00                 ;opcode lo
	dc      $000800                 ;movep y:(r0)+,x:OGDB
        dc      $8902                 ;Read GDB
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to shorten the read cycles
;
;**********************************************************************
	dc      $5f08                 ;NO selection - go command
        dc      $8902                 ;READ GDB
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to shorten the write cycles
;
;**********************************************************************
PWDLOOP dc      $5f08                 ;No selection - go command
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to write a value to a single
;       Program memory location.
;
;**********************************************************************
OPWRITE dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
PWRITPTR dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
PWRLOOP	dc      $0a04                 ;write PDB
	dc      $f40000                 ;opcode lo
	dc      $004400                 ;move #$xxxxxx,x0 - opcode hi
        dc      $4a04                 ;write PDB - go, no ex.
PWRITVAL dc     $000000                 ;#$xxxxxxxx operand hi
        dc      $000000                 ;operand lo
PWLOOP	dc      $4a04                 ;write PDB
        dc      $588400                 ;opcode lo
	dc      $000700                 ;move x0,p:(r0)+ - opcode hi
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to write to a single X
;       Data memory location.
;
;**********************************************************************
OXWRITE dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
XWRITPTR dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
XWRLOOP	dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $004400                 ;move #$xxxxxx,x0 - opcode hi
        dc      $4a04                 ;write PDB - go, no ex.
XWRITVAL dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
XWLOOP	dc      $4a04                 ;write PDB
        dc      $580000                 ;opcode lo
	dc      $004400                 ;movep x0,x:(r0)+ - opcode hi
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to write to a single
;       Y Data memory location.
;
;**********************************************************************
OYWRITE dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
YWRITPTR dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
YWRLOOP	dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $004400                 ;move #$xxxxxx,x0 - opcode hi
        dc      $4a04                 ;write PDB - go, no ex.
YWRITVAL dc     $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
YWLOOP	dc      $4a04                 ;write PDB
        dc      $580000                 ;opcode lo
	dc      $004c00                 ;move x0,y:(r0)+ - opcode hi
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       This sequence is used to re-enter the User Program
;       from the debug state.  This sequence is used for Go immediate
;       from current address or Go from a new address.  When called
;       it sends the Instruction Latch value or a Jmp instruction.
;
;**********************************************************************
USERMODE dc     $0a04                 ;write PDB, wait for ack.
        dc      $000000                 ;PIIB or Jmp long opcode high
        dc      $000000                 ;PIIB low or Jmp long opcode low
        dc      $6a10                 ;write PDB,no wait for ack.
        dc      $000000                 ;PDB or Jmp Address high
        dc      $000000                 ;PDB or Jmp Address low
        dc      $000001
;**********************************************************************
;       56300
;       Restore registers used for write sequences
;
;**********************************************************************
RESTOREX0 dc    $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $004400                 ;move #$xxxxxx,x0 opcode hi
        dc      $4a04                 ;write PDB
X0VAL   dc      $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
        dc      $0a04                 ;write PDB
        dc      $f40000                 ;opcode lo
	dc      $006000                 ;move #$xxxxxx,r0 opcode hi
        dc      $4a04                 ;write PDB
R0VAL   dc      $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
        dc      $0a04                 ;write PDB
        dc      $f42000                 ;opcode lo
	dc      $000500                 ;move #$xxxxxx,m0,opcode hi
        dc      $4a04                 ;write PDB
M0VAL   dc      $000000                 ;#$xxxxxx operand hi
        dc      $000000                 ;operand lo
        dc      $000001                 ;eos
;**********************************************************************
;       56300
;       Save register values before doing multiple write values
;
;**********************************************************************
SAVEX0  dc      $4a04                 ;write PDB
        dc      $c43c00                 ;opcode lo
	dc      $000800                 ;move x0,x:OGDB - opcode hi
        dc      $8902                 ;read GDB
SAVER0  dc      $4a04                 ;write PDB
        dc      $d03c00                 ;opcode lo
	dc      $000800                 ;move r0,x:OGDB - opcode hi
        dc      $8902                 ;read GDB
SAVEM0  dc      $4a04                 ;write PDB
        dc      $e03c00                 ;opcode lo
	dc      $000800                 ;move m0,x:OGDB - opcode hi
        dc      $8902                 ;read GDB
        dc      $0a04                 ;write PDB
        dc      $f42000                 ;opcode lo
	dc      $000500                 ;move #$ffffff,m0 - opcode hi
        dc      $4a04                 ;write operand
        dc      $ffff00
	dc      $00ff00
        dc      $000001                 ;eos
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
        endsec          ;end of sec56k3
ENDSEC4         equ     *

