; TASKING TriCore C compiler v1.5r1 Build 322 SN 00090364
; options: -e -A1 -g -O0 -Id:\ctri\include -s -N8 -zTC112_COR1 -zTC112_COR4
;          -zTC112_COR10 -zTC112_COR13 -zTC112_COR14 -zTC112_COR16 -zTC112_COR17
	.name	"ethernet_test"
	.symb	TOOL, "TASKING TriCore C compiler v1.5", 1
	.symb	TYPE, 256, "bit", 'g', 0, 1
	.symb	FILE, "ethernet_test.c"
; file "ethernet_test.c":
;    1 |// File Ethernet_Test.c
;    2 |
;    3 |/*
;    4 |The following is the basic flow of the loopback test program
;    5 |This procedure assumes you are using 10B-T.  Use a "loopback" cable (see
;    6 |the Q/A on loopback cable fabrication).  A regular 10B-T cable connected to
;    7 |a hub will not work.
;    8 |
;    9 |Configure RxCTL for Promiscious mode, RxOK
;   10 |(1) Write 0x0104 to IOBase+0xA (PacketPage Pointer)
;   11 |(2) Write 0x0180h to IOBase+0xC (PacketPage Data Port)
;   12 |
;   13 |Configure TestCTL (FDX, DisableLT
;   14 |(3) Write 0x0118 to IOBase+0xA (PacketPage Pointer)
;   15 |(4) Write 0x4080 to IOBase+0xC (PacketPage Data Port)
;   16 |
;   17 |Set 10BaseT, SerRxOn, SerTxOn in LineCTL
;   18 |(5) Write 0x0112 to IOBase+0xA (PacketPage Pointer)
;   19 |(6) Write 0x00C0 to IOBase+0xC (PacketPage Data Port)
;   20 |
;   21 |Write the TX command
;   22 |(7) Write 00C0h to IOBase+0x4 (PacketPage Pointer)
;   23 |
;   24 |Write the frame length  (XX = number of bytes to TX)
;   25 |(8) Write 00XXh to IOBase+0x6 (PacketPage Pointer)
;   26 |
;   27 |Read BusST to verify it is set as 0x0118 (Rdy4TxNow is set)
;   28 |(9) Write 0x0138 to IOBase+0xA (PacketPage Pointer)
;   29 |(10) Read IOBase+0xC  Should read 0x0118
;   30 |
;   31 |Copy the TX frame to the on-chip buffer
;   32 |(11) Write XX/2 words to IOBase+0x0 (TX Data Port)
;   33 |
;   34 |At this point frame should go out on the wire.
;   35 |
;   36 |To read the TX'd frame:
;   37 |
;   38 |Read RxEvent for RxOK (0x0104)
;   39 |(12) Write 0x0124 to IOBase+0xA (PacketPage Pointer)
;   40 |(13) Read IOBase+0xC  Should read 0x0104 or 0x0504h
;   41 |
;   42 |Read IOBase+0  This will be the RxStatus (RxEvent) word again.
;   43 |Read IOBase+0 again.  This will be the RxLength (number of bytes received).
;   44 |Read IOBase+0 (RxLength/2) times to read complete frame.
;   45 |
;   46 |------------------------------------------
;   47 |Fabricating a "loopback" cable for testing
;   48 |------------------------------------------
;   49 |
;   50 |An easy way to fabricate a "loopback" cable for testing is to take a
;   51 |PCB 10B-T connector and jumper each row of pins together as shown
;   52 |in the diagram below.  Insert an ordinary 10B-T cable into the connector.
;   53 |This will connect the TX pair to the RX pair for a loopback cable.
;   54 |
;   55 |                    +----+----------+----+
;   56 |                    |    |          |    |
;   57 |                    |  o====o====o====o  |
;   58 |                    |    |          |    |
;   59 |                    |  o====o====o====o  |
;   60 |                    |    |          |    |
;   61 |                    |    +----------+    |
;   62 |                    |                    |
;   63 |                    \____________________/
;   64 |
;   65 |
;   66 |                         Bottom View
;   67 |
;   68 |*/
;   69 |//----------------------------------------------------------------------------
;   70 |
;   71 |#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
;   72 |#include "stdio.h"
	.symb	FILE, "d:\\ctri\\include\\stdio.h"
	.symb	FILE, "d:\\ctri\\include\\stdarg.h"
	.symb	ENDF
	.symb	TYPE, 260, 'P', #2
	.symb	TYPE, 261, "_iobuf", 'S', 24,\
		 "_ptr", #260, 0,\
		 "_base", #260, 4,\
		 "_cnt", #16, 8,\
		 "_bufsiz", #16, 12,\
		 "_flag", #5, 16,\
		 "_file", #2, 18,\
		 "_wcnt", #16, 20
	.symb	TYPE, 262, "FILE", 'T', #261
	.symb	TYPE, 263, "va_list", 'T', #260
	.symb	TYPE, 264, "size_t", 'T', #18
	.symb	TYPE, 265, "fpos_t", 'T', #7
	.symb	TYPE, 266, "off_t", 'T', #6
	.symb	ENDF
;   73 |#define CS8900IOBASE 0xB0800300
;   74 |#define SIZE_OF_FRAME    100 // in words
;   75 |#define LOOP_FRAME_DATA 0x1234    
;   76 |
;   77 |unsigned char ucEthernetTest(void)
;   78 |{
	.sdecl	"code.ethernet_test",CODE
	.sect	"code.ethernet_test"
	.align	4
	.symb	LINE, 78
	.symb	TYPE, 267, 'X', 8, #3, 26, 0
	.symb	GFUN, "ucEthernetTest", ucEthernetTest, #267, 0, 32, 0
	.symb	ALAB, ucEthernetTest, #267
ucEthernetTest:
	.symb	SOFF, 32
	.symb	IDEN, "j", -28, #3, 131, 0x5
	.symb	IDEN, "usEther1", -24, #5, 131, 0x5
	.symb	IDEN, "usEther2", -20, #5, 131, 0x5
	.symb	IDEN, "usEther", -16, #5, 131, 0x5
	.symb	IDEN, "uiEther", -12, #18, 131, 0x5
	.symb	IDEN, "ucErrorFlag", -8, #3, 131, 0x5
	nop
	sub16.a	sp,#32
;   79 |
;   80 |unsigned char j;
;   81 |unsigned short usEther1, usEther2, usEther;
;   82 |unsigned int uiEther;
;   83 |unsigned char ucErrorFlag;
;   84 |
;   85 |ucErrorFlag = 0;
	.symb	LINE, 85
	mov16	d15,#0				; ucErrorFlag
	st.b	[sp]24,d15			; ucErrorFlag
;   86 |printf("Testing Ethernet Controller...\n");
	.symb	LINE, 86
	movh.a	a4,#@his(_17)
	lea	a4,[a4]@los(_17)
	callg	printf
;   87 |
;   88 |//   Write8900(0x0A,0x0136);
;   89 |//   uiEther = Read8900(0x0C);
;   90 |//   printf("\SelfST im I/O-Modus(0x1696):  %X\n",uiEther);
;   91 |
;   92 |
;   93 |// read Product Identification Register. Should be 0E630009 = CS8900A
;   94 |  	Write8900(0x0A,0x0000);
	.symb	LINE, 94
	mov	d4,#10				; 10
	mov16	d5,#0				; 0
	callg	Write8900
;   95 |  	usEther1 = Read8900(0x0C);
	.symb	LINE, 95
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]8,d2			; usEther1
;   96 |  	usEther1=SwapBytes(usEther1);
	.symb	LINE, 96
	ld.hu	d4,[sp]8			; usEther1
	callg	SwapBytes
	st.h	[sp]8,d2			; usEther1
;   97 |  	Write8900(0x0A,0x0002);
	.symb	LINE, 97
	mov	d4,#10				; 10
	mov16	d5,#2				; 2
	callg	Write8900
;   98 |  	usEther2 = Read8900(0x0C);
	.symb	LINE, 98
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]12,d2			; usEther2
;   99 |  	usEther2=SwapBytes(usEther2);
	.symb	LINE, 99
	ld.hu	d4,[sp]12			; usEther2
	callg	SwapBytes
	st.h	[sp]12,d2			; usEther2
;  100 |// printf("\nProd-ID im I/O-Modus:  %4X%4X\n",usEther1,usEther2);
;  101 |  	uiEther = usEther1; 
	.symb	LINE, 101
	ld.hu	d15,[sp]8			; usEther1
	st16.w	[sp]20,d15			; uiEther
;  102 |  	uiEther=uiEther<<16; 
	.symb	LINE, 102
	ld16.w	d15,[sp]20			; uiEther
	sh	d15,d15,#16			; uiEther
	st16.w	[sp]20,d15			; uiEther
;  103 |  	uiEther = uiEther + usEther2;
	.symb	LINE, 103
	ld16.w	d15,[sp]20			; uiEther
	ld.hu	d7,[sp]12			; usEther2
	add16	d15,d7				; uiEther
	st16.w	[sp]20,d15			; uiEther
;  104 |  	if (uiEther != 0x0E630009)
	.symb	LINE, 104
	ld16.w	d15,[sp]20			; uiEther
	mov.u	d7,#0x9				; 241369097
	addih	d7,d7,#0xe63			; 241369097
	jeq	d15,d7,_25
;  105 |	{
;  106 |	printf("	ERROR: Ethernet Controller not supported! %X\n",uiEther);  
	.symb	LINE, 106
	movh.a	a4,#@his(_18)
	lea	a4,[a4]@los(_18)
	ld16.w	d15,[sp]20			; uiEther
	st16.w	[sp],d15			; uiEther
	callg	printf
;  107 |	return(ucErrorFlag = 1);
	.symb	LINE, 107
	mov16	d2,#1				; 1
	st.b	[sp]24,d2			; ucErrorFlag
	ret16
;  108 |	}
	.symb	LINE, 108
_25:
;  109 |   	else	printf("	Ethernet Controller CS8900A detected\n"); 
	.symb	LINE, 109
	movh.a	a4,#@his(_19)
	lea	a4,[a4]@los(_19)
	callg	printf
;  110 |
;  111 |//Read Self Status Register.
;  112 |  	Write8900(0x0A,0x0136);
	.symb	LINE, 112
	mov	d4,#10				; 10
	mov	d5,#310				; 310
	callg	Write8900
;  113 |  	usEther = Read8900(0x0C);
	.symb	LINE, 113
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]16,d2			; usEther
;  114 |//  	BitsSelfTestReg(usEther);
;  115 |  	if(usEther && (ACTIVE_33V || EEPROM_PRESENT || INIT_DONE))
	.symb	LINE, 115
	ld.hu	d15,[sp]16			; usEther
	jeq	d15,#0,_26			; usEther
;  116 |		printf("	EEPROM detected\n");
	.symb	LINE, 116
	movh.a	a4,#@his(_20)
	lea	a4,[a4]@los(_20)
	callg	printf
	j	_27
_26:
;  117 |		else 
;  118 |   		{
;  119 |   		printf("	ERROR: Ethernet EEPROM not present\n");
	.symb	LINE, 119
	movh.a	a4,#@his(_21)
	lea	a4,[a4]@los(_21)
	callg	printf
;  120 |		return(ucErrorFlag = 1);
	.symb	LINE, 120
	mov16	d2,#1				; 1
	st.b	[sp]24,d2			; ucErrorFlag
	ret16
;  121 |		}
	.symb	LINE, 121
_27:
;  122 |// Start external Looptest
;  123 |printf("	Start of external loop test...\n");
	.symb	LINE, 123
	movh.a	a4,#@his(_22)
	lea	a4,[a4]@los(_22)
	callg	printf
;  124 |
;  125 |Init8900loop();	//initialize for external loop test
	.symb	LINE, 125
	callg	Init8900loop
;  126 |
;  127 |RequestSend(SIZE_OF_FRAME * 2); //reserve memory in CS8900 first
	.symb	LINE, 127
	mov	d4,#200				; 200
	callg	RequestSend
;  128 |
;  129 |Write8900(ADD_PORT, PP_BusST);
	.symb	LINE, 129
	mov	d4,#10				; 10
	mov	d5,#312				; 312
	callg	Write8900
;  130 |while(!(Read8900(DATA_PORT) & READY_FOR_TX_NOW));  //wait for  Ready for TX
	.symb	LINE, 130
	j	_29
_28:
_29:
_30:
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#256
	jeq	d2,#0,_30
;  131 |
;  132 |for (j = 0; j < SIZE_OF_FRAME; j++)  // fill frame buffer for transmission
	.symb	LINE, 132
	mov16	d15,#0				; j
	st16.b	[sp]4,d15			; j
	j	_32
_31:
;  133 | 	{								 // and send frame
;  134 |    WriteFrame8900(LOOP_FRAME_DATA);
	.symb	LINE, 134
	mov	d4,#4660			; 4660
	callg	WriteFrame8900
	.symb	LINE, 132
	ld16.bu	d15,[sp]4			; j
	add16	d15,#1				; j
	st16.b	[sp]4,d15			; j
_32:
	nop
	ld16.bu	d15,[sp]4			; j
	lt	d15,d15,#100
	jne	d15,#0,_31
;  135 |    }
;  136 |
;  137 |Write8900(ADD_PORT, PP_RxEvent);
	.symb	LINE, 137
	mov	d4,#10				; 10
	mov	d5,#292				; 292
	callg	Write8900
;  138 |while(!(Read8900(DATA_PORT) & RX_OK)); // wait for Frame Revieved
	.symb	LINE, 138
	j	_34
_33:
_34:
_35:
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#256
	jeq	d2,#0,_35
;  139 |
;  140 |///*
;  141 |if ((Read8900(RX_FRAME_PORT) == 0x0104) && 
;  142 |		(Read8900(RX_FRAME_PORT) == 0xC8) &&
;  143 |		(Read8900(RX_FRAME_PORT) == 0x1234))
	.symb	LINE, 143
	mov16	d4,#0				; 0
	callg	Read8900
	mov	d15,#260			; 260
	jne	d2,d15,_38
	mov16	d4,#0				; 0
	callg	Read8900
	eq	d2,d2,#200
	jeq	d2,#0,_38
	mov16	d4,#0				; 0
	callg	Read8900
	mov	d15,#4660			; 4660
	jne	d2,d15,_38
;  144 |		printf("	External looptest O.K.\n");
	.symb	LINE, 144
	movh.a	a4,#@his(_23)
	lea	a4,[a4]@los(_23)
	callg	printf
	j	_39
_38:
;  145 |    else
;  146 |    {
;  147 |	printf("	ERROR: External looptest failed\n");
	.symb	LINE, 147
	movh.a	a4,#@his(_24)
	lea	a4,[a4]@los(_24)
	callg	printf
;  148 |	return(ucErrorFlag = 1);
	.symb	LINE, 148
	mov16	d2,#1				; 1
	st.b	[sp]24,d2			; ucErrorFlag
	ret16
;  149 |    }
	.symb	LINE, 149
_39:
;  150 |//*/
;  151 |// to use these printf´s, command out the if sentence above!
;  152 |//printf (" RxStatus (0x0104) = %4X\n",Read8900(RX_FRAME_PORT));
;  153 |//printf (" RxLenght = %4X\n",Read8900(RX_FRAME_PORT));
;  154 |//printf (" Frame Data = %4X\n",Read8900(RX_FRAME_PORT));
;  155 |return(ucErrorFlag = 0);
	.symb	LINE, 155
	mov16	d2,#0				; 0
	st.b	[sp]24,d2			; ucErrorFlag
;  156 |}
	.symb	LINE, 156
_42:
	ret16
	.symb	EFUN
;  157 |// --------------------------  end of test--------------------------------------
;  158 |
;  159 |
;  160 |// -------------------------- MAC-Adress programming ---------------------------
;  161 |
;  162 |unsigned char ucProgMAC(void)
;  163 |{
	.symb	LINE, 163
	.sdecl	"farrom.ethernet_test",ROMDATA
	.sect	"farrom.ethernet_test"
	.align	4
_43:
	.byte	0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10
	.byte	0xff
	.align	2
_44:
	.half	0x0000,0x0000,0x0000
_45:
	.half	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
	.sect	"code.ethernet_test"
	.symb	TYPE, 268, 'X', 8, #3, 26, 0
	.symb	GFUN, "ucProgMAC", ucProgMAC, #268, 0, 64, 0
	.symb	ALAB, ucProgMAC, #268
ucProgMAC:
	.symb	SOFF, 64
	.symb	IDEN, "neu_schreiben_i", -64, #3, 131, 0x5
	.symb	IDEN, "faktor_i", -60, #5, 131, 0x5
	.symb	IDEN, "timeout_i", -56, #5, 131, 0x5
	.symb	IDEN, "ucErrorFlag", -52, #3, 131, 0x5
	.symb	TYPE, 269, 'Z', #3, 12
	.symb	IDEN, "mac_filter_i", -48, #269, 129, 0x5
	nop
	sub16.a	sp,#64
;  164 |
;  165 |unsigned char neu_schreiben_i='n';
	.symb	LINE, 165
	mov16	d15,#110			; neu_schreiben_i
	st16.b	[sp],d15			; neu_schreiben_i
;  166 |unsigned short faktor_i=0x10, timeout_i=0;
	.symb	LINE, 166
	mov16	d15,#16				; faktor_i
	st16.h	[sp]4,d15			; faktor_i
	mov16	d15,#0				; timeout_i
	st16.h	[sp]8,d15			; timeout_i
;  167 |unsigned char ucErrorFlag;
;  168 |
;  169 |unsigned char mac_filter_i[13]={0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xFF};
	.symb	LINE, 169
	movh.a	a15,#@his(_43)			; _43
	lea	a15,[a15]@los(_43)		; _43
	lea	a7,[sp]16			; mac_filter_i
	mov16.a	a6,#12				; mac_filter_i
_116:
	.symb	TYPE, 271, 'Z', #5, 2
	.symb	IDEN, "mac_i", -32, #271, 129, 0x5
	.symb	TYPE, 273, 'Z', #5, 5
	.symb	IDEN, "EEPROM_test_i", -24, #273, 129, 0x5
	nop
	ld16.bu	d15,[a15+]
	st16.b	[a7+],d15
	isync
	loop16	a6,_116
;  170 |unsigned short mac_i[3]={0x0000,0x0000,0x0000}, EEPROM_test_i[6]={0x0000,0x0000,0x0000,0x0000,0x0000,0x0000};
	.symb	LINE, 170
	movh.a	a15,#@his(_44)			; _44
	lea	a15,[a15]@los(_44)		; _44
	lea	a7,[sp]32			; mac_i
	ld16.w	d15,[a15+]
	st16.w	[a7+],d15
	ld16.h	d15,[a15+]
	st16.h	[a7+],d15
	movh.a	a15,#@his(_45)			; _45
	lea	a15,[a15]@los(_45)		; _45
	lea	a7,[sp]40			; EEPROM_test_i
	mov16.a	a6,#2				; EEPROM_test_i
_117:
	.symb	IDEN, "checksumme_i", -12, #5, 131, 0x5
	.symb	IDEN, "index_i", -8, #5, 131, 0x5
	.symb	IDEN, "counter", -4, #5, 131, 0x5
	nop
	ld16.w	d15,[a15+]
	st16.w	[a7+],d15
	isync
	loop16	a6,_117
;  171 |unsigned short checksumme_i=0,index_i=0;
	.symb	LINE, 171
	mov16	d15,#0				; checksumme_i
	st.h	[sp]52,d15			; checksumme_i
	mov16	d15,#0				; index_i
	st.h	[sp]56,d15			; index_i
;  172 |unsigned short counter;
;  173 |			
;  174 | do  // ungültige Zeichen werden angezeigt aber ignoriert
	.symb	LINE, 174
_58:
;  175 | { 
;  176 |  printf("Bitte geben Sie die MAC Adesse ein (Abbruch und Neueingabe mit ESC)!\n");
	.symb	LINE, 176
	movh.a	a4,#@his(_46)
	lea	a4,[a4]@los(_46)
	callg	printf
;  177 |  printf(" 12 Stellen hexadezimal (ungültige Zeichen werden ignoriert) :\n\t\t");
	.symb	LINE, 177
	movh.a	a4,#@his(_47)
	lea	a4,[a4]@los(_47)
	callg	printf
;  178 |  for(index_i=0;index_i<12;index_i++)
	.symb	LINE, 178
	mov16	d15,#0				; index_i
	st.h	[sp]56,d15			; index_i
	j	_87
_59:
;  179 |  { 
;  180 |   do  
	.symb	LINE, 180
_60:
_61:
;  181 |   { 
;  182 |    mac_filter_i[12]=getchar(); // einlesen und in Hex-Werte wandeln
	.symb	LINE, 182
	movh.a	a15,#@his(_iob+8)
	lea	a15,[a15]@los(_iob+8)
	ld16.w	d15,[a15]
	add16	d15,#1
	movh.a	a15,#@his(_iob+8)
	lea	a15,[a15]@los(_iob+8)
	st16.w	[a15],d15
	jge	d15,#0,_112
	movh.a	a7,#@his(_iob)
	lea	a7,[a7]@los(_iob)
	ld.a	a15,[a7]
	ld.b	d15,[a15]
	and	d15,d15,#255
	add16.a	a15,#1
	movh.a	a7,#@his(_iob)
	lea	a7,[a7]@los(_iob)
	st.a	[a7],a15
	j	_113
_112:
	movh.a	a4,#@his(_iob)
	lea	a4,[a4]@los(_iob)
	callg	_filbuf
	mov16	d15,d2
_113:
	nop
	st.b	[sp]28,d15
;  183 |    if((mac_filter_i[12]-0x30) < 10) mac_filter_i[index_i] = mac_filter_i[12]-0x30;
	.symb	LINE, 183
	ld.bu	d15,[sp]28
	addi	d15,d15,#-48
	lt	d15,d15,#10
	jeq	d15,#0,_62
	ld.bu	d15,[sp]28
	addi	d15,d15,#-48
	lea	a15,[sp]16
	ld.hu	d7,[sp]56			; index_i
	addsc.a	a15,a15,d7,#0
	st16.b	[a15],d15
	j	_83
_62:
;  184 |    else if(mac_filter_i[12] == 'A' || mac_filter_i[12] == 'a') mac_filter_i[index_i] = 0x0A;
	.symb	LINE, 184
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#65
	jne	d15,#0,_63
	ld.bu	d15,[sp]28
	eq	d15,d15,#97
	jeq	d15,#0,_64
_63:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#10				; 10
	st16.b	[a15],d15
	j	_82
_64:
;  185 |    else if(mac_filter_i[12] == 'B' || mac_filter_i[12] == 'b') mac_filter_i[index_i] = 0x0B;
	.symb	LINE, 185
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#66
	jne	d15,#0,_65
	ld.bu	d15,[sp]28
	eq	d15,d15,#98
	jeq	d15,#0,_66
_65:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#11				; 11
	st16.b	[a15],d15
	j	_81
_66:
;  186 |    else if(mac_filter_i[12] == 'C' || mac_filter_i[12] == 'c') mac_filter_i[index_i] = 0x0C;
	.symb	LINE, 186
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#67
	jne	d15,#0,_67
	ld.bu	d15,[sp]28
	eq	d15,d15,#99
	jeq	d15,#0,_68
_67:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#12				; 12
	st16.b	[a15],d15
	j	_80
_68:
;  187 |    else if(mac_filter_i[12] == 'D' || mac_filter_i[12] == 'd') mac_filter_i[index_i] = 0x0D;
	.symb	LINE, 187
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#68
	jne	d15,#0,_69
	ld.bu	d15,[sp]28
	eq	d15,d15,#100
	jeq	d15,#0,_70
_69:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#13				; 13
	st16.b	[a15],d15
	j	_79
_70:
;  188 |    else if(mac_filter_i[12] == 'E' || mac_filter_i[12] == 'e') mac_filter_i[index_i] = 0x0E;
	.symb	LINE, 188
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#69
	jne	d15,#0,_71
	ld.bu	d15,[sp]28
	eq	d15,d15,#101
	jeq	d15,#0,_72
_71:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#14				; 14
	st16.b	[a15],d15
	j	_78
_72:
;  189 |    else if(mac_filter_i[12] == 'F' || mac_filter_i[12] == 'f') mac_filter_i[index_i] = 0x0F;
	.symb	LINE, 189
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#70
	jne	d15,#0,_73
	ld.bu	d15,[sp]28
	eq	d15,d15,#102
	jeq	d15,#0,_74
_73:
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#15				; 15
	st16.b	[a15],d15
	j	_77
_74:
;  190 |    else if(mac_filter_i[12] == 0x1B) mac_filter_i[index_i] = 0x10 ;//Escape 
	.symb	LINE, 190
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#27
	jeq	d15,#0,_75
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#16				; 16
	st16.b	[a15],d15
	j	_76
_75:
;  191 |    else mac_filter_i[index_i] = 0x10; // vergl. Abbruchbedingung => Fehlerkontrolle! beliebiger Wert >0xF und nicht 0x1B
	.symb	LINE, 191
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	mov16	d15,#16				; 16
	st16.b	[a15],d15
_76:
_77:
_78:
_79:
_80:
_81:
_82:
_83:
;  192 |   }
;  193 |   while (((mac_filter_i[index_i] <0x00) || (mac_filter_i[index_i] >0x0F)) && mac_filter_i[12]!=0x1B);
	.symb	LINE, 193
	nop
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	ld16.bu	d15,[a15]
	jlt	d15,#0,_84
	lea	a15,[sp]16
	ld.hu	d15,[sp]56			; index_i
	addsc.a	a15,a15,d15,#0
	ld16.bu	d15,[a15]
	ge	d15,d15,#16
	jeq	d15,#0,_85
_84:
	nop
	ld.bu	d15,[sp]28
	ne	d15,d15,#27
	jne	d15,#0,_61
_85:
;  194 |   if(mac_filter_i[12] == 0x1B) break; // wenn ECS dann nochmal neu
	.symb	LINE, 194
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#27
	jeq	d15,#0,_86
	j	_88
_86:
	.symb	LINE, 178
	nop
	ld.hu	d15,[sp]56			; index_i
	add16	d15,#1				; index_i
	st.h	[sp]56,d15			; index_i
_87:
	nop
	ld.hu	d15,[sp]56			; index_i
	lt	d15,d15,#12
	jne	d15,#0,_60
;  195 |  }
	.symb	LINE, 195
_88:
;  196 | }
;  197 | while(mac_filter_i[12] == 0x1B);
	.symb	LINE, 197
	nop
	ld.bu	d15,[sp]28
	eq	d15,d15,#27
	jne	d15,#0,_58
;  198 | mac_i[0] = (int)mac_filter_i[0]  * 0x1000 + (int)mac_filter_i[1] * 0x100 + (int)mac_filter_i[2] * 0x10 + mac_filter_i[3];
	.symb	LINE, 198
	ld.bu	d15,[sp]16
	sha	d15,d15,#12
	ld.bu	d7,[sp]17
	sha	d7,d7,#8
	add16	d15,d7
	ld.bu	d7,[sp]18
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]19
	add16	d15,d7
	st.h	[sp]32,d15
;  199 | mac_i[1] = (int)mac_filter_i[4]  * 0x1000 + (int)mac_filter_i[5] * 0x100 + (int)mac_filter_i[6] * 0x10 + mac_filter_i[7];
	.symb	LINE, 199
	ld.bu	d15,[sp]20
	sha	d15,d15,#12
	ld.bu	d7,[sp]21
	sha	d7,d7,#8
	add16	d15,d7
	ld.bu	d7,[sp]22
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]23
	add16	d15,d7
	st.h	[sp]34,d15
;  200 | mac_i[2] = (int)mac_filter_i[8]  * 0x1000 + (int)mac_filter_i[9] * 0x100 + (int)mac_filter_i[10] * 0x10 + mac_filter_i[11];
	.symb	LINE, 200
	ld.bu	d15,[sp]24
	sha	d15,d15,#12
	ld.bu	d7,[sp]25
	sha	d7,d7,#8
	add16	d15,d7
	ld.bu	d7,[sp]26
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]27
	add16	d15,d7
	st.h	[sp]36,d15
;  201 | // Vorbereiten der Checksumme für das Beschreiben des EEPROMs
;  202 | checksumme_i = (-1 * (0xA1 + 0x0A + 0x21 + 0x58 +
;  203 |                mac_filter_i[0] *0x10 + mac_filter_i[1] + mac_filter_i[2] *0x10 + mac_filter_i[3] + 
;  204 |                mac_filter_i[4] *0x10 + mac_filter_i[5] + mac_filter_i[6] *0x10 + mac_filter_i[7] + 
;  205 |                mac_filter_i[8] *0x10 + mac_filter_i[9] + mac_filter_i[10] *0x10 + mac_filter_i[11]));
	.symb	LINE, 205
	ld.bu	d15,[sp]16
	sha16	d15,#4
	ld.bu	d7,[sp]17
	add16	d15,d7
	ld.bu	d7,[sp]18
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]19
	add16	d15,d7
	ld.bu	d7,[sp]20
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]21
	add16	d15,d7
	ld.bu	d7,[sp]22
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]23
	add16	d15,d7
	ld.bu	d7,[sp]24
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]25
	add16	d15,d7
	ld.bu	d7,[sp]26
	sha16	d7,#4
	add16	d15,d7
	ld.bu	d7,[sp]27
	add16	d15,d7
	mov	d7,#-292			; -292
	sub	d15,d7,d15
	st.h	[sp]52,d15			; checksumme_i
;  206 | checksumme_i=(unsigned char)checksumme_i << 8;
	.symb	LINE, 206
	ld.hu	d15,[sp]52			; checksumme_i
	extr.u	d15,d15,#0,#8			; checksumme_i
	sha	d15,d15,#8
	st.h	[sp]52,d15			; checksumme_i
;  207 |
;  208 |// printf("Checksumme:  %4X\n",checksumme_i);
;  209 |
;  210 | /*
;  211 | printf("MAC-Adresse:  ");
;  212 | for(index_i=0;index_i<3;index_i++)
;  213 |  printf(" %4X",mac_i[index_i]);
;  214 | printf("\n");
;  215 | */
;  216 |//++++++++++++++++++++++++++ EEPROM programmieren ++++++++++++++++++++
;  217 |
;  218 |//Status
;  219 |//Write8900(0x0A,0x0136);printf("\n SelfST (0x1696):  %4X\n",Read8900(0x0C)); // zur Kontrolle wenn EEPROM schon geschrieben ist
;  220 |//Schreibschutz aufheben
;  221 |do
	.symb	LINE, 221
_89:
;  222 |{
;  223 | printf("MAC-Adresse wird gespeichert");
	.symb	LINE, 223
	movh.a	a4,#@his(_48)
	lea	a4,[a4]@los(_48)
	callg	printf
;  224 | warten8900(faktor_i);
	.symb	LINE, 224
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
;  225 | Write8900(0x0A,0x0040); 
	.symb	LINE, 225
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
;  226 |// Write8900(0x0C,0x0030);// Erase/Write Enable 93c46
;  227 | Write8900(0x0C,0x00C0);// Erase/Write Enable 93c66
	.symb	LINE, 227
	mov	d4,#12				; 12
	mov	d5,#192				; 192
	callg	Write8900
;  228 | // Löschen
;  229 | warten8900(faktor_i);
	.symb	LINE, 229
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
;  230 | Write8900(0x0A,0x0040);
	.symb	LINE, 230
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
;  231 |// Write8900(0x0C,0x0020);// alle Register löschen 93c46
;  232 | Write8900(0x0C,0x0080);// alle Register löschen 93c66
	.symb	LINE, 232
	mov	d4,#12				; 12
	mov	d5,#128				; 128
	callg	Write8900
;  233 |
;  234 | for(counter=0;counter<10000;counter++);
	.symb	LINE, 234
	mov16	d15,#0				; counter
	st.h	[sp]60,d15			; counter
	j	_91
_90:
	nop
	ld.hu	d15,[sp]60			; counter
	add16	d15,#1				; counter
	st.h	[sp]60,d15			; counter
_91:
	nop
	ld.hu	d15,[sp]60			; counter
	mov	d7,#10000			; 10000
	jlt	d15,d7,_90
;  235 | // Schreiben
;  236 | Write8900_EEPROM(0x00,0xA10A);
	.symb	LINE, 236
	mov16	d4,#0				; 0
	mov.u	d5,#41226			; 41226
	callg	Write8900_EEPROM
;  237 | Write8900_EEPROM(0x01,0x2158);
	.symb	LINE, 237
	mov16	d4,#1				; 1
	mov	d5,#8536			; 8536
	callg	Write8900_EEPROM
;  238 | Write8900_EEPROM(0x02,mac_i[0]);
	.symb	LINE, 238
	mov16	d4,#2				; 2
	ld.hu	d5,[sp]32
	callg	Write8900_EEPROM
;  239 | Write8900_EEPROM(0x03,mac_i[1]);
	.symb	LINE, 239
	mov16	d4,#3				; 3
	ld.hu	d5,[sp]34
	callg	Write8900_EEPROM
;  240 | Write8900_EEPROM(0x04,mac_i[2]);
	.symb	LINE, 240
	mov16	d4,#4				; 4
	ld.hu	d5,[sp]36
	callg	Write8900_EEPROM
;  241 | Write8900_EEPROM(0x05,checksumme_i);//*/
	.symb	LINE, 241
	mov16	d4,#5				; 5
	ld.hu	d5,[sp]52			; checksumme_i
	callg	Write8900_EEPROM
;  242 | // Schreibschutz einschalten
;  243 | warten8900(faktor_i);Write8900(0x0A,0x0040);  
	.symb	LINE, 243
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
;  244 | warten8900(faktor_i);Write8900(0x0A,0x0000); 
	.symb	LINE, 244
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov16	d5,#0				; 0
	callg	Write8900
;  245 |
;  246 | // zum Test auslesen
;  247 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0000); // von Adresse im EEPROM
	.symb	LINE, 247
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#512				; 512
	callg	Write8900
;  248 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 248
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  249 | //printf("\nEEPROM-Wert 00h:  %4X",Read8900(0x0C)); // und Wert auslesen 
;  250 | EEPROM_test_i[0] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 250
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]40,d2
;  251 | 
;  252 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0001); // von Adresse im EEPROM
	.symb	LINE, 252
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#513				; 513
	callg	Write8900
;  253 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 253
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  254 | //printf("\nEEPROM-Wert 01h:  %4X",Read8900(0x0C)); // und Wert auslesen
;  255 | EEPROM_test_i[1] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 255
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]42,d2
;  256 | 
;  257 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0002); // von Adresse im EEPROM
	.symb	LINE, 257
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#514				; 514
	callg	Write8900
;  258 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 258
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  259 | //printf("\nEEPROM-Wert 02h:  %4X",Read8900(0x0C)); // und Wert auslesen
;  260 | EEPROM_test_i[2] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 260
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]44,d2
;  261 |  
;  262 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0003); // von Adresse im EEPROM
	.symb	LINE, 262
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#515				; 515
	callg	Write8900
;  263 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 263
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  264 | //printf("\nEEPROM-Wert 03h:  %4X",Read8900(0x0C)); // und Wert auslesen
;  265 | EEPROM_test_i[3] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 265
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]46,d2
;  266 | 
;  267 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0004); // von Adresse im EEPROM
	.symb	LINE, 267
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#516				; 516
	callg	Write8900
;  268 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 268
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  269 | //printf("\nEEPROM-Wert 04h:  %4X",Read8900(0x0C)); // und Wert auslesen
;  270 | EEPROM_test_i[4] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 270
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]48,d2
;  271 | 
;  272 | warten8900(faktor_i);Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | 0x0005); // von Adresse im EEPROM
	.symb	LINE, 272
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	mov	d5,#517				; 517
	callg	Write8900
;  273 | warten8900(faktor_i);Write8900(0x0A,0x0042); 
	.symb	LINE, 273
	ld.hu	d4,[sp]4			; faktor_i
	callg	warten8900
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  274 | //printf("\nEEPROM-Wert 05h:  %4X",Read8900(0x0C)); // und Wert auslesen 
;  275 | EEPROM_test_i[5] = Read8900(0x0C);// zur Sicherheit noch mal auslesen
	.symb	LINE, 275
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]50,d2
;  276 |
;  277 | if((0xA10A != EEPROM_test_i[0]) || (0x2158 != EEPROM_test_i[1]) || 
;  278 |    (mac_i[0] != EEPROM_test_i[2]) || (mac_i[1] != EEPROM_test_i[3]) || (mac_i[2] != EEPROM_test_i[4]) || 
;  279 |    (checksumme_i != EEPROM_test_i[5]))
	.symb	LINE, 279
	ld.hu	d15,[sp]40
	mov.u	d7,#41226			; 41226
	jne	d15,d7,_96
	ld.hu	d15,[sp]42
	mov	d7,#8536			; 8536
	jne	d15,d7,_96
	ld.hu	d15,[sp]32
	ld.hu	d7,[sp]44
	jne	d15,d7,_96
	ld.hu	d15,[sp]34
	ld.hu	d7,[sp]46
	jne	d15,d7,_96
	ld.hu	d15,[sp]36
	ld.hu	d7,[sp]48
	jne	d15,d7,_96
	ld.hu	d15,[sp]52			; checksumme_i
	ld.hu	d7,[sp]50
	jeq	d15,d7,_104
_96:
;  280 | {
;  281 |  do  
	.symb	LINE, 281
_97:
;  282 |  { 
;  283 |   printf("\n MAC-Adresse nicht richtig gespeichert!! Noch ein Versuch ? ");
	.symb	LINE, 283
	movh.a	a4,#@his(_49)
	lea	a4,[a4]@los(_49)
	callg	printf
;  284 |   neu_schreiben_i = getchar();
	.symb	LINE, 284
	movh.a	a15,#@his(_iob+8)
	lea	a15,[a15]@los(_iob+8)
	ld16.w	d15,[a15]
	add16	d15,#1
	movh.a	a15,#@his(_iob+8)
	lea	a15,[a15]@los(_iob+8)
	st16.w	[a15],d15
	jge	d15,#0,_114
	movh.a	a7,#@his(_iob)
	lea	a7,[a7]@los(_iob)
	ld.a	a15,[a7]
	ld.b	d15,[a15]
	and	d15,d15,#255
	add16.a	a15,#1
	movh.a	a7,#@his(_iob)
	lea	a7,[a7]@los(_iob)
	st.a	[a7],a15
	j	_115
_114:
	movh.a	a4,#@his(_iob)
	lea	a4,[a4]@los(_iob)
	callg	_filbuf
	mov16	d15,d2
_115:
	nop
	st16.b	[sp],d15			; neu_schreiben_i
;  285 |  }
;  286 |  while ((neu_schreiben_i != 'J' ) && (neu_schreiben_i != 'j') && (neu_schreiben_i != 'n') && (neu_schreiben_i != 'N')); 
	.symb	LINE, 286
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#74
	jeq	d15,#0,_100
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#106
	jeq	d15,#0,_100
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#110
	jeq	d15,#0,_100
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#78
	jne	d15,#0,_97
_100:
;  287 |  faktor_i+=2;
	.symb	LINE, 287
	nop
	ld.hu	d15,[sp]4			; faktor_i
	add16	d15,#2				; faktor_i
	st16.h	[sp]4,d15			; faktor_i
;  288 |  if(faktor_i>0x100)faktor_i=0x100;
	.symb	LINE, 288
	ld.hu	d15,[sp]4			; faktor_i
	mov	d7,#256				; 256
	jge	d7,d15,_101
	mov	d15,#256			; faktor_i
	st16.h	[sp]4,d15			; faktor_i
_101:
;  289 |  if(neu_schreiben_i == 'N' || neu_schreiben_i == 'n'  )
	.symb	LINE, 289
	nop
	ld16.bu	d15,[sp]			; neu_schreiben_i
	eq	d15,d15,#78
	jne	d15,#0,_102
	ld16.bu	d15,[sp]			; neu_schreiben_i
	eq	d15,d15,#110
	jeq	d15,#0,_103
_102:
;  290 |  {
;  291 |   printf("\n MAC-Adresse nicht richtig gespeichert!!\n\t Ethernet-Test ABGEBROCHEN!!\n");
	.symb	LINE, 291
	movh.a	a4,#@his(_50)
	lea	a4,[a4]@los(_50)
	callg	printf
;  292 |   return(ucErrorFlag = 1);
	.symb	LINE, 292
	mov16	d2,#1				; 1
	st.b	[sp]12,d2			; ucErrorFlag
	ret16
;  293 |  }
	.symb	LINE, 293
_103:
;  294 | }
	.symb	LINE, 294
_104:
;  295 |}
;  296 |while(neu_schreiben_i != 'N' && neu_schreiben_i != 'n');  
	.symb	LINE, 296
	nop
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#78
	jeq	d15,#0,_105
	ld16.bu	d15,[sp]			; neu_schreiben_i
	ne	d15,d15,#110
	jne	d15,#0,_89
_105:
;  297 |
;  298 |
;  299 |printf("\nSoftware-Reset ");
	.symb	LINE, 299
	movh.a	a4,#@his(_51)
	lea	a4,[a4]@los(_51)
	callg	printf
;  300 |Write8900(0x0A,0x0114);
	.symb	LINE, 300
	mov	d4,#10				; 10
	mov	d5,#276				; 276
	callg	Write8900
;  301 |Write8900(0x0C,0x0055);
	.symb	LINE, 301
	mov	d4,#12				; 12
	mov	d5,#85				; 85
	callg	Write8900
;  302 |do
	.symb	LINE, 302
_106:
;  303 |{
;  304 | Write8900(0x0A,0x0136);
	.symb	LINE, 304
	mov	d4,#10				; 10
	mov	d5,#310				; 310
	callg	Write8900
;  305 | printf(".");
	.symb	LINE, 305
	lea	a4,_52
	callg	printf
;  306 |}
;  307 |while(Read8900(0x0C)&0x0080 != 0x0080);
	.symb	LINE, 307
	mov	d4,#12				; 12
	callg	Read8900
;  308 |printf("\n");
	.symb	LINE, 308
	lea	a4,_53
	callg	printf
;  309 |				
;  310 |//Write8900(0x0A,0x0136);
;  311 |//printf("SelfST (1696h):  %4Xh\n",Read8900(0x0C));
;  312 |
;  313 |if(Read8900(0x0C) != 0x06D6)
	.symb	LINE, 313
	mov	d4,#12				; 12
	callg	Read8900
	mov	d15,#1750			; 1750
	jeq	d2,d15,_109
;  314 |{
;  315 | printf("Nach Reset EEPROM nicht eingelesen!\n");
	.symb	LINE, 315
	movh.a	a4,#@his(_54)
	lea	a4,[a4]@los(_54)
	callg	printf
;  316 | if(Read8900(0x0C) == 0x02D6)
	.symb	LINE, 316
	mov	d4,#12				; 12
	callg	Read8900
	mov	d15,#726			; 726
	jne	d2,d15,_107
;  317 |  printf("Fehlerhafte Checksumme!\n");
	.symb	LINE, 317
	movh.a	a4,#@his(_55)
	lea	a4,[a4]@los(_55)
	callg	printf
_107:
;  318 | if(Read8900(0x0C) == 0x0156)
	.symb	LINE, 318
	mov	d4,#12				; 12
	callg	Read8900
	mov	d15,#342			; 342
	jne	d2,d15,_108
;  319 |  printf("Reset nicht vollst. ausgeführt!\n");
	.symb	LINE, 319
	movh.a	a4,#@his(_56)
	lea	a4,[a4]@los(_56)
	callg	printf
_108:
;  320 | return(ucErrorFlag = 1);
	.symb	LINE, 320
	mov16	d2,#1				; 1
	st.b	[sp]12,d2			; ucErrorFlag
	ret16
;  321 |}
	.symb	LINE, 321
_109:
;  322 |else printf("MAC-Address successfully stored in EEPROM\n");
	.symb	LINE, 322
	movh.a	a4,#@his(_57)
	lea	a4,[a4]@los(_57)
	callg	printf
;  323 |{
;  324 |//*/
;  325 |// to use these printf´s, command out the if sentence above!
;  326 |//printf (" RxStatus (0x0104) = %4X\n",Read8900(RX_FRAME_PORT));
;  327 |//printf (" RxLenght = %4X\n",Read8900(RX_FRAME_PORT));
;  328 |//printf (" Frame Data = %4X\n",Read8900(RX_FRAME_PORT));
;  329 |return(ucErrorFlag = 0);
	.symb	LINE, 329
	mov16	d2,#0				; 0
	st.b	[sp]12,d2			; ucErrorFlag
;  330 |}
;  331 |}
	.symb	LINE, 331
_111:
	ret16
	.symb	EFUN
;  332 |
;  333 |
;  334 |
;  335 |//---------------------------------------------------------------------------------------
;  336 |// wait for Ethernet EEPROM
;  337 |void warten8900(unsigned int faktor_i)
;  338 |{
	.symb	LINE, 338
	.symb	TYPE, 275, 'X', 8, #1, 26, 1, #18
	.symb	GFUN, "warten8900", warten8900, #275, 0, 16, 0
	.symb	ALAB, warten8900, #275
warten8900:
	.symb	SOFF, 16
	.symb	LTIM, "faktor_i", 4, 0, 0x8cd
	.symb	IDEN, "faktor_i", 4, #18, 0, 0x80d
	.symb	IDEN, "index_i", -12, #18, 131, 0x5
	.symb	LTIM, "faktor_i", 4, 0, 0x84d
	.symb	LTIM, "faktor_i", -16, 131, 0x8c5
	.symb	IDEN, "maximum_i", -8, #18, 131, 0x5
	.symb	LTIM, "faktor_i", -16, 131, 0x845
	.symb	LTIM, "faktor_i", 15, 0, 0x8cd
	.symb	LTIM, "faktor_i", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
;  339 | unsigned int index_i=0,maximum_i;
	.symb	LINE, 339
	st16.w	[sp],d4				; faktor_i
	mov16	d15,#0				; index_i
	st16.w	[sp]4,d15			; index_i
;  340 |
;  341 | maximum_i=faktor_i*0x50;
	.symb	LINE, 341
	ld16.w	d15,[sp]			; faktor_i
	mul	d15,d15,#80
	st16.w	[sp]8,d15			; maximum_i
;  342 | if(maximum_i>0x10000) maximum_i=0x10000;
	.symb	LINE, 342
	ld16.w	d15,[sp]8			; maximum_i
	movh	d7,#0x1				; 65536
	jge.u	d7,d15,_118
	movh	d15,#0x1			; maximum_i
	st16.w	[sp]8,d15			; maximum_i
_118:
;  343 | do
	.symb	LINE, 343
_119:
;  344 | {
;  345 |  Write8900(0x0A,0x0136);
	.symb	LINE, 345
	mov	d4,#10				; 10
	mov	d5,#310				; 310
	callg	Write8900
;  346 | } 
;  347 | while ( Read8900(0x0C)&0x0100 == 0x0100);// warten während EEPROM BUSY
	.symb	LINE, 347
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#1
	jne	d2,#0,_119
;  348 | for(index_i=0;index_i<maximum_i;index_i++);
	.symb	LINE, 348
	mov16	d15,#0				; index_i
	st16.w	[sp]4,d15			; index_i
	j	_121
_120:
	nop
	ld16.w	d15,[sp]4			; index_i
	add16	d15,#1				; index_i
	st16.w	[sp]4,d15			; index_i
_121:
	nop
	ld16.w	d15,[sp]4			; index_i
	ld.w	d7,[sp]8			; maximum_i
	jlt.u	d15,d7,_120
;  349 |
;  350 |}
	.symb	LINE, 350
	ret16
	.symb	EFUN
;  351 |//---------------------------------------------------------------------------------------
;  352 |void Write8900_EEPROM(unsigned char Address, unsigned short Data)
;  353 |{
	.symb	LINE, 353
	.symb	TYPE, 276, 'X', 8, #1, 26, 2, #3, #5
	.symb	GFUN, "Write8900_EEPROM", Write8900_EEPROM, #276, 0, 16, 0
	.symb	ALAB, Write8900_EEPROM, #276
Write8900_EEPROM:
	.symb	SOFF, 16
	.symb	LTIM, "Data", 5, 0, 0x8cd
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "Data", 5, #5, 0, 0x80d
	.symb	IDEN, "faktor_i", -8, #18, 131, 0x5
	.symb	LTIM, "Data", 5, 0, 0x84d
	.symb	LTIM, "Data", -16, 131, 0x8c5
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	LTIM, "Address", -12, 131, 0x8c5
	.symb	IDEN, "usReadValue", -4, #5, 131, 0x5
	nop
	sub16.a	sp,#16
;  354 |unsigned int faktor_i=0x10;
	.symb	LINE, 354
	st16.h	[sp],d5				; Data
	st.b	[sp]4,d4			; Address
	mov16	d15,#16				; faktor_i
	st16.w	[sp]8,d15			; faktor_i
;  355 |unsigned short usReadValue; 
;  356 |//printf("Write8900_EEPROM -> Address:= %4x, Data:=%4x\n",Address,Data);
;  357 |do
	.symb	LINE, 357
_122:
	.symb	LTIM, "Data", -16, 131, 0x845
	.symb	LTIM, "Data", 5, 0, 0x8cd
	.symb	LTIM, "Data", 5, 0, 0x84d
	.symb	LTIM, "Address", -12, 131, 0x845
	.symb	LTIM, "Address", 5, 0, 0x8cd
	.symb	LTIM, "Address", 5, 0, 0x84d
	.symb	LTIM, "Address", 5, 0, 0x8cd
	.symb	LTIM, "Address", 5, 0, 0x84d
	.symb	LTIM, "Data", 7, 0, 0x8cd
;  358 |{
;  359 | printf(".");
	.symb	LINE, 359
	lea	a4,_52
	callg	printf
;  360 | warten8900(faktor_i);
	.symb	LINE, 360
	ld.w	d4,[sp]8			; faktor_i
	callg	warten8900
;  361 | Write8900(0x0A,0x0042); Write8900(0x0C,Data);  // Wert der zu schreiben ist
	.symb	LINE, 361
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
	mov	d4,#12				; 12
	ld.hu	d5,[sp]				; Data
	callg	Write8900
;  362 | warten8900(faktor_i);
	.symb	LINE, 362
	ld.w	d4,[sp]8			; faktor_i
	callg	warten8900
;  363 | Write8900(0x0A, 0x0040); Write8900(0x0C,0x0100 |(unsigned short) Address);// an Adresse im EEPROM
	.symb	LINE, 363
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	ld.bu	d5,[sp]4			; Address
	or	d5,d5,#256
	extr.u	d5,d5,#0,#16
	callg	Write8900
;  364 | warten8900(faktor_i);
	.symb	LINE, 364
	ld.w	d4,[sp]8			; faktor_i
	callg	warten8900
;  365 | Write8900(0x0C,0x0); // zur Sicherheit Register mal löschen
	.symb	LINE, 365
	mov	d4,#12				; 12
	mov16	d5,#0				; 0
	callg	Write8900
;  366 | warten8900(faktor_i);
	.symb	LINE, 366
	ld.w	d4,[sp]8			; faktor_i
	callg	warten8900
;  367 | Write8900(0x0A,0x0040); Write8900(0x0C,0x0200 | (unsigned short) Address); // von Adresse im EEPROM
	.symb	LINE, 367
	mov	d4,#10				; 10
	mov	d5,#64				; 64
	callg	Write8900
	mov	d4,#12				; 12
	ld.bu	d5,[sp]4			; Address
	mov	d15,#512			; 512
	or16	d5,d15
	extr.u	d5,d5,#0,#16
	callg	Write8900
;  368 | warten8900(faktor_i);
	.symb	LINE, 368
	ld.w	d4,[sp]8			; faktor_i
	callg	warten8900
;  369 | Write8900(0x0A,0x0042); //printf("\nTestzugriff EEPROM-Wert :  %4X",Read8900(0x0C)); // und Wert auslesen
	.symb	LINE, 369
	mov	d4,#10				; 10
	mov	d5,#66				; 66
	callg	Write8900
;  370 | faktor_i++;
	.symb	LINE, 370
	ld16.w	d15,[sp]8			; faktor_i
	add16	d15,#1				; faktor_i
	st16.w	[sp]8,d15			; faktor_i
;  371 | usReadValue = Read8900(0x0C);
	.symb	LINE, 371
	mov	d4,#12				; 12
	callg	Read8900
	st.h	[sp]12,d2			; usReadValue
;  372 |}
;  373 |while(usReadValue!=Data); // nochmal, wenn es nicht geklappt hat
	.symb	LINE, 373
	ld.hu	d15,[sp]12			; usReadValue
	ld.hu	d7,[sp]				; Data
	jne	d15,d7,_122
;  374 |}
	.symb	LINE, 374
	ret16
	.symb	LTIM, "Data", 7, 0, 0x84d
	.symb	EFUN
;  375 |
;  376 |//------------------------------------------------------------------------------
;  377 |// configure port-pins for use with LAN-controller,
;  378 |// reset it and send the configuration-sequence
;  379 |// (InitSeq[])
;  380 |void Init8900loop(void)
;  381 |{
	.symb	LINE, 381
	.symb	TYPE, 277, 'X', 8, #1, 26, 0
	.symb	GFUN, "Init8900loop", Init8900loop, #277, 0, 0, 0
	.symb	ALAB, Init8900loop, #277
Init8900loop:
	.symb	SOFF, 0
;  382 |//  unsigned short i;
;  383 |
;  384 |  Write8900(ADD_PORT, PP_SelfCTL);
	.symb	LINE, 384
	mov	d4,#10				; 10
	mov	d5,#276				; 276
	callg	Write8900
;  385 |  Write8900(DATA_PORT, POWER_ON_RESET);       // Reset the Ethernet-Controller
	.symb	LINE, 385
	mov	d4,#12				; 12
	mov	d5,#64				; 64
	callg	Write8900
;  386 |
;  387 |  Write8900(ADD_PORT, PP_SelfST);
	.symb	LINE, 387
	mov	d4,#10				; 10
	mov	d5,#310				; 310
	callg	Write8900
;  388 |  while (!(Read8900(DATA_PORT) & INIT_DONE)); // wait until chip-reset is done
	.symb	LINE, 388
	j	_124
_123:
_124:
_125:
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#128
	jeq	d2,#0,_125
;  389 |
;  390 |/*  for (i = 0; i < sizeof InitSeq / sizeof (TInitSeq); i++) // configure the CS8900
;  391 |  {
;  392 |    Write8900(ADD_PORT, InitSeq[i].Addr);
;  393 |    Write8900(DATA_PORT, InitSeq[i].Data);
;  394 |  }
;  395 |*/
;  396 |  Write8900(ADD_PORT, PP_RxCTL);
	.symb	LINE, 396
	mov	d4,#10				; 10
	mov	d5,#260				; 260
	callg	Write8900
;  397 |  Write8900(DATA_PORT, (RX_OK_ENBL | RX_PROM_ACCEPT));
	.symb	LINE, 397
	mov	d4,#12				; 12
	mov	d5,#384				; 384
	callg	Write8900
;  398 |
;  399 |  Write8900(ADD_PORT, PP_TestCTL);
	.symb	LINE, 399
	mov	d4,#10				; 10
	mov	d5,#280				; 280
	callg	Write8900
;  400 |  Write8900(DATA_PORT, (FDX_8900 | LINK_OFF));
	.symb	LINE, 400
	mov	d4,#12				; 12
	mov	d5,#16512			; 16512
	callg	Write8900
;  401 |
;  402 |  Write8900(ADD_PORT, PP_LineCTL);
	.symb	LINE, 402
	mov	d4,#10				; 10
	mov	d5,#274				; 274
	callg	Write8900
;  403 |  Write8900(DATA_PORT, (SERIAL_RX_ON | SERIAL_TX_ON));
	.symb	LINE, 403
	mov	d4,#12				; 12
	mov	d5,#192				; 192
	callg	Write8900
;  404 |}
	.symb	LINE, 404
	ret16
	.symb	EFUN
;  405 |
;  406 |// writes a word in little-endian byte order to
;  407 |// a specified port-address
;  408 |void Write8900(unsigned char Address, unsigned short Data)
;  409 |{
	.symb	LINE, 409
	.symb	TYPE, 278, 'X', 8, #1, 26, 2, #3, #5
	.symb	GFUN, "Write8900", Write8900, #278, 0, 16, 0
	.symb	ALAB, Write8900, #278
Write8900:
	.symb	SOFF, 16
	.symb	LTIM, "Data", 5, 0, 0x8cd
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "Data", 5, #5, 0, 0x80d
	.symb	LTIM, "Data", 5, 0, 0x84d
	.symb	LTIM, "Data", -16, 131, 0x8c5
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	LTIM, "Address", -12, 131, 0x8c5
	.symb	LTIM, "Data", -16, 131, 0x845
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Address", -12, 131, 0x845
	.symb	LTIM, "Address", 7, 0, 0x8cd
	.symb	LTIM, "Address", 7, 0, 0x84d
	nop
	sub16.a	sp,#16
	st16.h	[sp],d5				; Data
	st.b	[sp]4,d4			; Address
;  410 |//  printf("Write8900 -> Address:= %4x, Data:=%4x\n",Address,Data);
;  411 |  HVAR(unsigned short,Address + CS8900IOBASE) = Data;
	.symb	LINE, 411
	ld.hu	d15,[sp]			; Data
	ld.bu	d7,[sp]4			; Address
	mov.u	d6,#0x300			; -1333787904
	addih	d6,d6,#0xb080			; -1333787904
	add16	d7,d6
	mov16.a	a15,d7
	st16.h	[a15],d15
;  412 |}
	.symb	LINE, 412
	ret16
	.symb	LTIM, "Data", 15, 0, 0x84d
	.symb	EFUN
;  413 |
;  414 |// writes a word in little-endian byte order to TX_FRAME_PORT
;  415 |void WriteFrame8900(unsigned short Data)
;  416 |{
	.symb	LINE, 416
	.symb	TYPE, 279, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "WriteFrame8900", WriteFrame8900, #279, 0, 16, 0
	.symb	ALAB, WriteFrame8900, #279
WriteFrame8900:
	.symb	SOFF, 16
	.symb	LTIM, "Data", 4, 0, 0x8cd
	.symb	IDEN, "Data", 4, #5, 0, 0x80d
	.symb	LTIM, "Data", 4, 0, 0x84d
	.symb	LTIM, "Data", -16, 131, 0x8c5
	.symb	LTIM, "Data", -16, 131, 0x845
	.symb	LTIM, "Data", 15, 0, 0x8cd
	nop
	sub16.a	sp,#16
	st16.h	[sp],d4				; Data
;  417 |  HVAR(unsigned short,TX_FRAME_PORT + CS8900IOBASE) = Data;
	.symb	LINE, 417
	ld.hu	d15,[sp]			; Data
	movh.a	a15,#0xb080
	lea	a15,[a15]0x300
	st16.h	[a15],d15			; Data
;  418 |}
	.symb	LINE, 418
	ret16
	.symb	LTIM, "Data", 15, 0, 0x84d
	.symb	EFUN
;  419 |
;  420 |// copies bytes from MCU-memory to frame port
;  421 |// NOTES: * an odd number of byte may only be transfered
;  422 |//          if the frame is written to the end!
;  423 |//        * MCU-memory MUST start at word-boundary
;  424 |void CopyToFrame8900(void *Source, unsigned short Size)
;  425 |{
	.symb	LINE, 425
	.symb	TYPE, 282, 'P', #1
	.symb	TYPE, 280, 'X', 8, #1, 26, 2, #282, #5
	.symb	GFUN, "CopyToFrame8900", CopyToFrame8900, #280, 0, 16, 0
	.symb	ALAB, CopyToFrame8900, #280
CopyToFrame8900:
	.symb	SOFF, 16
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	LTIM, "Source", 20, 0, 0x8cd
	.symb	IDEN, "Source", 20, #282, 0, 0x80d
	.symb	IDEN, "Size", 4, #5, 0, 0x80d
	.symb	TYPE, 284, 'P', #5
	.symb	IDEN, "piSource", -8, #284, 131, 0x5
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
	.symb	LTIM, "Source", 20, 0, 0x84d
	.symb	LTIM, "Source", -12, 131, 0x8c5
	.symb	LTIM, "Source", -12, 131, 0x845
	.symb	LTIM, "Source", 23, 0, 0x8cd
	nop
	sub16.a	sp,#16
;  426 |  unsigned short * piSource;                       // Keil: Pointer added to correct expression
	.symb	LINE, 426
	st16.h	[sp],d4				; Size
	st.a	[sp]4,a4			; Source
;  427 |  
;  428 |  piSource = Source;                             // Keil: Line added
	.symb	LINE, 428
	ld.a	a7,[sp]4			; Source
	st.a	[sp]8,a7			; piSource
;  429 |  while (Size > 1) {
	.symb	LINE, 429
	j	_127
_126:
	.symb	LTIM, "Source", 23, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
;  430 |    WriteFrame8900(*piSource++);
	.symb	LINE, 430
	nop
	ld16.a	a15,[sp]8			; piSource
	ld.hu	d4,[a15]
	callg	WriteFrame8900
	ld.a	a7,[sp]8			; piSource
	add16.a	a7,#2				; piSource
	st.a	[sp]8,a7			; piSource
;  431 |    Size -= 2;
	.symb	LINE, 431
	ld.hu	d15,[sp]			; Size
	add16	d15,#-2				; Size
	st16.h	[sp],d15			; Size
	.symb	LINE, 429
_127:
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	nop
	ld.hu	d15,[sp]			; Size
	jge	d15,#2,_126
;  432 |  }
;  433 |  
;  434 |  if (Size)                                      // if odd num. of bytes...
	.symb	LINE, 434
	ld.hu	d15,[sp]			; Size
	jeq	d15,#0,_128			; Size
;  435 |    WriteFrame8900(*(unsigned char *)piSource);  // write leftover byte (the LAN-controller
	.symb	LINE, 435
	ld16.a	a15,[sp]8			; piSource
	ld16.bu	d4,[a15]
	callg	WriteFrame8900
_128:
;  436 |}                                                // ignores the highbyte)
	.symb	LINE, 436
	ret16
	.symb	EFUN
;  437 |
;  438 |// reads a word in little-endian byte order from
;  439 |// a specified port-address
;  440 |unsigned short Read8900(unsigned char Address)
;  441 |{
	.symb	LINE, 441
	.symb	TYPE, 285, 'X', 8, #5, 26, 1, #3
	.symb	GFUN, "Read8900", Read8900, #285, 0, 16, 0
	.symb	ALAB, Read8900, #285
Read8900:
	.symb	SOFF, 16
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "ReturnValue", -12, #5, 131, 0x5
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	LTIM, "Address", -16, 131, 0x8c5
	.symb	LTIM, "Address", -16, 131, 0x845
	.symb	LTIM, "Address", 15, 0, 0x8cd
	.symb	LTIM, "Address", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
;  442 |  unsigned short ReturnValue;
	.symb	LINE, 442
	st16.b	[sp],d4				; Address
;  443 |
;  444 |  ReturnValue = HVAR(unsigned short,Address + CS8900IOBASE);
	.symb	LINE, 444
	ld16.bu	d15,[sp]			; Address
	mov.u	d7,#0x300			; -1333787904
	addih	d7,d7,#0xb080			; -1333787904
	add16	d15,d7
	mov16.a	a15,d15
	ld.hu	d15,[a15]
	st16.h	[sp]4,d15			; ReturnValue
;  445 |//  printf("Read8900 -> Address:= %4x, Data:=%4x\n",Address,ReturnValue);
;  446 |
;  447 |  return ReturnValue;
	.symb	LINE, 447
	ld.hu	d2,[sp]4			; ReturnValue
;  448 |}
	.symb	LINE, 448
_129:
	ret16
	.symb	EFUN
;  449 |
;  450 |// reads a word in little-endian byte order from RX_FRAME_PORT
;  451 |unsigned short ReadFrame8900(void)
;  452 |{
	.symb	LINE, 452
	.symb	TYPE, 286, 'X', 8, #5, 26, 0
	.symb	GFUN, "ReadFrame8900", ReadFrame8900, #286, 0, 16, 0
	.symb	ALAB, ReadFrame8900, #286
ReadFrame8900:
	.symb	SOFF, 16
	.symb	IDEN, "ReturnValue", -16, #5, 131, 0x5
	nop
	sub16.a	sp,#16
;  453 |  unsigned short ReturnValue;
;  454 |
;  455 |  ReturnValue = HVAR(unsigned short,RX_FRAME_PORT + CS8900IOBASE);
	.symb	LINE, 455
	movh.a	a15,#0xb080
	lea	a15,[a15]0x300
	ld.hu	d15,[a15]
	st16.h	[sp],d15			; ReturnValue
;  456 |  return ReturnValue;
	.symb	LINE, 456
	ld.hu	d2,[sp]				; ReturnValue
;  457 |}
	.symb	LINE, 457
_130:
	ret16
	.symb	EFUN
;  458 |
;  459 |// reads a word in big-endian byte order from RX_FRAME_PORT
;  460 |// (useful to avoid permanent byte-swapping while reading
;  461 |// TCP/IP-data)
;  462 |unsigned short ReadFrameBE8900(void)
;  463 |{
	.symb	LINE, 463
	.symb	TYPE, 287, 'X', 8, #5, 26, 0
	.symb	GFUN, "ReadFrameBE8900", ReadFrameBE8900, #287, 0, 16, 0
	.symb	ALAB, ReadFrameBE8900, #287
ReadFrameBE8900:
	.symb	SOFF, 16
	.symb	IDEN, "ReturnValue", -16, #5, 131, 0x5
	nop
	sub16.a	sp,#16
;  464 |  unsigned short ReturnValue;
;  465 |
;  466 |  ReturnValue = HVAR(unsigned short,RX_FRAME_PORT + CS8900IOBASE);
	.symb	LINE, 466
	movh.a	a15,#0xb080
	lea	a15,[a15]0x300
	ld.hu	d15,[a15]
	st16.h	[sp],d15			; ReturnValue
;  467 |  ReturnValue = SwapBytes(ReturnValue);
	.symb	LINE, 467
	ld.hu	d4,[sp]				; ReturnValue
	callg	SwapBytes
	st16.h	[sp],d2				; ReturnValue
;  468 |  return ReturnValue;
	.symb	LINE, 468
	ld.hu	d2,[sp]				; ReturnValue
;  469 |}
	.symb	LINE, 469
_131:
	ret16
	.symb	EFUN
;  470 |
;  471 |// reads a word in little-endian byte order from
;  472 |// a specified port-address
;  473 |// NOTE: this func. xfers the high-byte 1st, must be used to
;  474 |//       access some special registers (e.g. RxStatus)
;  475 |unsigned short ReadHB1ST8900(unsigned char Address)
;  476 |{
	.symb	LINE, 476
	.symb	TYPE, 288, 'X', 8, #5, 26, 1, #3
	.symb	GFUN, "ReadHB1ST8900", ReadHB1ST8900, #288, 0, 16, 0
	.symb	ALAB, ReadHB1ST8900, #288
ReadHB1ST8900:
	.symb	SOFF, 16
	.symb	LTIM, "Address", 4, 0, 0x8cd
	.symb	IDEN, "Address", 4, #3, 0, 0x80d
	.symb	IDEN, "ReturnValue", -12, #5, 131, 0x5
	.symb	LTIM, "Address", 4, 0, 0x84d
	.symb	LTIM, "Address", -16, 131, 0x8c5
	.symb	LTIM, "Address", -16, 131, 0x845
	.symb	LTIM, "Address", 15, 0, 0x8cd
	.symb	LTIM, "Address", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
;  477 |  unsigned short ReturnValue;
	.symb	LINE, 477
	st16.b	[sp],d4				; Address
;  478 |
;  479 |  ReturnValue = HVAR(unsigned short,Address + CS8900IOBASE);
	.symb	LINE, 479
	ld16.bu	d15,[sp]			; Address
	mov.u	d7,#0x300			; -1333787904
	addih	d7,d7,#0xb080			; -1333787904
	add16	d15,d7
	mov16.a	a15,d15
	ld.hu	d15,[a15]
	st16.h	[sp]4,d15			; ReturnValue
;  480 |  return ReturnValue;
	.symb	LINE, 480
	ld.hu	d2,[sp]4			; ReturnValue
;  481 |}
	.symb	LINE, 481
_132:
	ret16
	.symb	EFUN
;  482 |
;  483 |// copies bytes from frame port to MCU-memory
;  484 |// NOTES: * an odd number of byte may only be transfered
;  485 |//          if the frame is read to the end!
;  486 |//        * MCU-memory MUST start at word-boundary
;  487 |void CopyFromFrame8900(void *Dest, unsigned short Size)
;  488 |{
	.symb	LINE, 488
	.symb	TYPE, 289, 'X', 8, #1, 26, 2, #282, #5
	.symb	GFUN, "CopyFromFrame8900", CopyFromFrame8900, #289, 0, 16, 0
	.symb	ALAB, CopyFromFrame8900, #289
CopyFromFrame8900:
	.symb	SOFF, 16
	.symb	LTIM, "Dest", 20, 0, 0x8cd
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	IDEN, "Dest", 20, #282, 0, 0x80d
	.symb	IDEN, "Size", 4, #5, 0, 0x80d
	.symb	IDEN, "piDest", -8, #284, 131, 0x5
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
	.symb	LTIM, "Dest", 20, 0, 0x84d
	.symb	LTIM, "Dest", -12, 131, 0x8c5
	.symb	LTIM, "Dest", -12, 131, 0x845
	.symb	LTIM, "Dest", 23, 0, 0x8cd
	nop
	sub16.a	sp,#16
;  489 |  unsigned short * piDest;                         // Keil: Pointer added to correct expression
	.symb	LINE, 489
	st16.h	[sp],d4				; Size
	st.a	[sp]4,a4			; Dest
;  490 |
;  491 |  piDest = Dest;                                 // Keil: Line added
	.symb	LINE, 491
	ld.a	a7,[sp]4			; Dest
	st.a	[sp]8,a7			; piDest
;  492 |  while (Size > 1) {
	.symb	LINE, 492
	j	_134
_133:
	.symb	LTIM, "Dest", 23, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
;  493 |    *piDest++ = ReadFrame8900();
	.symb	LINE, 493
	callg	ReadFrame8900
	ld.a	a7,[sp]8			; piDest
	st16.h	[a7],d2				; piDest
	ld.a	a7,[sp]8			; piDest
	add16.a	a7,#2				; piDest
	st.a	[sp]8,a7			; piDest
;  494 |    Size -= 2;
	.symb	LINE, 494
	ld.hu	d15,[sp]			; Size
	add16	d15,#-2				; Size
	st16.h	[sp],d15			; Size
	.symb	LINE, 492
_134:
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	nop
	ld.hu	d15,[sp]			; Size
	jge	d15,#2,_133
;  495 |  }
;  496 |  
;  497 |  if (Size)                                      // check for leftover byte...
	.symb	LINE, 497
	ld.hu	d15,[sp]			; Size
	jeq	d15,#0,_135			; Size
;  498 |    *(unsigned char *)piDest = ReadFrame8900();  // the LAN-Controller will return 0
	.symb	LINE, 498
	callg	ReadFrame8900
	ld.a	a7,[sp]8			; piDest
	st16.b	[a7],d2				; piDest
_135:
;  499 |}                                                // for the highbyte
	.symb	LINE, 499
	ret16
	.symb	EFUN
;  500 |
;  501 |// does a dummy read on frame-I/O-port
;  502 |// NOTE: only an even number of bytes is read!
;  503 |void DummyReadFrame8900(unsigned short Size)       // discards an EVEN number of bytes
;  504 |{                                                // from RX-fifo
	.symb	LINE, 504
	.symb	TYPE, 290, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "DummyReadFrame8900", DummyReadFrame8900, #290, 0, 16, 0
	.symb	ALAB, DummyReadFrame8900, #290
DummyReadFrame8900:
	.symb	SOFF, 16
	.symb	LTIM, "Size", 4, 0, 0x8cd
	.symb	IDEN, "Size", 4, #5, 0, 0x80d
	.symb	LTIM, "Size", 4, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
	nop
	sub16.a	sp,#16
	st16.h	[sp],d4				; Size
;  505 |  while (Size > 1) {
	.symb	LINE, 505
	j	_137
_136:
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	LTIM, "Size", -16, 131, 0x8c5
;  506 |    ReadFrame8900();
	.symb	LINE, 506
	callg	ReadFrame8900
;  507 |    Size -= 2;
	.symb	LINE, 507
	ld.hu	d15,[sp]			; Size
	add16	d15,#-2				; Size
	st16.h	[sp],d15			; Size
	.symb	LINE, 505
_137:
	.symb	LTIM, "Size", -16, 131, 0x845
	.symb	LTIM, "Size", 15, 0, 0x8cd
	nop
	ld.hu	d15,[sp]			; Size
	jge	d15,#2,_136
;  508 |  }
;  509 |}
	.symb	LINE, 509
	ret16
	.symb	LTIM, "Size", 15, 0, 0x84d
	.symb	EFUN
;  510 |
;  511 |// requests space in CS8900's on-chip memory for
;  512 |// storing an outgoing frame
;  513 |void RequestSend(unsigned short FrameSize)
;  514 |{
	.symb	LINE, 514
	.symb	TYPE, 291, 'X', 8, #1, 26, 1, #5
	.symb	GFUN, "RequestSend", RequestSend, #291, 0, 16, 0
	.symb	ALAB, RequestSend, #291
RequestSend:
	.symb	SOFF, 16
	.symb	LTIM, "FrameSize", 4, 0, 0x8cd
	.symb	IDEN, "FrameSize", 4, #5, 0, 0x80d
	.symb	LTIM, "FrameSize", 4, 0, 0x84d
	.symb	LTIM, "FrameSize", -16, 131, 0x8c5
	.symb	LTIM, "FrameSize", -16, 131, 0x845
	.symb	LTIM, "FrameSize", 5, 0, 0x8cd
	.symb	LTIM, "FrameSize", 5, 0, 0x84d
	nop
	sub16.a	sp,#16
	st16.h	[sp],d4				; FrameSize
;  515 |  Write8900(TX_CMD_PORT, TX_START_ALL_BYTES);
	.symb	LINE, 515
	mov16	d4,#4				; 4
	mov	d5,#192				; 192
	callg	Write8900
;  516 |  Write8900(TX_LEN_PORT, FrameSize);
	.symb	LINE, 516
	mov16	d4,#6				; 6
	ld.hu	d5,[sp]				; FrameSize
	callg	Write8900
;  517 |}
	.symb	LINE, 517
	ret16
	.symb	EFUN
;  518 |
;  519 |// check if CS8900 is ready to accept the
;  520 |// frame we want to send
;  521 |unsigned short Rdy4Tx(void)
;  522 |{
	.symb	LINE, 522
	.symb	TYPE, 292, 'X', 8, #5, 26, 0
	.symb	GFUN, "Rdy4Tx", Rdy4Tx, #292, 0, 0, 0
	.symb	ALAB, Rdy4Tx, #292
Rdy4Tx:
	.symb	SOFF, 0
;  523 |  Write8900(ADD_PORT, PP_BusST);
	.symb	LINE, 523
	mov	d4,#10				; 10
	mov	d5,#312				; 312
	callg	Write8900
;  524 |  return (Read8900(DATA_PORT) & READY_FOR_TX_NOW);
	.symb	LINE, 524
	mov	d4,#12				; 12
	callg	Read8900
	and	d2,d2,#256
	extr.u	d2,d2,#0,#16
;  525 |}
	.symb	LINE, 525
_138:
	ret16
	.symb	EFUN
;  526 |
;  527 |// help function to swap the byte order of a WORD
;  528 |unsigned short SwapBytes(unsigned short Data)
;  529 |{
	.symb	LINE, 529
	.symb	TYPE, 293, 'X', 8, #5, 26, 1, #5
	.symb	GFUN, "SwapBytes", SwapBytes, #293, 0, 16, 0
	.symb	ALAB, SwapBytes, #293
SwapBytes:
	.symb	SOFF, 16
	.symb	LTIM, "Data", 4, 0, 0x8cd
	.symb	IDEN, "Data", 4, #5, 0, 0x80d
	.symb	LTIM, "Data", 4, 0, 0x84d
	.symb	LTIM, "Data", -16, 131, 0x8c5
	.symb	LTIM, "Data", -16, 131, 0x845
	.symb	LTIM, "Data", 2, 0, 0x8cd
	.symb	LTIM, "Data", 2, 0, 0x84d
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
	st16.h	[sp],d4				; Data
;  530 |  return (Data >> 8) | (Data << 8);
	.symb	LINE, 530
	ld.hu	d2,[sp]				; Data
	sha16	d2,#-8
	ld.hu	d15,[sp]			; Data
	sha	d15,d15,#8
	or16	d2,d15
	extr.u	d2,d2,#0,#16
;  531 |}
	.symb	LINE, 531
_139:
	ret16
	.symb	EFUN
;  532 |
;  533 |void BitsSelfTestReg(unsigned int Data)
;  534 |{
	.symb	LINE, 534
	.symb	TYPE, 294, 'X', 8, #1, 26, 1, #18
	.symb	GFUN, "BitsSelfTestReg", BitsSelfTestReg, #294, 0, 16, 0
	.symb	ALAB, BitsSelfTestReg, #294
BitsSelfTestReg:
	.symb	SOFF, 16
	.symb	LTIM, "Data", 4, 0, 0x8cd
	.symb	IDEN, "Data", 4, #18, 0, 0x80d
	.symb	LTIM, "Data", 4, 0, 0x84d
	.symb	LTIM, "Data", -12, 131, 0x8c5
	.symb	LTIM, "Data", -12, 131, 0x845
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
	nop
	sub16.a	sp,#16
	st.w	[sp]4,d4			; Data
;  535 |printf("Explanation of data = %X in Self Status Register:\n",Data);
	.symb	LINE, 535
	movh.a	a4,#@his(_140)
	lea	a4,[a4]@los(_140)
	ld16.w	d15,[sp]4			; Data
	st16.w	[sp],d15			; Data
	callg	printf
;  536 |if (Data && INIT_DONE)  printf("		CS8900A initialisation complete\n");
	.symb	LINE, 536
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_155			; Data
	movh.a	a4,#@his(_141)
	lea	a4,[a4]@los(_141)
	callg	printf
	j	_156
_155:
;  537 |	else printf("		CS8900A initialisation failed\n");
	.symb	LINE, 537
	movh.a	a4,#@his(_142)
	lea	a4,[a4]@los(_142)
	callg	printf
_156:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  538 |if (Data && ACTIVE_33V) printf("		CS8900A opperates with 3,3V\n");
	.symb	LINE, 538
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_157			; Data
	movh.a	a4,#@his(_143)
	lea	a4,[a4]@los(_143)
	callg	printf
	j	_158
_157:
;  539 |	else printf("		CS8900A opperates with 5V\n");
	.symb	LINE, 539
	movh.a	a4,#@his(_144)
	lea	a4,[a4]@los(_144)
	callg	printf
_158:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  540 |if (Data && (EEPROM_PRESENT || EEPROM_OK))
	.symb	LINE, 540
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_161			; Data
;  541 |	{
;  542 |	if (Data && EE_SIZE_64) printf("		Size of EEPROM  = 64 words\n");
	.symb	LINE, 542
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_159			; Data
	movh.a	a4,#@his(_145)
	lea	a4,[a4]@los(_145)
	callg	printf
	j	_160
_159:
;  543 |		else printf("		Size of EEPROM  = 128 / 256 words\n");
	.symb	LINE, 543
	movh.a	a4,#@his(_146)
	lea	a4,[a4]@los(_146)
	callg	printf
_160:
;  544 |	}
	.symb	LINE, 544
_161:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  545 |if (Data && EL_PRESENT) printf("		External logic for latchable address bus decode is present\n");
	.symb	LINE, 545
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_162			; Data
	movh.a	a4,#@his(_147)
	lea	a4,[a4]@los(_147)
	callg	printf
	j	_163
_162:
;  546 |	else printf("		No external logic for address bus decode present\n");
	.symb	LINE, 546
	movh.a	a4,#@his(_148)
	lea	a4,[a4]@los(_148)
	callg	printf
_163:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  547 |if (Data && EEPROM_OK)  printf("		Checksum of EEPROM readout is O.K.\n");
	.symb	LINE, 547
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_164			; Data
	movh.a	a4,#@his(_149)
	lea	a4,[a4]@los(_149)
	callg	printf
	j	_165
_164:
;  548 |	else printf("		EEPROM checksum failure\n");
	.symb	LINE, 548
	movh.a	a4,#@his(_150)
	lea	a4,[a4]@los(_150)
	callg	printf
_165:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  549 |if (Data && EL_PRESENT) printf("		EEPROM seems to be present\n");
	.symb	LINE, 549
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_166			; Data
	movh.a	a4,#@his(_151)
	lea	a4,[a4]@los(_151)
	callg	printf
	j	_167
_166:
;  550 |	else printf("		No EEPROM present\n");
	.symb	LINE, 550
	movh.a	a4,#@his(_152)
	lea	a4,[a4]@los(_152)
	callg	printf
_167:
	.symb	LTIM, "Data", 15, 0, 0x8cd
	.symb	LTIM, "Data", 15, 0, 0x84d
;  551 |if (Data && SI_BUSY)	printf("		EEPROM is busy\n");
	.symb	LINE, 551
	nop
	ld16.w	d15,[sp]4			; Data
	jeq	d15,#0,_168			; Data
	movh.a	a4,#@his(_153)
	lea	a4,[a4]@los(_153)
	callg	printf
	ret16
_168:
;  552 |	else printf("		EEPROM not busy\n");
	.symb	LINE, 552
	movh.a	a4,#@his(_154)
	lea	a4,[a4]@los(_154)
	callg	printf
_169:
;  553 |}
	.symb	LINE, 553
	ret16
	.symb	EFUN
	.symb	ENDF
	.sdecl	"fardata.ethernet_test",DATA,INIT
	.sect	"fardata.ethernet_test"
	.align	4
_146:
	.ascii	"		Size of EEPROM  = 128 / 256 words"
	.byte	0x0a,0x00
	.align	2
_50:
	.byte	0x0a
	.ascii	" MAC-Adresse nicht richtig gespeichert!!"
	.byte	0x0a,0x09
	.ascii	" Ethernet-Test ABGEBROCHEN!!"
	.byte	0x0a,0x00
	.align	2
_49:
	.byte	0x0a
	.ascii	" MAC-Adresse nicht richtig gespeichert!! Noch ein Versuch ?"
	.ascii	" "
	.byte	0x00
_147:
	.ascii	"		External logic for latchable address bus decode is presen"
	.ascii	"t"
	.byte	0x0a,0x00
_24:
	.ascii	"	ERROR: External looptest failed"
	.byte	0x0a,0x00
_150:
	.ascii	"		EEPROM checksum failure"
	.byte	0x0a,0x00
	.align	2
_152:
	.ascii	"		No EEPROM present"
	.byte	0x0a,0x00
	.align	2
_51:
	.byte	0x0a
	.ascii	"Software-Reset "
	.byte	0x00
	.align	2
_140:
	.ascii	"Explanation of data = %X in Self Status Register:"
	.byte	0x0a,0x00
	.align	2
_19:
	.ascii	"	Ethernet Controller CS8900A detected"
	.byte	0x0a,0x00
	.sdecl	"data.ethernet_test",DATA,INIT,ABS18
	.sect	"data.ethernet_test"
	.align	4
_52:
	.ascii	"."
	.byte	0x00
	.sect	"fardata.ethernet_test"
	.align	2
_145:
	.ascii	"		Size of EEPROM  = 64 words"
	.byte	0x0a,0x00
	.sect	"data.ethernet_test"
_53:
	.byte	0x0a,0x00
	.sect	"fardata.ethernet_test"
_142:
	.ascii	"		CS8900A initialisation failed"
	.byte	0x0a,0x00
	.align	2
_153:
	.ascii	"		EEPROM is busy"
	.byte	0x0a,0x00
_151:
	.ascii	"		EEPROM seems to be present"
	.byte	0x0a,0x00
_143:
	.ascii	"		CS8900A opperates with 3,3V"
	.byte	0x0a,0x00
	.align	2
_18:
	.ascii	"	ERROR: Ethernet Controller not supported! %X"
	.byte	0x0a,0x00
	.symb	TYPE, 295, 'Z', #261, 9
	.symb	ALAB, _iob, #295
	.align	2
_54:
	.ascii	"Nach Reset EEPROM nicht eingelesen!"
	.byte	0x0a,0x00
	.align	2
_47:
	.ascii	" 12 Stellen hexadezimal (ungültige Zeichen werden ignoriert"
	.ascii	") :"
	.byte	0x0a,0x09,0x09,0x00
_148:
	.ascii	"		No external logic for address bus decode present"
	.byte	0x0a,0x00
_22:
	.ascii	"	Start of external loop test..."
	.byte	0x0a,0x00
	.align	2
_149:
	.ascii	"		Checksum of EEPROM readout is O.K."
	.byte	0x0a,0x00
	.symb	TYPE, 297, 'X', 8, #16, 26, 2, #260, #1
	.symb	ALAB, printf, #297
_144:
	.ascii	"		CS8900A opperates with 5V"
	.byte	0x0a,0x00
	.align	2
_56:
	.ascii	"Reset nicht vollst. ausgeführt!"
	.byte	0x0a,0x00
	.align	2
_57:
	.ascii	"MAC-Address successfully stored in EEPROM"
	.byte	0x0a,0x00
	.align	2
_23:
	.ascii	"	External looptest O.K."
	.byte	0x0a,0x00
	.align	2
_154:
	.ascii	"		EEPROM not busy"
	.byte	0x0a,0x00
	.align	2
_21:
	.ascii	"	ERROR: Ethernet EEPROM not present"
	.byte	0x0a,0x00
	.align	2
_17:
	.ascii	"Testing Ethernet Controller..."
	.byte	0x0a,0x00
_55:
	.ascii	"Fehlerhafte Checksumme!"
	.byte	0x0a,0x00
	.align	2
_46:
	.ascii	"Bitte geben Sie die MAC Adesse ein (Abbruch und Neueingabe "
	.ascii	"mit ESC)!"
	.byte	0x0a,0x00
_20:
	.ascii	"	EEPROM detected"
	.byte	0x0a,0x00
_48:
	.ascii	"MAC-Adresse wird gespeichert"
	.byte	0x00
	.align	2
_141:
	.ascii	"		CS8900A initialisation complete"
	.byte	0x0a,0x00
	.symb	TYPE, 300, 'P', #261
	.symb	TYPE, 298, 'X', 8, #16, 26, 1, #300
	.symb	ALAB, _filbuf, #298
	.align	4
	.global	BitsSelfTestReg
	.global	CopyFromFrame8900
	.global	CopyToFrame8900
	.global	DummyReadFrame8900
	.global	Init8900loop
	.global	Rdy4Tx
	.global	Read8900
	.global	ReadFrame8900
	.global	ReadFrameBE8900
	.global	ReadHB1ST8900
	.global	RequestSend
	.global	SwapBytes
	.global	Write8900
	.global	Write8900_EEPROM
	.global	WriteFrame8900
	.global	ucEthernetTest
	.global	ucProgMAC
	.global	warten8900
	.extern	(CODE) _filbuf
	.extern	(DATA) _iob
	.extern	(CODE) printf
	.calls	"BitsSelfTestReg", "printf"
	.calls	"CopyFromFrame8900", "ReadFrame8900"
	.calls	"CopyToFrame8900", "WriteFrame8900"
	.calls	"DummyReadFrame8900", "ReadFrame8900"
	.calls	"Init8900loop", "Read8900"
	.calls	"Init8900loop", "Write8900"
	.calls	"Rdy4Tx", "Read8900"
	.calls	"Rdy4Tx", "Write8900"
	.calls	"ReadFrameBE8900", "SwapBytes"
	.calls	"RequestSend", "Write8900"
	.calls	"Write8900_EEPROM", "Read8900"
	.calls	"Write8900_EEPROM", "Write8900"
	.calls	"Write8900_EEPROM", "printf"
	.calls	"Write8900_EEPROM", "warten8900"
	.calls	"ucEthernetTest", "Init8900loop"
	.calls	"ucEthernetTest", "Read8900"
	.calls	"ucEthernetTest", "RequestSend"
	.calls	"ucEthernetTest", "SwapBytes"
	.calls	"ucEthernetTest", "Write8900"
	.calls	"ucEthernetTest", "WriteFrame8900"
	.calls	"ucEthernetTest", "printf"
	.calls	"ucProgMAC", "Read8900"
	.calls	"ucProgMAC", "Write8900"
	.calls	"ucProgMAC", "Write8900_EEPROM"
	.calls	"ucProgMAC", "_filbuf"
	.calls	"ucProgMAC", "printf"
	.calls	"ucProgMAC", "warten8900"
	.calls	"warten8900", "Read8900"
	.calls	"warten8900", "Write8900"
