; TASKING TriCore C compiler v1.5r1 Build 322 SN 00090364
; options: -e -A1 -g -O1 -Id:\ctri\include -s -N8 -zTC112_COR1 -zTC112_COR4
;          -zTC112_COR10 -zTC112_COR13 -zTC112_COR14 -zTC112_COR16 -zTC112_COR17
	.name	"cs8900"
	.symb	TOOL, "TASKING TriCore C compiler v1.5", 1
	.symb	TYPE, 256, "bit", 'g', 0, 1
	.symb	FILE, "cs8900.c"
; file "cs8900.c":
;    1 |/******************************************************************
;    2 | *****                                                        *****
;    3 | *****  Name: cs8900.c                                        *****
;    4 | *****  Ver.: 1.0                                             *****
;    5 | *****  Date: 07/05/2001                                      *****
;    6 | *****  Auth: Andreas Dannenberg                              *****
;    7 | *****        HTWK Leipzig                                    *****
;    8 | *****        university of applied sciences                  *****
;    9 | *****        Germany                                         *****
;   10 | *****  Func: ethernet packet-driver for use with LAN-        *****
;   11 | *****        controller CS8900 from Crystal/Cirrus Logic     *****
;   12 | *****                                                        *****
;   13 | ******************************************************************/
;   14 |
;   15 |#include "cs8900.h"
	.symb	FILE, "cs8900.h"
	.symb	TYPE, 257, 'S', 4,\
		 "Addr", #5, 0,\
		 "Data", #5, 2
	.symb	TYPE, 258, "TInitSeq", 'T', #257
	.symb	ENDF
;   16 |// Keil: Following lines are needed to access the CS8900 on the MCB167NET board
;   17 |#include "tcpip.h" 
	.symb	FILE, "tcpip.h"
	.symb	TYPE, 259, 'N', 0, 1,\
		 "CLOSED", 0,\
		 "LISTENING", 1,\
		 "SYN_SENT", 2,\
		 "SYN_RECD", 3,\
		 "ESTABLISHED", 4,\
		 "FIN_WAIT_1", 5,\
		 "FIN_WAIT_2", 6,\
		 "CLOSE_WAIT", 7,\
		 "CLOSING", 8,\
		 "LAST_ACK", 9,\
		 "TIME_WAIT", 10
	.symb	TYPE, 260, "TTCPStateMachine", 'T', #259
	.symb	TYPE, 261, 'N', 0, 1,\
		 "ARP_REQUEST", 0,\
		 "TCP_SYN_FRAME", 1,\
		 "TCP_SYN_ACK_FRAME", 2,\
		 "TCP_FIN_FRAME", 3,\
		 "TCP_DATA_FRAME", 4
	.symb	TYPE, 262, "TLastFrameSent", 'T', #261
	.symb	ENDF
;   18 |
;   19 |#include "main.h" // Included for HVAR declaration 
	.symb	FILE, "main.h"
	.symb	TYPE, 263, "uword", 'T', #18
	.symb	FILE, "TC1775BRegs.h"
	.symb	ENDF
	.symb	FILE, "GPTU.H"
	.symb	ENDF
	.symb	FILE, "RTC.H"
	.symb	ENDF
	.symb	ENDF
;   20 |//Phytec: Line changed for phytec board
;   21 |#define CS8900IOBASE 0xB0400300
;   22 |// Keil: End of added lines
;   23 |
;   24 |// configure port-pins for use with LAN-controller,
;   25 |// reset it and send the configuration-sequence
;   26 |// (InitSeq[])
;   27 |
;   28 |void Init8900(void)
;   29 |{
	.sdecl	"code.cs8900",CODE
	.sect	"code.cs8900"
	.align	4
	.symb	LINE, 29
	.symb	TYPE, 264, 'X', 8, #1, 26, 0
	.symb	GFUN, "Init8900", Init8900, #264, 0, 0, 0
	.symb	ALAB, Init8900, #264
Init8900:
	.symb	IDEN, "i", -1, #5, 131, 0x5
;   30 |  unsigned short i;
;   31 |
;   32 |// Keil: function modified to access the CS8900 on the address/data bus
;   33 |  Write8900(ADD_PORT, PP_SelfCTL);
	.symb	LINE, 33
	mov	d4,#10				; 10
	.symb	SOFF, 0
	.symb	LTIM, "i", -1, 0, 0x45
	mov	d5,#276				; 276
	callg	Write8900
;   34 |  Write8900(DATA_PORT, POWER_ON_RESET);            // Reset the Ethernet-Controller
	.symb	LINE, 34
	mov	d4,#12				; 12
	mov	d5,#64				; 64
	callg	Write8900
;   35 |
;   36 |  Write8900(ADD_PORT, PP_SelfST);
	.symb	LINE, 36
	mov	d4,#10				; 10
	mov	d5,#310				; 310
	callg	Write8900
;   37 |  while (!(Read8900(DATA_PORT) & INIT_DONE));      // wait until chip-reset is done
	.symb	LINE, 37
_3:
	.symb	LTIM, "i", 14, 0, 0xcd
	mov	d4,#12				; 12
	callg	Read8900
	jz.t	d2:7,_3
;   38 |
;   39 |
;   40 |  
;   41 |  for (i = 0; i < sizeof InitSeq / sizeof (TInitSeq); i++) // configure the CS8900
	.symb	LINE, 41
	mov16	d14,#0				; 0
	movh.a	a13,#@his(InitSeq)
	lea	a13,[a13]@los(InitSeq)
_4:
	.symb	LTIM, "i", 14, 0, 0x4d
	.symb	LTIM, "i", 14, 0, 0xcd
	nop
	addsc.a	a14,a13,d14,#2
;   42 |  {
;   43 |    Write8900(ADD_PORT, InitSeq[i].Addr);
	.symb	LINE, 43
	mov	d4,#10				; 10
	ld.hu	d5,[a14]
	callg	Write8900
;   44 |    Write8900(DATA_PORT, InitSeq[i].Data);
	.symb	LINE, 44
	mov	d4,#12				; 12
	ld.hu	d5,[a14]2
	callg	Write8900
	.symb	LINE, 41
	add16	d14,#1				; i
	extr.u	d14,d14,#0,#16			; i
	jlt.u	d14,#5,_4
;   45 |  }
;   46 |}
	.symb	LINE, 46
	ret16
	.symb	LTIM, "i", 14, 0, 0x4d
	.symb	EFUN
;   47 |
;   48 |// writes a word in little-endian byte order to
;   49 |// a specified port-address
;   50 |
;   51 |void Write8900(unsigned char Address, unsigned short Data)
;   52 |{
	.symb	LINE, 52
	.symb	TYPE, 265, 'X', 8, #1, 26, 2, #3, #5
	.symb	GFUN, "Write8900", Write8900, #265, 0, 0, 0
	.symb	ALAB, Write8900, #265
Write8900:
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "Data", 5, #5, 0, 0x80d
;   53 |// Keil: function modified to access the CS8900 on the address/data bus
;   54 |  HVAR(unsigned short,Address + CS8900IOBASE) = Data;
	.symb	LINE, 54
	mov.u	d15,#0x300			; -1337982208
	.symb	SOFF, 0
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	LTIM, "Data", 5, 0, 0x8cd
	addih	d15,d15,#0xb040			; -1337982208
	add16	d15,d4
	mov16.a	a15,d15
	st16.h	[a15],d5
;   55 |}
	.symb	LINE, 55
	ret16
	.symb	LTIM, "Data", 5, 0, 0x84d
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	EFUN
;   56 |
;   57 |// writes a word in little-endian byte order to TX_FRAME_PORT
;   58 |
;   59 |void WriteFrame8900(unsigned short Data)
;   60 |{
	.symb	LINE, 60
	.symb	TYPE, 266, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "WriteFrame8900", WriteFrame8900, #266, 0, 0, 0
	.symb	ALAB, WriteFrame8900, #266
WriteFrame8900:
	.symb	IDEN, "Data", 4, #5, 0, 0x80d
	.symb	SOFF, 0
	.symb	LTIM, "Data", 4, 0, 0x8cd
;   61 |// Keil: function modified to access the CS8900 on the address/data bus
;   62 |  HVAR(unsigned short,TX_FRAME_PORT + CS8900IOBASE) = Data;
	.symb	LINE, 62
	movh.a	a15,#0xb040
	lea	a15,[a15]0x300
	st16.h	[a15],d4			; Data
;   63 |}
	.symb	LINE, 63
	ret16
	.symb	LTIM, "Data", 4, 0, 0x84d
	.symb	EFUN
;   64 |
;   65 |// copies bytes from MCU-memory to frame port
;   66 |// NOTES: * an odd number of byte may only be transfered
;   67 |//          if the frame is written to the end!
;   68 |//        * MCU-memory MUST start at word-boundary
;   69 |
;   70 |void CopyToFrame8900(void *Source, unsigned short Size)
;   71 |{
	.symb	LINE, 71
	.symb	TYPE, 269, 'P', #1
	.symb	TYPE, 267, 'X', 8, #1, 26, 2, #269, #5
	.symb	GFUN, "CopyToFrame8900", CopyToFrame8900, #267, 0, 0, 0
	.symb	ALAB, CopyToFrame8900, #267
CopyToFrame8900:
	.symb	IDEN, "Source", 20, #269, 0, 0x80d
	.symb	IDEN, "Size", 14, #5, 0, 0x80d
	.symb	TYPE, 271, 'P', #5
	.symb	IDEN, "piSource", -1, #271, 131, 0x5
	.symb	SOFF, 0
	.symb	LTIM, "Source", 20, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
	.symb	LTIM, "piSource", -1, 0, 0x45
	.symb	LTIM, "piSource", 30, 0, 0xcd
	mov16	d14,d4				; Size
;   72 |  unsigned short * piSource;                       // Keil: Pointer added to correct expression
;   73 |  
;   74 |  piSource = Source;                             // Keil: Line added
	.symb	LINE, 74
	mov16.aa a14,a4				; piSource
;   75 |  while (Size > 1) {
	.symb	LINE, 75
	j	_6
_5:
	.symb	LTIM, "Source", 20, 0, 0x84d
	.symb	LTIM, "piSource", 30, 0, 0x4d
	.symb	LTIM, "piSource", 30, 0, 0xcd
	.symb	LTIM, "piSource", 30, 0, 0x4d
	.symb	LTIM, "piSource", 30, 0, 0xcd
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
;   76 |//  WriteFrame8900(*((unsigned short *)Source)++); // Keil: Line replaced with following line
;   77 |    WriteFrame8900(*piSource++);
	.symb	LINE, 77
	nop
	ld.hu	d4,[a14]
	callg	WriteFrame8900
	add16	d14,#-2				; Size
	extr.u	d14,d14,#0,#16			; Size
	add16.a	a14,#2				; piSource
	.symb	LINE, 75
_6:
	.symb	LTIM, "piSource", 30, 0, 0x4d
	.symb	LTIM, "piSource", 31, 0, 0xcd
	.symb	LTIM, "piSource", 31, 0, 0x4d
	jge	d14,#2,_5
;   78 |    Size -= 2;
;   79 |  }
;   80 |  
;   81 |  if (Size)                                      // if odd num. of bytes...
	.symb	LINE, 81
	jeq	d14,#0,_7			; Size
;   82 |//  WriteFrame8900(*(unsigned char *)Source);    // Keil: Line replaced with following line
;   83 |    WriteFrame8900(*(unsigned char *)piSource);  // write leftover byte (the LAN-controller
	.symb	LINE, 83
	mov16.aa a15,a14			; piSource
	ld16.bu	d4,[a15]
	callg	WriteFrame8900
_7:
;   84 |}                                                // ignores the highbyte)
	.symb	LINE, 84
	ret16
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	EFUN
;   85 |
;   86 |// reads a word in little-endian byte order from
;   87 |// a specified port-address
;   88 |
;   89 |unsigned short Read8900(unsigned char Address)
;   90 |{
	.symb	LINE, 90
	.symb	TYPE, 272, 'X', 8, #5, 26, 1, #3
	.symb	GFUN, "Read8900", Read8900, #272, 0, 0, 0
	.symb	ALAB, Read8900, #272
Read8900:
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "ReturnValue", -1, #5, 131, 0x5
;   91 |  unsigned short ReturnValue;
;   92 |
;   93 |// Keil: function modified to access the CS8900 on the address/data bus
;   94 |  ReturnValue = HVAR(unsigned short,Address + CS8900IOBASE);
	.symb	LINE, 94
	mov.u	d15,#0x300			; -1337982208
	.symb	SOFF, 0
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	LTIM, "ReturnValue", -1, 0, 0x45
	.symb	LTIM, "ReturnValue", 2, 0, 0xcd
	addih	d15,d15,#0xb040			; -1337982208
	add16	d15,d4
	mov16.a	a15,d15
	ld.hu	d2,[a15]
;   95 |  
;   96 |  return ReturnValue;
;   97 |}
	.symb	LINE, 97
	ret16
	.symb	LTIM, "ReturnValue", 2, 0, 0x4d
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	EFUN
;   98 |
;   99 |// reads a word in little-endian byte order from RX_FRAME_PORT
;  100 |
;  101 |unsigned short ReadFrame8900(void)
;  102 |{
	.symb	LINE, 102
	.symb	TYPE, 273, 'X', 8, #5, 26, 0
	.symb	GFUN, "ReadFrame8900", ReadFrame8900, #273, 0, 0, 0
	.symb	ALAB, ReadFrame8900, #273
ReadFrame8900:
	.symb	IDEN, "ReturnValue", -1, #5, 131, 0x5
	.symb	SOFF, 0
	.symb	LTIM, "ReturnValue", -1, 0, 0x45
	.symb	LTIM, "ReturnValue", 2, 0, 0xcd
;  103 |  unsigned short ReturnValue;
;  104 |
;  105 |// Keil: function modified to access the CS8900 on the address/data bus
;  106 |  ReturnValue = HVAR(unsigned short,RX_FRAME_PORT + CS8900IOBASE);
	.symb	LINE, 106
	movh.a	a15,#0xb040
	lea	a15,[a15]0x300
	ld.hu	d2,[a15]
;  107 |  
;  108 |  return ReturnValue;
;  109 |}
	.symb	LINE, 109
	ret16
	.symb	LTIM, "ReturnValue", 2, 0, 0x4d
	.symb	EFUN
;  110 |
;  111 |// reads a word in big-endian byte order from RX_FRAME_PORT
;  112 |// (useful to avoid permanent byte-swapping while reading
;  113 |// TCP/IP-data)
;  114 |
;  115 |unsigned short ReadFrameBE8900(void)
;  116 |{
	.symb	LINE, 116
	.symb	TYPE, 274, 'X', 8, #5, 26, 0
	.symb	GFUN, "ReadFrameBE8900", ReadFrameBE8900, #274, 0, 0, 0
	.symb	ALAB, ReadFrameBE8900, #274
ReadFrameBE8900:
	.symb	IDEN, "ReturnValue", -1, #5, 131, 0x5
	.symb	SOFF, 0
	.symb	LTIM, "ReturnValue", -1, 0, 0x45
	.symb	LTIM, "ReturnValue", 4, 0, 0xcd
	.symb	LTIM, "ReturnValue", 4, 0, 0x4d
	.symb	LTIM, "ReturnValue", 2, 0, 0xcd
;  117 |  unsigned short ReturnValue;
;  118 |
;  119 |// Keil: function modified to access the CS8900 on the address/data bus
;  120 |  ReturnValue = HVAR(unsigned short,RX_FRAME_PORT + CS8900IOBASE);
	.symb	LINE, 120
	movh.a	a15,#0xb040
	lea	a15,[a15]0x300
	ld.hu	d4,[a15]
;  121 |  ReturnValue = SwapBytes(ReturnValue);
	.symb	LINE, 121
	jg	SwapBytes
	.symb	LTIM, "ReturnValue", 2, 0, 0x4d
	.symb	EFUN
;  122 |  
;  123 |  return ReturnValue;
;  124 |}
;  125 |
;  126 |// reads a word in little-endian byte order from
;  127 |// a specified port-address
;  128 |// NOTE: this func. xfers the high-byte 1st, must be used to
;  129 |//       access some special registers (e.g. RxStatus)
;  130 |
;  131 |unsigned short ReadHB1ST8900(unsigned char Address)
;  132 |{
	.symb	LINE, 132
	.symb	TYPE, 275, 'X', 8, #5, 26, 1, #3
	.symb	GFUN, "ReadHB1ST8900", ReadHB1ST8900, #275, 0, 0, 0
	.symb	ALAB, ReadHB1ST8900, #275
ReadHB1ST8900:
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "ReturnValue", -1, #5, 131, 0x5
;  133 |  unsigned short ReturnValue;
;  134 |
;  135 |// Keil: function modified to access the CS8900 on the address/data bus
;  136 |  ReturnValue = HVAR(unsigned short,Address + CS8900IOBASE);
	.symb	LINE, 136
	mov.u	d15,#0x300			; -1337982208
	.symb	SOFF, 0
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	LTIM, "ReturnValue", -1, 0, 0x45
	.symb	LTIM, "ReturnValue", 2, 0, 0xcd
	addih	d15,d15,#0xb040			; -1337982208
	add16	d15,d4
	mov16.a	a15,d15
	ld.hu	d2,[a15]
;  137 |  
;  138 |  return ReturnValue;
;  139 |}
	.symb	LINE, 139
	ret16
	.symb	LTIM, "ReturnValue", 2, 0, 0x4d
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	EFUN
;  140 |
;  141 |// copies bytes from frame port to MCU-memory
;  142 |// NOTES: * an odd number of byte may only be transfered
;  143 |//          if the frame is read to the end!
;  144 |//        * MCU-memory MUST start at word-boundary
;  145 |
;  146 |void CopyFromFrame8900(void *Dest, unsigned short Size)
;  147 |{
	.symb	LINE, 147
	.symb	TYPE, 276, 'X', 8, #1, 26, 2, #269, #5
	.symb	GFUN, "CopyFromFrame8900", CopyFromFrame8900, #276, 0, 0, 0
	.symb	ALAB, CopyFromFrame8900, #276
CopyFromFrame8900:
	.symb	IDEN, "Dest", 20, #269, 0, 0x80d
	.symb	IDEN, "Size", 14, #5, 0, 0x80d
	.symb	IDEN, "piDest", -1, #271, 131, 0x5
	.symb	SOFF, 0
	.symb	LTIM, "Dest", 20, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
	.symb	LTIM, "piDest", -1, 0, 0x45
	.symb	LTIM, "piDest", 30, 0, 0xcd
	mov16	d14,d4				; Size
;  148 |  unsigned short * piDest;                         // Keil: Pointer added to correct expression
;  149 |
;  150 |  piDest = Dest;                                 // Keil: Line added
	.symb	LINE, 150
	mov16.aa a14,a4				; piDest
;  151 |  while (Size > 1) {
	.symb	LINE, 151
	j	_9
_8:
	.symb	LTIM, "Dest", 20, 0, 0x84d
	.symb	LTIM, "piDest", 30, 0, 0x4d
	.symb	LTIM, "piDest", 30, 0, 0xcd
	.symb	LTIM, "piDest", 30, 0, 0x4d
	.symb	LTIM, "piDest", 30, 0, 0xcd
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
;  152 |//  *((unsigned short *)Dest)++ = ReadFrame8900(); // Keil: Line replaced with following line
;  153 |    *piDest++ = ReadFrame8900();
	.symb	LINE, 153
	callg	ReadFrame8900
	add16	d14,#-2				; Size
	extr.u	d14,d14,#0,#16			; Size
	st16.h	[a14+],d2			; piDest
	.symb	LINE, 151
_9:
	.symb	LTIM, "piDest", 30, 0, 0x4d
	jge	d14,#2,_8
;  154 |    Size -= 2;
;  155 |  }
;  156 |  
;  157 |  if (Size)                                      // check for leftover byte...
	.symb	LINE, 157
	jeq	d14,#0,_10			; Size
;  158 |//  *(unsigned char *)Dest = ReadFrame8900();    // Keil: Line replaced with following line
;  159 |    *(unsigned char *)piDest = ReadFrame8900();  // the LAN-Controller will return 0
	.symb	LINE, 159
	callg	ReadFrame8900
	st16.b	[a14],d2			; piDest
_10:
;  160 |}                                                // for the highbyte
	.symb	LINE, 160
	ret16
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	EFUN
;  161 |
;  162 |// does a dummy read on frame-I/O-port
;  163 |// NOTE: only an even number of bytes is read!
;  164 |
;  165 |void DummyReadFrame8900(unsigned short Size)       // discards an EVEN number of bytes
;  166 |{                                                // from RX-fifo
	.symb	LINE, 166
	.symb	TYPE, 277, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "DummyReadFrame8900", DummyReadFrame8900, #277, 0, 0, 0
	.symb	ALAB, DummyReadFrame8900, #277
DummyReadFrame8900:
	.symb	IDEN, "Size", 14, #5, 0, 0x80d
	.symb	SOFF, 0
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
	mov16	d14,d4				; Size
;  167 |  while (Size > 1) {
	.symb	LINE, 167
	j	_12
_11:
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	LTIM, "Size", 14, 0, 0x8cd
;  168 |    ReadFrame8900();
	.symb	LINE, 168
	callg	ReadFrame8900
;  169 |    Size -= 2;
	.symb	LINE, 169
	add16	d14,#-2				; Size
	extr.u	d14,d14,#0,#16			; Size
	.symb	LINE, 167
_12:
	jge	d14,#2,_11
;  170 |  }
;  171 |}
	.symb	LINE, 171
	ret16
	.symb	LTIM, "Size", 14, 0, 0x84d
	.symb	EFUN
;  172 |
;  173 |// requests space in CS8900's on-chip memory for
;  174 |// storing an outgoing frame
;  175 |
;  176 |void RequestSend(unsigned short FrameSize)
;  177 |{
	.symb	LINE, 177
	.symb	TYPE, 278, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "RequestSend", RequestSend, #278, 0, 0, 0
	.symb	ALAB, RequestSend, #278
RequestSend:
	.symb	IDEN, "FrameSize", 14, #5, 0, 0x80d
	.symb	SOFF, 0
	.symb	LTIM, "FrameSize", 4, 0, 0x8cd
	.symb	LTIM, "FrameSize", 4, 0, 0x84d
	.symb	LTIM, "FrameSize", 14, 0, 0x8cd
	.symb	LTIM, "FrameSize", 14, 0, 0x84d
	.symb	LTIM, "FrameSize", 5, 0, 0x8cd
	.symb	LTIM, "FrameSize", 5, 0, 0x84d
	mov16	d14,d4				; FrameSize
;  178 |  Write8900(TX_CMD_PORT, TX_START_ALL_BYTES);
	.symb	LINE, 178
	mov16	d4,#4				; 4
	mov	d5,#192				; 192
	callg	Write8900
;  179 |  Write8900(TX_LEN_PORT, FrameSize);
	.symb	LINE, 179
	mov16	d4,#6				; 6
	mov16	d5,d14				; FrameSize
	jg	Write8900
	.symb	EFUN
;  180 |}
;  181 |
;  182 |// check if CS8900 is ready to accept the
;  183 |// frame we want to send
;  184 |
;  185 |unsigned short Rdy4Tx(void)
;  186 |{
	.symb	LINE, 186
	.symb	TYPE, 279, 'X', 8, #5, 26, 0
	.symb	GFUN, "Rdy4Tx", Rdy4Tx, #279, 0, 0, 0
	.symb	ALAB, Rdy4Tx, #279
Rdy4Tx:
;  187 |  Write8900(ADD_PORT, PP_BusST);
	.symb	LINE, 187
	mov	d4,#10				; 10
	.symb	SOFF, 0
	mov	d5,#312				; 312
	callg	Write8900
;  188 |  return (Read8900(DATA_PORT) & READY_FOR_TX_NOW);
	.symb	LINE, 188
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#256
;  189 |}
	.symb	LINE, 189
	ret16
	.symb	EFUN
;  190 |
	.symb	ENDF
	.symb	TYPE, 280, 'X', 8, #5, 26, 1, #5
	.symb	ALAB, SwapBytes, #280
	.symb	TYPE, 281, 'Z', #257, 4
	.symb	ALAB, InitSeq, #281
	.global	CopyFromFrame8900
	.global	CopyToFrame8900
	.global	DummyReadFrame8900
	.global	Init8900
	.global	Rdy4Tx
	.global	Read8900
	.global	ReadFrame8900
	.global	ReadFrameBE8900
	.global	ReadHB1ST8900
	.global	RequestSend
	.global	Write8900
	.global	WriteFrame8900
	.extern	(DATA) InitSeq
	.extern	(CODE) SwapBytes
	.calls	"CopyFromFrame8900", "ReadFrame8900"
	.calls	"CopyToFrame8900", "WriteFrame8900"
	.calls	"DummyReadFrame8900", "ReadFrame8900"
	.calls	"Init8900", "Read8900"
	.calls	"Init8900", "Write8900"
	.calls	"Rdy4Tx", "Read8900"
	.calls	"Rdy4Tx", "Write8900"
	.calls	"ReadFrameBE8900", "SwapBytes"
	.calls	"RequestSend", "Write8900"
