📄 tinymain.lst
字号:
C51 COMPILER V7.07 TINYMAIN 04/20/2004 18:04:41 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE TINYMAIN
OBJECT MODULE PLACED IN .\out\tinymain.obj
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE src\tinymain.c BROWSE DEBUG OBJECTEXTEND PRINT(.\lst\tinymain.lst) OBJECT(.
-\out\tinymain.obj)
stmt level source
1 /*
2 * Copyright (C) 2002 by TechiZ. All rights reserved.
3 *
4 * This program was written in Korean(Comment and some more).
5 *
6 * This program was developed by TechiZ(The Company name).
7 * TechiZ want to share this program with you who loves the 8051 & the TCP/IP.
8 *
9 * You MUST DOWNLOAD THIS CODE from TechiZ Homepage.
10 * You DO NOT USE THIS CODE FOR COMMERCIAL PURPOSE.
11 * This code is ONLY FREE FOR THE STUDY.
12 * If you want more, send me E-mail.
13 *
14 * E-mail: techiz@techiz.com
15 * ( Subject is : [T89C51RD2 & TinyTCP] bla~ bla bla.... )
16 *
17 * Homepage: http://www.techiz.com
18 *
19 * You DO NOT DELETE THIS COPYRIGHT MESSAGE IN THE USING OF THIS CODE.
20 *
21 * In the using of this code, TechiZ does NOT GUARANTEE ABOUT WORKING WITHOUT ERROR.
22 */
23
24 #include <stdio.h>
25 #include <aduc812.h>
*** WARNING C318 IN LINE 25 OF src\tinymain.c: can't open file 'aduc812.h'
26 #include <string.h>
27 #include "depend.h"
28 #include "tinytcp.h"
29 #include "include.h"
30 #include "reg_8019.h"
31
32 #define kbhit() while(!(RI != 0))
33
34 WORD test_application( void );
35 WORD test_dataHandler( tcp_Socket *s, BYTE *dp, WORD len );
36 void system_init( void );
37
38 //WORD i_test; // from test_application
39 //BYTE tbuf_test[80];
40
41 procref dataHandler[1]; /* called with incoming data */
42
43 extern in_Header *ip_tcp;
44 extern DWORD timeout_tcp, start_tcp;
45 extern DWORD x_tcp;
46
47 extern void print(BYTE *ch);
48 extern void tcp_Init(void);
49 extern void tcp_Listen(tcp_Socket *s, WORD port, DWORD timeout);
50 extern void tcp(void) reentrant;
51 extern void putb_ser(BYTE byte_data);
52 extern void tcp_Write( tcp_Socket *s, BYTE *dp, WORD len );
53 extern void tcp_Close(tcp_Socket *s);
C51 COMPILER V7.07 TINYMAIN 04/20/2004 18:04:41 PAGE 2
54
55
56
57 typedef struct _test_buf {
58 BYTE buf[80];
59 WORD len;
60 } TBUF;
61
62 TBUF test_buf;
63 tcp_Socket t_socket;
64
65 int tiny_tcp_main( void )
66 {
67 1 //kbhit();
68 1 ethernet_init();
69 1 print(" ** TINYTCP Test Program **\r\n");
70 1 tcp_Init();
71 1 test_buf.len = 0;
72 1
73 1 while ( 1 ) {
74 2 memset( &t_socket, 0, sizeof( tcp_Socket ) );
75 2 memset( &test_buf, 0, sizeof( TBUF ) );
76 2 print(" # ");
77 2 //tcp_Listen( &t_socket, 9999, test_dataHandler, 0 );
78 2 tcp_Listen( &t_socket, 9999, 0 );
79 2
80 2
81 2 printf("Our Ip address is %lx", sin_lclINAddr ) ;
82 2
83 2 print(" tcp_Listen..");
84 2 //tcp( test_application );
85 2 test_application();
86 2 tcp();
87 2 print("test_application..");
88 2 }
89 1 }
90 /*
91 WORD test_application( void )
92 {
93 //WORD i;
94 //BYTE tbuf[80];
95
96 if ( test_buf.len > 0 ) {
97 strcpy( tbuf_test, "You said," );
98 strncat( tbuf_test, test_buf.buf, test_buf.len );
99 for (i_test=0;i_test < test_buf.len;i_test++)
100 putb_ser( test_buf.buf[i_test] );
101 tcp_Write( &t_socket, tbuf_test, strlen(tbuf_test) );
102 tcp_Close( &t_socket );
103 test_buf.len = 0;
104 }
105 return 0;
106 }
107 */
108 WORD test_application( void )
109 {
110 1 WORD i;
111 1 BYTE tbuf[80];
112 1
113 1 if ( test_buf.len > 0 ) {
114 2 EN0_RXCR = 0; /* rx on(no broadcasts, no multicast,errors) */
115 2 strcpy( tbuf, "You said," );
C51 COMPILER V7.07 TINYMAIN 04/20/2004 18:04:41 PAGE 3
116 2 strncat( tbuf, test_buf.buf, test_buf.len );
117 2 //for (i=0;i < test_buf.len;i++)
118 2 // putb_ser( test_buf.buf[i] );
119 2 tcp_Write( &t_socket, tbuf, strlen(tbuf) );
120 2 //tcp_Close( &t_socket );
121 2 test_buf.len = 0;
122 2 }
123 1 return 0;
124 1 }
*** WARNING C280 IN LINE 110 OF SRC\TINYMAIN.C: 'i': unreferenced local variable
125
126 WORD test_dataHandler( tcp_Socket *s, BYTE *dp, WORD len )
127 {
128 1 //BYTE buf[80];
129 1 WORD i;
130 1
131 1 if ( dp == (BYTE *)0 ) {
132 2 return (0);
133 2 }
134 1
135 1 if ( len > 0 ) {
136 2 for ( i=0; i<len; i++ ) {
137 3 test_buf.buf[i] = dp[i];
138 3 }
139 2 test_buf.len = len;
140 2 }
141 1 return (1);
142 1 }
*** WARNING C280 IN LINE 126 OF SRC\TINYMAIN.C: 's': unreferenced local variable
143
144
145 void ethernet_address(void)
146 {
147 1 printf("\n\rsed_lclEthAddr = %x\n\r",sed_lclEthAddr);
148 1 printf("sed_ethBcastAddr= %x\n\r",sed_ethBcastAddr);
149 1 printf("sin_lclINAddr = %x\n\r",sin_lclINAddr);
150 1 printf("LOCAL_IP_ADDR = %x\n\r",LOCAL_IP_ADDR);
151 1 }
152
153
154
155 /*
156
157
158 #define khbit() ( RI != 0 )
159
160 void (code *vreset)() = (void (*)())0x0 ;
161 extern byte get_serial(void) ;
162
163 //extern void reset (void) ;
164 WORD test_application( void )
165 {
166
167 WORD len;
168 WORD tread;
169
170 if ( khbit() ) {
171 if ( get_serial() == 'q' ) {
172 print("warm boot\r\n") ;
173 vreset() ;
174 }
175
C51 COMPILER V7.07 TINYMAIN 04/20/2004 18:04:41 PAGE 4
176 */
*** ERROR C249 IN LINE 176 OF SRC\TINYMAIN.C: 'DATA': SEGMENT TOO LARGE
C51 COMPILATION COMPLETE. 3 WARNING(S), 1 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -