Home
Intel Pet Fence 8080 User's Manual
Contents
1. abbreviations 3 12 A 5 absolute object file 4 5 absolute object module 1 3 absolute segments 2 1 ADD 6 2 address 3 2 address spaces 2 2 2 4 allocation 3 7 allocation process 2 3 assembler ASMS1 1 3 5 1 BIT 2 2 2 3 3 9 BITADDRESSABLE 2 2 BLOCK 2 2 CODE 2 2 2 3 3 9 command entry 3 1 command invocation see invocation command comments 3 1 configuration controls 3 11 console display 4 1 continuation lines 3 1 control list 3 2 controls 3 4 see also linking controls listing controls locating controls CREATE 6 3 DATA 2 2 2 3 3 9 DEBUG control 1 3 3 4 3 6 debugging 1 1 DEBUGLINES 3 5 DEBUGPUBLICS 3 5 DEBUGSYMBOLS 3 5 DELETE 6 3 development process 1 1 1 2 device 3 2 editor text 1 3 error messages 4 4 B 1 D 1 EXIT 6 5 external references 2 4 filename 3 2 hexadecimal decimal conversion E 1 ICE 51 in circuit emulator 1 3 IDATA 2 1 thru 2 3 3 9 in circuit emulator see ICE 51 in circuit emulator INPAGE 2 1 input list 3 1 3 2 invocation command 3 1 6 1 address 3 2 control list 3 2 device 3 2 filename 3 2 input list 3 1 3 2 module name 3 2 name 3 2 output file 3 2 3 3 pathname 3 2 segment name 3 2 IXREF 4 4 4 5 LIBS1 6 1 thru 6 5 err
2. APPENDIX C LIB51 COMMAND SUMMARY The following is a summary of the commands used by the LIBS1 librarian Command CREATE ADD DELETE LIST EXIT Action Creates a new library file Inserts new modules into a library Removes modules from a library Lists the contents of a library Returns control to ISIS C 1 APPENDIX D LIB51 ERROR MESSAGES All LIBS1 error messages are non fatal because LIBS1 is an interactive program The command that caused the error will be aborted but LIB51 will not be interrupted Command Errors Errors caused by improper command entry are followed by a partial copy of the incorrect command with a number sign in the vicinity of the error as shown below ERROR MESSAGE partial command The following are the LIBS1 command error messages INSUFFICIENT MEMORY LIB51 cannot execute the command given because it requires more memory than is available in the Intellec system INVALID MODULE NAME A module listed in the command is incorrectly specified Module names must conform to the format given in Chapter 2 INVALID SYNTAX Check the command for one of the following e Misspelled keywords e Ampersand followed by a non blank character e ADD TO filename not followed by
3. Examples of Program Development MCS 51 ISIS II RL51 ISIS II MCS 51 RELOCATOR AND LINKER V2 8 Fl RLSL F1 SAMP1 0BJ F1 SAMP2 0BJ F1 SAMP3 0BJ TO 3 PRINT INPUT Fl Fl Fl LINK MAP FOR Fl SAMPLE MODULES INCLUDED SAMP1 OBJ SAMPLE SAMP2 OBJ CONSOLE IO F1 SAMPLE LST SYMBOLS LINES PUBLICS IXREF SAMP3 0BJ NUM CONVERSION TYPE BASE REG QUOVH DATA 0008H DATA L H CODE H CODE SAH CODE B H CODE FBH SYMBOL TABLE FOR C 005AH D L H C 0075H D 00l0H C 008CH D 0014H D 998H D 0008H C BH C A4H D 9918H D 99 8DH D 0489H B 0088H C 08 5AH D 00EQH D 49 00H N DH C 0110H C 0137H ISIS 11 C 0125H C 0121H C 0132H C 0FBH N 00 0 AH C 9119H 6 RL51 TYPE MODULE S EGMENT S EGMENT SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL ENDMOD MODULE SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL PUBLIC SYMBOL SEGMENT SYMBOL SYMBOL F1 SAMPLE SAMPLE RELOCATION LENGTH 0008H 0008H CH ABSOLUTE UNIT SAH 56H 4 BH 44H ABSOLUTE UNIT UNIT UNIT F1 SAMPLE SAMPLE NAME SAMPLE CONSTANT AREA DATA AREA NUM1 MSG NUM1 NUM2 MSG NUM2 SCON STACK START SUM_MSG SUM THl TMOD TRI TYPO MSG SAMPLE CONSOLE_IO ACC ARQ CR EXIT GET CHAR GET LOOP GET NUM GO ON IO ROUTINES LF PU
4. PUBLIC LOW MEM PTR PUBLIC INIT FLAG PUBLIC FULL FLAG PUBLIC HIGH MEM PTR PUBLIC DYNAMIC MEMORY PROC ALLOCATE SYMBOL NUM_BYTES SYMBOL POOL_SELECTOR SYMBOL ALLOC_PTR se SYMBOL FLAG LINES 19 LINES 20 LINE 21 LINES 22 DO SYMBOL I LINE 23 LINE 2 4 LINE 25 LINE 26 LINES 27 ENDDO LINES 28 LINES 29 LINES 30 LINE 3 1 LINE 32 LINE 33 LINES 3 4 LINES 35 LINE 36 LINES 37 LINE 38 ENDPROC ALLOCATE ENDMOD MEMRY Figure 4 2 Symbol Table NOTE The information in the listing file is taken from the input object modules If these are generated without the DEBUG option the SYMBOLS PUBLICS and LINES information will not be available for listing The symbol table contains scope definitions and information about the symbols and line numbers Scope definition identifies the module DO block or procedure that contains the symbol or line number Note that when the table contains only public symbols i e NOSYMBOLS and NOLINES controls are in effect scope definition is by module only RLS1 Outputs RL51 Outputs 4 4 Each entry in the table consists of three parts as follows e VALUE The value is the absolute address of the symbol The address is prefixed with a letter indicating the type of address space C code D internal data I indirect internal data B bit space X external data N typeless number A byte address or a bit address on a byte boundary is shown as a fo
5. intel MCS 51 UTILITIES USER S GUIDE FOR 8080 8085 BASED DEVELOPMENT SYSTEMS Copyright 1981 1982 1983 Intel Corporation Intel Corporation 3065 Bowers Avenue Santa Clara California 95051 Order Number 121737 003 MCS 51 UTILITIES USER S GUIDE FOR 8080 8085 BASED DEVELOPMENT SYSTEMS Order Number 121737 003 Copyright 1981 1982 1983 Intel Corporation Intel Corporation 3065 Bowers Avenue Santa Clara CA 95051 il Additional copies of this manual or other Intel literature may be obtained from Literature Department Intel Corporation 3065 Bowers Avenue Santa Clara CA 95051 Intel retains the right to make changes to these specifications at any time without notice Contact your local sales office to obtain the latest specifications before placing your order Intel Corporation makes no warranty of any kind with regard to this material including but not limited to the implied warranties of merchantability and fitness for a particular purpose Intel Corporation assumes no responsibility for any errors that may appear in this document Intel Corporation makes no commitment to update nor to keep current the information contained in this document Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product No other circuit patent licenses are implied Intel software products are copyrighted by and shall remain the property of Intel Corporation Use
6. 76 Next 3 instructions handle negative numbers 2E 772D 77 MOV R1 minus Store a minus sign 0030 14 78 DEC A 0031 F4 79 CPL A 89 Factor out the first digit 8l GO_ON2 0032 09 82 INC Rl 9933 75F 64 83 MOV B 16 0036 84 84 DIV AB 0037 2430 85 ADD A zero 9939 F7 86 MOV RI1 A store the first digit 87 Factor out the second digit 003A 09 88 INC Rl 003B E5FY 89 MOV A B 003D 75FYUA 90 MOV B 19 0040 84 91 DIV AB 0041 2430 92 ADD A zero 0043 F7 93 MOV RI1 A store the second digit 94 Store the third digit 0044 09 95 INC RI 2045 E5F 96 MOV A B 0047 2430 97 ADD A zero 0049 F7 98 MOV GRI A store the third digit 99 note that we return without restoring Rl 04A 22 100 RET 121 192 END SYMBOL TABLE LISTING NAME TYPE VALUE ATTRIBUTES Beth te D ADDR E H A ARl o D ADDR LlLH ASCBIN 2 C ADDR H R PUB SEG NUM ROUTINES Da d d dec cR D ADDR F H A BINASC C ADDR 0028H R PUB SEG NUM ROUTINES GO ON2 e gt C ADDR 0032H R SEG NUM ROUTINES MINUS a a NUMB g92DH A NUM CONVERSION NUM ROUTINES C SEG 4 BH REL UNIT PLUS a NUMB 2ZBH A POS C ADDR 0025H R SEG NUM ROUTINES SIGN 2 o B ADDR Q0EOH 7 A TEMP a a x o o REG R3 ZERO 4 4 NUMB 0030H REGISTER BANK S USED TARGET MACHINE S 8851 ASSEMBLY COMPLETE NO ERRORS FOUND Figure 5 3 SAMP3 Listing File Cont d
7. FILE2 EXTCMOD3 LINK MAP FOR OUTFIL FISFILEI EXTCMODI MOD2 CELP EJ RELOCATOR AND LINKER V1 0 MCS 51 INVOKED BY FIS FILE2 EXT TO OUTFIL EXT amp EXTCEXAMPLE TYPE BASE LENGTH RELOCATION SEGMENT NAME REG 0000H 0008H REG BANK 0 DATA 0008H 0010H UNIT DATA SEG 1 DATA 0014H 0008H ABSOLUTE QVERLAP REG 0018H 0008H REG BANK 3 BIT 0020H 0001H UNIT A_BIT_SEG 0021H 6 0000H roe OP TER DATA 0022H 0001H BITADDR DATA SEG 2 DATA 0023H 000BH ABSOLUTE IDATA 002EH 0042H UNIT STACK SEG 0070H 0010H TIC CN tet XDATA 0000H COOOH UNIT DYNAMIC_MEM CODE 0000H 1389H UNIT PROC 1 1389H 0477H EROAPEN CODE 1800H 07ASH INBLOCK PROC IGNORED SEGMENTS DYNAMIC PODL UNRESOLVED EXTERNAL SYMBOLS INVERT IGNORED SYMBOLS BIT256 Figure 4 1 Link Summary NOTE 1 For bit addresses the display format is byte address bit address example 0020H 7 for bit 7 of byte 0020H However when bit 0 of a byte is referenced only the byte address is displayed the 0 is not displayed 2 References to an unresolved external symbol an external symbol refer ring to an ignored public symbol or a reference to an ignored segment will produce additional error messages Symbol Table The listing file contains a symbol table as specified by the SYMBOLS PUBLICS and LINES controls in the RL51 invocation A sample symbol table is shown in figure 4 2 4 2 MCS 51 SYMBOL TABLE FOR OUTFILE EXTCEXAMPLE TYPE NAME MODULE MEMRY
8. Guide for a list of possible I O errors This error occurs only if IXREF was requested Its occurrence does not invalidate the output object file FATAL ERROR 230 INCOMPATIBLE OVERLAY VERSION FILE file name The overlay file although loaded successfully by ISIS IT has a version number that is not the one expected by RL51 The possible cause is that the RL51 program and the loaded overlay are not of the same version This error occurs only if IXREF or OVERLAY was requested If only IXREF was requested the output object file is valid MCS 51 RLS1 Error Messages FATAL ERROR 231 TOO MANY IXREF ENTRIES The number of IXREF entries entry is a pair consisting of modules and symbol reference is too large to be processed The IXREF listing step is not performed The NOLIBRARIES and NOGENERATED controls may be used in order to decrease this number and overcome the error This error occurs only if IXREF was requested Its occurrence does not invalidate the output object file FATAL ERROR 232 OVERLAY CONTROL CONFLICTS XREF SELECTOR ITEMS The overlay control should not appear with the IXREF selector items NOLIBRAR IES or NOGENERATED FATAL ERROR 233 ILLEGAL USE OF IN OVERLAY CONTROL The use of gt with the OVERLAY control is illegal FATAL ERROR 240 INTERNAL PROCESS ERROR RL51 has detected that it has made a processing error This error indicates a bug within RL51 B 9
9. MOV TMOD 00100200B MOV THl 253 MOV SCON 11 11 10B SETB TRl Set timer to auto reload Set timer for 119 BAUD Prepare the Serial Port Start clock we e BO uo This is the main program It s an infinite loop where each iteration prompts the console for 2 input numbers and types out their sum START Type message explaining how to correct a typo MOV DPTR typo msg CALL put string CALL put crlf Get first number from console MOV DPTR numl msg CALL put string CALL put crlf MOV R numl CALL get num CALL put crif Get second number from console MOV DPTR num2 msg CALL put string CALL put crlf MOV R9 num2 CALL get num CALL put crif Convert the ASCII numbers to binary MOV R1 numl CALL ascbin MOV R1 num2 CALL ascbin Add the 2 numbers and store the results in SUM MOV a numl ADD a num2 MOV sum a Convert SUM from binary to ASCII MOV R1 sum CALL binasc Output sum to console MOV DPTR sum msg CALL put string MOV R1 sum MOV R2 4 CALL put data str JMP start au o Wa u DSEG at 8 STACK DS 8 At power up the stack pointer is initialized to point here Figure 5 1 SAMP1 Listing File MCS 51 Examples of Program Development 54595945 205E5820 544F2952 45545950 45204120 4E554D42 4552 20 54595045 29494E29 46495253 54294E55 4D424552 3A20 00 54595945 20494E20 5345434F 4E442904E 554D4245 523A29 OB 544845209 53554D20
10. 1 END GOLDILOCKS END mod2 main story DO THREE BEARS PROCEDURE EXTERNAL END GOLDILOCKS PROCEDURE EXTERNAL END CALL THREE BEARS CALL GOLDILOCKS CALL THREE BEARS END main story In this example the linker reserves the right to use the LITTLE BEARS BED as a SPARE BED because the two procedures are never active simultaneously To perform overlaying the linker must determine which procedures are active simul taneously To do this the linker assumes that all CALLs can be executed For example if procedure A calls procedure B and B calls procedures C and D then the linker can overlay RAM variables from C only with the RAM variables of D The linker however looks only at the PUBLIC EXTERNAL declarations It assumes that any reference to an EXTERNAL procedure will be executed but ignores the possibility of hidden calls The arguments to the OVERLAY control are therefore needed to specify those interconnections between modules that cannot otherwise be detected by the linker Such situations arise if the interconnection is done by a computed call to an external procedure whose address is not determined by a simple PUBLIC EXTERNAL relationship For example module A imports from module B a public variable that contains the address of a local or public procedure in B Module A then performs a computed call to the procedure in B The rule can be stated as follows The linker assumes a connection from module A to module B
11. 13 NOOVERLAY sent 3 13 OVERLAY A 9 B on ra une 3 13 OVERLAY ADS Dh ia 3 13 Abbreviations for Command Words 3 15 CHAPTER 4 RL51 OUTPUTS Console Display ina ido 4 1 Listine File aus 4 1 Link SIM MAREN nee 4 1 Symbol Table seinen 4 2 Inter Module Cross Reference Report IXREF 4 4 Error Messages isses 4 4 Absolute Object File uses 4 5 CHAPTER 5 EXAMPLES OF PROGRAM DEVELOPMENT Using Multiple Modules sese 5 1 Using the Locating Controls ssssse 5 0 Using RL51 with PL M 51 Modules 5 12 CHAPTER6 _ LIB51 LIBRARIAN Introduction acoustic buic es 6 1 LIBSI Dp aeter nmr ner enter pi bis re 6 1 The Invocation Line u a 6 1 The Command Line ass 6 1 Error Mossas nenne 6 2 LIBSE Subcommands aurrena ke 6 2 ADD es O tee 6 2 CREATE ns n nur 6 3 DECETE nee ernennen 6 3 LIST nn ea 6 4 EXIT ae ren tenant tie 6 5 APPENDIX A SUMMARY OF RL51 CONTROLS APPENDIX B RL51 ERROR MESSAGES APPENDIX C LIBS1 COMMAND SUMMARY APPENDIX D LIB51 ERROR MESSAGES APPENDIX E HEXADECIMAL DECIMAL CONVERSION TABLE Contents TABLES TABLE TITLE PAGE 2 1 Address Spaces and Segment Types 2 4 3 1 Definitions of Common Terms 3 2 3 2 Lasting Switches Su 3 6 3 3 Linking Switches u 3 8 3 4 Locating Controls u 3 10 A 1 Definitions of Common Terms A 1 A 2 Listino Control
12. 495329 OO SYMBOL TABLE LISTING ASCBIN BINASOS ax CONSTANT AREA DATA AREA GET N UM LJ 9 o NUMI MSG NUM NUM2 MSG NUM2 PUT C RLF PUT DATA STR PUT S SAMPL SCON STACK START SUM M SUM THI TMOD TRI TRING E SG TYPO MSG REGISTER BANK S ASSEMBLY COMPLETE QAAANDAVADANDANAN A O0OUOAAUU ADDR ADDR SEG SEG ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR USED 71 72 73 74 75 DATA AREA segment CONSTANT AREA segment RSEG NUMI NUM2 SUM RSEG TYPO constant area data area DS 4 DS 4 DS 4 _MSG DB TYPE X NUM1 MSG DB TYPE IN NUM2 MSG SUM_ i END 0056H CH LBH OOOH 0032H 0004H 0098H 0008H 000BH 0U4AH 0008H 008DH 0089H 0088H 6 0000H MSG EXT EXT EXT DATO EXT EXT EXT DrPrrPnxzrayvyY LY DB DB TYPE IN THE SUM ATT RI REL UNIT REL UNIT TARGET MACHINE S 8051 NO ERRORS FOUND DATA CODE TO RETYPE A NUMBER H FIRST NUMBER 00H SECOND NUMBER 00H IS 00H BUT cz un SEG CONSTANT AREA SEG DATA AREA SEG CONSTANT AREA SEG DATA AREA SEG CONSTANT AREA SEG DATA AREA SEG CONSTANT AREA Figure 5 1 SAMP1 Listing File Cont d 5 3 Examples of Program Development MCS 51 ISIS II MCS 51 MACRO ASSEMBLER V2 0 OBJ
13. ASMS1 PL M 51 and RL51 The first example is the sample program discussed in the ASMS1 User s Guide the example shows how to assemble each of the three modules then link and locate them into a single absolute object module with RL51 The second example is a short program that illustrates the use of the locating controls The third example shows the use of RL51 with PL M 51 modules emphasizing the library process Using Multiple Modules The first example is a program of three modules named SAMPLE CONSOLE IO and NUM_CONVERSION The source for these modules is in three files SAMP1 A51 SAMP2 A51 and SAMP3 A51 respectively To assemble these modules invoke the assembler as follows F1 ASM51 F1 SAMP1 A51 DEBUG F1 ASM51 F1 SAMP2 A51 DEBUG F1 ASM51 F1 SAMP3 A51 DEBUG Note that this example assumes the three source files are on the same drive as the assembler and linker locator and that the output file will be sent to the same drive The assembler invocations use the DEBUG control to have the symbol tables output to the object files for the three modules After assembly is complete the system has created object files SAMP1 OBJ SAMP2 OBJ and SAMP3 OBJ and listing files SAMP1 LST SAMP2 LST and SAMP3 LST The three listing files are shown in figures 5 1 5 2 and 5 3 To link and locate the three modules enter the command F1 RL51 FI SAMP1 OBJ F1 SAMP2 0BJ F1 SAMP3 0BJ amp TO F1 SAMPLE 4 SPRINT F1 S
14. BIT ADDRESSABLE segment is greater than the BIT space The specified segment is ignored ERROR 118 REFERENCE MADE TO ERRONEOUS EXTERNAL SYMBOL external name MODULE file name module name REFERENCE code address The specified ignored external symbol is referenced in the specified module at the specified code address ERROR 119 REFERENCE MADE TO ERRONEOUS SEGMENT SEGMENT segment name MODULE file name module name REFERENCE code address A symbol which is defined using the specified but ignored segment is referenced in the specified module at the specified code address ERROR 120 CONTENT BELONGS TO ERRONEOUS SEGMENT SEGMENT segment name MODULE file name module name A content record which belongs to the specified but ignored segment has been encountered The content record is not relocated ERROR 121 IMPROPER FIXUP MODULE file name module name SEGMENT segment name OFFSET pseg offset An error occurred in the evaluation of a fixup An example of this error is when the value of the fixup expression does not meet the requirements of the type of the referenced location 7 MCS 51 RLS1 Error Messages ERROR 122 CANNOT FIND MODULE MODULE file name module name The specified module name which was explicitly requested from the specified file in the command tail was not found in that file ERROR 123 ABSOLUTE IDATA SEGMENT DOES NOT FIT MODULE file name module name FROM data address TO
15. CALL check equal pi si 27 si 1 12 l END chk eq MODULE INFORMATION STATIC OVERLAYABLE CODE SIZE 0057H 87D CONSTANT SIZE 2H 2D DIRECT VARIABLE SIZE 2H 4H 2D 4D INDIRECT VARIABLE SIZE H H BD D BIT SIZE H LlH D 1D BIT ADDRESSABLE SIZE H t H D D AUXILIARY VARIABLE SIZE H D MAXIMUM STACK SIZE GH 6D REGISTER BANK S USED 34 LINES READ Y PROGRAM ERROR S END OF PL M 51 COMPILATION Figure 5 8 PL M 51 Listing File of CHK EQ 5 13 Examples of Program Development MCS 51 MCS 51 MACRO ASSEMBLER ICE51 Halt PAGE 1 ISIS II MCS 51 MACRO ASSEMBLER V2 9 OBJECT MODULE PLACED IN Fl HLTICE OBJ ASSEMBLER INVOKED BY asm5l fl hltice a5l debug pw 9 LOC OBJ LINE SOURCE l Stitle ICESL Halt 2 RRR EKER RARER AAA RRA RARAE RE RARE AREER OR CHOR ON GROKUNUE KR 3 Halt Ice 4 ae Store word parameters in R45 R67 k 5 PT Bit in C and execute A5 instruction 6 ad to return to ICE X 7 au e ke ee Uk oko e Kk 2 2 2 2 2 2 5 2 2 2 2 2 2 5 2 2 2 2 2 2 2 2 2 2 8 9 NAME halt ice 19 PUBLIC halt ice halt ice bit halt ice byte 11 bits SEGMENT BIT 12 bytes SEGMENT DATA 13 prog SEGMENT CODE 14 me 15 RSEG bits 16 halt ice bit 17 bit par 0000 18 7 DBIT 1 19 20 RSEG bytes 21 halt ice byte 22 first par 2000 23 DS 2 24 second par 2002 25 DS 2 26 27 RSEG prog 28 halt ice 0000 ACOQ F 29 7 MOV R
16. For example if the segment A was overlaid with the segment D and B calls D visibly by PUBLIC EXTERNAL declarations then the effect of A gt B is that A and D will not be overlaid since A can call D through B OVERLAY A gt B A module can be declared as non overlayable in two ways The argument A indicates that the module A calls all other modules On the other hand gt means every module calls A In either case no segments from A will be overlaid The effect of each form depends on the nature of A For example if the gt A form is used and A visibly calls all other modules then every module can call through A each other module In this case the linker will not perform any overlays The overlaying of data segments in on chip RAM has the following restrictions e The OVERLAY control cannot be invoked with the IXREF selection items NOGENERATED or NOLIBRARIES RL51 generates an error if either one is specified e Combined segments and segments appearing in locating controls are not overlaid by the linker Following is an example in which two disjoint modules share the same on chip RAM area modi DO THREE BEARS PROCEDURE PUBLIC DECLARE LITTLE BEARS BED BYTE IF BOOLEAN CLITTLE BEARS BED THEN CALL MSGC C SOMEONE S BEEN IN MY BED 0 LITTLE BEARS BED 0 END THREE BEARS END modi Using the RLS1 Program mode DO GOLDILOCKS PROCEDURE PUBLIC DECLARE SPARE BED BYTE SPARE BED
17. SINE and COSINE and they are in the same library in any order whatsoever a reference to TANGENT will cause all three to be loaded Partial Segments A segment is a unit of code memory or data memory The portion of a segment defined in one module is called a partial segment A partial segment has the following attributes defined in the source module e Name A relocatable segment has a name by which it is linked with other portions of the same segment from other modules Absolute segments do not have names e Type The type identifies the address space to which a segment belongs CODE XDATA DATA IDATA or BIT e Relocatability For relocatable segments only this attribute describes any special constraints on relocation PAGE INPAGE BLOCK BITADDRESSABLE or UNIT e Size The size of the segment in bytes or bits depending on the type e Base Address The lowest address in the partial segment For absolute segments the base address is assigned at assembly time for relocatable segments it is assigned at location time Absolute segments are complete segments they are taken as is into the output module Relocatable segments are either defined by ASMS1 users using the SEGMENT directive in the source module or automatically generated by the PL M 51 compiler Refer to the MCS 51 Macro Assembler User s Guide for details on the assembler directives Combining Relocatable Segments After processing the invocation comma
18. UNIT aligned combined with one other attrib ute the combined segment receives the more restrictive attribute For example if the three partial segments named STACK have relocation attri butes UNIT PAGE and UNIT the combined segment has attribute PAGE i e page aligned Note that the relocation attribute is applied to the combined segment not to each component segment To continue the example since the relocation is PAGE the combined segment will start on a page boundary but the component segments will be packed together without any gaps Allocating Memory for Segments After the segment table is complete RL51 can locate the segments within the memory spaces Table 2 1 shows the address spaces used by MCS 51 processors and the corresponding segment types The allocation process has a definite sequence the exact order is presented in Chapter 3 As an overview the process follows a general pattern of rules as follows 1 Each of the types of memory space is allocated independent of the other spaces 2 Within each space absolute segments are allocated first then segments specified within locating controls in the RL51 command then other relocatable segments 3 Because the on chip data space represents three overlapping address spaces DATA IDATA AND BIT the general pattern in rule 2 is modified a Absolute BIT DATA and IDATA segments and register banks are allocated first b Segments specified in PRECEDE and
19. and modules defined previously represent entry points in the appropriate modules segments pulled from PLMSI LIB e g the symbol P0034 is a code address in the module P0034 Symbols in the format procedure BYTE or procedure BIT e g HALT_ICE BYTE are DATA and BIT addresses used for passing parameters to the appropriate external procedures as implied by the name BYTE and WORD parameters are placed at DATA address starting at for example HALT_ICE BYTE BIT parameters are placed at BIT address starting at HALT ICE BIT see also the PL M 51 User s Guide about PL M 51 linkage to ASMSI 5 17 CHA LIB51 LIBRARIA Introduction LIBS1 is used to create and manipulate library files Library files are specially formatted collections of object modules any element of which may be retrieved during the linkage process in order to resolve program references to external names LIBS1 also allows you to alter the contents of these files by adding new modules or deleting old ones LIB51 user interface is fully compatible with LIB the ISIS II Librarian for the 8080 and 8085 environment LIB51 Input Input to LIB51 consists of modules originally generated by one of the 8051 language translators The Invocation Line The LIBS1 program is called by the command LIB51 cr LIBS1 identifies itself with a sign on message followed by an asterisk prompt shown as follows ISIS II MCS 51 LIBRARIAN Vxy where X
20. if there exists an external refer ence in to a public procedure in B In all other cases hidden connections must be explicitly given as arguments to the OVERLAY control Following is an example of a computed call to an external procedure MOD1 DO DECLARE I_O_CLEAR WORD EXTERNAL CALL 0 CLEAR END MOD1 MCS 51 MCS 51 Using the RL51 Program In another module you have MOD2 DO DECLARE I_O_CLEAR WORD PUBLIC READER PROCEDURE I O0 ERROR PROCEDURE END 0 ERROR I O SUCCESS PROCEDURE END I 0 SUCCESS IF ERR CODE gt 0 THEN I 0 CLEAR ELSE I 0 CLEAR I 0 ERROR 1 0 SUCCESS END READER END MOD2 In the above procedure MODI invokes a procedure defined in MOD2 To prevent the linker from overlaying on chip RAM variables of MOD2 with on chip RAM variables of MODI the following form of the OVERLAY control must be used OVERLAY MOD gt MOD2 Overlaying can be a good way of economizing on chip RAM space however overlay ing may in some cases give worse results For example if most procedures call one another the resulting segments will expand making it more difficult for the linker to allocate a few large segments than many small ones The outcome of the overlaying process can be checked by inspecting the link map All overlaid segments are indicated by OVERLAP Warning 4 DATA SPACE MEMORY OVERLAP is not generated for those segments Abbreviations for Command Words Most of
21. might be as given in the previous section RL51 APROG 0BJ BPROG OBJ PLMS1 LIB CODE MOD1 4000H MOD2 MOD3 Here the CODE control allocates space in code memory for segments MODI MOD2 and MOD3 MODI is aligned at location 4000H MOD2 and MOD3 are assigned contiguous addresses after MODI 3 11 Using the RLS1 Program Configuration Controls The configuration controls are used to describe the actual configurations that objects are aimed to This group contains the RAMSIZE control RAMSIZE The RAMSIZE control format RAMSIZE value where value is a number in the range 128 to 255 RAMSIZE specifies the maximum amount of on chip RAM that may be allocated for the user program The default value for RAMSIZE is 128 as is the case for the 8051 If the object is aimed at more than one configuration of the MCS 51 family specify the MINIMUM of all on chip RAM sizes among all machines you want to link The sole use of this control is to enable RL51 to check on chip memory size constraints at RL time and thus avoid confusion at ICE time OVERLAY NOOVERLAY Controls The linker allows overlaying of on chip RAM segments among modules under the specification of the OVERLAY control Two segments can be overlaid if all the following conditions exist e The segments have the same type DATA IDATA BIT or BITADDRESS ABLE e The segments use the same register bank determined by the USING attribute or the REGISTERBANK con
22. of a module within filename modname may be specified only if filename is a library file If modnames are given only the specified modules within filename are copied into library otherwise all modules are copied You may enter as many filenames or modnames as you wish library is the name of an existing library file to which the specified modules will be added Example ADD NIXON DEN NOVEL LIBCHISTORICAL LESSONS TO SCHO L LiBcer MCS 51 CREATE The CREATE command creates a new empty library Syntax CREATE filename Definition This command creates a new library file called filename If another file exists with that name an error message is generated and the user is prompted for a new subcommand DELETE The DELETE command deletes modules from a specified library Syntax DELETE J ibrary amp modname Definition The DELETE subcommand permits you to remove modules for which you have no need from the specified library DELETE removes the module specified and updates the library directory library is the library from which the deletion is to be made and modname is the name of the module to be removed You may specify as many modnames as you wish Example I CUL Te GCHDUR LIB CATEAS JERR 992 Co do LIBS1 Librarian LIB51 Librarian LIST The LIST command shows the current content of a specified library ies Syntax LIST library modname 1 1 TO Jistfile P
23. previous step and for all other complete relocatable segments from the input modules Overlays data segments Resolves external symbol references between the input modules Binds relocatable addresses to absolute addresses Produces an absolute object file CON Dm Produces a listing file consisting of a link summary a symbol table and an IXREF report 9 Detects and lists errors found in the input modules or in the RL51 command invocation Functions 1 2 3 5 and 6 are described in the remainder of this chapter Functions 7 8 and 9 are discussed in Chapter 4 the RL51 command invocation and overlaying of data segments are described in Chapter 3 Selecting Modules Input files are processed in the order they are specified in the invocation command The processing of an input file varies according to the content that is whether it is a library or non library file A non library file may contain a concatenation of zero or more object modules A library file contains zero or more object modules together with control information A module in a non library file is processed if it was explic itly listed in the module list or if the module list was not specified at all in other words as if all modules were listed implicitly The processing of a library file is more complicated If a module list was specified for the library file then it is processed in the same manner as a non library file If a module list was not specified then th
24. segment name 3 2 segment type absolute 2 1 segment type relocatable 2 1 STACK 2 3 SYMBOLS 3 5 symbol table 4 3 UNIT 2 2 XDATA 2 2 2 3 3 9 u ze owes p sener p wu E c umm p mes pe pers wore m summer p Bee wen er ES O MCS 51 Utilities User s Guide intel for 8080 8085 Based Development Systems 121737 003 REQUEST FOR READER S COMMENTS Intel s Technical Publications Departments attempt to provide publications that meet the needs of all Intel product users This form lets you participate directly in the publication process Your comments will help us correct and improve our publications Please take a few minutes to respond Please restrict your comments to the usability accuracy readability organization and completeness of this publication If you have any comments on the product that this publication describes please contact your Intel representative If you wish to order publications contact the Intel Literature Department see page ii of this manual 1 Please describe any errors you found in this publication include page number 2 Does the publication cover the information you expected or required Please make suggestions for improvement 3 Is this the right type of publication for your needs Is it at the right level What other types of publications are needed 4 Did you have any difficulty understanding descriptions or wording Where 5 Please rate this
25. 0004 C3 28 CLR C 99095 9430 29 SUBB A zero 2007 75F064 30 MOV B 100 A A4 31 MUL AB B FB 32 MOV TEMP A 33 Compute the second digit value C 08 34 INC R QOOD E6 35 MOV A R BOUE 9430 36 SUBB A zero 0010 75FUYA 37 MOV B 19 0013 A4 38 MUL AB 39 Add the value of the second aigit to num 0014 2B 40 ADD A TEMP 0015 FB 4l MOV TEMP A 42 Get third digit and its value to total 9016 G8 43 INC RO 0017 E6 44 MOV A R 0018 C3 45 CLR C 0019 9430 46 SUBB A zero lB 2B 47 ADD A TEMP lC FB 48 MOV TEMP A 49 Test the sign and complement the number if the 59 sign is a minus QUID E7 51 MOV A Rl LE B42D04 52 CINE A minus pos Skip the next 4 instr s 53 if the number is positive 0021 EB 54 MOV A TEMP 0022 F4 55 CPL A 9923 04 56 INC A 2024 FB 57 MOV TEMP A 58 59 Epilogue store the result and exit 60 POS Figure 5 3 SAMP3 Listing File 5 6 MCS 51 Examples of Program Development 0025 EB 61 MOV A TEMP 9926 F7 62 MOV R1 A 2027 22 63 RET 64 65 This routine converts binary to ASCII 66 INPUT a signed l byte integer pointed at by Rl 67 OUTPUT a 4 character string located where the 68 input number was pointed at by Rl 69 BINASC QGE7 79 SIGN bit ACC 7 71 Get the number find its sign and store its sign 0028 E7 72 MOV A Rl 0029 772B 73 MOV R1 plus Store a plus sign over 74 written by minus if needed 002B 30E704 75 JNB sign go on2 Test the sign bit
26. 0H 25 i 26 RSEG seg3 0900 27 DBIT lH 28 5 29 END Figure 5 5 TEST01 Assembly Listing File The RL51 listing file is shown in figure 5 6 ERROR 107 informs us that the locate attempt for SEG1 would overflow the data space SEGI was ignored not located for this reason The link map shows the following assignments for the remaining segments Addresses Segment 00H 07H Register Bank 0 08H IFH GAP 20H SEG3 one bit at bit location 0 20H 1 20H 7 GAP 21H 71H SEG2 50H bytes After these segments have been located there is not enough room for SEGI 21H bytes However there would be enough room if SEGI were located before the BIT segment To obtain this result the command is RL51 F1 TESTO1 0BJ PRECEDECSEG1 5 10 MCS 51 ISIS II RLSI ISIS II MCS 51 RELOCATOR AND LINKER V2 F1 TESTQOl OBJ RL51 INPUT MODULES INCLUDED F1 TESTO1 0BJ TEST 1 LINK MAP FOR F1 TEST 1 TEST 1 TYPE REG BIT DATA CODE IGNORED SEGMENTS SEG ERROR 107 SPACE DATA SEGMENT SEGI BASE H BH 0020H 0020H 0021H H LENGTH 0008H l8H H H S H l2H ADDRESS SPACE OVERFLOW Examples of Program Development INVOKED BY RELOCATION SEGMENT NAME REG BANK kkk GAP kik 1 UNIT SEG3 7 GAP kk ik UNIT SEG2 UNIT PROG Figure 5 6 RLS1 Listing File Without PRECEDE The RL51 listing file for this example is shown in fi
27. 1 main module CHK EQ is compiled by PLM51 F1 CHKEQ P51 DEBUG PW 90 The output of the compilation is shown in figure 5 8 The ASM51 module HLTICE is assembled by ASMB1 F1 HLTICE AS1 DEBUG PWC90 The output of the compilation is shown in figure 5 9 RLS1 is invoked by the following command RL51 F1 CHKEQ OBJ F1 HLTICE OBJ PLMS1 LIB IXREF PW 72 RL51 links the two pre translated input modules along with the mandatory library PLMSI LIB PLM51 LIB must be linked whenever a PL M 51 module participates in the linkage The result of the linkage is shown in figure 5 10 MCS 51 Examples of Program Development PL M 51 COMPILER ICE5l Check Halt PAGE l ISIS II PL M 51 V1 9 COMPILER INVOKED BY plm5l fl cnkeq p5l debug pw 9 Stitle ICE5l Check Halt Node ee ek ek ek KR e e e de ke e ke ek Check equal EJ KE Check if comparison yields the rA expected result If not call assembler routine to return to ICE FERRERA ek k ek ck ck e ck ke de ke e ke e e KK chk eq l l DO 2 l halt ice PROCEDURE vall val2 eq switch EXTERNAL 3 2 DECLARE vall val2 WORD eq switch BIT END 5 l check equal PROCEDURE vall val2 eq switch PUBLIC 6 2 DECLARE vall val2 WORD eq switch BIT 7 2 IF vall lt gt val2 lt gt eq switch THEN CALL nalt ice vall val2 eq switch 9 l1 END check equal dummy main program l0 l DECLARE pi WORD CONSTANT 3 Si WORD 11 l
28. 3H C 001FH C 0032H TYPE REG DATA DATA DATA BIT BIT IDATA COD E CODE CODE CODE CODE COD COD E E TYPE MODUL PUBLI BASE H 8H CH lL H l2H 0020H 0020H 1 0020H 2 0021H 0000H 0003H SAH 0070H 007FH 008BH 0094H E C SYMBOL PROC SYMBOL SYMBOL SYMBOL ENDPROC SYMBOL SYMBOL LINE LINE LINE LINE LINE LENGTH 0008H 0004H 4H 2H EH GOGGH 1 H I H G lH 3H 0057H 0016H FH CH 9H 0002H F1 CHKEQ CHK EQ NAME CHK EQ RELOCATION UNIT UNIT UNIT UNIT UNIT UNIT ABSOLUTE INBLOCK UNIT UNIT UNIT UNIT UNIT CHECK EQUAL CHK EQ CHECK EQUAL VALI VAL2 EQ SWITCH CHECK EQUAL PI SI O 0 JU E PAGE 1 INVOKED BY Fl CHKEQ OBJ Fl HLTICE OBJ PLM51 LIB IXREF PW 72 SEGMENT NAME REG BANK 6 BYTES CHK EQ DT 9 CHK EQ DT k kx GAP kkk CHK EQ BI 0 BITS GAP STACK CHK EQ PR 2P0038S PROG 2P0034S PIVORS CHK EQ CO Figure 5 10 RL51 Listing File of CHK EQ Examples of Program Development ISIS II RL51 C 0033H C 005AH B 0024H 1 D 8H B 0020H 1 B 0020H 1 D 0008H D 0008H C 0070H C 0070H D 000AH ISIS II RLSI LINE LINE ENDMOD MODULE PUBLIC PUBLIC SYMBOL SEGMENT SEGMENT SYMBOL PUBLIC SEGMENT SYMBOL ENDMOD 11 12 CHK_EQ HALT_ICE HALT_ICE BIT HALT_I
29. 4 first par move lst par to place 0002 ADOO F 30 MOV R5 first par l 0004 AEG F 31 MOV R6 second par move 2nd par to place 0006 AFOD F 32 MOV R7 second par l 0008 A200 F 33 MOV C bit par move bit par to place 34 i 000A AS 35 DB QA5H illegal op code B OG 36 NOP Will stop ICE 51 if 000C BO 37 NOP you type GO TIL OPC IS A5 B D Qu 38 NOP E 22 39 RET you can continue after stop 40 41 END MCS 51 MACRO ASSEMBLER ICE51 Halt PAGE 2 SYMBOL TABLE LISTING NAME TYPE VALUE ATTRIBUTES HALT ICE BIT B ADDR H R PUB SEG BITS HALT ICE BYTE D ADDR H R PUB SEG BYTES BIT PAR o o B ADDR H R SEG BITS BITS ww B SEG lH REL UNIT BYTES 2 s a D SEG OUW4H REL UNIT FIRST PAR D ADDR OOOOH R SEG BYTES HALT ICE C ADDR H R PUB SEG PROG PROG X C SEG FH REL UNIT SECOND PAR D ADDR 00 02H R SEG BYTES REGISTER BANK S USED TARGET MACHINE S 8951 ASSEMBLY COMPLETE NO ERRORS FOUND Figure 5 9 ASMSI Listing File of HLTICE 5 14 MCS 51 Examples of Program Development I IS II RL51 ISIS II MCS 51 RELOCATOR AND LINKER V2 0 RL51 INPUT MODULES INCLUDED FI CHKEQ OBJ CHK EQ Fl HLTICE OBJ HALT ICE F PLMSI LIB PQU34 FO PLM51 LIB P0038 F PLMSI LIB PIV R LINK MAP FOR Fl1 CHKEQ CHK EQ SYMBOL TABLE FOR C 0003H C 0033H D CH D EH B 0020H C 9994H D L H C 0033H C 0003H C 000
30. 9800306 Preface vi The following manuals may also be of interest e MCS 51 Macro Assembly Language Pocket Reference order number 9800935 e MCS 51 Utilities Pocket Reference order number 121817 e ICE 51 In Circuit Emulator Operating Instructions for ISIS II Users order number 9801004 Notational Conventions UPPERCASE italic directory name filename system id Vx y Tal punctuation Characters shown in uppercase must be entered in the order shown Enter the command words as shown or use a system defined abbreviation You may enter the characters in upper case or lowercase Italic indicates a meta symbol that may be replaced with an item that fulfills the rules for that symbol The actual symbol may be any of the following Is that portion of a pathname that acts as a file locator by identifying the device and or directory containing the filename Is a valid name for the part of a pathname that names a file Is a generic label placed on sample listings where an oper ating system dependent name would actually be printed Is a generic label placed on sample listings where the version number of the product that produced the listing would actually be printed Brackets indicate optional arguments or parameters One and only one of the enclosed entries must be selected unless the field is also surrounded by brackets in which case it is optional At least one of the enclosed items must be sel
31. AMPLE LST SYMBOLS LINES PUBLICS After the RL51 program has executed the system has placed the absolute object module in file SAMPLE and an output file with information on the link and locate process in file SAMPLE LST The output file also contains symbol table information as requested by the SYMBOLS LINES and PUBLICS controls The listing file is shown in figure 5 4 5 1 Examples of Program Development MCS 51 MCS 51 MACRO ASSEMBLER SAMPLE ISIS II MCS 51 MACRO ASSEMBLER V2 0 OBJECT MODULE PLACED IN ASSEMBLER INVOKED BY LINE LOC 9009 0200 0003 0006 00909 000p E vull 0014 0017 DOlA LD lF 0022 0025 0028 002B OO2E 0030 0033 0036 0038 003B 003D 0040 0042 0044 0946 0048 004B 4E 2051 9953 2055 0058 49008 OBJ 758929 758D03 7598DA D28E 900000 120000 120000 900000 120000 120009 7890 120009 120000 900000 120009 120009 7809 120000 120900 1999 120000 7980 120009 E500 2500 F500 7990 120000 902000 120090 7900 7A04 129900 80Bl Fr rj tj ri rij rj rij rg rg H Hj f fg 5 f HJ nj nj n r trj tj nj rj ry Xo 00 J OY Ul i W NO HY F1 SAMP1 0BJ F1 ASM51 F1 SAMP1 A5l DEBUG SOURCE NAME SAMPLE a EXTRN code put crlf put string put data str EXTRN code get num binasc ascbin CSEG This is the initializing section Execution always starts at address on power up ORG
32. BIT controls are allocated next then other relocatable BIT and BIT ADDRESSABLE segments following rule 2 c DATA type segments are allocated next segments in the DATA control first then other relocatable DATA segments d IDATA type segments except STACK are allocated next segments in the IDATA control first then other relocatable IDATA segments e Segments specified in the STACK control are allocated at as low an address as possible provided that it is above all BIT DATA and IDATA segments allocated under c and d f Last the segment STACK if it exists and is IDATA and is not mentioned in an explicit location control is now allocated at as low an address as possi ble provided that it is above all BIT DATA and IDATA segments allocated under c and d and e In most cases you do not need to use any explicit controls to obtain a satisfactory allocation of segments RL51 tries to fit your segments into the designated memory spaces as best it can following the rules As you can see most of the complexity occurs in the on chip data space 2 3 The Mechanics of Linkage and Location with RL51 2 4 Table 2 1 Address Spaces and Segment Types Code 64K bytes 0000H OFFFFH External data 64K bytes 0000H OFFFFH On chip data 128 bytes 00H 7FH direct addressing On chip data 256 bytes 00H OFFH indirect addressing see 1 Bit space in 128 bits 00H 7FH on chip data see 2 memo
33. BLICS and DEBUGLINES controls select what kinds of debug information are to be included in the output file The default of any switch is always the positive form DEBUGSYMBOLS DEBUGPUBLICS and DEBUGLINES Table 3 3 summarizes the linking switches Examples Because the linking switches default to the positive form you will usually use the negative forms to suppress unwanted debug information in the output file For example to cause the output file debug information to contain only the information for the public symbols use RLS1 F1 PR0G1 0BJ NODEBUGSYMBOLS NODEBUGLINES To have only the local symbols output to the absolute file use RL51 F1 PR0G1 0BJ NODP NODL Note the use of abbreviations NODP for NODEBUGPUBLICS and NODL for NODEBUGLINES A complete list of abbreviations for command words appears at the end of this chapter Table 3 3 Linking Switches DEBUGSYMBOLS Copies local symbol information to output file NODEBUGSYMBOLS Suppresses local symbols DEBUGPUBLICS Copies public symbol information to output file NODEBUGPUBLICS Suppresses public symbols DEBUGLINES Copies line number information high level language translators only to output file NODEBUGLINES Suppresses line numbers MCS 51 Using the RLS1 Program Locating Controls The locating controls allow you to assign absolute addresses to relocatable segments to specify the ordering of relocatable segments of a given type in memory and to force allocati
34. CE BYTE BIT_PAR BITS BYTES FIRST_PAR HALT ICE PROG SECOND_PAR HALT ICE INTER MODULE CROSS REFERENCE LISTING PAGE PAGE 2 3 CHECK_EQUAL BIT BIT CHK EQ CHECK EQUAL BYTE DATA CHK EQ HALT_ICE BIT BIT HALT ICE CHK EQ HALT ICE BYTE DATA HALT_ICE CHK EQ P0034 CODE P0034 CHK EQ P0038 CODE P 038 CHK EQ PIHOR CODE CHK EQ PIVOR PIVOR CODE PIV R CHK EQ PSW R NUMB CHK EQ PIVGR CHECK EQUAL CODE CHK EQ HALT ICE CODE HALT ICE CHK EQ Figure 5 10 RL51 Listing File of CHK EQ Cont d The result of a linkage process that includes PL M 51 modules deserves an expla nation The following paragraphs describe the modules segments and symbols that appear in the output listing of such a linkage The explanation refers to the actual example figure 5 10 In addition to the two input modules CHK EQ and HALT ICE RL51 pulled some modules from PLMS51 LIB The two modules P0034 and P0038 contain common PL M 51 run time routines and were pulled to resolve calls to those routines in the CHK EQ module The module PIVOR contains the initialization routine set the stack pointer set PSW and is pulled whenever a linkage process encounters a main module written in PL M 51 The segments BYTES BITS and PROG are the user segments as defined in the ASMSI HALT ICE module The code segments P0034S P0038S and PIVORS are the code segments of the pr
35. ECT MODULE PLACED IN Fl1 SAMP2 0BJ ASSEMBLER INVOKED BY Fl ASM5L F1 SAMP2 A51 DEBUG LOC OBJ LINE SOURCE 1 NAME CONSOLE IO 2 3 IO ROUTINES segment CODE 4 RSEG IO ROUTINES 5 This is the console IO routine cluster 6 PUBLIC put crlf put string put data str get num 7 USING 8 9 This routine outputs a Carriage Return and 19 a Line Feed 11 PUT CRLF B D 12 CR EQU DH carriage return 000A 13 LF EQU AH line feed 14 9999 749D 15 MOV A cr 0002 120099 F 16 CALL put_char 2005 740A 17 MOV A 1f 0007 120009 F 18 CALL put char A 22 19 RET 20 21 Routine outputs a null terminated string located 22 in CODE memory whose address is given in DPTR 23 PUT STRING B E4 24 CLR A acC 93 25 MOVC A A DPTR D 6206 26 JZ exit F 120000 F 27 CALL put char 0012 A3 28 INC DPTR 0013 8 F6 29 JMP put string 30 EXIT 0015 22 31 RET 32 33 Routine outputs a string located in DATA memory 34 whose address is in Rl and its length in R2 35 PUT DATA STR 0016 E7 36 MOV A Rl 0017 120000 F 37 CALL put_char LA g9 38 INC Rl lB DAF9 39 DJNZ R2 put data str LD 22 4 RET 41 42 gt Routine outputs a single character to console 43 The character is given in A 44 PUT CHAR QUIE 3099FD 45 JNB TI 0021 C299 46 CLR TI 0023 F599 47 MOV SBUF A 0025 22 48 RET 49 S Get a 4 character string from console 51 and stores it at the address given in R 52 If a X is received routine
36. ERROR 110 CANNOT FIND SEGMENT SEGMENT segment name The specified segment name occurred in the command tail but is not the name of any segment defined within the input files The specified segment is ignored ERROR 111 SPECIFIED BIT ADDRESS NOT ON BYTE BOUNDARY SEGMENT segment name The specified segment was requested in a BIT locating control The segment is not a BIT segment and the requested address is not on byte DOOR The specified segment is ignored ERROR 112 SEGMENT TYPE NOT LEGAL FOR COMMAND SEGMENT segment name The specified segment is not one of the types that are legal for the locating control for which it is specified The specified segment is ignored ERROR 113 RESERVED B 3 RL51 Error Messages MCS 51 ERROR 114 SEGMENT DOES NOT FIT SEGMENT segment name base length The specified segment cannot be located at the base specified by the locating control Starting at that base address there is insufficient memory for a segment of its length The specified segment is ignored ERROR 115 INPAGE SEGMENT IS GREATER THAN 256 BYTES SEGMENT segment name The specified INPAGE segment is greater than one page The specified segment is ignored ERROR 116 INBLOCK SEGMENT IS GREATER THAN 2047 BYTES SEGMENT segment name The specified INBLOCK segment is greater than one block The specified segment is ignored ERROR 117 BIT ADDRESSABLE SEGMENT IS GREATER THAN 16 BYTES SEGMENT segment name The specified
37. IG LIB must be specified in order to resolve the reference to the TANGENT function Also since TANGENT SINE COSINE COTRIG LIB must be respecified in order to resolve the reference to the COSINE function Using the RLS1 Program Output File The output filename is the name of the disk file that is to receive the absolute object module If the output file name is omitted RLS1 creates a filename for the output file by removing the extension from the first filename in the input list and using the drive and root name only If this input file contains no extension a fatal error occurs For example the command RL51 PROG is illegal since the output filename defaults to PROGI If there is already a file on the target drive with the name of the output file that file is overwritten by the new output file Examples RL51 F1 PROG OBJ TO F1 PROG This example specifies file PROG on drive 1 as the output file RL51 F1 PROG OBJ This example uses the default output file generated by RL51 The effect is the same as the first example the output file becomes F1 PROG RLS1 F1 SAMPLE1 0BJ F1 SAMPLE2 0BJ TO F2 SAMPL ABS In this example the output file is on a different drive from the input files and both the filename SAMPL and the extension ABS are specified Controls After the output filename you can add a list of controls to select options for listing linking and locating the output Use blanks not commas to separate con
38. L The first module name in the list is the one in which the symbol was declared PUBLIC If a symbol is unresolved or if a symbol is defined in a library and the NOLIBRAR ES selection item is in effect then the string UNRESOLVED appears in front of the modules list Error Messages RL51 displays error messages on the console and copies them to the end of the listing file unless the listing file is suppressed RL51 error messages describe warnings errors and fatal errors A warning is a detected condition that may or may not be what the user desired a warning does not terminate the link locate operation An error does not terminate operation but probably results in an output module that cannot be used A fatal error terminates operation of RL51 Refer to Appendix B for a list of the error messages and probable causes MCS 51 MCS 51 RLS1 Outputs INTER MODULE CROSS REFERENCE LISTING NAME USAGE MODULE NAMES CHECK EG BYTE DATA CHKEG TESBAS CHECK EQ BITS BIT BIT CHKEG 20P0008 CODE P0008 TESBAS P0015 CODE P0015 TESBAS P0016 CODE P0016 TESBAS PIHOR CODE TESBAS PIVOR PIVOR CODE PIVOR TESBAS PSWOR NUMB TESBAS PIVOR CHECK EG CODE CHKEQ TESBAS CHECK EG BITS CODE CHKEQ CHECK_EXIT CODE CHKEQ CHECK_INIT CODE CHKEG PUBOO CODE MODULE 0 MODULE 1 MODULE_2 PUBO CODE MODULE 0 MODULE 1 MODULE 2 PUBO2 CODE MODULE 0 3MODULE 1 MODULE 2 PUBO
39. LIC DEFINITIONS SYMBOL symbol name MODULE file name module name The specified public symbol in the specified module has already been defined in a previously unspecified processed module The specified symbol is ignored MCS 51 MCS 51 RL51 Error Messages ERROR 105 PUBLIC REFERS TO IGNORED SEGMENT SYMBOL public name SEGMENT segment name The specified public symbol is defined referencing the specified ignored segment The specified public symbol is ignored ERROR 106 SEGMENT OVERFLOW SEGMENT segment name The specified segment after combination is larger than the maximum segment size allowed for the segment according to its type or to the given locating control The specified segment is ignored ERROR 107 ADDRESS SPACE OVERFLOW SPACE space name SEGMENT segment name RL51 was unable to allocate the specified relocatable segment according to the segment relocation type in the specified address space The specified segment is ignored ERROR 108 SEGMENT IN LOCATING CONTROL CANNOT BE ALLOCATED SEGMENT segment name RL51 was unable to allocate the specified relocatable segment that appears in the locating control according to the requirements imposed by the locating control and according to the segment relocation type The specified segment is ignored ERROR 109 EMPTY RELOCATABLE SEGMENT SEGMENT segment name The specified segment after combination has zero size The specified segment is ignored
40. O ROUTINES R SEG IO ROUTINES R SEG IO ROUTINES R PUB SEG I0 ROUTINES R SEG IO ROUTINES REL UNIT A R SEG IO ROUTINES R PUB X SEG IO ROUTINES R PUB SEG IO ROUTINES R PUB SEG IO ROUTINES OA A LA GET MACHINE S 8051 NO ERRORS FOUND Figure 5 2 SAMP2 Listing File Cont d 5 5 Examples of Program Development MCS 51 MCS 51 MACRO ASSEMBLER NUM CONVERSION ISIS II MCS 51 MACRO ASSEMBLER V2 0 OBJECT MODULE PLACED IN Fl SAMP3 0BJ ASSEMBLER INVOKED BY Fl ASM51 F1 SAMP3 A51 DEBUG LOC OBJ LINE SOURCE l NAME NUM CONVERSION 2 3 NUM ROUTINES segment CODE an 4 RSEG NUM ROUTINES 5 This module converts from ASCII to binary 6 and back The binary numbers are signed one byte 7 integers i e range is 128 to 127 Their 8 ASCII representation is always 4 char s long 9 i e a sign followed by 3 digits 19 PUBLIC ascbin binasc 11 USING 2030 12 ZERO EQU gt 002B 13 PLUS EQU 402D 14 MINUS EQU _ 15 gt 16 This routine converts ASCII to binary 17 gt INPUT a 4 char string pointed at by Rl The 18 number range must be 128 to 127 and the 19 string must have 3 digits preceded by a sign 20 OUTPUT a signed one byte integer located where 21 the input string started pointed at by Rl 22 ASCBIN AS8QL 23 MOV RQ ARl Rl original value needed later 24 Compute first digit value and store it in TEMP REG 25 TEMP EQU R3 9992 08 26 INC R 9993 E6 27 MOV A RO
41. OFFH see note 2 Same as IDATA Same as IDATA XDATA CODE 0 OFFFFH 0 OFFFFH Table A 5 Configuration Controls ema CE RAMSIZE value Specifies the amount of on chip RAM the object is aimed to MCS 51 MCS 51 Summary of RLS1 Controls Table A 6 Overlay Controls DCS BE O OVERLAY overlay units Overlays data segments based on the information in the module declarations and in the overlay units NOOVERLAY Suppresses the overlaying of data segments Table A 7 Abbreviations for Command Words Command Word Abbreviation BIT CODE DATA DEBUGLINES DEBUGPUBLICS DEBUGSYMBOLS GENERATED IDATA IXREF LIBRARIES LINES MAP NAME NODEBUGLINES NODEBUGPUBLICS NODEBUGSYMBOLS NOGENERATED NOIXREF NOLIBRARIES NOLINES NOMAP NOOVERLAY NOPRINT NOPUBLICS NOSYMBOLS OVERLAY PAGEWIDTH PRECEDE PRINT PUBLICS RAMSIZE STACK SYMBOLS A 5 APPENDIX B RL51 ERROR MESSAGES RLS51 error messages describe warnings errors and fatal errors A warning is a detected condition that may or may not be what the user desired a warning does not terminate the link locate operation An error does not terminate operation but probably results in an output module that cannot be used A fatal error terminates operation of RL51 This appendix lists the warning error and fatal error messages in that order The text of each message is in UPPER CA
42. S CODE UNRESOLVED MODULE 1 MODULE 2 PUBO 4 CODE MODULE 0 MODULE 1 MODULE_2 PUBOS CODE MODULE 0 MODULE 1 MODULE e PUBO6 CODE UNRESOLVED MODULE 1 MODULE e PUBO 7 CODE MODULE 0 MODULE_1 MODULE_2 PUBOS CODE MODULE 0 MODULE 1 MODULE 2 PUBO0S CODE MODULE 0 MODULE 1 MODULE_2 PUB10 CODE MODULE 0 PUB1 1 XDATA MODULE 0 PUB12 DATA MODULE 0 PUB13 IDATA MODULE 0 PUB14 BIT MODULE 0 PUBIS NUMB MODULE_0 PUB16 CODE MODULE 0 PUB17 CODE MODULE 0 PUB18 CODE MODULE 0 PUB19 CODE MODULE 0 PUBXO CODE MODULE_1 MODULE_0 PUBX 1 CODE MODULE_1 MODULE 0 PUBYO CODE UNRESOLVED M DULE 1 MODULE 2 PUBZO CODE UNRESOLVED MODULE 1 Figure 4 3 IXREF Listing Absolute Object File The linking and locating process combines one or more relocatable object files into one absolute object file The absolute object file contains one module the absolute module consists of e A module header record that identifies the module e A set of intermixed content and debug records The content records contain the program code The debug records contain the location and scope of local symbols public symbols segment symbols and line numbers as specified by the DEBUG SYMBOLS DEBUGPUBLICS and DEBUGLINES controls in the RL51 invocation e A module end record that verifies the module name CHAPTER 5 EXAMPLES OF PROGRAM DEVELOPMENT This chapter shows three brief examples of program development using
43. SE A brief explanation of the probable cause for the error condition accompanies each error message Warnings WARNING 1 UNRESOLVED EXTERNAL SYMBOL SYMBOL external name MODULE file name module name The specified external symbol requested in the specified module has no matching public symbol in any of the input modules WARNING 2 REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL external name MODULE file name module name REFERENCE code address The specified unresolved external is referenced in the specified module at the specified code address WARNING 3 ASSIGNED ADDRESS NOT COMPATIBLE WITH ALIGNMENT SEGMENT segment name The address specified for the segment in a locating control is not compatible with the segment s alignment The segment is placed at the specified address violating its alignment WARNING 4 DATA SPACE MEMORY OVERLAP FROM byte bit address TO byte bit address The data space in the given range is occupied by two or more segments WARNING 5 CODE SPACE MEMORY OVERLAP FROM byte address TO byte address The code space in a given range is occupied by two or more segments WARNING 6 XDATA SPACE MEMORY OVERLAP FROM byte address TO byte address The xdata space in the given range is occupied by two or more segments RLS1 Error Messages B 2 WARNING 7 MODULE NAME NOT UNIQUE MODULE file name module name The specified name was used as the module name for more than one module The
44. T CHAR PAGE INVOKED BY SEGMENT NAME REG BANK g DATA AREA CONSTANT AREA NUM ROUTINES IO ROUTINES PAGE Figure 5 4 RL51 Output File I 2 5 8 MCS 51 Examples of Program Development C 90FBH PUBLIC PUT_CRLF C 0111H PUBLIC PUT DATA STR C 0106H PUBLIC PUT STRING B 0098H SYMBOL RI D 099H SYMBOL SBUF B 0098H 1 SYMBOL TI o ENDMOD CONSOLE IO ee MODULE NUM CONVERSION D E H SYMBOL ACC D 0001H SYMBOL ARI C 00BOH PUBLIC ASCBIN D F H SYMBOL B C 00DB8H PUBLIC BINASC C 00E2H SYMBOL GO_ON2 N 002DH SYMBOL MINUS C 00B0H SEGMENT NUM ROUTINES N 002BH SYMBOL PLUS C 00D5H SYMBOL POS B 00E0H 7 SYMBOL S IGN N 0030H S YMBOL ZERO sise ENDMOD NUM CONVERSION ISIS II RL51 PAGE 3 INTER MODULE CROSS REFERENCE LISTING USAGE MODULE NAMES ASCBIN BINASC GET NUM PUT CRLF PUT DATA STR CODE PUT STRING CODE NUM CONVERSION SAMPLE CODE NUM CONVERSION SAMPLE CODE CONSOLE IO SAMPLE CODE CONSOLE IO SAMPLE CONSOLE IO SAMPLE CODE CONSOLE IO SAMPLE Figure 5 4 RL51 Output File Cont d Using the Locating Controls The second example shows how to use the PRECEDE control to specify an order for data segments in this case because the RL51 algorithm for locating segments results in a segment being left out The program is named TESTOI After assembly the listing of TESTO1 OBJ is as shown in figure 5 5 The program s code sequence is irrelevant to the examp
45. UBLICS Definition The LIST command enables you to examine the contents of the specified library A listing of the contents of the library may be printed you can send this list to a file to be printed later or you may print the list directly depending upon Jistfile If listfile is omitted the listing is sent to the console output library is the library for which you need the list of modules modname is the name of the module desired listfile is a file or an output device on which the list of modules is to be printed and PUBLICS optionally calls for a listing of the public symbols in each listed module Example The following examples illustrate the use of the LIST subcommand MLIST SCHOOL LIB REFERENCE ONE DAY lt cr gt LIST REF LIB ALMANACS DICTIONARIES ENCYCLOPEDIAS MAPS 8 ESTO F L REMOVE NOT PUBLICS lt cr gt See figure 6 1 for an example of the LIST output format PRINTED_MATTER PUBLISHER LIBRARY_OF_CONGRESS_NUMBER DICTIONARIES ABRIDGED UNABRIDGED ENCYCLOPEDIAS VOLUMES SETS PUBLISHER MAPS STATE COUNTRY RELIEF GLOBES Figure 6 1 LIST Command Output MCS 51 MCS 51 EXIT The EXIT terminates the LIB51 program Syntax EXIT LIBS1 Librarian APPENDIX A SUMMARY OF RL51 CONTROLS Table of Basic Definitions Table A 1 gives definitions of basi
46. User s Guide for details on segment types and relocation attributes Notes On Locating Controls The following notes refer to table 3 4 1 Bit addresses for non BIT segments in the BIT control must be on byte bounda ries that is they must be divisible by eight BIT type segments can be aligned on bit boundaries 2 Therange of addresses for the IDATA control is dependent on the target machine See the RAMSIZE control later in this chapter 3 The STACK control specifies which segments are to be allocated uppermost in the IDATA space The memory accessed starts after the highest on chip RAM address occupied by any previously allocated segment and continues to the top of the IDATA space Table 3 4 Locating Controls Address Range Segment Types Address Space Hex and Attributes PRECEDE Register banks and bit 00H 2FH DATA UNIT aligned addressable space in IDATA on chip data RAM Bit addressable space 00H 7FH BIT DATA IDATA in on chip data RAM see note 1 Directly addressable 00H 7FH DATA UNIT aligned on chip data RAM IDATA Indirectly addressable 00H OFFH IDATA on chip data RAM see note 2 Same as IDATA see Same as IDATA Same as IDATA note 3 External data RAM 0 OFFFFH XDATA Code memory 0 OFFFFH CODE MCS 51 MCS 51 Using the RL51 Program NOTE This control has no other effect on any segments The IDATA STACK segment if it exists is placed higher than segments that were mentio
47. a cr gt e DELETE libname modname not followed by a lt cr gt e DELETE modname not specified e CREATE filename not followed by a lt cr gt e LIST TO filename not followed by PUBLICS or a lt cr gt LEFT PARENTHESIS EXPECTED There is a missing left parenthesis in the command RIGHT PARENTHESIS EXPECTED There is a missing right parenthesis in the command MODULE NAME TOO LONG The specified module name exceeds 40 characters TO EXPECTED LIBS1 Error Messages D 2 The TO filename is omitted in the ADD command UNRECOGNIZED COMMAND An illegal or misspelled command was entered The only legal commands are ADD CREATE DELETE LIST and EXIT File or Module Errors The following errors indicate that there is some problem with the file or module specified There is no partial copy of the command given with these error messages FILE ALREADY EXISTS The file specified in the CREATE command already exists Choose a new name for the library filename DUPLICATE SYMBOL IN INPUT You have attempted to add a file that contains aPUBLIC symbol already within the library filename NOT LIBRARY The specified file is not a library filenamet modname NOT FOUND You have attempted to delete a module that does not exist Check for misspelling of the filename or module name modname ATTEMPT TO ADD DUPLICATE MODULE The specified module name already appears within the library symbol ALREADY IN LIBRARY Y
48. c terms used in the command format summary Table A 1 Definitions of Common Terms Names can be from 1 to 40 characters long and must be composed of letters A Z digits O 9 or special characters _ The first character must be a letter or a special character module name Same as name segment name Same as name pathname A valid ISIS II filename reference or device reference See next two items for examples filename A reference to a disk file The format is F root ext Examples PROG1 F1 SAMPL1 TEST HEX F2 SAMPLE OBJ device A reference to a non disk device Examples LP CO TO value A 16 bit unsigned integer Examples 1011B 304Q 4096D or just 4096 0C300H address Same as value RL51 Command Format Summary Here is a summary of the syntax of the RL51 invocation command Refer to the Preface for an explanation of the command format notation The RL51 command has the overall format Fn 1RL51 input lIist T0 output filel control list where n drive number input list input file t module list 1 input file filename see table A 1 module list module name 1 module name seetable A 1 output file filename see table A 1 control list control Summary of RLS1 Controls listing control linking control control locating control configuration control overlay control print pagewidth map listing control lt symbols publics line
49. command is repeated up to and including the point of error RLS1 Error Messages B 6 FATAL ERROR 205 NUMERIC CONSTANT TOO LARGE partial command A numeric constant greater than OFFFFH was found in the command The command is repeated up to and including the point of error FATAL ERROR 206 INVALID CONSTANT partial command An illegally constructed context was found A common example of this error is enter ing a hexadecimal number with a letter first The command is repeated up to and including the point of error FATAL ERROR 207 INVALID NAME partial command An illegally constructed name was found Names can be from 1 through 40 charac ters long and must be composed of the letters A Z the digits 0 9 or special charac ters The first character must be a letter or a special character The command is repeated up to and including the point of error FATAL ERROR 208 INVALID FILE NAME partial command The file name specified in the command is not a valid ISIS II file name The command is repeated up to and including the point or error FATAL ERROR 209 FILE USED IN CONFLICTING CONTEXTS FILE file name The specified file is used in more than one context for example using the same file for both input and output This may be caused by specifying for the first input file a file that has no extension and not specifying an output file FATAL ERROR 210 I O ERROR INPUT FILE ISIS II ERROR FILE f
50. d to specific modules Once the faulty module has been identified fixing the problem is considerably simpler When a program must be modified modular programming simplifies the job You can link new or modified modules to the existing program with confidence that the rest of the program will not be changed MCS 51 Modular Program Development Process This section is a brief review of the program development process using an MCS 51 language translator e g the relocatable MCS 51 assembler or PL M 51 compiler linker locator code converter programs PROM programmer and ICE 51 in circuit emulator The process is shown in figure 1 1 1 1 Introduction MCS 51 ABSOLUTE OBJECT MODULE RL51 LINKER LOCATOR RELOCATABL OBJECT MODULES TEXT SOURCE ASM51 FACTORY ROM EDITOR MODULES ASSEMBLER MASK VERSION ABSOLUTE PROGRAMS PROM VERSION ICE 51 IN CIRCUIT EMULATOR LEGEND INTEL DEVELOPMENT TOOLS AND OTHER PRODUCTS USER CODED ESBEN HEX a CONVERSION OBJECT MODULE Figure 1 1 MCS 51 Program Development Process 121737 1 Segments Modules Libraries and Programs In the initial design stages the tasks to be performed by the program are defined and then partitioned into subprograms Here are brief introductions to the kinds of subprograms used with the MCS 51 assembler and linker locator A segment is a unit of code or data memory A segment may be relocatable or absol
51. d to the software development tools for the MCS 51 family Reader s Guide The manual is organized into six chapters and five appendixes Chapter 1 discusses the advantages of modular programming and summarizes the process of modular programming with the MCS 51 development tools Chapter 2 reviews the mechanics of linkage and location for the RL51 program Chapter 3 gives the details on invoking the linker locator Chapter 4 discusses the files and displays produced by the RL51 program with examples Chapter 5 contains three examples of programs with the link and locate steps for each program Chapter 6 describes the LIB51 the MCS 51 library manager and its usage Appendix A presents the syntax of the RL51 commands with brief definitions of the controls Appendix B lists the error messages and warnings displayed by RL51 with FUERTE for corrective action Appendix C lists a summary of LIB51 commands Appendix D lists the error messages generated by LIB51 with suggestions for corrective action Appendix E contains hexadecimal decimal conversion tables as a convenient reference Related Literature To help you use this manual you should be familiar with the contents of the follow ing manuals e MCS 51 Macro Assembler User s Guide order number 9800937 e PL M 51 User s Guide order number 121966 o MCS 51 Family of Single Chip Microcomputers User s Manual order number 121517 o JSIS II User s Guide order number
52. data address The specified module contains an absolute IDATA segment that occupies non existent internal RAM space in the target machine The segment is ignored Notice however that the module may contain erroneous references to this segment which are not reported ERROR 124 RESERVED ERROR 125 MORE ERRORS ENCOUNTERED NOT REPORTED Non fatal errors encountered henceforth will not be reported ERROR 126 OVERLAY MODULE NOT FOUND MODULE file name module name The specified module name explicitly mentioned in the overlay control was not found ERROR 127 OVERLAY DATA ADDRESS SPACE OVERFLOM SPACE on chipRAM space RL 51 was unable to allocate an overlaid segment of the specified address space Try to link with the NOOVERLAY control Fatal Errors FATAL ERROR 201 INVALID COMMAND LINE SYNTAX partial command A syntax error was detected in the command The command is repeated up to and including the point of error FATAL ERROR 202 INVALID COMMAND LINE TOKEN TOO LONG partial command The command line contains a token that is too long The command is repeated up to and including the point of error FATAL ERROR 203 EXPECTED ITEM MISSING partial command An expected item in the command line such as an input file name or a file name following the TO is missing The command is repeated up to and including the point of error FATAL ERROR 204 INVALID KEY WORD partial command An invalid keyword was found in the command The
53. dupli cation or disclosure is subject to restrictions stated in Intel s software license or as defined in ASPR 7 104 9 a 9 No part of this document may be copied or reproduced in any form or by any means without the prior written consent of Intel Corporation The following are trademarks of Intel Corporation and its affiliates and may only be used to identify Intel products BITBUS im iRMX Plug A Bubble COMMputer iMMX iSBC PROMPT CREDIT Insite SBX Promware Data Pipeline intel SDM QueX Genius intel BOS iSXM QUEST A Intelevision Library Manager Ripplemode l inteligent Identifier MCS RMX 80 PICE inteligent Programming Megachassis RUPI ICE Intellec MICROMAINFRAME Seamless iCS Intellink MULTIBUS SOLO iDBP iOSP MULTICHANNEL SYSTEM 2000 iDIS iPDS MULTIMODULE UPI iLBX REVISION HISTORY DATE APPD 001 Original issue 002 Added IXREF and LIBSI 003 Added OVERLAY NOOVERLAY controls iii PREFACE This manual describes the RL51 linker and locator and the LIBS1 librarian for program modules produced by MCS 51 language translators such as ASMSI and PL M 51 The RL51 and the LIB51 program operate on an Intel development system with an 8080 or 8085 processor The configuration must include 64K of RAM a console and at least one diskette or hard disk drive running under the ISIS II operating environment NOTE In this manual the term MCS 51 refers to all members of the MCS 51 family of microcomputers an
54. e An inter module cross reference listing IXREF e Error messages detected by RL51 Link Summary A sample of a link summary is shown in figure 4 1 The summary includes the follow ing kinds of information e A header echoing the RL51 invocation e Input modules included in the link process Input modules are identified by module name and file name e A link map unless suppressed by the NOMAP control The map lists all allocated segments giving the type base address and length of each segment The map also identifies segment overlaps and gaps in the memory space e A list of segments that were ignored in the link process If any segments were ignored the reasons for doing so will be reported later as an error e A list of unresolved external symbols An external symbol is unresolved when it is not matched by a public symbol in one of the input modules Each occurrence of an unresolved external symbol in a module will be reported later as an error e A list of all symbols that were ignored in the locate process A symbol is ignored when the same name appears as a public symbol in different modules or has attributes that are incompatible with external references or belongs to an ignored segment Each occurrence of an ignored symbol in a module will be reported later as an error CHAPTER 4 4 1 RL51 Outputs ISIS II MCS 51 RL51 NAME CEXAMPLE MAP PRINT INPUT MODULES INCLUDED FILET EXTCMOD1 FILET EXTCMOD2
55. e library file is processed only if the previously processed modules contained at least one unresolved external The library is scanned for modules containing public symbols that match as yet unresolved externals Each such module is processed as if it were explicitly specified The selection process continues until the modules in the library cannot satisfy any unresolved externals including any externals encountered while processing modules from the library RL51 will report an error if the same module name is encountered more than once during the link process CHAPTER 2 THE MECHANICS OF LINKAGE AND LOCATION WITH RL51 The Mechanics of Linkage and Location with RLS1 2 2 Take TRIGON LIB as an utterly fictitious example Assume it contains procedures called SINE COSINE TANGENT ARCSINE ARCCOS ARCTAN HYPER BOLIC_SINE and HYPERBOLIC_COSINE When RL51 starts processing TRIGON LIB it has already made a first pass over all files that appear before it in the invocation line If one of these contains a refer ence to the external SINE and there is no public by that name RL51 will assume that the procedure SINE from TRIGON LIB is to be loaded Otherwise it will leave SINE alone for the moment If while loading from TRIGON LIB RL51 encounters new externals that a module in the library can resolve it will scan the library once more Thus there is no logical order among modules in a library they are all equal If TANGENT calls
56. ected unless the field is also surrounded by brackets in which case it is optional The items may be used in any order unless other wise noted The vertical bar separates options within brackets or braces Ellipses indicate that the preceding argument or parameter may be repeated The preceding item may be repeated but each repetition must be separated by a comma Punctuation other than ellipses braces and brackets must be entered as shown For example the punctuation shown in the following command must be entered SUBMIT PLM86CPROGA SRC 9 SEPT 81 MCS 51 MCS 51 Preface In interactive examples user input lines are printed in white on black to differentiate them from system output cr Indicates a carriage return vil CHAPTER 1 PAGE INTRODUCTION The Advantages of Modular Programming 1 1 Efficient Program Development 1 1 Multiple Use of Subprograms 1 1 Ease of Debugging and Modifying 1 1 MCS 5 Modular Program Development Process 1 1 Segments Modules Libraries and Programs 1 2 Entering and Editing Source Modules 1 3 Assembly and Compilation 1 3 Relocation and Linkage 1 7 1 3 ROM and PROM Versions e 1 3 ICE 51 In Circuit Emulator 1 3 SDK 51 System D
57. esign Kit sees 1 3 Keeping Track of Files eene 1 4 CHAPTER 2 THE MECHANICS OF LINKAGE AND LOCATION WITH RLS1 Major Functions a un 2 1 Selecting Modules un aueh 2 1 Partial Sesments au kenne 2 2 Combining Relocatable Segments 2 2 Allocating Memory for Segments 2 3 Overlaying Data Segments sese 2 4 Resolving External References ese 2 4 Binding Relocatable Addresses 2 5 CHAPTER 3 USING THE RL51 PROGRAM Introduction nee een arte 3 1 Command Entry Continuation Lines And Comments een 3 1 RL51 Command Format Summary 3 1 Input EISE Lose M ane tou 3 2 Output File anne 3 4 Controls gcc 3 4 Listing Controls ask 3 4 PRINT NOBRINF oa 3 5 PAGEWIDTH asi 3 5 Listing SWITCHES alas 3 6 IXREE NODSRBE ne 3 6 L ink ng Controls lios 3 7 NAME A en cn ms ne 3 8 I3nking Switches aussen 3 8 Locating Controls unsere 3 9 Allocation Sequence eese 3 9 Format Summary ansiada 3 9 Table of Locating Controls 3 10 Notes on Locating Controls ss 3 10 Configuration Controls ooooooocnnnnnncnncnncnccnnnanannn ono nooo 3 12 RAMSIZE radiata ol Rs 3 12 CONTENTS PAGE OVERLAY NOOVERLAY Controls 3 12 OVER FA Y rd 3
58. eviously explained run time routines MCS 51 Examples of Program Development All segments whose names are of the form CHK EQ any are segments generated by PL M 51 as result of compiling module CHK EQ The prefix CHK EQ indicates that the segment belongs to the CHK EQ module The suffix indicates the segment type e g PR stands for the PRogram CODE segment CO for the COnstant CODE segment DT for DATA segment and BI for BIT segment On chip segment names may be followed by a register bank number 0 3 This number indicates the register bank that must be in effect while data in this segment is accessed The STACK segment was discussed before Note that this segment is not supplied by the user but is pulled automatically from PLM51 LIB because the main module is written in PL M 51 The absolute segment at 0000H 0002H contains the reset vector which consists of a JUMP to the initialization routine contained in the PIVORS segment Most of PL M 51 generated relocatable segments have the UNIT relocation type A frequent exception is the program code segment CHK_EQ PR which is INBLOCK whenever a module is compiled under ROM MEDIUM which is the default used by the compiler Another less frequent exception is the BITAD DRESSABLE DATA segment generated when bit structures are declared within the PL M 51 source program User symbols appear in the symbol table and the IXREF report Symbols whose names are equal to segments
59. gure 5 7 The PRECEDE control caused the link mapping to be as follows Addresses 00H 08H 29H 29H 1 29H 7 07H 28H 2AH 7AH Segment Register Bank 0 SEGI 21H bytes SEG3 one bit at bit location 0 GAP SEG2 50H bytes Refer to Chapter 2 for details on RL51 s allocating algorithm 5 11 Examples of Program Development MCS 51 ISIS II RL5l ISIS II MCS 51 RELOCATOR AND LINKER X021 INVOKED BY RL51 Fl TESTOL OBJ PRECEDE SEGI INPUT MODULES INCLUDED FL TEST L OBJ TESTOI1 LINK MAP FOR Fl TESTOL TESTO1 TYPE BASE LENGTH RELOCATION SEGMENT NAME REG 0000H BH REG BANK 9 DATA BH 0021H UNIT SEGI BIT 0029H 0000H 1 UNIT SEG3 0029H 1 0000H 7 Ke GAP ARK DATA 002AH 0050H UNIT SEG2 CODE H l2H UNIT PROG Figure 5 7 RLS1 Listing File with PRECEDE Using RL51 with PL M 51 Modules The third example shows how to use RL51 with object modules produced by PL M 51 The example shows the use of PLM51 LIB and demonstrates PE M 51 generated segments and the PL M 51 to ASMSI linkage The entire application introduces a way to halt ICE 51 at run time The procedure CHECK_EQUAL in the PL M 51 module CHK_EQ checks if an arithmetic expression is true If yes 1t calls the HALT_ICE assembler routine which causes ICESI to stop the program that is currently running The code of the program is irrelevant the example merely intends to show the program development process The PLMS
60. he text editor on your system to code the modules into source files The source modules are coded in assembly language or a high level language such as PL M 51 The editor may also be used to make corrections in the source code Assembly and Compilation The assembler ASM51 and compiler PL M 51 translate the source code into relocatable object code producing an object file The ASMSI object file is relocata ble when at least one input segment 1s relocatable otherwise the object file is an absolute file The PL M 51 object file is always relocatable The assembler and compiler also produce a listing file showing the results of the translation When the ASMS1 or PL M 51 invocation contains the DEBUG control the object file also receives the symbol table and other debug information for use in symbolic debugging of the program Relocation and Linkage After translation of all modules of the program the linker locator RL51 processes the object module files The RL51 program combines relocatable partial segments with the same name then assigns absolute memory locations to all the relocatable segments RL51 also resolves all references between modules using the library files when they are necessary for this resolution RL51 outputs an absolute object module file that contains the completed program and a summary listing file showing the results of the link locate process including a memory map symbol table and optionally an inter module c
61. htforward However for complex applications for example those with mixed ASM 51 and PL M 51 modules consult Chapter 3 Resolving External References An external reference points to a location in another module The EXTERNAL declaration for symbols tells RL51 that the reference is to a location defined in another module In the latter module the symbol is declared PUBLIC so that external refer ences to that symbol in other modules can be satisfied As it processes the input modules RL51 builds a table of public symbols and unresolved external references As each public symbol is added to the table any external references to that symbol are deleted After all segments have been located MCS 51 MCS 51 The Mechanics of Linkage and Location with RL51 the public symbols are bound to absolute addresses RL51 issues a warning for any unresolved externals that remain in the table External symbols and corresponding public symbols must be compatible That is both must be defined to address the same address space or at least one must be defined as a typeless symbol NUMBER and if the symbol represents a PL M 51 proce dure name then both must share the same register bank i e must be declared within the PL M 51 source modules with the same USING attribute Binding Relocatable Addresses After allocating memory for the combined segments and binding the public symbols RL51 makes a second pass pass 2 through the input module
62. ile name An ISIS II I O error was detected in accessing an input file The text of the message includes a description of the specific I O error that occurred See the ISIS II User s Guide for a list of possible I O errors FATAL ERROR 211 I U ERROR OUTPUT FILE ISIS II ERROR FILE file name An ISIS II I O error was detected in accessing the output file The text of the message includes a description of the specific I O error that occurred See the ISIS II User s Guide for a list of possible I O errors FATAL ERROR 212 1 0 ERROR LISTING FILE ISIS II ERROR FILE file name An ISIS II I O error was detected in accessing the listing file The text of the message includes a description of the specific I O error that occurred See the STS II User s Guide for a list of possible I O errors MCS 51 MCS 51 RLS1 Error Messages FATAL ERROR 213 1 0 ERROR TEMPORARY FILE ISIS II ERROR FILE file name An ISIS II I O error was detected in accessing a temporary file The text of the message includes a description of the specific I O error that occurred See the ISIS II User s Guide for a list of possible I O errors FATAL ERROR 214 INPUT PHASE ERROR MODULE file name module name This error occurs when RL51 encounters different data during pass two than it read during pass one FATAL ERROR 215 CHECK SUM ERROR MODULE file name module name A bad check sum was detected in the input module This indicates a bad input m
63. ist The input list tells RL51 what files are to be processed The files must be disk files containing relocatable object modules as described in Chapter 2 The entry for each file in the list can include the following information e The drive number If the drive number is omitted drive 0 is assumed as the default e The filename The filename is the name of the object file including an extension if one exists e A list of modules enclosed in parentheses If a module list is provided only the modules in the list are linked into the output file and modules not in the list are ignored If no module list is provided the default for a non library file is to link MCS 51 MCS 51 Using the RLS1 Program all modules in the file into the output module The default for a library file is to link only those modules that satisfy previously declared external symbols see the exact process in Chapter 2 under Selecting Modules If a module named in the module list is not present in the file the system issues an error message but does not halt the link process Module names specified explicitly or implicitly must be unique throughout the entire application Examples RL51 F1 PROG OBJ TO F1 PROG ABS In this example the input list has one file PROG OBJ on drive 1 RLS1 links all the modules in this file into the output file PROG ABS This and other examples omit the drive number on the RL51 reference for clarity 1 e
64. le The two DATA segments SEGI and SEG2 and the BIT segment BIT3 are the points of interest for this example SEGI is 21H bytes long SEG2 50H bytes long SEG3 one bit long The assembler listing also shows working register bank 0 8 bytes long absolutely located at addresses 00H through 07H All these segments are to be located in the on chip data RAM of an 8051 For the 8051 the directly addressable on chip data RAM is 80H bytes long addresses 00H through 7FH addresses 20H through 2FH are bit addressable The working regis ters may occupy the first 20H bytes of the space To see what RL51 does with this program enter the command RLS1 F1 TESTO1 OBJ 5 0 Examples of Program Development MCS 51 MCS 51 MACRO ASSEMBLER TEST 1 ISIS II MCS 51 MACRO ASSEMBLER V2 0 OBJECT MODULE PLACED IN F1 TEST 1 OBJ ASSEMBLER INVOKED BY Fl ASM5L F1 TEST 1 SRC PRINT CO OBJECT Fl TESTY1 0BJ LOC OBJ LINE SOURCE l This test shows the use of the 2 PRECEDE locating control 3 One bit causes failure of the 4 RL51 allocation algorithm 5 but the PRECEDE control fixes it 6 7 NAME test l 8 9 prog SEGMENT CODE l segl SEGMENT DATA 11 Seg2 SEGMENT DATA 12 seg3 SEGMENT BIT 13 14 RSEG prog 15 16 Code segment 17 g 434F4445 18 DB CODE IS IRRELEVANT 2004 2049532 0008 49525245 C 4C455641 9619 4E54 19 29 RSEG segl BUGS 21 DS Q21H 22 23 RSEG seg2 0009 24 DS 5
65. module cross reference report to print file NOIXREF Suppresses the intermodule cross reference report NOTE The default for any control except IXREF is the positive form PRINT MAP SYMBOLS PUBLICS and LINES NAME module name Specifies the name of the output module If the NAME control is omitted the output module name defaults to the name of the first input module processed Table A 3 Linking Controls DEBUGSYMBOLS Copies local symbol information to output file NODEBUGSYMBOLS Suppresses local symbols DEBUGPUBLICS Copies public symbol information to output file NODEBUGPUBLICS Suppresses public symbols DEBUGLINES Copies line number information high level language translators only to output file NODEBUGLINES Suppresses line numbers NOTE For all linking controls except NAME the default is the positive form DEBUGSYMBOLS DEBUGPUBLICS and DEBUGLINES PRECEDE Table A 4 Locating Controls Address Range Segment Types Address Space Hex and Attributes Register banks and bit 00H 2FH DATA UNIT aligned addressable space in Br on chip data RAM Bit addressable space in on chip data RAM Directly addressable on chip data RAM Indirectly addressable on chip data RAM Same as IDATA see note 3 External data RAM Code memory 00H 7FH see note 1 00H 7FH BIT DATA IDATA DATA UNIT aligned IDATA IDATA 00H
66. nced user in cases where running RL51 without them does not give a good enough result Format Summary The locating controls have the format control segment 1 where segment segment name base address 3 9 Using the RL51 Program The segments specified in the locating controls are allocated in the order they appear the first segment is assigned the lowest possible address and succeeding segments receive higher and higher addresses The user has the option of specifying the base address of any or all segments Segments with specified base addresses must appear in the list in ascending numerical order Segments named in a locating control with a specific base address are allocated at that address irrespective of segment overlap or segment type contradiction as long as ascending order is maintained Base addresses are byte addresses except for the BIT locating control where addresses are bit addresses in the bit space 0 to 127 Table of Locating Controls Table 3 4 lists the locating controls in order of precedence The first column gives the name of the control The second column describes the address space affected by the control The third column gives the address range for segments within each control The last column shows what types of segments are allowed for each control for each valid type the column also shows the allowable relocation attributes Refer to the MCS 51 Macro Assembler User s Guide and PL M 51
67. nd RL51 performs a first pass over the input modules identified in the command Pass 1 generates a segment table a publics table and an unresolved externals table The segment table is discussed in this section the other two tables are discussed later in this chapter The segment table contains the name length type and relocation attribute of all combined segments from all modules Combined segments are produced from the partial segments in the input modules according to the following rules e RL51 combines all partial segments with the same name into one relocatable segment For example if three input modules each have a partial relocatable segment named STACK the segment table will have one segment named STACK that combines the length of the three partial segments MCS 51 MCS 51 The Mechanics of Linkage and Location with RL51 e All the partial segments to be combined must be of the same type CODE DATA IDATA XDATA or BIT If any partial segments have the same names but different types an error occurs e The length of the combined segment must not exceed the physical size of the memory type Details on maximum size appear later in this chapter e The relocation attributes of all the partial segments to be combined must either be the same or UNIT aligned combined with one other attribute The combined segment receives the relocation attribute shared by the input partial segments or if the segments have attribute
68. ned in the STACK control The STACK control provides a convenient way to handle the stack usually for ASMSI based application where STACK is not used First assign the stack pointer SP to a relocatable segment consider the following ASMS1 example STACK_AREA SEGMENT IDATA SEGMENT directive in source DS 10H Reserve 16 bytes for stack Sr Other CODE instructions MOV SP STACK_AREA 1 Initialize SP Then at relocation time specify the segment named STACK AREA in a STACK locating control RL51 STACK STACK AREA where ellipsis represents the rest of the invocation line exclusive of the STACK control NOTE If the application contains modules produced by PL M 51 the STACK should be used as the stack segment Examples Here are three brief examples of invocations with locating controls See Chapter 5 for a more extended example RL51 F1 PROG1 0BJ F1 PROG2 0BJ TO F2 PROG ABS amp PRECEDE MESSAGET1D XDATA CARRAY1 256 ARRAY 512 In this example the DATA or IDATA segment named MESSAGEI will be allocated space in on chip RAM in the lowest available location overlapping the BIT space if necessary The XDATA control specifies that the two arrays are to be located at specific addresses e g for debugging RL51 F1 TEST OBJ STACK STACK AREA Here the STACK control allocates the uppermost portion of IDATA space for the segment named STACK AREA The software definition of STACK AREA
69. ocation line contain the same segment name more than once The command is repeated up to and including the point of error FATAL ERROR 223 NOT A DISK FILE partial command The file specified in the input list or as an output file is not a valid ISIS II disk file name The command is repeated up to and including the point of error FATAL ERROR 224 DUPLICATE KEYWORD partial command The same keyword appears in the command more than once The command is repeated up to and including the point of error FATAL ERROR 225 SEGMENT ADDRESSES ARE NOT IN ASCENDING ORDER partial command The addresses of the segments within one locating control are not in ascending order The command is repeated up to and including the point of error FATAL ERROR 226 SEGMENT ADDRESS INVALID FOR CONTROL partial command The address requested for a segment is not valid for the given locating control The command is repeated up to and including the point of error FATAL ERROR 227 PAGEWIDTH PARAMETER QUT OF RANGE partial command The PAGEWIDTH parameter given is out of the acceptable range FATAL ERROR 228 RAMSIZE PARAMETER OUT OF RANGE partial command The RAMSIZE parameter given is out of acceptable range FATAL ERROR 229 1 0 ERROR OVERLAY FILE ISIS II ERROR FILE file name An ISIS II I O error was detected in accessing an overlay file The text of the message includes a description of the specific I O error that occurred See the STS II User s
70. odule or a read error FATAL ERROR 216 INSUFFICIENT MEMORY The memory available for execution of RL51 has been used up This is usually caused by too many external public symbols or segments in the input files or by too many errors FATAL ERROR 217 NO MODULE TO BE PROCESSED After scanning all the input files no module was selected to be processed This is usually caused by an empty input file s or incorrect module names in the input list FATAL ERROR 218 NOT AN OBJECT FILE FILE file name The file named in the message judging by its first byte of data is not a valid object file FATAL ERROR 219 NOT AN 8051 OBJECT FILE FILE file name The translator ID field in the module header record indicates that the specified module is not an 8051 object module FATAL ERROR 220 INVALID INPUT MODULE MODULE file name module name The specified input module was found to be invalid Possible causes are incorrect record order incorrect record type illegal field illegal relation between fields or a missing required record This error could be the result of a translator record FATAL ERROR 221 MODULE SPECIFIED MORE THAN ONCE partial command The input list in the invocation line contains the same module name more than once The command is repeated up to and including the point of error B 7 RL51 Error Messages MCS 51 FATAL ERROR 222 SEGMENT SPECIFIED MORE THAN ONCE partial command The locating controls in the inv
71. of the command You can break a command between command words or other entries but not in the middle of a word or parameter The program begins a continuation line with a double asterisk as a prompt The continuation feature is not shown in the format notation but examples of contin ued commands occur in the discussions of command elements Any characters in a line following a semicolon character or an ampersand are treated as a comment RL51 Command Format Summary Here is a summary of the syntax of the RL51 invocation command Refer to the Preface for an explanation of the command format notation The RL51 command has the overall format Fn J3RLS1 input list TO output file Lcontrol list where input list is a list of filenames separated by commas The files named in input list should contain the relocatable modules to be linked and located in the final absolute output module For each file you can additionally specify which modules are to be included CHAPTER 3 USING THE RL51 PROGRAM Using the RLS1 Program 3 2 output file is the name of the file that is to receive the output module If you omit this entry the program will supply a default name based on the first filename in the input list control list selects options for listing linking and locating the output The listing controls specify what information is to be sent to the listing file and the page width to be used The linking controls s
72. on of segments into a specific range of addresses Allocation Sequence The system allocates memory in accordance with segment attributes and locating controls using a fixed order of precedence The precedence of the allocating opera tions grouped by type of memory space is as follows Internal Data Space e Absolute BIT DATA and IDATA segments and register banks e Segments specified in a PRECEDE control in the RL51 command e Segments specified in a BIT control in the RL51 command e DATA type segments with relocation equal to BIT ADDRESSABLE e Other relocatable bit segments e Segments specified in a DATA control in the RL51 command e DATA type segments with relocation equal to UNIT aligned e Segments specified in an IDATA control in the RL51 command e Other relocatable IDATA segments except STACK e Segments specified in a STACK control in the RL51 command e STACK if it is IDATA and has not been specified in any other locate control External Data Space e Absolute external data segments e Segments specified in an XDATA control in the RL51 command e Other relocatable external data segments Code Space e Absolute code segments e Segments specified in a CODE control in the RL51 command e Other relocatable code segments NOTE In most cases the allocation algorithm will produce a workable solution without requiring the user to enter any locating controls in the RL51 command These controls are intended for the experie
73. ontents of each file Thus source code files can use extensions like SRC A51 or P51 indicating that the code is for input to ASMSI or PL M 51 Object code files receive the extension OBJ by default or the user can specify another extension Executable files generally have no extension Listing files can use LST the default extension given by the translator RL51 uses M51 for the default listing file extension in order not to destroy the ASMSI listing file with the LST extension Library files customarily have the extension LIB Use caution with the extension TMP as many ISIS II utilities including RL51 and LIB51 create temporary files with this extension These utilities will delete your file if it has the same name and extension as the temporary files they create MCS 51 This chapter describes the operation of the RL51 program Most of the process is transparent to the user however an understanding of the operation at the level presented here will help you to use the linking and locating controls in the RL51 invocation More specific details on the allocating process appear in Chapter 3 Major Functions The RL51 program performs the following major functions 1 Selects modules including library processing 2 Combines relocatable partial segments of the same name into a single segment 3 Allocates memory for the combined segments resulting from the
74. or messages D 1 D 2 LINES 3 5 3 6 3 12 linking controls 3 8 A 3 NAME 3 8 linking switches 3 8 DEBUGLINES 3 8 DEBUGPUBLICS 3 8 DEBUGSYMBOLS 3 8 NODEBUGLINES 3 8 NODEBUGPUBLICS 3 8 NODEBUGSYMBOLS 3 8 link summary 3 4 4 1 LIST 6 4 listing controls 3 4 A 3 DEBUG control 3 5 link summary 3 4 listing file 3 4 listing file 4 1 listing switches 3 6 IXREF 4 4 4 5 LINES 3 5 3 6 MAP 3 5 3 6 NOLINES 3 6 NOMAP 3 6 NOPUBLICS 3 6 NOSYMBOLS 3 6 PUBLICS 3 5 3 6 SYMBOLS 3 5 3 6 locating controls 3 9 3 10 3 11 5 9 A 4 BIT 3 9 CODE 3 9 DATA 3 9 IDATA 3 9 PRECEDE 3 9 5 9 STACK 3 9 XDATA 3 9 major functions 2 1 MAP 3 5 memory map 3 4 modifying 1 1 module 1 2 2 1 modular programming 1 1 module name 3 2 NAME 3 8 name 3 2 NODEBUGLINES 3 6 NODEBUGPUBLICS 3 6 NODEBUGSYMBOLS 3 6 Index 1 Index NOIXREF 3 6 4 4 NOLINES 3 5 NOMAP 3 5 NOOVERLAY 3 12 NOPRINT 3 4 notation A 1 NOPUBLICS 3 5 NOSYMBOLS 3 5 output file 3 2 3 3 OVERLAY 3 12 PAGE 2 2 partial segments 2 2 pathname 3 2 PRECEDE 2 3 3 9 5 9 PRINT 3 4 program 1 2 program development 1 1 1 2 PROM programmer 1 1 PUBLICS 3 5 Index 2 MCS 51 RAMSIZE 3 12 relocatable segments 2 1 2 2 relocation 1 3 2 1 RL51 1 3 2 1 2 2 3 1 5 1 command format A 2 controls 3 4 A 1 error messages B 1 thru B 9 pass 2 2 SDK 51 1 3 segment 1 2 2 1
75. ou have attempted to add a module that contains a PUBLIC symbol that is already in the library filename CHECKSUM ERROR See ISIS II error 208 filename OBJECT RECORD TOO SHORT See ISIS II error 217 filename ILLEGAL RECORD FORMAT See ISIS II error 218 LIB51 cannot process the specified file because it is not a legal object file Possible cause is a file damage or translator error MCS 51 APPENDIX E HEXADECIMAL DECIMAL CONVERSION TABLE Table E 1 is for hexadecimal to decimal and decimal to hexadecimal conversion To find the decimal equivalent of a hexadecimal number locate the hexadecimal number in the correct position and note the decimal equivalent Add the decimal numbers To find the hexadecimal equivalent of a decimal number locate the next lower decimal number in the table and note the hexadecimal number and its position Subtract the decimal number shown in the table from the starting number Find the difference in the table Continue this process until there is no difference Table E 1 Hexadecimal Decimal Conversion Table Most Significant Byte Least Significant Byte 0 YO ON ND n m O O D gt J OO O1 B amp ND n M O O D gt oo I O O1 B GO N n M OO OO gt I OO O1 B ND n M O O D gt o i O 1 B ND 0 0 Y C2 CO D D ND ND m m
76. pecify the name of the output module and deter mine what debug information is to be placed in the output file The locating controls allow you to assign absolute addresses to relocatable segments and to specify the order of relocatable segments within a given type of memory The configuration control is used to describe the actual configu ration the object is aimed to The overlay control overlays data segments between modules The next several sections give details and examples of the elements of the RL51 command Table 3 1 gives brief definitions of some of the terms used in the controls A list of abbreviations for command words appears at the end of the chapter Table 3 1 Definitions of Common Terms Names can be from 1 to 40 characters in length and must be composed of letters A Z digits 0 9 or special characters _ The first character must be a letter or a special character module name Same as name Same as name segment name A valid ISIS II filename reference or device reference See next two items for examples pathname filename A reference to a disk file The format is Fn root ext Examples PROG1 F1 SAMPL1 TEST HEX F2 SAMPLE OBJ A reference to a non disk device Examples LP CO TO A 16 bit unsigned integer Examples 1011B 304Q 4096D or just 4096 0C300H Same as value device value address Input L
77. publication on a scale of 1 to 5 5 being the best rating NE run zusam ge neuen e is DATE TITLE COMPANY NAME DEPARTMENT ADDRESS CITY STATE ZIP CODE COUNTRY Please check here if you require a written reply WE D LIKE YOUR COMMENTS This document is one of a series describing Intel products Your comments on the back of this form will help us produce better manuals Each reply will be reviewed All comments and suggestions become the property of Intel Corporation If you are in the United States use the preprinted address provided on this form to return your comments No postage is required If you are not in the United States return your comments to the Intel sales office in your country For your convenience a list of international sales offices is provided on the back cover of this document NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST CLASS PERMIT NO 79 HILLSBORO OR POSTAGE WILL BE PAID BY ADDRESSEE Intel Corporation DTO Technical Publications HF2 38 5200 N E Elam Young Parkway Hillsboro Oregon 97124 9987 Intel INTEL CORPORATION 3065 Bowers Avenue Santa Clara California 95051 408 987 8080 Printed in U S A DEVELOPMENT SYSTEMS 3894 250 0188 OSPS NR DTO
78. ross reference IXREF listing ROM and PROM Versions The absolute object module produced by RL51 can be loaded into members of the MCS 51 family of microcomputers For ROM versions of the microcomputer the program is masked into ROM during the manufacturing process For PROM versions and versions with no on chip CODE memory a PROM programmer is used to load the absolute module into program memory accessible to the microcomputer for execution Refer to the MCS 51 Family of Single Chip Microcomputers User s Manual for details on the versions of microcomputers available ICE 51 In Circuit Emulator The ICE 51 in circuit emulator is used for software and hardware debugging and integration into the final product The absolute object modules produced by RL51 can be loaded into the emulator s memory for execution Refer to the ICE 51 manual listed in the preface for details SDK 51 System Design Kit The SDK 51 system design kit for MCS 51 microcomputers is a useful tool for evalu ation and simple program execution However the SDK 51 requires the hexadecimal object code format output by previous assemblers For use with the SDK 51 the absolute object file must be processed by the OBJHEX code conversion program Refer to the 1S1S II User s Guide for details on OBJHEX Introduction 1 3 Introduction Keeping Track of Files It is convenient to use the extensions of filenames to indicate the stage in the process represented by the c
79. ry 1 The amount of indirectly addressable on chip data memory is machine dependent within the MCS 51 microcomputer family see the discussion of RAMSIZE control in Chapter 3 2 This bit space overlaps byte addresses 20H 2FH in on chip data memory Note Addresses in the special function register memory direct data addresses 80H OFFH bit addresses 80H OFFH cannot be relocated they are always absolute Thus these addresses are not referenced in this table Rule f applies to PL M 51 PL M 51 produces for the stack an IDATA segment called STACK whose size is 1 Although by applying rule f RL51 makes the stack as big as possible it is the user responsibility to ensure that the size of the stack is large enough the segment map shows where the stack is located No rules for the allocation process can guarantee an optimal solution If you are short of memory and RL51 s first try is not satisfactory you can place the segments in memory using the locating controls Details on the locating controls are given in Chapter 3 Overlaying Data Segments On chip RAM is a scarce resource on the MCS 51 To economize the PL M 51 compiler overlays data segments in the compiled module RL 51 completes the work by overlaying the data segments across modules This is accomplished by using the OVERLAY control If RL 51 informed you about ignored segments due to lack of on chip RAM try this control The use of OVERLAY is in general straig
80. s ixref HE case PRINT pathname 1 print NOPRINT pathname see table A 1 pagewidth PAGEWIDTH value value see table A 1 mar map NOMAP bois 1x SYMBOLS symbols NOSYMBOLS ie PUBLICS PUDNCS NOPUBLICS imag EN mes NOLINES aerae LIVRE Denm dnb c LNOTIREF selection list selection item 1 1 Se _ generated selection item f rares jenen GENERATED ne NOGENERATED pese 13 D LIBRARTES ema NOLIBRARIES NAME module name EN J debugsymbols linking control debuglines debugpublics DEBUGSYMBOLS gt nnl Bb DEBUGLINES Me vi NODEBUGLINES DEBUGPUBLICS TERNIR UDICE ET HAT PRECEDE DATA BIT locating controls IDATA segment STACK XDATA CODE segment segment name address MCS 51 MCS 51 Summary of RL51 Controls segment name see table A 1 address see table A 1 configuration control ramsize ramsize RAMSIZE value value see table A 1 overlay control oo Y Coverlay unitl 1 overlay unit ov module name calls ov module name ov module name MP ns module name see table A 1 calls Tables of Listing Linking Locating and OverlayingControls Tables A 2 through A 6 describe the RL51 controls Table A 7 gives abbreviations for the controls Notes On Locating Controls The following notes refer to table A 4 l Bit addresses for non BIT segments in the BIT control must be on byte bounda ries
81. s aria A 3 FIGURES FIGURE TITLE PAGE 1 1 MCS 51 Program Development Process 1 2 4 1 Link Summary oso ea 4 2 4 2 Symbol Table essen 4 3 4 3 IXREF Listing ss ee 4 5 5 1 SAMPI Listing File 5 2 5 2 SAMP2 Listing File 5 4 5 3 SAMP3 Listing File 5 6 5 4 REST Output File as 5 8 MCS 51 TITLE PAGE Linking Controls im ile A 4 Locating Controls esses A 4 Configuration Controls A 4 Overlay Controls m A 5 Abbreviations for Command Words A 5 Hexadecimal Decimal Conversion ll ido qM E ers E 1 TITLE PAGE TESTO1 Assembly Listing File 5 10 RL51 Listing File Without PRECEDE 5 11 RL51 Listing File with PRECEDE 5 12 PL M 51 Listing File of CHK EQ 5 13 ASMSI Listing File of HLTICE 5 14 RLS1 Listing File of CHK EQ 5 15 LIST Command Output 6 4 CHAPTER 1 INTRODUCTION The Advantages of Modular Programming Many programs are too long or complex to write as a single unit Programming becomes much simpler when the code is divided into small functional units Modular programs are usually easier to code debug and change than monolithic programs The modular approach to programming is similar to the design of hardware that contains numerous circ
82. s to build the listing file and fixup i e bind to absolute addresses any relocatable or external references At this point RL51 also processes debug records if requested and performs fixups to any relocatable debug symbols that require processing to compute their absolute addresses 2 5 Introduction The RL51 program performs two functions for MCS 51 programs e The link function combining a number of object modules specified in an input list into a single object module in an output file e The locate function assigning absolute addresses to any relocatable addresses in the input modules This chapter explains how to enter commands how to continue a long command onto more than one input line how to enter comments in the invocation and how to use abbreviations of the command words The chapter then presents a summary of the format of the RL51 invocation command followed by details on the elements of the command with examples Command Entry Continuation Lines and Comments The RL51 command is a standard ISIS II file invocation Terminate the command with the RETURN key Note that the terminating carriage return is not shown in the command format notation Because of the many options available with the RL51 command command lines can become very long To break a command into several input lines use the continuation character an ampersand 4 before the RETURN to end intermediate lines
83. specified module is not processed WARNING 8 MODULE NAME EXPLICITLY REQUESTED FROM ANOTHER FILE MODULE file name module name The specified module was requested explicitly to be processed from another file that has not yet been processed The specified module is not processed WARNING 9 EMPTY ABSOLUTE SEGMENT MODULE file name module name The specified module contains an empty absolute segment This segment is not allocated The base address of this segment may be overlapped without any additional message Errors ERROR 101 SEGMENT COMBINATION ERROR SEGMENT segment name MODULE file name module name The attributes of the specified partial segment in the specified module contradict those of previous unspecified occurrences of partial segments with the same name The segment is ignored ERROR 102 EXTERNALS ATTRIBUTE MISMATCH SYMBOL external name MODULE file name module name The attributes of the specified external symbol in the specified module contradict those of previous unspecified occurrences of public symbol with the same name The specified symbol is ignored ERROR 103 EXTERNAL ATTRIBUTES DO NOT MATCH PUBLIC SYMBOL symbol name MODULE file name module name The attributes of the specified external public symbol in the specified module contradict those of previous unspecified occurrences of public external symbol with the same name The specified symbol is ignored ERROR 104 MULTIPLE PUB
84. st file to a device other than a disk file the print control format is PRINT device where device is an ISIS II device code Common devices are CO console LP line printer TO terminal other than console and VO video terminal screen If you omit the print control or if you enter the command word PRINT without a filename or device name RL51 creates a disk file for the listing The name of the default listing file has the same root as the output filename and has an exten sion of M51 the drive number is also the one used in the output filename Example RLS1 F1 PROG OBJ F1 PROG1 0BJ TO F2 PROG2 ABS Since this command does not specify a listing file destination the system creates a default file named PROG2 MS1 on drive 2 The output listing filename may not be the same as the output filename or any of the filenames in the input list If the listing file duplicates an input or output filename a fatal error results If the listing filename already exists on the target drive the old file with that name is overwritten by the new listing file The NOPRINT option specifies that no output listing file is to be produced NOPRINT overrides the MAP SYMBOLS PUBLICS LINES and IXREF controls PAGEWIDTH The PAGEWIDTH control specifies the maximum number of columns per line in the print output file The control takes the form 3 5 Using the RLS1 Program PAGEWIDTH width where width is an unsigned number
85. starts over again 53 GET NUM 0026 7AG4 54 MOV R2 4 set up string length as 4 0028 A900 55 MOV R1 AR R value may be needed for restart 56 GET LOOP 0QU2A 120009 F 57 CALL get char 58 Next 4 instr s handle X the routine starts Figure 5 2 SAMP2 Listing File MCS 51 2D 2F 0032 0035 C2E7 B41805 120090 89EF F7 09 DAEF 22 0037 0038 0039 0038 3098FD C298 E599 22 99 3C 3F 0041 0043 SYMBOL TABLE N AM E AGO a lt s a ARD Lee de CONSOLE IO CR 5 His d EXIT u GET CHAR GET LOOP GET NUM GO ON lt s IO ROUTINES EE n uode e PUT CHAR PUT CRLF PUT DATA STR PUT STRING BI X uw xu a SBUF ta da jj EP REGISTER BANK S USED ASSEMBLY COMPLETE LISTING UU 0000000 WOraaaa Y P ADDR ADDR NUMB ADDR ADDR ADDR ADDR ADDR SEG NUMB ADDR ADDR ADDR ADDR ADDR ADDR ADDR E Y V L E H V H DH LSH 3CH 002AH 0026H 003 7H 44H AH LEH H l6H BH 98H 99H 9998H y TAR Examples of Program Development over if received CLR ACC 7 CINE A 18H GO ON CALL put crif JMP get num GO ON MOV R1 A INC RL DJNZ R2 get loop RET clear the parity bit if not X go on Get a single character from console The character is returned in A GET CHAR JNB RI S CLR RI MOV A SBUF RET END U E ATTRIBUTES A A A R SEG I
86. that is they must be divisible by eight BIT type segments can be aligned on bit boundaries 2 Therange of addresses for the IDATA control is dependent on the target machine The 8051 has 128 bytes addresses 00H 7FH See the RAMSIZE control in this context 3 The STACK control specifies which segments are to be allocated uppermost in the IDATA space The memory accessed starts after the highest on chip RAM address occupied by any previously allocated segment and continues to the top of the IDATA space NOTE This control has no other effect on any segments The IDATA STACK segment if it exists is placed higher than segments that were mentioned in the STACK control Table A 2 Listing Controls O RN PRINT pathname Sends the listing file to the file or device specified by pathname NOPRINT Suppresses the listing file overrides any of the following listing controls PAGEWIDTH value Specifies the maximum page width to be used MAP Outputs memory map to link summary NOMAP Suppresses memory map SYMBOLS Outputs local symbols to symbol table NOSYMBOLS Suppresses local symbols Summary of RLS1 Controls Table A 2 Listing Controls Cont d O RN PUBLICS Outputs public symbols to symbol table NOPUBLICS Suppresses public symbols LINES Outputs line numbers to symbol table high level language translators only NOLINES Suppresses line numbers IXREF selection list Appends inter
87. the command words in the RL51 command have short forms to save you keystrokes over the full spellings Here is a list of the command words and their abbreviations Command Word Abbreviation BIT BI CODE CO DATA DT DEBUGLINES DL DEBUGPUBLICS DP DEBUGSYMBOLS DS GENERATED GN IDATA ID IXREF IX Using the RLS1 Program Command Word LIBRARIES LINES MAP NAME NODEBUGLINES NODEBUGPUBLICS NODEBUGSYMBOLS NOGENERATED NOIXREF NOLIBRARIES NOLINES NOMAP NOOVERLAY NOPRINT NOPUBLICS NOSYMBOLS OVERLAY PAGEWIDTH PRECEDE PRINT PUBLICS RAMSIZE MCS 51 Abbreviation RL51 OUTPUTS The RL51 program produces three outputs console displays a listing file and the absolute object module file This chapter describes these outputs and gives examples As discussed in Chapter 3 the listing controls in the RL51 command allow the user to suppress some information in the listing file and the linking controls can suppress some information in the absolute object file Console Display The console displays produced by RL51 consist of a sign on message and any error messages that occur The sign on is as follows ISIS II MCS 51 RELOCATOR AND LINKER Vxy where X y is the version number Listing File RL51 produces a listing file unless it is suppressed in the RL51 invocation The RL51 listing file contains e summary of the link and locate process e A symbol table as specified in the RL51 invocation
88. the examples assume drive 0 RL51 F1 SAMP1 0BJ F1 SAMP2 0BJ F1 SAMP3 0BJ 4 T0 F2 SAMP ABS In this example the input list has three files RLS1 links all the modules in each of these files into the output file Note that the in the second line of the example is generated by the system in response to the continuation character amp on the first line of the example RL51 F1 PROG1 0BJ CMOD1 MOD3 F1 PROG2 0BJ MOD2 4 TO F1 PROG3 ABS Here the input list has two input files PROGI OBJ and PROG2 OBJ From PROGI OBJ only the modules named MODI and MOD3 are to be linked into the output file any other modules in file PROG1 OBJ are ignored by RL51 From PROG2 OBJ only the module named MOD is to be linked RLS1 F1 PLMPRG OBJ F1 UTILS1 LIB F1 1051 LIB PLMS1 LIB The example introduces a typical linking using libraries Here PLMPRG is linked with two private libraries and with the mandatory library PLMS1 LIB which must be used if modules generated by PLMS1 participate in the linkage RL51 F1 EXAMPL 0BJ COTRIG LIB TRIG LIB COTRIG LIB Interaction between libraries i e libraries that reference each other may sometimes require the same library to be mentioned twice in the input list In the preceding example COTRIG LIB contains the COTANGENT and COSINE trigonometric functions TRIG LIB contains the SINE and TANGENT function and EXAMPL OBJ references the COTANGENT function Since COTANGENT 1 TANGENT TR
89. tput public symbols to symbol table NOPUBLICS Suppress public symbols LINES Output line numbers to symbol table high level language transla tors only NOLINES Suppress line numbers IXREF Append intermodule cross reference report to print file NOIXREF Suppress the intermodule cross reference report MCS 51 MCS 51 Using the RL51 Program The NOGENERATED control causes RL51 to surpress output of entries whose symbol name begins with a question mark such symbols are usually PL M 51 generated symbols The GENERATED form of the control causes RL51 to output such entries also The NOLIBRARIES control causes RL51 to surpress output of entries whose module resides within a library The LIBRARIES form of the control causes RLS1 to include all libraries in the IXREF report The selection list is used to control the number of entries collected for the IXREF report This is needed when an excessive number of IXREF entries make it impossi ble for RL51 to generate the IXREF report Examples Because the default for any listing switch except IXREF is the positive form the main use of the switches is to suppress unwanted information To suppress the entire symbol table for example the command would be RL51 F1 PROG OBJ NOSYMBOLS NOPUBLICS NOLINES As another example to see only the public symbols no map or other symbols or lines the command is RL51 F1 PROG OBJ PRINT F2 PROG M51 NOMAP NOSB NOLI Note the use of abbre
90. trol e The segments are marked as overlayable Currently this is done only by the PL M 51 compiler ASM51 V2 1 and lower lacks this feature Therefore assembler segments are considered non overlayable e The segments belong to disjoint modules That is no procedure in one module can directly or indirectly call a procedure from the other The default is NOOVERLAY No overlaying of on chip RAM segments is done by the linker The general form of the OVERLAY control is as follows OVERLAY Coverlay unit 1 where overlay unit is ov module name calls ov module name ov module name is a legal RL51 module name or which stands for all the module names calls is gt MCS 51 MCS 51 Using the RL51 Program OVERLAY If the OVERLAY control appears in the invocation line without arguments the linker assumes that no intra module calls exist except for those deducible from the PUBLIC EXTERNAL declarations and that overlaying of all overlayable segments is safe NOOVERLAY The linker does not overlay data segments OVERLAY A gt B If the OVERLAY control appears in the invocation line with arguments it indicates that there are invisible calls between modules The notation A gt B means that module A calls module B In this case the linker overlays all overlayable segments except that segments from A are not overlaid by segments from B Note that the added connection can prevent other segments from overlaying
91. trols in the list The same control may not appear more than once in the list if a duplicate control is encountered a fatal error results and the program aborts The next several sections explain the controls and give examples Listing Controls The listing file output by RLS1 can contain a link summary a symbol table an IXREF report and a list of error messages The link summary can contain a memory map of the linked segments The listing controls are the PRINT option the PAGEWIDTH control the MAP option the SYMBOLS option the PUBLICS option the LINES option and the IXREF option These controls allow you to specify the file or device to receive the output listing to omit the listing file altogether to omit the map from the link summary or to omit local symbols public symbols or line numbers from the symbol table You may also specify if you wish to have the IXREF report generated and the specific page width to be used MCS 51 MCS 51 Using the RL51 Program NOTE The information in the listing file is taken from the input object modules If these are generated without the DEBUG option the SYMBOLS PUBLICS and LINES information will not be available for listing PRINT NOPRINT The print options control the destination of the list file To direct the list file to a disk file the print control format is PRINT CL Fn filenamel ext Example RLS1 F1 SAMPLE1 OBJ 4 SPRINT C F1 SAMPLE LST To direct the li
92. uits The device or program is logically divided into black boxes with specific inputs and outputs Once the interfaces between the units have been defined detailed design of each unit can proceed separately Efficient Program Development Programs can be developed more quickly with the modular approach because small subprograms are easier to understand design and test than large programs With the module inputs and outputs defined the programmer can supply the needed input and verify the correctness of the module by examining the output The separate modules are then linked and located into one program module Finally the completed program is tested Multiple Use of Subprograms Code written for one program is often useful in others Modular programming allows these sections to be saved for future use Because the code is relocatable saved modules can be linked to any program that fulfills their input and output requirements With monolithic programming such sections of code are buried inside the program and are not so available for use by other programs If you put your frequently used subprograms into a library RL51 will take care to load only those you need Thus you can save RAM and ROM without having to keep track of what is needed and what is not Ease of Debugging and Modifying Modular programs are generally easier to debug than monolithic programs Because the modular interfaces are well defined problems can be isolate
93. ur digit hexadecimal number example O0EOH A bit address unless it is on a byte boundary is shown as a byte address followed by a period and the bit offset 1 through 7 into the byte o TYPE The type field identifies the entry as a local symbol SYMBOL a public symbol PUBLIC segment SEGMENT or a line number LINE e NAME The name field gives the name of the symbol or the number of the line For scope definition a line is printed for the beginning and end of each block The TYPE field shows the type of block MODULE DO or PROC for PROCEDURE and the end of each block ENDMOD ENDDO ENDPROC The NAME field shows the name of the block if any NOTE Line number information and scope definitions other than MODULE are applicable only to object files produced by high level language translators e g PL M 51 Inter Module Cross Reference Report IXREF The listing file contains an IXREF report as specified by the IXREF control and its associated selection list in the RL51 invocation A sample IXREF report is shown in figure 4 3 The IXREF report consists of an alphabetically sorted list of symbols Each such symbol begins a new line and represents a symbol that was declared as PUBLIC or EXTERNAL in at least one of the input modules Each symbol is followed by its corresponding address space followed by a semicolon To the right of the semicolon starts a list of modules in which the symbol was declared PUBLIC or EXTERNA
94. ute A relocatable segment in a module can be a complete segment or can be a partial segment to be combined with other partial segments from other modules A relocatable segment has a name type and other attributes that allow the linker to combine it with other partial segments if required and to correctly locate the segment An absolute segment has no name and cannot be combined with other segments See Chapter 2 for more detail on partial segments A module contains one or more segments or partial segments A module has a name assigned by the user The module definitions determine the scope of local symbols An object file contains one or more modules You can add modules to a file by trans fering the new modules from their individual files to another file e g COPY filel file2 TO file3 A library is a file that contains one or more modules A library file is internally marked as a library so RL51 can easily identify it as such RL51 selects out of the modules in the library only those previously referenced Libraries are created using the LIBS1 utility which is described in detail in Chapter 6 A program consists of a single absolute module merging all absolute and relocatable segments from all input modules The name of the output module produced by RLS1 can be defined by the user or allowed to default to the name of the first input module MCS 51 Entering and Editing Source Modules After the design is completed use t
95. viations NOSB for NOSYMBOLS and NOLI for NOLINES to save keystrokes A complete list of abbreviated forms appears at the end of this chapter Note that the blank separating PRINT from its parameters is optional you could also use PRINT F2 PROG MS1 In order to suppress generated symbols from the IXREF report the command is RLS1 F1 PROG OBJ F1 PROCS OBJ F1 PLMS1 LIB IXREFCNOGN Using the NOGN NOGENERATED selection item prevents PL M 51 run time library procedures from being written to the IXREF report Linking Controls The linking controls allow you to name the resultant output module and to specify which debug information is to be copied to the output module NOTE In order to obtain the debug information SYMBOLS PUBLICS or LINES the DEBUG control must be included in the invocation line for the translator used to produce the input modules 3 7 Using the RL51 Program MCS 51 3 8 NAME The NAME control allows you to name the output module The format is NAME module name If the NAME control is not used the output module name defaults to the name of the first input module processed Example FISRLSI FI SAMPL1 0BJ F1 SAMPL2 0BJ TO F1 SAMPLE ABS 4 NAMECSAMPLE PROGRAM In this example the name SAMPLE PROGRAM is assigned to the output module Note that the blank between NAME and its parameter is optional and can be omitted as shown in the example Linking Switches The DEBUGSYMBOLS DEBUGPU
96. which specifies the maximum page width to be used The allowable range for width is 72 to 132 The default PAGEWIDTH is 78 Listing Switches The MAP SYMBOLS PUBLICS LINES and IXREF controls select what portions of the listing files are to be generated The default of any switch with the exception of IXREF is the positive form MAP SYMBOLS PUBLICS and LINES Table 3 2 summarizes the listing switches IXREF NOIXREF This control specifies whether or not to produce the inter module cross reference report If IXREF is specified the report is appended to the print file A selection list may be added to the positive form only of the IXREF control A selection list causes RL51 to output or suppress output of various selected entries to the IXREF report An entry consists of a symbol and a module where this symbol is referenced either as public or as external The general form of the IXREF control is IXREF L Cselection item L 12 2 where selection item is either NO GENERATED or NO LIBRARIES If IXREF is specified and any of the selection items are omitted the missing selection item assumes its positive form A selec tion item may appear at most once Th selection items are best explained by describing the effect of their negative form Table 3 2 Listing Switches Output memory map to link summary NOMAP Suppress memory map SYMBOLS Output local symbols to symbol table NOSYMBOLS Suppress local symbols PUBLICS Ou
97. y is the version number While in LIB51 you will receive the asterisk prompt after each command is completed Following the asterisk prompt you may enter any of the following LIB51 subcom mands ADD CREATE DELETE EXIT LIST The Command Line If the command line is longer than a line on your particular console up to the maximum of 122 characters allowed you may continue it on the next line by enter ing an ampersand amp as the last non blank character on the line before executing the carriage return LIB51 responds to this with a double asterisk prompt to let you know that it is ready for the continuation of the command line TER 6 6 1 LIBS1 Librarian MCS 51 6 2 LIBS1 uses a temporary file named LIB TMP on the library file disk If you have a file with this name it will be destroyed Error Messages Appendix D lists the error messages generated by LIBS1 LIB51 Subcommands Each of the LIB51 subcommands is described on the following pages The syntax and definition of each subcommand is given along with an example of its use ADD The ADD command adds modules to a specified library Syntax ADD filenamel modname 11 1 TO library Definition This command inserts modules into the library The modules may be elements of another library or they may be in object files filename is the name of the file containing at least one object module modname is the name
Download Pdf Manuals
Related Search
Related Contents
NuTone PFOB-52 Fan User Manual UM1512 User manual - STMicroelectronics AIR QUALITY MONITOR Lightolier PE2M1675 User's Manual Sharp LC-40LE700UN 40" Full HD Black LCD TV 「民法(債権関係)の改正に関する 中間的な論点整理 Copyright © All rights reserved.
Failed to retrieve file