; 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	"easyweb"
	.symb	TOOL, "TASKING TriCore C compiler v1.5", 1
	.symb	TYPE, 256, "bit", 'g', 0, 1
	.symb	FILE, "easyweb.c"
; file "easyweb.c":
;    1 |/******************************************************************
;    2 | *****                                                        *****
;    3 | *****  Name: easyweb.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: implements a dynamic HTTP-server by using       *****
;   11 | *****        the easyWEB-API                                 *****
;   12 | *****                                                        *****
;   13 | ******************************************************************/
;   14 |
;   15 |#define extern            // Keil: Line added for modular project management
;   16 |//#include "stdlib.h"
;   17 |#include "main.h"
	.symb	FILE, "main.h"
	.symb	TYPE, 257, "uword", 'T', #18
	.symb	FILE, "TC1775BRegs.h"
	.symb	ENDF
	.symb	FILE, "GPTU.H"
	.symb	ENDF
	.symb	FILE, "RTC.H"
	.symb	ENDF
	.symb	ENDF
;   18 |#include "string.h"
	.symb	FILE, "d:\\ctri\\include\\string.h"
	.symb	TYPE, 258, "size_t", 'T', #18
	.symb	ENDF
;   19 |#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, "fpos_t", 'T', #7
	.symb	TYPE, 265, "off_t", 'T', #6
	.symb	ENDF
;   20 |#include "easyweb.h"
	.symb	FILE, "easyweb.h"
	.sdecl	"farrom.easyweb",ROMDATA
	.sect	"farrom.easyweb"
	.align	4
GetResponse:
	.byte	0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30
	.byte	0x20,0x4f,0x4b,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74
	.byte	0x2d,0x54,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,0x78,0x74,0x2f
	.byte	0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a,0x00
	.symb	TYPE, 266, 'Z', #3, 44
	.symb	IDEN, "GetResponse", GetResponse, #266, 129, 0x0
	.symb	ALAB, GetResponse, #266
	.symb	ENDF
;   21 |#include "cs8900.h"       // Keil: *.c -> *.h    // ethernet packet driver
	.symb	FILE, "cs8900.h"
MyMAC:
	.byte	0x01,0x02,0x03,0x04,0x05,0x06
	.symb	TYPE, 268, 'Z', #3, 5
	.symb	IDEN, "MyMAC", MyMAC, #268, 129, 0x0
	.symb	ALAB, MyMAC, #268
	.symb	TYPE, 270, 'S', 4,\
		 "Addr", #5, 0,\
		 "Data", #5, 2
	.symb	TYPE, 271, "TInitSeq", 'T', #270
	.align	2
InitSeq:
	.half	0x0158,0x0201,0x015a,0x0403,0x015c,0x0605,0x0112,0x00c0
	.half	0x0104,0x0d00
	.symb	TYPE, 272, 'Z', #270, 4
	.symb	IDEN, "InitSeq", InitSeq, #272, 129, 0x0
	.symb	ALAB, InitSeq, #272
	.symb	ENDF
;   22 |#include "tcpip.h"        // Keil: *.c -> *.h    // easyWEB TCP/IP stack
	.symb	FILE, "tcpip.h"
MyIP:
	.half	0x79c2,0x1860
	.symb	TYPE, 274, 'Z', #5, 1
	.symb	IDEN, "MyIP", MyIP, #274, 129, 0x0
	.symb	ALAB, MyIP, #274
SubnetMask:
	.half	0xffff,0x00ff
	.symb	IDEN, "SubnetMask", SubnetMask, #274, 129, 0x0
	.symb	ALAB, SubnetMask, #274
GatewayIP:
	.half	0xa8c0,0xc800
	.symb	IDEN, "GatewayIP", GatewayIP, #274, 129, 0x0
	.symb	ALAB, GatewayIP, #274
	.symb	TYPE, 276, '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, 277, "TTCPStateMachine", 'T', #276
	.symb	TYPE, 278, '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, 279, "TLastFrameSent", 'T', #278
	.symb	ENDF
;   23 |//PHYTEC: #include <reg167.h>	      // Keil: Register definition file for 80C167
;   24 |
;   25 |#include "webside.h"                             // webside for our HTTP server (HTML)
	.symb	FILE, "webside.h"
WebSide:
	.byte	0x3c,0x21,0x64,0x6f,0x63,0x74,0x79,0x70,0x65,0x20,0x68,0x74
	.byte	0x6d,0x6c,0x20,0x70,0x75,0x62,0x6c,0x69,0x63,0x20,0x22,0x2d
	.byte	0x2f,0x2f,0x77,0x33,0x63,0x2f,0x2f,0x64,0x74,0x64,0x20,0x68
	.byte	0x74,0x6d,0x6c,0x20,0x34,0x2e,0x30,0x20,0x74,0x72,0x61,0x6e
	.byte	0x73,0x69,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x2f,0x2f,0x65,0x6e
	.byte	0x22,0x3e,0x0d,0x0a,0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a
	.byte	0x3c,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x3c
	.byte	0x6d,0x65,0x74,0x61,0x20,0x68,0x74,0x74,0x70,0x2d,0x65,0x71
	.byte	0x75,0x69,0x76,0x3d,0x22,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74
	.byte	0x2d,0x54,0x79,0x70,0x65,0x22,0x20,0x63,0x6f,0x6e,0x74,0x65
	.byte	0x6e,0x74,0x3d,0x22,0x74,0x65,0x78,0x74,0x2f,0x68,0x74,0x6d
	.byte	0x6c,0x3b,0x20,0x63,0x68,0x61,0x72,0x73,0x65,0x74,0x3d,0x69
	.byte	0x73,0x6f,0x2d,0x38,0x38,0x35,0x39,0x2d,0x31,0x22,0x3e,0x0d
	.byte	0x0a,0x20,0x20,0x20,0x3c,0x6d,0x65,0x74,0x61,0x20,0x68,0x74
	.byte	0x74,0x70,0x2d,0x65,0x71,0x75,0x69,0x76,0x3d,0x22,0x72,0x65
	.byte	0x66,0x72,0x65,0x73,0x68,0x22,0x20,0x63,0x6f,0x6e,0x74,0x65
	.byte	0x6e,0x74,0x3d,0x22,0x35,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x20
	.byte	0x3c,0x74,0x69,0x74,0x6c,0x65,0x3e,0x65,0x61,0x73,0x79,0x57
	.byte	0x45,0x42,0x20,0x2d,0x20,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63
	.byte	0x20,0x57,0x65,0x62,0x73,0x69,0x64,0x65,0x3c,0x2f,0x74,0x69
	.byte	0x74,0x6c,0x65,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x65,0x61,0x64
	.byte	0x3e,0x0d,0x0a,0x3c,0x62,0x6f,0x64,0x79,0x20,0x74,0x65,0x78
	.byte	0x74,0x3d,0x22,0x23,0x46,0x46,0x46,0x46,0x30,0x30,0x22,0x20
	.byte	0x62,0x67,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x36,0x36
	.byte	0x33,0x33,0x36,0x36,0x22,0x20,0x6c,0x69,0x6e,0x6b,0x3d,0x22
	.byte	0x23,0x30,0x30,0x30,0x30,0x45,0x45,0x22,0x20,0x76,0x6c,0x69
	.byte	0x6e,0x6b,0x3d,0x22,0x23,0x35,0x35,0x31,0x41,0x38,0x42,0x22
	.byte	0x20,0x61,0x6c,0x69,0x6e,0x6b,0x3d,0x22,0x23,0x33,0x33,0x46
	.byte	0x46,0x33,0x33,0x22,0x3e,0x0d,0x0a,0x3c,0x62,0x3e,0x3c,0x69
	.byte	0x3e,0x3c,0x66,0x6f,0x6e,0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72
	.byte	0x3d,0x22,0x23,0x46,0x46,0x46,0x46,0x46,0x46,0x22,0x3e,0x3c
	.byte	0x66,0x6f,0x6e,0x74,0x20,0x73,0x69,0x7a,0x65,0x3d,0x2b,0x33
	.byte	0x3e,0x48,0x45,0x4c,0x4c,0x4f,0x0d,0x0a,0x57,0x4f,0x52,0x4c
	.byte	0x44,0x21,0x3c,0x2f,0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x66
	.byte	0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x69,0x3e,0x3c,0x2f,0x62,0x3e
	.byte	0x0d,0x0a,0x3c,0x70,0x3e,0x3c,0x62,0x3e,0x3c,0x66,0x6f,0x6e
	.byte	0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x46,0x46
	.byte	0x46,0x46,0x46,0x46,0x22,0x3e,0x54,0x68,0x69,0x73,0x20,0x69
	.byte	0x73,0x20,0x61,0x20,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20
	.byte	0x77,0x65,0x62,0x73,0x69,0x64,0x65,0x20,0x68,0x6f,0x73,0x74
	.byte	0x65,0x64,0x20,0x62,0x79,0x20,0x74,0x68,0x65,0x20,0x65,0x6d
	.byte	0x62,0x65,0x64,0x64,0x65,0x64,0x0d,0x0a,0x57,0x65,0x62,0x73
	.byte	0x65,0x72,0x76,0x65,0x72,0x20,0x65,0x61,0x73,0x79,0x57,0x45
	.byte	0x42,0x2e,0x3c,0x2f,0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x62
	.byte	0x3e,0x0d,0x0a,0x3c,0x62,0x72,0x3e,0x3c,0x62,0x3e,0x3c,0x66
	.byte	0x6f,0x6e,0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23
	.byte	0x46,0x46,0x46,0x46,0x46,0x46,0x22,0x3e,0x48,0x61,0x72,0x64
	.byte	0x77,0x61,0x72,0x65,0x3a,0x3c,0x2f,0x66,0x6f,0x6e,0x74,0x3e
	.byte	0x3c,0x2f,0x62,0x3e,0x0d,0x0a,0x3c,0x75,0x6c,0x3e,0x0d,0x0a
	.byte	0x3c,0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x66,0x6f,0x6e,0x74,0x20
	.byte	0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x43,0x43,0x43,0x43
	.byte	0x43,0x43,0x22,0x3e,0x50,0x48,0x59,0x54,0x45,0x43,0x20,0x64
	.byte	0x65,0x62,0x75,0x67,0x43,0x4f,0x52,0x45,0x2d,0x54,0x43,0x31
	.byte	0x37,0x37,0x35,0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x20
	.byte	0x61,0x74,0x20,0x44,0x56,0x31,0x25,0x4d,0x48,0x7a,0x3c,0x2f
	.byte	0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x6c,0x69,0x3e,0x0d,0x0a
	.byte	0x0d,0x0a,0x3c,0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x66,0x6f,0x6e
	.byte	0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x43,0x43
	.byte	0x43,0x43,0x43,0x43,0x22,0x3e,0x54,0x69,0x6d,0x65,0x20,0x61
	.byte	0x66,0x74,0x65,0x72,0x20,0x6c,0x61,0x73,0x74,0x20,0x72,0x65
	.byte	0x73,0x65,0x74,0x20,0x69,0x6e,0x20,0x73,0x65,0x63,0x6f,0x6e
	.byte	0x64,0x73,0x20,0x3d,0x20,0x44,0x56,0x32,0x25,0x20,0x20,0x20
	.byte	0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x66,0x6f
	.byte	0x6e,0x74,0x3e,0x3c,0x62,0x72,0x3e,0x0d,0x0a,0x3c,0x62,0x72
	.byte	0x3e,0x0d,0x0a,0x3c,0x42,0x52,0x3e,0x3c,0x2f,0x6c,0x69,0x3e
	.byte	0x0d,0x0a,0x0d,0x0a,0x3c,0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x66
	.byte	0x6f,0x6e,0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23
	.byte	0x43,0x43,0x43,0x43,0x43,0x43,0x22,0x3e,0x49,0x6e,0x66,0x69
	.byte	0x6e,0x65,0x6f,0x6e,0x20,0x54,0x72,0x69,0x63,0x6f,0x72,0x65
	.byte	0x20,0x54,0x43,0x31,0x37,0x37,0x35,0x20,0x43,0x50,0x55,0x3c
	.byte	0x2f,0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x6c,0x69,0x3e,0x0d
	.byte	0x0a,0x0d,0x0a,0x3c,0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x66,0x6f
	.byte	0x6e,0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x43
	.byte	0x43,0x43,0x43,0x43,0x43,0x22,0x3e,0x43,0x53,0x38,0x39,0x30
	.byte	0x30,0x41,0x20,0x31,0x30,0x4d,0x42,0x69,0x74,0x20,0x45,0x74
	.byte	0x68,0x65,0x72,0x6e,0x65,0x74,0x20,0x43,0x6f,0x6e,0x74,0x72
	.byte	0x6f,0x6c,0x6c,0x65,0x72,0x20,0x6f,0x6e,0x2d,0x62,0x6f,0x61
	.byte	0x72,0x64,0x3c,0x2f,0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x6c
	.byte	0x69,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x6c,0x69,0x3e,0x0d,0x0a
	.byte	0x3c,0x66,0x6f,0x6e,0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d
	.byte	0x22,0x23,0x43,0x43,0x43,0x43,0x43,0x43,0x22,0x3e,0x34,0x20
	.byte	0x4d,0x42,0x79,0x74,0x65,0x20,0x42,0x75,0x72,0x73,0x74,0x2d
	.byte	0x4d,0x6f,0x64,0x65,0x2d,0x46,0x6c,0x61,0x73,0x68,0x3c,0x2f
	.byte	0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f,0x6c,0x69,0x3e,0x0d,0x0a
	.byte	0x0d,0x0a,0x3c,0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x66,0x6f,0x6e
	.byte	0x74,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x23,0x43,0x43
	.byte	0x43,0x43,0x43,0x43,0x22,0x3e,0x31,0x20,0x2d,0x20,0x32,0x20
	.byte	0x4d,0x42,0x79,0x74,0x65,0x20,0x66,0x61,0x73,0x74,0x20,0x53
	.byte	0x52,0x41,0x4d,0x3c,0x2f,0x66,0x6f,0x6e,0x74,0x3e,0x3c,0x2f
	.byte	0x6c,0x69,0x3e,0x0d,0x0a,0x3c,0x2f,0x75,0x6c,0x3e,0x0d,0x0a
	.byte	0x0d,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c
	.byte	0x2f,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,0x00
	.symb	TYPE, 280, 'Z', #3, 1102
	.symb	IDEN, "WebSide", WebSide, #280, 129, 0x0
	.symb	ALAB, WebSide, #280
	.symb	ENDF
;   26 |#undef extern
;   27 |extern unsigned int uiFrequency;
;   28 |#define extern     
;   29 |
;   30 |void easyweb(void)
;   31 |{
	.sdecl	"code.easyweb",CODE
	.sect	"code.easyweb"
	.align	4
	.symb	LINE, 31
	.symb	TYPE, 282, 'X', 8, #1, 26, 0
	.symb	GFUN, "easyweb", easyweb, #282, 0, 0, 0
	.symb	ALAB, easyweb, #282
easyweb:
	.symb	SOFF, 0
;   32 |//InitOsc();              // Keil: No oscillator initialization necessary at this time.
;   33 |//InitPorts();			  // Keil: No port initialization necessary at this time.
;   34 |
;   35 |  TCPLowLevelInit();
	.symb	LINE, 35
	callg	TCPLowLevelInit
;   36 |
;   37 |/*
;   38 |  *(unsigned char *)RemoteIP = 24;               // uncomment those lines to get the
;   39 |  *((unsigned char *)RemoteIP + 1) = 8;          // quote of the day from a real
;   40 |  *((unsigned char *)RemoteIP + 2) = 69;         // internet server! (gateway must be
;   41 |  *((unsigned char *)RemoteIP + 3) = 7;          // set to your LAN-router)
;   42 |
;   43 |  TCPLocalPort = 2025;
;   44 |  TCPRemotePort = TCP_PORT_QOTD;
;   45 |
;   46 |  TCPActiveOpen();
;   47 |
;   48 |  while (SocketStatus & SOCK_ACTIVE)             // read the quote from memory
;   49 |  {                                              // by using the hardware-debugger
;   50 |    DoNetworkStuff();
;   51 |  }
;   52 |*/
;   53 |
;   54 |  HTTPStatus = 0;                                // clear HTTP-server's flag register
	.symb	LINE, 54
	mov16	d15,#0				; HTTPStatus
	st.b	HTTPStatus,d15			; HTTPStatus
;   55 |
;   56 |  TCPLocalPort = TCP_PORT_HTTP;                  // set port we want to listen to
	.symb	LINE, 56
	mov16	d15,#80				; TCPLocalPort
	st.h	TCPLocalPort,d15		; TCPLocalPort
;   57 |  
;   58 |  while (1)                                      // repeat forever
	.symb	LINE, 58
_3:
;   59 |  {
;   60 |    if (!(SocketStatus & SOCK_ACTIVE)) TCPPassiveOpen();   // listen for incoming TCP-connection
	.symb	LINE, 60
	ld.bu	d15,SocketStatus		; SocketStatus
	jnz.t	d15:0,_4
	callg	TCPPassiveOpen
_4:
;   61 |    DoNetworkStuff();                                      // handle network and easyWEB-stack
	.symb	LINE, 61
	callg	DoNetworkStuff
;   62 |                                                           // events
;   63 |    HTTPServer();
	.symb	LINE, 63
	callg	HTTPServer
	.symb	LINE, 58
	j	_3
;   64 |  }
;   65 |}
	.symb	LINE, 65
	ret16
	.symb	EFUN
;   66 |
;   67 |// This function implements a very simple dynamic HTTP-server.
;   68 |// It waits until connected, then sends a HTTP-header and the
;   69 |// HTML-code stored in memory. Before sending, it replaces
;   70 |// some special strings with dynamic values.
;   71 |// NOTE: For strings crossing page boundaries, replacing will
;   72 |// not work. In this case, simply add some extra lines
;   73 |// (e.g. CR and LFs) to the HTML-code.
;   74 |
;   75 |void HTTPServer(void)
;   76 |{
	.symb	LINE, 76
	.symb	TYPE, 283, 'X', 8, #1, 26, 0
	.symb	GFUN, "HTTPServer", HTTPServer, #283, 0, 0, 0
	.symb	ALAB, HTTPServer, #283
HTTPServer:
	.symb	SOFF, 0
;   77 |  if (SocketStatus & SOCK_CONNECTED)             // check if somebody has connected to our TCP
	.symb	LINE, 77
	ld.bu	d15,SocketStatus		; SocketStatus
	jz.t	d15:1,_12
;   78 |  {
;   79 |    if (SocketStatus & SOCK_DATA_AVAILABLE)      // check if remote TCP sent data
	.symb	LINE, 79
	jz.t	d15:2,_5
;   80 |      TCPReleaseRxBuffer();                      // and throw it away
	.symb	LINE, 80
	callg	TCPReleaseRxBuffer
_5:
;   81 |
;   82 |    if (SocketStatus & SOCK_TX_BUF_RELEASED)     // check if buffer is free for TX
	.symb	LINE, 82
	ld.bu	d15,SocketStatus		; SocketStatus
	jz.t	d15:3,_14
;   83 |    {
;   84 |      if (!(HTTPStatus & HTTP_SEND_PAGE))        // init byte-counter and pointer to webside
	.symb	LINE, 84
	ld.bu	d15,HTTPStatus			; HTTPStatus
	and	d15,d15,#1
	jne	d15,#0,_6
;   85 |      {                                          // if called the 1st time
;   86 |        HTTPBytesToSend = sizeof(WebSide) - 1;   // get HTML length, ignore trailing zero
	.symb	LINE, 86
	mov	d7,#1102			; HTTPBytesToSend
	st.h	HTTPBytesToSend,d7		; HTTPBytesToSend
;   87 |        PWebSide = (unsigned char *)WebSide;     // pointer to HTML-code
	.symb	LINE, 87
	movh.a	a15,#@his(WebSide)
	lea	a15,[a15]@los(WebSide)
	st.a	PWebSide,a15			; PWebSide
;   88 |      }
	.symb	LINE, 88
_6:
	mov	d14,#512			; 512
;   89 |
;   90 |      if (HTTPBytesToSend > MAX_TCP_TX_DATA_SIZE)     // transmit a segment of MAX_SIZE
	.symb	LINE, 90
	ld.hu	d7,HTTPBytesToSend		; HTTPBytesToSend
	jge	d14,d7,_9
;   91 |      {
;   92 |        if (!(HTTPStatus & HTTP_SEND_PAGE))           // 1st time, include HTTP-header
	.symb	LINE, 92
	jne	d15,#0,_7
	mov	d4,#44				; 44
;   93 |        {
;   94 |          memcpy(TCP_TX_BUF, GetResponse, sizeof(GetResponse) - 1);
	.symb	LINE, 94
	movh.a	a4,#@his(TxFrame1+54)
	lea	a4,[a4]@los(TxFrame1+54)
	movh.a	a5,#@his(GetResponse)
	lea	a5,[a5]@los(GetResponse)
	callg	memcpy
	mov	d4,#468				; 468
;   95 |          memcpy(TCP_TX_BUF + sizeof(GetResponse) - 1, PWebSide, MAX_TCP_TX_DATA_SIZE - sizeof(GetResponse) + 1);
	.symb	LINE, 95
	movh.a	a4,#@his(TxFrame1+98)
	lea	a4,[a4]@los(TxFrame1+98)
	ld.a	a5,PWebSide			; PWebSide
	callg	memcpy
;   96 |          HTTPBytesToSend -= MAX_TCP_TX_DATA_SIZE - sizeof(GetResponse) + 1;
	.symb	LINE, 96
	ld.hu	d15,HTTPBytesToSend		; HTTPBytesToSend
	addi	d15,d15,#-468			; HTTPBytesToSend
	st.h	HTTPBytesToSend,d15		; HTTPBytesToSend
;   97 |          PWebSide += MAX_TCP_TX_DATA_SIZE - sizeof(GetResponse) + 1;
	.symb	LINE, 97
	ld.a	a15,PWebSide			; PWebSide
	lea	a15,[a15]468			; PWebSide
	st.a	PWebSide,a15			; PWebSide
;   98 |        }
	.symb	LINE, 98
	j	_8
_7:
	mov	d4,#512				; 512
;   99 |        else
;  100 |        {
;  101 |          memcpy(TCP_TX_BUF, PWebSide, MAX_TCP_TX_DATA_SIZE);
	.symb	LINE, 101
	movh.a	a4,#@his(TxFrame1+54)
	lea	a4,[a4]@los(TxFrame1+54)
	ld.a	a5,PWebSide			; PWebSide
	callg	memcpy
;  102 |          HTTPBytesToSend -= MAX_TCP_TX_DATA_SIZE;
	.symb	LINE, 102
	ld.hu	d4,HTTPBytesToSend		; HTTPBytesToSend
	sub16	d4,d14				; HTTPBytesToSend
	st.h	HTTPBytesToSend,d4		; HTTPBytesToSend
;  103 |          PWebSide += MAX_TCP_TX_DATA_SIZE;
	.symb	LINE, 103
	ld.a	a15,PWebSide			; PWebSide
	lea	a15,[a15]512			; PWebSide
	st.a	PWebSide,a15			; PWebSide
;  104 |        }
	.symb	LINE, 104
_8:
;  105 |          
;  106 |        TCPTxDataCount = MAX_TCP_TX_DATA_SIZE;   // bytes to xfer
	.symb	LINE, 106
	mov	d15,#512			; TCPTxDataCount
	st.h	TCPTxDataCount,d15		; TCPTxDataCount
;  107 |        InsertDynamicValues();                   // exchange some strings...
	.symb	LINE, 107
	callg	InsertDynamicValues
;  108 |        TCPTransmitTxBuffer();                   // xfer buffer
	.symb	LINE, 108
	callg	TCPTransmitTxBuffer
;  109 |      }
	.symb	LINE, 109
	j	_11
_9:
;  110 |      else if (HTTPBytesToSend)                  // transmit leftover bytes
	.symb	LINE, 110
	ld.hu	d4,HTTPBytesToSend		; HTTPBytesToSend
	jeq	d4,#0,_11			; HTTPBytesToSend
;  111 |      {
;  112 |        memcpy(TCP_TX_BUF, PWebSide, HTTPBytesToSend);
	.symb	LINE, 112
	movh.a	a4,#@his(TxFrame1+54)
	lea	a4,[a4]@los(TxFrame1+54)
	ld.a	a5,PWebSide			; PWebSide
	callg	memcpy
;  113 |        TCPTxDataCount = HTTPBytesToSend;        // bytes to xfer
	.symb	LINE, 113
	ld.hu	d15,HTTPBytesToSend		; HTTPBytesToSend
	st.h	TCPTxDataCount,d15		; TCPTxDataCount
;  114 |        InsertDynamicValues();                   // exchange some strings...
	.symb	LINE, 114
	callg	InsertDynamicValues
;  115 |        TCPTransmitTxBuffer();                   // send last segment
	.symb	LINE, 115
	callg	TCPTransmitTxBuffer
;  116 |        TCPClose();                              // and close connection
	.symb	LINE, 116
	callg	TCPClose
;  117 |        HTTPBytesToSend = 0;                     // all data sent
	.symb	LINE, 117
	mov16	d15,#0				; HTTPBytesToSend
	st.h	HTTPBytesToSend,d15		; HTTPBytesToSend
;  118 |      }
;  119 |
;  120 |      HTTPStatus |= HTTP_SEND_PAGE;              // ok, 1st loop executed
	.symb	LINE, 120
_11:
	ld.bu	d15,HTTPStatus			; HTTPStatus
	or	d15,d15,#1			; HTTPStatus
	st.b	HTTPStatus,d15			; HTTPStatus
;  121 |    }
;  122 |  }
	.symb	LINE, 122
	ret16
_12:
	mov16	d7,#-2				; -2
;  123 |  else
;  124 |    HTTPStatus &= ~HTTP_SEND_PAGE;               // reset help-flag if not connected
	.symb	LINE, 124
	ld.bu	d15,HTTPStatus			; HTTPStatus
	and16	d15,d7				; HTTPStatus
	st.b	HTTPStatus,d15			; HTTPStatus
_14:
;  125 |}
	.symb	LINE, 125
	ret16
	.symb	EFUN
;  126 |
;  127 |// searches the TX-buffer for special strings and replaces them
;  128 |// with dynamic values (for example the temperature)
;  129 |
;  130 |void InsertDynamicValues(void)
;  131 |{
	.symb	LINE, 131
	.sect	"farrom.easyweb"
	.align	2
_15:
	.byte	0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x32
	.sect	"code.easyweb"
	.symb	TYPE, 284, 'X', 8, #1, 26, 0
	.symb	GFUN, "InsertDynamicValues", InsertDynamicValues, #284, 0, 16, 0
	.symb	ALAB, InsertDynamicValues, #284
InsertDynamicValues:
	.symb	TYPE, 286, 'P', #3
	.symb	IDEN, "Key", -1, #286, 131, 0x5
	.symb	TYPE, 287, 'Z', #2, 11
	.symb	IDEN, "NewKey", -12, #287, 129, 0x5
	.symb	SOFF, 16
	.symb	LTIM, "Key", -1, 0, 0x45
	nop
	sub16.a	sp,#16
;  132 |  unsigned char *Key;
;  133 |  char NewKey[12] = "123456789012";
	.symb	LINE, 133
	movh.a	a15,#@his(_15)			; _15
	lea	a15,[a15]@los(_15)		; _15
	lea	a7,[sp]4			; NewKey
	mov16.a	a6,#2				; NewKey
_28:
	.symb	IDEN, "i", -1, #5, 131, 0x5
	.symb	LTIM, "i", -1, 0, 0x45
	.symb	LTIM, "Key", 30, 0, 0xcd
	.symb	LTIM, "i", 14, 0, 0xcd
	nop
	ld16.w	d15,[a15+]
	st16.w	[a7+],d15
	isync
	loop16	a6,_28
;  134 |  unsigned short i;
;  135 |  
;  136 |  if (TCPTxDataCount < 4) return;       // there can't be any special string
	.symb	LINE, 136
	ld.hu	d15,TCPTxDataCount		; TCPTxDataCount
	jlt	d15,#4,_27
	mov16	d14,#0				; 0
;  137 |  
;  138 |  Key = TCP_TX_BUF;
	.symb	LINE, 138
	movh.a	a14,#@his(TxFrame1+54)
	lea	a14,[a14]@los(TxFrame1+54)
;  139 |  
;  140 |  for (i = 0; i < (TCPTxDataCount - 3); i++)
	.symb	LINE, 140
	lea	a13,[sp]4
	j	_26
_18:
;  141 |  {
;  142 |    if (*Key == 'D')
	.symb	LINE, 142
	nop
	ld16.bu	d15,[a14]
	eq	d15,d15,#68
	jeq	d15,#0,_25
;  143 |     if (*(Key + 1) == 'V')
	.symb	LINE, 143
	ld16.bu	d15,[a14]1
	eq	d15,d15,#86
	jeq	d15,#0,_25
;  144 |       if (*(Key + 3) == '%')
	.symb	LINE, 144
	ld16.bu	d15,[a14]3
	eq	d15,d15,#37
	jeq	d15,#0,_25
;  145 |         switch (*(Key + 2))
	.symb	LINE, 145
	ld16.bu	d15,[a14]2
	addi	d15,d15,#-50
	jeq	d15,#-1,_19			; case 49
	jeq	d15,#0,_20			; case 50
	j	_25				; default
;  146 |         {
;  147 |           case '1' :                                 // "DV1%"?
	.symb	LINE, 147
_19:
	.symb	LTIM, "Key", 30, 0, 0x4d
	.symb	LTIM, "Key", 20, 0, 0xcd
	.symb	LTIM, "Key", 20, 0, 0x4d
	.symb	LTIM, "Key", 30, 0, 0xcd
;  148 |           {
;  149 |			 sprintf(NewKey, "%2u  ", uiFrequency);     //
	.symb	LINE, 149
	lea	a5,_16
	ld.w	d15,uiFrequency			; uiFrequency
	st16.w	[sp],d15			; uiFrequency
	mov16.aa a4,a13
	callg	sprintf
;  150 |             memcpy(Key, NewKey, 4);                  
	.symb	LINE, 150
	mov16	d4,#4				; 4
	mov16.aa a5,a13
	mov16.aa a4,a14				; Key
	callg	memcpy
;  151 |             break;
	.symb	LINE, 151
	j	_25
;  152 |           }
;  153 |           case '2' :                                 // "DV2%"?
	.symb	LINE, 153
_20:
	.symb	LTIM, "Key", 30, 0, 0x4d
	.symb	LTIM, "Key", 20, 0, 0xcd
	.symb	LTIM, "Key", 20, 0, 0x4d
	.symb	LTIM, "Key", 30, 0, 0xcd
;  154 |           {
;  155 |             sprintf(NewKey, "%10u", RTC_uwGetTime());    // insert module Uptime		 
	.symb	LINE, 155
	callg	RTC_uwGetTime
	lea	a5,_17
	st16.w	[sp],d2
	mov16.aa a4,a13
	callg	sprintf
;  156 |             memcpy(Key, NewKey, 10);                  
	.symb	LINE, 156
	mov	d4,#10				; 10
	mov16.aa a5,a13
	mov16.aa a4,a14				; Key
	callg	memcpy
;  157 |             break;
;  158 |           }
;  159 |         }
;  160 |    Key++;
	.symb	LINE, 160
_25:
	.symb	LTIM, "Key", 30, 0, 0x4d
	.symb	LTIM, "Key", 30, 0, 0xcd
	.symb	LTIM, "Key", 30, 0, 0x4d
	.symb	LTIM, "Key", 30, 0, 0xcd
	.symb	LTIM, "i", 14, 0, 0x4d
	.symb	LTIM, "i", 14, 0, 0xcd
	add16	d14,#1				; i
	add16.a	a14,#1				; Key
	.symb	LINE, 140
	extr.u	d14,d14,#0,#16			; i
_26:
	ld.hu	d15,TCPTxDataCount		; TCPTxDataCount
	add16	d15,#-3
	jlt	d14,d15,_18
;  161 |  }
;  162 |}
	.symb	LINE, 162
_27:
	ret16
	.symb	LTIM, "i", 14, 0, 0x4d
	.symb	LTIM, "Key", 30, 0, 0x4d
	.symb	EFUN
;  163 | 
	.symb	ENDF
	.symb	IDEN, "TCPFlags", TCPFlags, #3, 131, 0x0
	.symb	ALAB, TCPFlags, #3
	.sdecl	"bss.easyweb",DATA,CLEAR,ABS18
	.sect	"bss.easyweb"
	.align	4
TCPFlags:
	.space	1
	.symb	ALAB, uiFrequency, #18
	.symb	IDEN, "TCPLocalPort", TCPLocalPort, #5, 131, 0x0
	.symb	ALAB, TCPLocalPort, #5
	.align	2
TCPLocalPort:
	.space	2
	.symb	IDEN, "RemoteIP", RemoteIP, #274, 129, 0x0
	.symb	ALAB, RemoteIP, #274
	.sdecl	"farbss.easyweb",DATA,CLEAR
	.sect	"farbss.easyweb"
	.align	4
RemoteIP:
	.space	4
	.symb	IDEN, "TCPTxDataCount", TCPTxDataCount, #5, 131, 0x0
	.symb	ALAB, TCPTxDataCount, #5
	.sect	"bss.easyweb"
TCPTxDataCount:
	.space	2
	.symb	IDEN, "HTTPStatus", HTTPStatus, #3, 131, 0x0
	.symb	ALAB, HTTPStatus, #3
HTTPStatus:
	.space	1
	.symb	IDEN, "HTTPBytesToSend", HTTPBytesToSend, #5, 131, 0x0
	.symb	ALAB, HTTPBytesToSend, #5
	.align	2
HTTPBytesToSend:
	.space	2
	.symb	IDEN, "TxFrame2Size", TxFrame2Size, #3, 131, 0x0
	.symb	ALAB, TxFrame2Size, #3
TxFrame2Size:
	.space	1
	.symb	TYPE, 289, 'Z', #3, 73
	.symb	IDEN, "TxFrame2", TxFrame2, #289, 129, 0x0
	.symb	ALAB, TxFrame2, #289
	.sect	"farbss.easyweb"
TxFrame2:
	.space	74
	.symb	IDEN, "LastFrameSent", LastFrameSent, #278, 131, 0x0
	.symb	ALAB, LastFrameSent, #278
	.sect	"bss.easyweb"
LastFrameSent:
	.space	1
	.symb	TYPE, 291, 'Z', #3, 565
	.symb	IDEN, "TxFrame1", TxFrame1, #291, 129, 0x0
	.symb	ALAB, TxFrame1, #291
	.sect	"farbss.easyweb"
TxFrame1:
	.space	566
	.symb	TYPE, 293, 'X', 8, #1, 26, 0
	.symb	ALAB, TCPPassiveOpen, #293
	.symb	IDEN, "ISNGenHigh", ISNGenHigh, #5, 131, 0x0
	.symb	ALAB, ISNGenHigh, #5
	.sect	"bss.easyweb"
ISNGenHigh:
	.space	2
	.symb	IDEN, "PWebSide", PWebSide, #286, 131, 0x0
	.symb	ALAB, PWebSide, #286
	.align	4
PWebSide:
	.space	4
	.symb	TYPE, 294, 'X', 8, #1, 26, 0
	.symb	ALAB, DoNetworkStuff, #294
	.symb	TYPE, 295, 'X', 8, #1, 26, 0
	.symb	ALAB, TCPClose, #295
	.symb	TYPE, 296, 'Z', #5, 2
	.symb	IDEN, "RecdFrameMAC", RecdFrameMAC, #296, 129, 0x0
	.symb	ALAB, RecdFrameMAC, #296
	.sect	"farbss.easyweb"
RecdFrameMAC:
	.space	6
	.symb	TYPE, 298, 'Z', #3, 255
	.symb	IDEN, "RxTCPBuffer", RxTCPBuffer, #298, 129, 0x0
	.symb	ALAB, RxTCPBuffer, #298
RxTCPBuffer:
	.space	256
	.symb	IDEN, "TxFrame1Size", TxFrame1Size, #5, 131, 0x0
	.symb	ALAB, TxFrame1Size, #5
	.sect	"bss.easyweb"
TxFrame1Size:
	.space	2
	.symb	TYPE, 300, 'Z', #261, 9
	.symb	IDEN, "_iob", _iob, #300, 129, 0x0
	.symb	ALAB, _iob, #300
	.sect	"farbss.easyweb"
	.align	4
_iob:
	.space	240
	.symb	IDEN, "RecdFrameIP", RecdFrameIP, #274, 129, 0x0
	.symb	ALAB, RecdFrameIP, #274
RecdFrameIP:
	.space	4
	.symb	IDEN, "TCPSeqNr", TCPSeqNr, #7, 131, 0x0
	.symb	ALAB, TCPSeqNr, #7
	.sect	"bss.easyweb"
TCPSeqNr:
	.space	4
	.symb	IDEN, "RetryCounter", RetryCounter, #3, 131, 0x0
	.symb	ALAB, RetryCounter, #3
RetryCounter:
	.space	1
	.symb	IDEN, "TCPUNASeqNr", TCPUNASeqNr, #7, 131, 0x0
	.symb	ALAB, TCPUNASeqNr, #7
	.align	2
TCPUNASeqNr:
	.space	4
	.symb	IDEN, "TCPRxDataCount", TCPRxDataCount, #5, 131, 0x0
	.symb	ALAB, TCPRxDataCount, #5
TCPRxDataCount:
	.space	2
	.sdecl	"data.easyweb",DATA,INIT,ABS18
	.sect	"data.easyweb"
	.align	4
_17:
	.ascii	"%10u"
	.byte	0x00
	.symb	IDEN, "TCPTimer", TCPTimer, #3, 131, 0x0
	.symb	ALAB, TCPTimer, #3
	.sect	"bss.easyweb"
TCPTimer:
	.space	1
	.symb	TYPE, 302, 'X', 8, #16, 26, 3, #260, #260, #1
	.symb	ALAB, sprintf, #302
	.symb	TYPE, 303, 'X', 8, #1, 26, 0
	.symb	ALAB, TCPReleaseRxBuffer, #303
	.symb	IDEN, "TCPRemotePort", TCPRemotePort, #5, 131, 0x0
	.symb	ALAB, TCPRemotePort, #5
	.align	2
TCPRemotePort:
	.space	2
	.symb	IDEN, "TCPAckNr", TCPAckNr, #7, 131, 0x0
	.symb	ALAB, TCPAckNr, #7
TCPAckNr:
	.space	4
	.symb	IDEN, "RecdIPFrameLength", RecdIPFrameLength, #5, 131, 0x0
	.symb	ALAB, RecdIPFrameLength, #5
RecdIPFrameLength:
	.space	2
	.symb	TYPE, 304, 'X', 8, #1, 26, 0
	.symb	ALAB, TCPLowLevelInit, #304
	.sect	"data.easyweb"
	.align	2
_16:
	.ascii	"%2u  "
	.byte	0x00
	.symb	IDEN, "RecdFrameLength", RecdFrameLength, #5, 131, 0x0
	.symb	ALAB, RecdFrameLength, #5
	.sect	"bss.easyweb"
RecdFrameLength:
	.space	2
	.symb	TYPE, 305, 'X', 8, #18, 26, 0
	.symb	ALAB, RTC_uwGetTime, #305
	.symb	IDEN, "TCPStateMachine", TCPStateMachine, #276, 131, 0x0
	.symb	ALAB, TCPStateMachine, #276
TCPStateMachine:
	.space	1
	.symb	IDEN, "TransmitControl", TransmitControl, #3, 131, 0x0
	.symb	ALAB, TransmitControl, #3
TransmitControl:
	.space	1
	.symb	TYPE, 306, 'X', 8, #1, 26, 0
	.symb	ALAB, TCPTransmitTxBuffer, #306
	.symb	IDEN, "RemoteMAC", RemoteMAC, #296, 129, 0x0
	.symb	ALAB, RemoteMAC, #296
	.sect	"farbss.easyweb"
RemoteMAC:
	.space	6
	.symb	TYPE, 308, 'P', #1
	.symb	TYPE, 311, 'P', #1
	.symb	TYPE, 309, 'X', 8, #308, 26, 3, #311, #311, #18
	.symb	ALAB, memcpy, #309
	.symb	IDEN, "SocketStatus", SocketStatus, #3, 131, 0x0
	.symb	ALAB, SocketStatus, #3
	.sect	"bss.easyweb"
SocketStatus:
	.space	1
	.align	4
	.sect	"farbss.easyweb"
	.align	4
	.global	GatewayIP
	.global	GetResponse
	.global	HTTPBytesToSend
	.global	HTTPServer
	.global	HTTPStatus
	.global	ISNGenHigh
	.global	InitSeq
	.global	InsertDynamicValues
	.global	LastFrameSent
	.global	MyIP
	.global	MyMAC
	.global	PWebSide
	.global	RecdFrameIP
	.global	RecdFrameLength
	.global	RecdFrameMAC
	.global	RecdIPFrameLength
	.global	RemoteIP
	.global	RemoteMAC
	.global	RetryCounter
	.global	RxTCPBuffer
	.global	SocketStatus
	.global	SubnetMask
	.global	TCPAckNr
	.global	TCPFlags
	.global	TCPLocalPort
	.global	TCPRemotePort
	.global	TCPRxDataCount
	.global	TCPSeqNr
	.global	TCPStateMachine
	.global	TCPTimer
	.global	TCPTxDataCount
	.global	TCPUNASeqNr
	.global	TransmitControl
	.global	TxFrame1
	.global	TxFrame1Size
	.global	TxFrame2
	.global	TxFrame2Size
	.global	WebSide
	.global	_iob
	.global	easyweb
	.extern	(CODE) DoNetworkStuff
	.extern	(CODE) RTC_uwGetTime
	.extern	(CODE) TCPClose
	.extern	(CODE) TCPLowLevelInit
	.extern	(CODE) TCPPassiveOpen
	.extern	(CODE) TCPReleaseRxBuffer
	.extern	(CODE) TCPTransmitTxBuffer
	.extern	(CODE) memcpy
	.extern	(CODE) sprintf
	.extern	(DATA,ABS18) uiFrequency
	.calls	"HTTPServer", "InsertDynamicValues"
	.calls	"HTTPServer", "TCPClose"
	.calls	"HTTPServer", "TCPReleaseRxBuffer"
	.calls	"HTTPServer", "TCPTransmitTxBuffer"
	.calls	"InsertDynamicValues", "RTC_uwGetTime"
	.calls	"InsertDynamicValues", "sprintf"
	.calls	"easyweb", "DoNetworkStuff"
	.calls	"easyweb", "HTTPServer"
	.calls	"easyweb", "TCPLowLevelInit"
	.calls	"easyweb", "TCPPassiveOpen"
