#include "def21262.h"
#include "asm_sprt.h"

.global _pack_tx_data;
.global _unpack_rx_data;

.section/pm seg_pmco;

	
_pack_tx_data:

	leaf_entry;
	
	r0=r4;
	r2=b#01111111100;
	r4 = b#10000000001; 
	r1=lshift r0 by 2;
	r1=r1 and r2;
	r0=r1 or r4;
	
	leaf_exit;
	
_pack_tx_data.end:


_unpack_rx_data:

	leaf_entry;
	
	r0=r4;
	r4=fext r0 by 25:1; //bit 0;
	
	r1=fext r0 by 22:1;//bit1
	r4=r4 or fdep r1 by 1:1;
	
	r1=fext r0 by 19:1;//bit2
	r4=r4 or fdep r1 by 2:1;
	
	r1=fext r0 by 16:1;//bit3
	r4=r4 or fdep r1 by 3:1;
	
	r1=fext r0 by 13:1;//bit4
	r4=r4 or fdep r1 by 4:1;
	
	r1=fext r0 by 10:1;//bit5
	r4=r4 or fdep r1 by 5:1;
	
	r1=fext r0 by 7:1;//bit6
	r4=r4 or fdep r1 by 6:1;
	
	r1=fext r0 by 4:1;//bit7
	r4=r4 or fdep r1 by 7:1;
	
	r0=r4;
	leaf_exit;		

_unpack_rx_data.end:



	
