⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strings.html

📁 PKE(被动无钥门禁系统
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR2,StringBuffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR1,Append&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.Append&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This appends the string stored at Append in RAM, at the end of a StringBuffer.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.Char2String"></A><H3>
String.Char2String</H3>
<PRE>
&nbsp;<B>String.Char2String</B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;&nbsp;w&nbsp;)</PRE>
<P>
<DL>
<DD>	This function converts a char array to a string.<BR><BR>	ATTENTION, the StringBuffer has to be big enough for the resulting string.	This function will write the complete string to ram, regardless of the buffer size!<BR>
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>FSR2	The</CODE> - start address of String </DD>
<DD><CODE>FSR1</CODE> - The start address of char array </DD>
<DD><CODE>w</CODE> - The number of chars in the array </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Written</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR2,StringBuffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR1,ArrayAddress&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">'A'&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movwf&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">INDF1&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.Char2String&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This stores the string "A" at the address StringBuffer.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.GetLength"></A><H3>
String.GetLength</H3>
<PRE>
&nbsp;Strings.length&nbsp;&nbsp;w&nbsp;&nbsp;<B>String.GetLength</B>(&nbsp;FSR2&nbsp;)</PRE>
<P>
<DL>
<DD>	This function returns the length of a string.	The length represents the number of characters in the string.	To get the memory space of the string add 1 to the length	(end of string character).<BR>
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>FSR2	The</CODE> - start address of String </DD>
</DL></DD>
<DD><DL>
<DT><B>Returns:</B>
<DD><CODE>Strings.length</CODE> - The length of the string </DD>
<DD><CODE>w</CODE> - The length of the string </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Written</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR2,StringBuffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.GetLength&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>bz&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">BufferEmpty&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This example reads the length of a string, if it is zero, the code		at the address BufferEmpty will be executed.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.HexArray2String"></A><H3>
String.HexArray2String</H3>
<PRE>
&nbsp;<B>String.HexArray2String</B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;&nbsp;w&nbsp;)</PRE>
<P>
<DL>
<DD>	This function converts an array of hex values to a character encoded string.	Each byte will be encoded as two characters.
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>FSR2</CODE> - The start address of String </DD>
<DD><CODE>FSR1</CODE> - The start address of array </DD>
<DD><CODE>w</CODE> - The number of bytes to convert </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE>	String.Hex2ASCII
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>2</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR2,StringBuffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR1,ArrayAddress&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x01&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movwf&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">POSTINC1&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x23&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movwf&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">POSTDEC1&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x02&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.HexArray2String&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This stores the string "0123" at the address StringBuffer.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.Hex2ASCII"></A><H3>
String.Hex2ASCII</H3>
<PRE>
&nbsp;w&nbsp;&nbsp;<B>String.Hex2ASCII</B>(&nbsp;w&nbsp;)</PRE>
<P>
<DL>
<DD>	This function converts an the low nibble of a hex value to an ascii character.<BR>
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>w</CODE> - The hex value </DD>
</DL></DD>
<DD><DL>
<DT><B>Returns:</B>
<DD><CODE>w</CODE> - The character encoded hex value </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x12&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.Hex2ASCII&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This returns '2'</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.Copy"></A><H3>
String.Copy</H3>
<PRE>
&nbsp;<B>String.Copy</B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;)</PRE>
<P>
<DL>
<DD>	This function copies a string at one address to another address.<BR><BR>	ATTENTION, the reserved memory has to be big enough for the resulting string.	This function will write the complete string to ram, regardless of the buffer size!<BR>
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>FSR2	The</CODE> - start address of the destination </DD>
<DD><CODE>FSR1</CODE> - The start address of the string </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD> FSR1 FSR2</DD></DL>
</DD>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Written</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR1,String&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>lfsr&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">FSR2,StringBuffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">String.Copy&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This copies the string String to a StringBuffer</DD></DL>
</DD>
</DL>
<HR>
&nbsp;
<!-- ========= END OF CLASS DATA ========= -->




</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -