GNU assembler and GTE[top|sitemap|download|docs]

GNU assembler and GTE

I have modified the GNU assembler to support the GTE coprocessor. It does now know about GTE register names (in the disassembly) and all common GTE instructions. You only need some macro definitions for the register names during assembly.

GNU assembler input

    /* some GTE instructions. does nothing useful */
    
    	.text
    
    	lw	t4,0(s0)
    	lw	t5,4(s0)
    	ctc2	t4,R11R12
    	ctc2	t5,R13R21
    	lw	t4,8(s0)
    	lw	t5,12(s0)
    	lw	t6,16(s0)
    	ctc2	t4,R22R23
    	ctc2	t5,R31R32
    	ctc2	t6,R33
    	lw	t4,20(s0)
    	lw	t5,24(s0)
    	ctc2	t4,TRX
    	lw	t6,28(s0)
    	ctc2	t5,TRY
    	ctc2	t6,TRZ
    	lwc2	VXY0,0(s4)
    	lwc2	VZ2,20(s4)
    	rtpt
    	nclip
    	lwc2	RGB0,0(t7)
    	lwc2	RGB1,4(t7)
    	lwc2	RGB2,8(t7)
    	lwc2	RGB,8(t7)
    	dpct
    	swc2	RGB0,4(a2)
    	swc2	RGB1,16(a2)
    	swc2	RGB2,28(a2)
    	mtc2	a2,IR0
    	lwc2	IR1,0(a0)
    	lwc2	IR2,4(a0)
    	lwc2	IR3,8(a0)
    	gpf12
    	mfc2	v0,LZCR
    	mtc2	a3,IR0
    	lwc2	IR1,0(a1)
    	lwc2	IR2,4(a1)
    	lwc2	IR3,8(a1)
    	gpl12
    	lw	t0,16(sp)
    	swc2	IR1,0(t0)
    	swc2	IR2,4(t0)
    	swc2	IR3,8(t0)
    
    	.end
    

GNU assembler output

    
    <span class=y4>asm.o:span>     file format ecoff-littlemips
    
    Disassembly of section .text:
    
    00000000 <.text>:
       0:	8e0c0000 	lw	$t4,0($s0)
       4:	8e0d0004 	lw	$t5,4($s0)
       8:	48cc0000 	ctc2	$t4,$R11R12
       c:	48cd0800 	ctc2	$t5,$R13R21
      10:	8e0c0008 	lw	$t4,8($s0)
      14:	8e0d000c 	lw	$t5,12($s0)
      18:	8e0e0010 	lw	$t6,16($s0)
      1c:	48cc1000 	ctc2	$t4,$R22R23
      20:	48cd1800 	ctc2	$t5,$R31R32
      24:	48ce2000 	ctc2	$t6,$R33
      28:	8e0c0014 	lw	$t4,20($s0)
      2c:	8e0d0018 	lw	$t5,24($s0)
      30:	48cc2800 	ctc2	$t4,$TRX
      34:	8e0e001c 	lw	$t6,28($s0)
      38:	48cd3000 	ctc2	$t5,$TRY
      3c:	48ce3800 	ctc2	$t6,$TRZ
      40:	ca800000 	lwc2	$VXY0,0($s4)
      44:	ca850014 	lwc2	$VZ2,20($s4)
    	...
      50:	4a280030 	rtpt
      54:	4b400006 	nclip
      58:	c9f40000 	lwc2	$RGB0,0($t7)
      5c:	c9f50004 	lwc2	$RGB1,4($t7)
      60:	c9f60008 	lwc2	$RGB2,8($t7)
      64:	c9e60008 	lwc2	$RGB,8($t7)
    	...
      70:	4af8002a 	dpct
      74:	e8d40004 	swc2	$RGB0,4($a2)
      78:	e8d50010 	swc2	$RGB1,16($a2)
      7c:	e8d6001c 	swc2	$RGB2,28($a2)
      80:	48864000 	mtc2	$a2,$IR0
      84:	c8890000 	lwc2	$IR1,0($a0)
      88:	c88a0004 	lwc2	$IR2,4($a0)
      8c:	c88b0008 	lwc2	$IR3,8($a0)
    	...
      98:	4b98003d 	gpf12
      9c:	4802f800 	mfc2	$v0,$LZCR
      a0:	48874000 	mtc2	$a3,$IR0
      a4:	c8a90000 	lwc2	$IR1,0($a1)
      a8:	c8aa0004 	lwc2	$IR2,4($a1)
      ac:	c8ab0008 	lwc2	$IR3,8($a1)
    	...
      b8:	4ba8003e 	gpl12
      bc:	8fa80010 	lw	$t0,16($sp)
      c0:	00000000 	nop
      c4:	e9090000 	swc2	$IR1,0($t0)
      c8:	e90a0004 	swc2	$IR2,4($t0)
      cc:	e90b0008 	swc2	$IR3,8($t0)
    


Created with psxdev.pl
Copyright ©2000 by Daniel Balster