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

📄 strings.html

📁 PKE(被动无钥门禁系统
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by AsmDoc -->
<TITLE>
HTMLWriter
</TITLE>

<META NAME="keywords" CONTENT="HTMLWriter class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Strings";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ======== START OF CLASS DATA ======== -->
<H2>
Module Strings</H2>
<HR>

<P>
	This module provides useful functions to operate with strings.<BR>	But when using these functions, you should always remember, that	they are capable of overwriting the complete RAM on your device,	if not used the correct way. This will most likely happen, if a	string read by one of these functions is not terminated with the	end of string character ('\0').
<P>

<P>
<HR>

<P>
<!-- ========== MACRO SUMMARY =========== -->

<A NAME="macro_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Macro Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.ReadPGM2RAM">String.ReadPGM2RAM</A></B>(&nbsp;Prog&nbsp;&nbsp;RAM&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function reads a String from the program memory to a RAM buffer.</TD>
</TR>
</TABLE>
<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Function Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.ReadFromPGM">String.ReadFromPGM</A></B>(&nbsp;TBLPTRU&nbsp;&nbsp;TBLPTRH&nbsp;&nbsp;TBLPTRL&nbsp;&nbsp;FSR2&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function reads a String from the program memory to a RAM buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.Append">String.Append</A></B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function appends string2 at the end of string1.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.Char2String">String.Char2String</A></B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function converts a char array to a string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;Strings.length&nbsp;&nbsp;w&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.GetLength">String.GetLength</A></B>(&nbsp;FSR2&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function returns the length of a string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.HexArray2String">String.HexArray2String</A></B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function converts an array of hex values to a character encoded string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;w&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.Hex2ASCII">String.Hex2ASCII</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function converts an the low nibble of a hex value to an ascii character.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="Strings.html#String.Copy">String.Copy</A></B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function copies a string at one address to another address.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ MACRO DETAIL ========== -->

<A NAME="macro_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Macro Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="String.ReadPGM2RAM"></A><H3>
String.ReadPGM2RAM</H3>
<PRE>
&nbsp;<B>String.ReadPGM2RAM</B>(&nbsp;Prog&nbsp;&nbsp;RAM&nbsp;)</PRE>
<P>
<DL>
<DD>	This function reads a String from the program memory to a RAM buffer.<BR>	ATTENTION, the buffer has to be at least big enough for the 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>Prog</CODE> - The start address in the program memory </DD>
<DD><CODE>RAM</CODE> - The start address of the buffer to write </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="#AA22AA">String.ReadPGM2RAM&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">ExString,BufferADR&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE><FONT COLOR="#AA22AA">ExString&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF">DE&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">"Example\0"&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This will copy the string "Example" to BufferADR in RAM.</DD></DL>
</DD>
</DL>
<HR>
<P>
<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="String.ReadFromPGM"></A><H3>
String.ReadFromPGM</H3>
<PRE>
&nbsp;<B>String.ReadFromPGM</B>(&nbsp;TBLPTRU&nbsp;&nbsp;TBLPTRH&nbsp;&nbsp;TBLPTRL&nbsp;&nbsp;FSR2&nbsp;)</PRE>
<P>
<DL>
<DD>	This function reads a String from the program memory to a RAM buffer.<BR>	ATTENTION, the buffer has to be at least big enough for the 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>TBLPTRU</CODE> - The upper bits of the start address in the program memory </DD>
<DD><CODE>TBLPTRH</CODE> - The high bits of the start address in the program memory </DD>
<DD><CODE>TBLPTRL</CODE> - The low bits of the start address in the program memory </DD>
<DD><CODE>FSR2</CODE> - The start address of the buffer to write </DD>
</DL></DD>
<P>
<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>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">upper ExString&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">TBLPTRU&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">high ExString&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">TBLPTRH&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">low ExString&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">TBLPTRL&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">BufferADR&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.ReadFromPGM&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">...&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE><FONT COLOR="#AA22AA">ExString&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF">DE&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">"Example\0"&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>		This will copy the string "Example" to BufferADR in RAM.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="String.Append"></A><H3>
String.Append</H3>
<PRE>
&nbsp;<B>String.Append</B>(&nbsp;FSR2&nbsp;&nbsp;FSR1&nbsp;)</PRE>
<P>
<DL>
<DD>	This function appends string2 at the end of string1.<BR><BR>	ATTENTION, the first String 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 String1 </DD>
<DD><CODE>FSR1</CODE> - The start address of String2 </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>

⌨️ 快捷键说明

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