Instructions for MS-DOS program "RPLCOMP" ***************************************************************** NOTICE Hewlett-Packard is making RPLCOMP.EXE available to customers free of charge to help them in HP 48SX application development, under the following conditions: * The program RPLCOMP.EXE and the documentation file RPLCOMP.MAN are provided "as is," and are subject to change without notice. Hewlett-Packard Company make no warranty of any kind with regard to the software or documentation, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard Company shall not be liable for any error or for incidental or consequential damages in connection with the furnishing, performance, or use of this software and documentation. * The program and documentation are copyrighted by Hewlett- Packard. Sale of this material is prohibited without prior written permission of Hewlett-Packard Company. * The HP Customer Support department does not support RPLCOMP. Questions, comments, defect reports, etc. should be directed to the Library Development conference on the HP Calculator Bulletin Board System. All responses from Hewlett-Packard will normally be provided through that conference. * Software generated by RPLCOMP.EXE should be tested and qualified in its final form. Revised versions of the software and documentation will be posted on the Bulletin Board as they become available. -1- 1. RPLCOMP - RPL Compiler Rplcomp is an RPL compiler or, more precisely, a preprocessor. From RPL source files, it produces sasm source files ready for assembly. The compiler is invoked as follows: rplcomp [ -C ] [ [ [ ] ] ] Rplcomp accepts up to 3 arguments: Specifies the RPL source. If omitted or specified as ``-'', it defaults to stdin. RPL source file names by convention use the ``.s'' extension. Specifies where the output will go, defaulting to stdout. Since the output is usually fed to sasm, RPL output file names by convention use the ``.a'' extension. Specifies the file containing information for the hash table, so named because the customary extension is ``.ext''. If this parameter is omitted, this information is not output. If this paramater is specified as ``-'', the information is output to stdout. The -C option copies the RPL source as comments in the output code. This allows a post-processor to edit the assembly listings in a more readable format. 1.1 Object Definition When rplcomp is compiling a file, it recognizes certain words (detailed below) and generates appropriate code for them. All other words are assumed to be the labels of objects in the runstream, and are emitted simply as 5-nibble constants, possibly with substitution as per DEFINE below. After assembly, the SLOAD program will be used to fill in the addresses of the objects in the runstream based on the provided list of entry points called ENTRIES.O. The following sections describes the words recognized by rplcomp, and their corresponding actions. The following words define objects: -2- LAM Defines a DOLAM object whose name is specified by . The non-ASCII escape sequences listed under $ below are allowed. <_l_a_m_i_d> may be a DEFINED value (See DEFINE below). ID Defines a DOIDNT object whose name is specified by . <_i_d> may be a DEFINED value (See DEFINE below). TAG Defines a DOTAG object whose tag is specified by and whose object is given by . may be either an object definition or a label. < tagid > may be a DEFINED value (See DEFINE below). $ "string" "string" Defines a DOCSTR object with the contents contained between the quotes. Two consecutive quotes within the string are interpreted as a single quote (e.g., ``""""'' becomes the string ``f(CW"''). Non-ASCII characters may be input as \xx where xx is the hex value of the character. Also, \n, \r, \f, \t are the ASCII newline, return, form-feed, and tab characters. CHR CHR ^ CHR "" CHR "^" Defines a DOCHAR object with the specified character. The second and fourth forms generate control characters. For example, ``CHR A'' generates an ``A'', ``CHR ^A'' generates a control-A. The double-quote character can be generated by specifying ``CHR "'' or ``CHR """''. Also, the \-escaped characters described under $ above can be used. CODE ...(assembly language code)... ENDCODE For insertion of assembly-language code in a DOCODE object. The word CODE generates a DOCODE and a link field, the word ENDCODE terminates assembly-language input and generates a label to be used by the link field. When encountered in the assembly-language code, the word LOOP results in generation of RPL main loop code. The words LOOP and ENDCODE are recognized by rplcomp if they are either 1) the first word on the line, or 2) the second word preceded by a label. -3- # # Defines a DOBINT object whose body is the number specified in hex or in decimal. Rplcomp recognizes lower-case hex digits; compiler does not. % Defines a DOREAL object with the specified floating-point number. To be recognized as a real number in the first form, the number must contain a decimal point and/or ``E''. The second form is more forgiving, and will recognize an integer as a real number. %% Defines a DOEREL object with the specified floating-point number. C% Defines a DOCMP object with the specified floating-point numbers. C%% Defines a DOECMP object with the specified floating-point numbers. PTR