📄 using.phtml.htm
字号:
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac">
<TITLE>Compiling and testing ETHTEST, the example code</TITLE>
</HEAD>
<BODY BGCOLOR="#C0C0C0">
<TABLE BORDER=0 CELLPADDING=0>
<TR>
<TD VALIGN=TOP BGCOLOR='#000000'>
<TABLE ALIGN=LEFT VALIGN=TOP WIDTH=100 BORDER=0 CELLPADDING=3 CELLSPACING=0 >
<TR><TD BORDER=0 VALIGN=TOP ALIGN=CENTER><A HREF="http://www.8052.com"><IMG SRC="../8052ico.gif" BORDER=0></A>
</TD></TR>
<FORM method=get action="../search.phtml">
<TR><TD ALIGN=CENTER>
<FONT COLOR="#FFFFFF" SIZE=2>
<B>Search 8052.com...</B><BR>
<I>and the web!</I>
<INPUT TYPE=HIDDEN NAME=MSGFORUM VALUE="TRUE">
<INPUT TYPE=HIDDEN NAME=FULLSEARCH VALUE="TRUE">
<INPUT TYPE=HIDDEN Name=TYPE Value=ALLTERMS>
<INPUT Type=Text Size=14 Name=TERMS>
<INPUT TYPE="submit" VALUE="Search!"><P>
<A HREF="../find8052.phtml"><IMG SRC="../advsearch.gif" BORDER=0></A>
</TD></TR>
</FORM>
<TR><TD ALIGN=CENTER><HR>
<FONT COLOR="#FFFFFF" SIZE=2>
<FORM method=POST action="../login.phtml"><INPUT TYPE=HIDDEN Name=LOGINPAGE Value='/tcpip/using.phtml'><B>User (Email)</B><BR><INPUT Type=Text Size=14 MAXLENGTH=40 Name=EMAIL><BR><B>Password</B><BR> <INPUT Type=PASSWORD Size=14 MAXLENGTH=10 Name=PASSWORD><BR><INPUT TYPE='submit' VALUE='Login'></FORM><P><A HREF="../forget.phtml">Forgot password?</A><P><A HREF="../newacct.phtml">Create Account</A><P>
</TD></TR>
<TR><TD BORDER=0 ALIGN=CENTER><HR><A HREF="http://www.8052.com"><IMG SRC="../infoonl.gif" BORDER=0 VSPACE=5></A><BR>
<A HREF="http://www.8052.com"><IMG SRC="../main.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../forum"><IMG SRC="../msgbrd.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../tutorial.phtml"><IMG SRC="../tutorial.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../faq.phtml"><IMG SRC="../faq.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../news.phtml"><IMG SRC="../news.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../codelib.phtml"><IMG SRC="../codelib.gif" BORDER=0 VSPACE=2><BR>
<A HREF="../chips.phtml"><IMG SRC="../chips.gif" BORDER=0 VSPACE=2><BR>
<A HREF="../links.phtml"><IMG SRC="../links.gif" BORDER=0 VSPACE=2><BR>
<A HREF="../books.phtml"><IMG SRC="../books.gif" BORDER=0 VSPACE=2><BR>
<A HREF="../reviews.phtml"><IMG SRC="../reviews.gif" BORDER=0 VSPACE=2><BR>
<A HREF="../homepages.phtml"><IMG SRC="../upages.gif" BORDER=0 VSPACE=2>
</TD></TR>
<TR><TD BORDER=0 ALIGN=CENTER><HR><IMG SRC="../projol.gif" VSPACE=5><BR>
<A HREF="../tcpip"><FONT SIZE=2 COLOR="#FFFFFF">8052 TCP/IP</FONT></A><P>
<A HREF="../users/jsno"><FONT SIZE=2 COLOR="#FFFFFF">8052 CD-ROM</FONT></A><P>
</TD></TR>
<TR><TD BORDER=0 ALIGN=CENTER><HR><IMG SRC="../prodonl.gif" VSPACE=5><BR>
<A HREF="../products.phtml"><IMG SRC="../products.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../services.phtml"><IMG SRC="../service.gif" BORDER=0 VSPACE=2></A>
</TD></TR>
<TR><TD BORDER=0 ALIGN=CENTER><HR>
<IMG SRC="../othinfo.gif" VSPACE=5><BR>
<A HREF="../aboutvis.phtml"><IMG SRC="../about.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../contact.phtml"><IMG SRC="../contact.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../disclaim.phtml"><IMG SRC="../disclaim.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="../privacy.phtml"><IMG SRC="../privacy.gif" BORDER=0 VSPACE=2></A><BR>
</TD></TR>
<TR><TD BORDER=0 ALIGN=CENTER><HR><IMG SRC="../prodhl.gif" VSPACE=5><BR>
<CENTER>
<A HREF="http://www.8052.com/redirlnk.phtml?ID=97"><IMG SRC="../advertising/wsisideb.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="http://www.8052.com/redirlnk.phtml?ID=98"><IMG SRC="../advertising/Cygnal100x100.gif" BORDER=0></A><BR>
<A HREF="http://www.8052.com/redirlnk.phtml?ID=105"><IMG SRC="../advertising/pfside.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="http://www.8052.com/redirlnk.phtml?ID=96"><IMG SRC="../advertising/pinico.gif" BORDER=0 VSPACE=2></A><BR>
<A HREF="http://www.8052.com/redirlnk.phtml?ID=99"><IMG SRC="../advertising/keil.gif" BORDER=0 VSPACE=2></A><BR>
</CENTER>
</TD></TR>
</TABLE>
</TD>
<TD VALIGN=TOP>
<FONT SIZE=2>
<TABLE ALIGN=CENTER VALIGN=TOP BORDER=0 CELLSPACING=6 CELLPADDING=4>
<TR><TD ALIGN=CENTER>
<!-- 998120167 -->
<A HREF="http://www.8052.com/redirlnk.phtml?ID=127"><IMG BORDER=0 SRC="http://www.8052.com/advertising/rascc.gif" WIDTH=475 HEIGHT=80></A>
<P><CENTER><TABLE BORDER=1 BGCOLOR="#FFFFFF"><TR><TD>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=3>
<TR>
<TD><FONT SIZE=2>2001-08-08</FONT></TD>
<TD> <FONT SIZE=2><A HREF="http://www.8052.com/news.phtml?NEWSID=16"><B>Cygnal Integrated Products and SANYO Semi. Sign Agreement for Sales Coverage in Asia</B></A></FONT></TD>
</TR>
<TR>
<TD><FONT SIZE=2>2001-06-04</FONT></TD>
<TD> <FONT SIZE=2><A HREF="http://www.8052.com/news.phtml?NEWSID=15"><B>Triscend Adds Communication Bridge Solutions to E5 Configurable System-on-Chip</B></A></FONT></TD>
</TR>
<TR>
<TD><FONT SIZE=2>2001-05-22</FONT></TD>
<TD> <FONT SIZE=2><A HREF="http://www.8052.com/news.phtml?NEWSID=14"><B>Embedded Pascal 805x MKII compiler now available</B></A></FONT></TD>
</TR>
</TABLE></TD></TR><TR><TD BGCOLOR="#D0D0D0"><FONT SIZE=2>Currently online: <B>17</B> guests</TD></TR></TABLE></CENTER>
</TD></TR>
</TABLE>
<TABLE CELLPADDING=10><TR><TD><FONT SIZE=2>
<BODY>
<P ALIGN=CENTER><TABLE BORDER="0" CELLSPACING="6" CELLPADDING="4">
<TR>
<TD><P> <B><FONT COLOR="#FF0000" SIZE=+2>Using the 8390 Code</FONT></B></P>
<P>The code has been written to reduce the amount of overhead required to
get the code working. The best way to see how easily the code intergrates
into an application is to examine the ETHTEST.ASM code. Below is an overview
of the code, and what the user variables etc are and how they affect the
compilation and execution of the ethernet driver.</P>
<P><B>REQUIREMENTS</B><BR>
The minimum requirements for using the 8390 code are:</P>
<OL>
<LI>8390 chipset compatible network card configured in the XDATA address
space on a page boundary
<LI>3.5k RAM configured on a page boundary (depends on size of Transmit
and Receive Buffer)
<LI>One spare interrupt, either INT0 or INT1
</OL>
<P><B>FUNCTIONS OF THE CODE</B><BR>
While the code is lengthly, there are only five (5) routines that should
be called from the calling program. These routines are explained in greater
detail below. In short, the routines are:</P>
<UL>
<LI><A HREF="#Int8390">Int8390</A> - Interrupt portion of the driver
<LI><A HREF="#Probe8390">Probe8390</A> - Attempts to locate an 8390 compatible
card at the <TT>IOAddr</TT> page boundary
<LI><A HREF="#NS8390_Init">NS8390_Init </A>- Initializes the NIC
<LI><A HREF="#EIGetPacket">EIGetPacket</A> - Retrieves a packet from the
NIC
<LI><A HREF="#SendPacket">SendPacket</A> - Sends a packet from the <TT>TXBUFFER</TT>
on to the NIC and triggers a send
</UL>
<P><B>IMPLEMENTING THE CODE</B><BR>
To include support for the 8390 driver, Use the INCLUDE or similar directive
to add the 8390.INC file to your source. An example is</P>
<BLOCKQUOTE>
<P><TT>INCL "8390.INC" ; Include 8390 Ethernet drivers</TT></P>
</BLOCKQUOTE>
<P>This will compile both the 8390.INC file, as well and use the NEEQUATE.TXT
file which is also required for successful compilation.</P>
<P>A skeleton struction to get the code working would look like this:</P>
<BLOCKQUOTE>
<P><TT>ORG 0000h<BR>
ajmp Begin</TT></P>
<P><TT>ORG INT0 or INT1 address<BR>
ljmp Int8390</TT></P>
<P><TT>BEGIN:<BR>
<Start of initialization code></TT></P>
<BLOCKQUOTE>
<P><TT>lcall Probe8390<BR>
lcall NS8390_Init</TT></P>
</BLOCKQUOTE>
<P><TT><End of Initializtion code></TT></P>
<P><TT><Main program loop></TT></P>
<BLOCKQUOTE>
<P><TT>jnb EI_RXD, NoPktWait</TT></P>
<P><TT>lcall ProcessPacket<BR>
clr EI_RXD</TT></P>
</BLOCKQUOTE>
<P><TT>NoPktWait:</TT></P>
<BLOCKQUOTE>
<P><TT>sjmp MainLoop</TT></P>
<P><TT>INCL "8390.inc"<BR>
end</TT></P>
</BLOCKQUOTE>
</BLOCKQUOTE>
<P ALIGN=CENTER><HR><---------- VARIABLES ----------></P>
<P>This section describes the variables and there purpose. Listed here are
both user variables, and system use variables. User variables determine
run-time configurations. System use variables are used by the code to keep
track of itself and various status flags. The only system user variable
that should be modified by the application program is <TT>ei_RXD</TT>. Changing
any other System Variable may cause unpredicable behaviour.</P>
<P><TABLE BORDER="1" CELLSPACING="2" CELLPADDING="0">
<TR>
<TH WIDTH="98"><P ALIGN=LEFT>Type of variable</TH>
<TH WIDTH="64">Name</TH>
<TH WIDTH="94">declared in file:</TH>
<TH>Use</TH></TR>
<TR>
<TD WIDTH="98">User Variables</TD>
<TD WIDTH="64"><A HREF="#IOAddr">IOAddr</A><BR>
<A HREF="#SAPROM">SAPROM</A><BR>
<A HREF="#Multibyte">MultiByte</A><BR>
<A HREF="#eidebug">EIDebug</A><BR>
<A HREF="#rxbuffer">RXBuffer</A><BR>
<A HREF="#txbuffer">TXBuffer</A></TD>
<TD WIDTH="94">8390.inc<BR>
8390.inc<BR>
8390.inc<BR>
8390.inc<BR>
8390.inc<BR>
8390.inc</TD>
<TD>Page boundary setting of the NIC. (MSB)<BR>
Start of data area for SAPROM data<BR>
Byte to enter into Multicast array<BR>
TRUE to include debug information in code<BR>
Points to start of receive buffer<BR>
Points to start of transmit buffer</TD></TR>
<TR>
<TD WIDTH="98">System Variables</TD>
<TD WIDTH="64"><A HREF="#eitxing">ei_Txing</A><BR>
<A HREF="#eirxd">ei_Rxd</A><BR>
<A HREF="#dmaing">dmaing</A><BR>
<A HREF="#nextpage">Next_Page</A></TD>
<TD WIDTH="94">8390.inc<BR>
8390.inc<BR>
8390.inc<BR>
8390.inc</TD>
<TD>TRUE is card tranmitting data<BR>
TRUE is ReceiveBuffer contains valid data<BR>
TRUE is transferring data to NIC<BR>
Holds pointer to next page from NIC</TD></TR>
</TABLE>
</P>
<P><FONT SIZE=+2>User Variables:</FONT></P>
<P><A NAME="IOAddr"></A><B>IOAddr: </B>The contains the Most Significant
Byte of the word address of the NIC. For example. If the Address of the
NIC was at 6300h, then IOAddr would contain the value 63h. This value, combined
with the value stored in R1 addresses the correct register within the Network
Card.</P>
<P><A NAME="SAPROM"></A><B>SAPROM:</B> This array, which at most will be
32 bytes long, but should only use the first 16 bytes, contains the data
stored on the PROM chip of the NIC. The most important data out of this
PROM area is the MAC address that the card uses. The initialization routine
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -