# HG changeset patch # User lost # Date 1233035752 0 # Node ID f643e2ff0008c5dbbde8765a68f40e8e0d301311 # Parent faf43dc805c97a0509047b6abfa9e30e64bb0699 Fix up some bogosity that prevented automake from working right diff -r faf43dc805c9 -r f643e2ff0008 Makefile.am --- a/Makefile.am Tue Jan 27 05:26:55 2009 +0000 +++ b/Makefile.am Tue Jan 27 05:55:52 2009 +0000 @@ -1,2 +1,2 @@ SUBDIRS = src -DIST_SUBDIRS = doc +DIST_SUBDIRS = doc src diff -r faf43dc805c9 -r f643e2ff0008 configure.ac --- a/configure.ac Tue Jan 27 05:26:55 2009 +0000 +++ b/configure.ac Tue Jan 27 05:55:52 2009 +0000 @@ -5,5 +5,6 @@ AC_CONFIG_FILES([ Makefile src/Makefile + doc/Makefile ]) AC_OUTPUT diff -r faf43dc805c9 -r f643e2ff0008 doc/Makefile.am --- a/doc/Makefile.am Tue Jan 27 05:26:55 2009 +0000 +++ b/doc/Makefile.am Tue Jan 27 05:55:52 2009 +0000 @@ -1,3 +1,3 @@ -EXTRA_DIST = lwasm.txt internals.txt pseudo\ ops.txt object\ files.txt +EXTRA_DIST = lwasm.txt internals.txt pseudoops.txt objectfiles.txt diff -r faf43dc805c9 -r f643e2ff0008 doc/object files.txt --- a/doc/object files.txt Tue Jan 27 05:26:55 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -An object file consists of a series of sections each of which contains a -list of exported symbols, a list of incomplete references, and a list of -"local" symbols which may be used in calculating incomplete references. Each -section will obviously also contain the object code. - -Exported symbols must be completely resolved to an address within the -section it is exported from. - -Each object file starts with a magic number and version number. The magic -number is the string "LWOBJ16" for this 16 bit object file format. The only -defined version number is currently 0. Thus, the first 8 bytes of the object -file are: - -4C574F424A313600 - -Each section has the following items in order: - -* section name -* flags -* list of local symbols (and addresses within the section) -* list of exported symbols (and addresses within the section) -* list of incomplete references along with the expressions to calculate them -* the actual object code - -The section starts with the name of the section with a NUL termination -followed by a series of flag bytes terminated by NUL. The following flag -bytes are defined: - -Byte Meaning -00 no more flags -01 section is BSS - no actual code is present - -Either a NULL section name or end of file indicate the presence of no more -sections. - -Each entry in the exported and local symbols table consists of the symbol -(NUL terminated) followed by two bytes which contain the value in big endian -order. The end of a symbol table is indicated by a NULL symbol name. - -Each entry in the incomplete references table consists of an expression -followed by a 16 bit offset where the reference goes. Expressions are -defined as a series of terms up to an "end of expression" term. Each term -consists of a single byte which identifies the type of term (see below) -followed by any data required by the term. Then end of the list is flagged -by a NULL expression (only an end of expression term). - -TERMTYPE Meaning -00 end of expression -01 integer (16 bit in big endian order follows) -02 external symbol reference (NUL term symbol) -03 local symbol reference (NUL term symbol) -04 operator (1 byte operator number - see below) -05 section base address reference - -External references are resolved using other object files while local -references are resolved using the local symbol table(s) from this file. This -allows local symbols that are not exported to have the same names as -exported symbols or external references. - -The operator numbers are: - -NUM OP -01 + (plus) -02 - (minus) -03 * (times) -04 / (divide) -05 % (modulus) -06 \ (integer division) -07 bitwise and -08 bitwise or -09 bitwise xor -0A boolean and -0B boolean or -0C - (unary negation, 2's complement) -0D ^ (unary 1's complement) - -An expression is represented in a postfix manner with both operands for -binary operators preceding the operator and the single operand for unary -operators preceding the operator. diff -r faf43dc805c9 -r f643e2ff0008 doc/objectfiles.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/objectfiles.txt Tue Jan 27 05:55:52 2009 +0000 @@ -0,0 +1,79 @@ +An object file consists of a series of sections each of which contains a +list of exported symbols, a list of incomplete references, and a list of +"local" symbols which may be used in calculating incomplete references. Each +section will obviously also contain the object code. + +Exported symbols must be completely resolved to an address within the +section it is exported from. + +Each object file starts with a magic number and version number. The magic +number is the string "LWOBJ16" for this 16 bit object file format. The only +defined version number is currently 0. Thus, the first 8 bytes of the object +file are: + +4C574F424A313600 + +Each section has the following items in order: + +* section name +* flags +* list of local symbols (and addresses within the section) +* list of exported symbols (and addresses within the section) +* list of incomplete references along with the expressions to calculate them +* the actual object code + +The section starts with the name of the section with a NUL termination +followed by a series of flag bytes terminated by NUL. The following flag +bytes are defined: + +Byte Meaning +00 no more flags +01 section is BSS - no actual code is present + +Either a NULL section name or end of file indicate the presence of no more +sections. + +Each entry in the exported and local symbols table consists of the symbol +(NUL terminated) followed by two bytes which contain the value in big endian +order. The end of a symbol table is indicated by a NULL symbol name. + +Each entry in the incomplete references table consists of an expression +followed by a 16 bit offset where the reference goes. Expressions are +defined as a series of terms up to an "end of expression" term. Each term +consists of a single byte which identifies the type of term (see below) +followed by any data required by the term. Then end of the list is flagged +by a NULL expression (only an end of expression term). + +TERMTYPE Meaning +00 end of expression +01 integer (16 bit in big endian order follows) +02 external symbol reference (NUL term symbol) +03 local symbol reference (NUL term symbol) +04 operator (1 byte operator number - see below) +05 section base address reference + +External references are resolved using other object files while local +references are resolved using the local symbol table(s) from this file. This +allows local symbols that are not exported to have the same names as +exported symbols or external references. + +The operator numbers are: + +NUM OP +01 + (plus) +02 - (minus) +03 * (times) +04 / (divide) +05 % (modulus) +06 \ (integer division) +07 bitwise and +08 bitwise or +09 bitwise xor +0A boolean and +0B boolean or +0C - (unary negation, 2's complement) +0D ^ (unary 1's complement) + +An expression is represented in a postfix manner with both operands for +binary operators preceding the operator and the single operand for unary +operators preceding the operator. diff -r faf43dc805c9 -r f643e2ff0008 doc/pseudo ops.txt --- a/doc/pseudo ops.txt Tue Jan 27 05:26:55 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -The following pseudo operations are understood by LWASM. - -SECTION - -This introduces a section called . This is only valid if assembling to -an object file. Only one section can be open at any given time. Sections -may be ended with ENDSECTION. Only one section can be open at any given -time. A subsequent SECTION directive will end the previous section. It is -important to note that an end of file does not close the currently open -section. There cannot be a symbol on a SECTION line. - -ENDSECTION - -Specifies the end of a section. This is optional. There cannot be a symbol -on an ENDSECTION line. - -ORG - -Specifies the assembly address. For the raw target, this is advisory and -only affects the addresses of symbols. For the object file target, this can -only appear outside of all sections. For the DECB target, each ORG statement -after which any output is generated will generate a segment in the output -file. must be completely resolved during pass 1 of the assembly -process and thus may not refer to forward references or external symbols, or -other symbols that refer to such. - - EQU - -Makes equivalent to . may be an external reference -in which case any references to will also be external references. - -EXPORT [ as ] - -Marks previously defined for export. If is specified, it -will be exported as . must not be an external reference and -must be defined before EXPORT. - -EXTERN [ as ] -IMPORT [ as ] - -Marks as an external reference. If is specified, is -the local name the symbol is references as in this assembly file while - is the actual symbol to be referenced externally. - -END [] - -Marks the end of the assembly process. Immediately terminates assembly -without processing any other lines in this file or any others. It is -optional. is only allowed for the DECB target in which case it -specifies the execution address. If it is not specified, the address -defaults to 0. diff -r faf43dc805c9 -r f643e2ff0008 doc/pseudoops.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/pseudoops.txt Tue Jan 27 05:55:52 2009 +0000 @@ -0,0 +1,51 @@ +The following pseudo operations are understood by LWASM. + +SECTION + +This introduces a section called . This is only valid if assembling to +an object file. Only one section can be open at any given time. Sections +may be ended with ENDSECTION. Only one section can be open at any given +time. A subsequent SECTION directive will end the previous section. It is +important to note that an end of file does not close the currently open +section. There cannot be a symbol on a SECTION line. + +ENDSECTION + +Specifies the end of a section. This is optional. There cannot be a symbol +on an ENDSECTION line. + +ORG + +Specifies the assembly address. For the raw target, this is advisory and +only affects the addresses of symbols. For the object file target, this can +only appear outside of all sections. For the DECB target, each ORG statement +after which any output is generated will generate a segment in the output +file. must be completely resolved during pass 1 of the assembly +process and thus may not refer to forward references or external symbols, or +other symbols that refer to such. + + EQU + +Makes equivalent to . may be an external reference +in which case any references to will also be external references. + +EXPORT [ as ] + +Marks previously defined for export. If is specified, it +will be exported as . must not be an external reference and +must be defined before EXPORT. + +EXTERN [ as ] +IMPORT [ as ] + +Marks as an external reference. If is specified, is +the local name the symbol is references as in this assembly file while + is the actual symbol to be referenced externally. + +END [] + +Marks the end of the assembly process. Immediately terminates assembly +without processing any other lines in this file or any others. It is +optional. is only allowed for the DECB target in which case it +specifies the execution address. If it is not specified, the address +defaults to 0.