* as/doc/asxhtm.html: documented changed ABS behaviour
[fw/sdcc] / as / doc / README
index abaaf35b8ccfda2354d4c01ee1815164b4565cd9..7b8effad2cb95f848ecaaacf088b764be231779e 100644 (file)
@@ -24,7 +24,7 @@ The changes are of three types
 ========================================================================
 MISCELLANEOUS CHANGES
 
-* There is a bug in LKMAIN: it tests S_DEF flag in "s_flag".  
+* There is a bug in LKMAIN: it tests S_DEF flag in "s_flag".
   No one else uses s_flag in the linker - S_DEF is defined in s_type
   instead.  Presumably LKMAIN should use s_type as well?  Changed.
 
@@ -41,9 +41,9 @@ MISCELLANEOUS CHANGES
   case insensitive, regardless of the CASE_SENSITIVE flag.  This simplifies
   using the assembler on existing code.
 
-* The scheme described below for debug information can make for very long 
-  symbol names.  Thus, I have modified the assembler and linker to allow 
-  names up to 80 characters, moving the name strings out of the sym struct.  
+* The scheme described below for debug information can make for very long
+  symbol names.  Thus, I have modified the assembler and linker to allow
+  names up to 80 characters, moving the name strings out of the sym struct.
   This will save significant heap space over simply increasing NCPS to 80.
 
 * I have added one module, ASNOICE.C, to each assembler; and one module,
@@ -62,7 +62,7 @@ It is comprised of the modules:
     i51mch.c
     i51adr.c
     i51ext.c
-    appexdk.txt "Appendix K" about the 8051 for the documentation
+    appendk.txt "Appendix K" about the 8051 for the documentation
 
 I added four attributes to the .area directive to support
 the 8051's multiple address spaces:
@@ -75,7 +75,7 @@ These will typically be used as follows (names are examples):
        .area   IDATA (DATA)
        .area   IBIT (BIT)
        .area   MYXDATA (REL,CON,XDATA)
-        .area  MYCODE (REL,CON,CODE)
+       .area   MYCODE (REL,CON,CODE)
 
 The default segment, _CODE, should not be used for the 8051.  For
 compatibility reasons, _CODE is allocated in "DATA" space.  You
@@ -102,15 +102,15 @@ A comment in lkrloc says
     * as an 'r' error by the assembler,
     * but it is processed here anyway.
 This is no longer true, so the code in question is #defined out
-in the linker only.  I suspect that thie would cause problems
+in the linker only.  I suspect that this would cause problems
 if a module with R_WORD | R_BYT1 by other cause were to be processed.
 
 I am not entirely happy with outr11 in the case where the destination
 is an absolute value.  The ideal would be to pass the value thru to the
 linker, and resolve at link time whether or not the address is within
 2K of the instruction location.  Unfortunately, I couldn't figure out
-how to pass an absolute value to the linker, as it has no area.  Thus, 
-I interpreted absolute values as being relative to the beginning of the 
+how to pass an absolute value to the linker, as it has no area.  Thus,
+I interpreted absolute values as being relative to the beginning of the
 current area, as is done in the other assemblers for relative branch
 instructions.  I am less happy with this solution here, as a 2K range
 is far larger than the +-128 for a branch instruction.  I can envision
@@ -130,7 +130,7 @@ SOURCE-LEVEL DEBUG OF ASSEMBLY CODE WITH NoICE
    file.  You may also wish to use the "-a" switch to make all symbols
    global.  Non-global symbols are not passed to the object file.
 
-2) The assemblers will pass any line beginning with the characters 
+2) The assemblers will pass any line beginning with the characters
    ";!" (semi-colon, exclamation point) intact to the object file.
    You can use such comments in your assembly modules to embed NoICE
    commands in your source code.
@@ -141,7 +141,7 @@ SOURCE-LEVEL DEBUG OF ASSEMBLY CODE WITH NoICE
    ";!" comments will be included.  Specifying the -j switch will force
    a map file to be produced as well.
 
-4) The linker will process any line beginning with the characters 
+4) The linker will process any line beginning with the characters
    ";!" (semi-colon, exclamation point) by removing the ";!" and
    passing the remainder of the line to the .NOI file (if any).
    This allows NoICE commands to be placed as ";!" comments in
@@ -152,8 +152,8 @@ SOURCE-LEVEL DEBUG OF ASSEMBLY CODE WITH NoICE
    switches), a LOAD command for the hex file will be placed in the
    .NOI file (if any).
 
-6) The linker will output the ";!" lines after all symbols have been 
-   output.  Thus, such lines can contain NoICE commands which refer to 
+6) The linker will output the ";!" lines after all symbols have been
+   output.  Thus, such lines can contain NoICE commands which refer to
    symbols by name.
 
 ========================================================================
@@ -172,7 +172,7 @@ with certain formats described below.
    described below.  if your project contains a mixture of C and assembly
    source files, you may wish to use "-j" on the assembly modules.
 
-2) The assemblers will pass any line beginning with the characters 
+2) The assemblers will pass any line beginning with the characters
    ";!" (semi-colon, exclamation point) intact to the .REL file.
    The compiler can make use of this fact to pass datatype information
    and stack offsets for automatic symbols through the assembler and
@@ -183,7 +183,7 @@ with certain formats described below.
    will be as described below.  Specifying the -j switch will force
    a map file to be produced as well.
 
-4) The linker will process any line beginning with the characters 
+4) The linker will process any line beginning with the characters
    ";!" (semi-colon, exclamation point) by removing the ";!" and
    passing the remainder of the line to the .NOI file (if any).
 
@@ -201,15 +201,15 @@ with certain formats described below.
        text.integer
 
    into NoICE FILE and LINE (line number) commands in the .NOI output file.
-   It will assume that "text" is the file name without path or extension, 
+   It will assume that "text" is the file name without path or extension,
    that "integer" is the decimal line number within the file, and that
-   the value of the symbol is equal to the address of the first instruction 
+   the value of the symbol is equal to the address of the first instruction
    produced by the line.
 
 8) The linker will process symbols with names of the form
        text.name
 
-   into NoICE FILE and DEFINESCOPED commands in the .NOI file 
+   into NoICE FILE and DEFINESCOPED commands in the .NOI file
    (if any), to define file-scope variables:
        FILE text
        DEFS name symbolvalue
@@ -217,7 +217,7 @@ with certain formats described below.
 9) The linker will process symbols with names of the form
        text.name.name2
 
-   into NoICE FILE, FUNCTION, and DEFINESCOPED commands in the 
+   into NoICE FILE, FUNCTION, and DEFINESCOPED commands in the
    .NOI file (if any), to define function-scope variables:
        FILE text
        FUNC name
@@ -226,7 +226,7 @@ with certain formats described below.
 10) The linker will process symbols with names of the form
        text.name.name2.integer
 
-   into NoICE FILE, FUNCTION, and DEFINESCOPED commands in the 
+   into NoICE FILE, FUNCTION, and DEFINESCOPED commands in the
    .NOI file (if any), to define function-scope variables, to allow
    multiple scopes within a single C function.  "Integer" is a scope
    number, and should be zero for the first scope, and increment
@@ -242,7 +242,7 @@ with certain formats described below.
 11) The linker will process symbols with names of the form
        text.name..FN
 
-   into NoICE FILE, DEFINE, and FUNCTION commands in the .NOI 
+   into NoICE FILE, DEFINE, and FUNCTION commands in the .NOI
    file (if any), to define the start of a global function:
        FILE text
        DEF  name symbolvalue %code
@@ -251,7 +251,7 @@ with certain formats described below.
 12) The linker will process symbols with names of the form
        text.name..SFN
 
-   into NoICE FILE, DEFINESCOPED, and SFUNCTION commands in the .NOI 
+   into NoICE FILE, DEFINESCOPED, and SFUNCTION commands in the .NOI
    file (if any), to define the start of a file-scope (static)
    function:
        FILE text
@@ -277,17 +277,17 @@ example file ctest1.c, and the hypothetical ctest1.s produced by
 compiling it illustrate this.  The comments in the file describe
 the information, but would not be present in an actual implementation.
 
-1) Begin each file with a ";!FILE" specifying the file name and its 
-   original extension (usually ".c"), and with the path if the file is 
+1) Begin each file with a ";!FILE" specifying the file name and its
+   original extension (usually ".c"), and with the path if the file is
    not in the current directory.
        ;!FILE ctest1.c
 
-2) Define any basic data types: char defaults to S08.  Redefine as U08 or 
+2) Define any basic data types: char defaults to S08.  Redefine as U08 or
    ASCII if you desire.  "int" defaults to S16.  Redefine if necessary.
        ;!DEFT 0 char %ASCII
 
-3) Define any data structures, typedefs, enums, etc. (C generally 
-   does this per source file.  Types will remain in scope unless 
+3) Define any data structures, typedefs, enums, etc. (C generally
+   does this per source file.  Types will remain in scope unless
    redefined).  For example, the C structure
 
        typedef struct {
@@ -305,11 +305,11 @@ the information, but would not be present in an actual implementation.
        ;!DEFT 23. pi %*int
        ;!ENDS 25.
 
-   Since the user can change input radix at will, it is generally 
+   Since the user can change input radix at will, it is generally
    recommended to specify radix explicitly in the ;! commands: by
    a trailing "." for decimal, or leading "0x" for hex.
 
-4) Use ;!FUNC, (or ;!SFUNC), ;!DEFS, and ;!ENDF to define any 
+4) Use ;!FUNC, (or ;!SFUNC), ;!DEFS, and ;!ENDF to define any
    function arguments and local variables.  The function
        void main( void )
        {
@@ -339,13 +339,13 @@ the information, but would not be present in an actual implementation.
 
 5) In general, it is desirable to generate two symbols for each
    function:  one with an underbar, at the first byte of the
-   function, so that the disassembler will show it as the destination 
+   function, so that the disassembler will show it as the destination
    of the JSR; and a second without an underbar at the address of
    the first source line after stack frame is set up.  The latter
    will be a common breakpoint location.
 
    CUG292 can generate global symbols by using a "::"
-       _main::         
+       _main::
                tsx
                xgdx
                subd #44
@@ -365,13 +365,13 @@ the information, but would not be present in an actual implementation.
                ldd #6
                std  _gestr
 
-8) Declare the end of the function body.  The value of this symbol 
-   is the highest address which NoICE will consider to be within the 
-   function for scoping purposes.  The address must be on or before 
+8) Declare the end of the function body.  The value of this symbol
+   is the highest address which NoICE will consider to be within the
+   function for scoping purposes.  The address must be on or before
    the RTS, so that it does not overlap the following function.
-   Normally, the address will be the last C source line in the 
+   Normally, the address will be the last C source line in the
    function before stack frame is destroyed.
-       ctest1.main..EFN::      
+       ctest1.main..EFN::
                xgdx
                addd #44
                xgdx
@@ -379,7 +379,7 @@ the information, but would not be present in an actual implementation.
                rts
 
 9) Global variables defined in the file, and their datatypes, may be
-   defined at any time.  Debugging is most convenient if the 
+   defined at any time.  Debugging is most convenient if the
    traditional C leading underbar is omitted.  The global declarations
        int gi;
        STR *pgstr;
@@ -397,9 +397,9 @@ the information, but would not be present in an actual implementation.
    the assembler, while the "::" defintion defines the value, which
    is unknown until link time.
 
-10) File-scope static variables, and their datatypes, must be defined 
+10) File-scope static variables, and their datatypes, must be defined
    between the ;!FILE and the ;!ENDFILE in order to set proper scope.
-   Debugging is most convenient if the traditional C leading underbar 
+   Debugging is most convenient if the traditional C leading underbar
    is omitted.  The static declarations
        static int si;
        static STR sstr;
@@ -417,10 +417,10 @@ the information, but would not be present in an actual implementation.
    the "::" definitions may be elsewhere in the file if it is
    convenient, as the symbol name carries the scoping information.
 
-11) Function-scope static variables, and their datatypes, must be 
+11) Function-scope static variables, and their datatypes, must be
    defined between the ;!FUNC (or ;!SFUNC) and the corresponding
-   ;!ENDF in order to set proper scope.  Debugging is most convenient 
-   if the traditional C leading underbar is omitted.  The static 
+   ;!ENDF in order to set proper scope.  Debugging is most convenient
+   if the traditional C leading underbar is omitted.  The static
    declarations
        void main( void )
        {
@@ -449,7 +449,7 @@ the information, but would not be present in an actual implementation.
        ;!ENDFILE
 
         CTEST1.C - sample C source code
-        CTEST1.S - output from ImageCraft compiler, hand-doctored 
+        CTEST1.S - output from ImageCraft compiler, hand-doctored
                    to add additional debug information
        CTEST2.C - second C module
         CTEST2.S - output from ImageCraft compiler, undoctored