Hca.geocities.com/JLABELLE@rogers.com/nsasm/docs/nsasm.htmlca.geocities.com/JLABELLE_rogers.com/nsasm/docs/nsasm.htmldelayedxmJTOKtext/htmlPS'Tb.HTue, 07 Dec 2004 00:52:17 GMT5Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)en, *mJTNSASM User Manual

NSASM User Manual

COP8 Assembly Tools Documentation


Table of Contents
NSASM
overview
Installation
I. asmcop
1. Introduction
2. Invocation and Operation
invoking asmcop
default file name and extensions
include file search order
help file search order
temporary file directory
error level return
3. Assembly Language Elements
character set
location counter
symbol and label construction
operand expression evaluation
addressing
label field
operation field
operand field
comment field
4. Assembly Process
5. Assignment Statements
6. Macros
defining a macro
calling a macro
using parameters
7. Error and Warning Messages
command line errors
assembly time errors
assembler error messages
8. The Assembly Listing
I. Assembly Directives
.addr --  puts one or more 8-bit addresses in memory
.addrw --  puts one or more 16-bit addresses in memory
.byte --  put one or more 8-bit bytes of data in memory (same as .db)
.chip --  specifies the member of the COP8 family
.contrl --  controls the address range of jumps and calls
.db --  put one or more 8-bit bytes of data in memory (same as .byte)
.do --  controls the .do - .enddo looping macro
.doparm --  repeats a one parameter macro for each argument in a list
.dsb --  allocates 8-bit bytes of memory for storage
.dsw --  allocates 16-bit words of memory for storage
.dw --  allocates 16-bit words of memory for storage (same as .word)
.else --  specifies assembly code to be assembled when a conditional assembly case is false
.end --  marks the physical end of a source program
.enddo --  controls the .do - .enddo macro
.endif --  marks the end of a conditional assembly
.endm --  marks the end of a macro definition
.endsect --  ends a program sections and restores the previous section
.exit --  terminates a .do - .enddo macro
.error --  generates an error message
.exitm --  terminates a .do - .enddo macro and terminates the macro expansion immediately
.extrn --  specifies symbols that are public to other modules
.fb --  fills one or more 8-bit bytes of memory with a value
.fw --  fills one or more 16 bit words of memory with a values
.form --  inserts a formfeed character into the listing file
.if --  conditionally assembles if an expression is not equal to zero
.ifb --  conditionally assembles base on whether the operand is blank
.ifc --  conditionally assembles base on character strings (same as .ifstr)
.ifdef --  conditionally assembles base on whether a symbol is defined
.ifnb --  conditionally assembles base on whether the operand is non-blank
.ifndef --  conditionally assembles base on whether a symbol is not defined
.ifstr --  conditionally assembles base on character strings (same as .ifc)
.incld --  includes the assblembly statements from a specified file
.list --  controls listing of the source program
.local --  establishes a new program section for local labels
.macro --  names a macro and signifies the start of a macro definition
.mdel --  deletes a macro definition
.mloc --  declares a lable local to a macro definition
.opdef --  assignes another name to an opcode
.opt --  selects COP8 mask-programmable options
.org --  sets the program counter to a new value
.out,.out1,.out2,.outall --  output messages per assembler pass
.public --  makes a symbol available to other modules
.sect --  specifies the start of a section
.set --  assigns a values to symbols
.space --  inserts a number of blank lines into the listing file
.title --  controls the header lines of the listing file
.warning --  generates a warning message
.word --  allocates 16-bit words of memory for storage (same as .dw)
II. Assembler Options and Controls
aserrorfile --  creates a copy of the source file with error messages added
chip --  specifies the member of the COP8 family
cnddirectives --  controls the listing of conditional directives
cndlines --  controls the listing of lines that are not assembled because of conditional assembly
commenentlines --  controls the listing of comment lines
complexrel --  controls the use of complex relocation
constants --  controls whether constants symbol information is kept for debugging purposes
crossref --  adds a cross reference table to the listing file
datadirectives --  controls the display of data directives in the listing file
define --  defines a symbol to be used in the source program
echo --  controls whether command files (@file) are echoed
errorfile --  controls the creation of an error file
formfeed --  controls the page breaks in the listing file
headings --  controls the heading of the listing file
ilines --  controls the listing of include files
include --  specifies a path to search for include files
listfile --  controls the generation of a listing file
localsymbols --  controls whether local symbol information is save for debugging purposes
masterlist --  controls whether source lines are listed in the listing file
mcalls --  controls the listing of macro calls
mcomments --  controls the listing of macro comments
mdefinitions --  controls the listing of macro definitions
memory --  allows for less PC RAM usage
mexpansions --  controls whether the whole macro is shown or just the call
mlocal --  controls whether local macro symbols are included in the cross reference table.
mobject --  lists macros even if they don't generete code
model --  specifies the memory model
numberlines --  controls how listing file lines are numbered
objectfile --  controls the generation of an object file
pass --  controls the number of passes through the source code that the assembler should perform
plength --  controls the listing file page length
pwidth --  controls the listing file page length
quick --  speeds up the assembly process by not generating some output files
remove --  removes the error strings added by aserrorfile
restore --  restores the control flags saved by save
save --  saves the state of some options
signedcompare --  controls the arithmetic used when evaluating expressions for contional operators
sizesymbol --  controls the maximum size for a symbol
sym_debug --  controls the source line and symbolic debugging
tablesymbols --  controls the listing of a symbol table
tabs --  controls the display of tab characters
undefine --  undefines a symbol defined by define
uppercase --  controls the case of symbols and opcodes
verify --  creates a listing file for each pass of the assembler
warnings --  controls the output of warnings messages
xdirectory --  controls how directory are searched for include files
II. lncop
9. Introduction
10. Invocation and Operation
invocation
default configuration file
linker options
default file names and extensions
library file search order
help and configuration file search order
temporary file directory
error level return
11. memory allocation and load map
12. Linker Example
13. Linker Error Messages
Command Errors
Link Errors
Link Warnings
Object Module Errors
III. Linker Options and Controls
briefmap --  controls the map format
crossref --  controls the inclusion of a cross reference table in the output map file
debug --  controls whether object file debug symbols are added to the COFF file
echo --  controls the echoing of linker command files
extract --  controls the use of library modules
extractsymbol --  controls the use of library symbols
file --  specifies the file frow which to read linker commands
format --  controls the output object file format
ignoreerrors --  controls the generation of object files when source programs have errors
libdirectory --  controls the search path for library files
libfile --  specifies library files to be searched
load --  specifies object files and modules to be linked into the program
localsymbols --  controls if local symbols appear in the cross reference table
mapfile --  controls the creation of the map file
outputfile --  controls the creation of the absolute object file
pwidth --  controls the page width of the map file
range --  specifies blocks of valid addresses for a type of memory
sect --  defines a section
sizesect --  specifies the size of a relocatable section
tablesymbols --  controls the addition of a symbol table to the map file
warnings --  controls the output of warning messages
xdirectory --  controls how directory are searched for library files
III. libcop
14. Introduction
15. Invocation and Operation
invocation
object files and module names
library options
default file names and extensions
help file search order
error level return
16. Library Errors
command errors
command warnings
object errors
IV. Librarian Options and Commands
add --  places the specified libraries into the library
backup --  creates a new library to avoid any possible damage to the old library
delete --  removes an object module from the library
echo --  display the lines read from a command file
list --  displays a list of all the modules contained in the library
replace --  replaces and object module with the same name
update --  replaces object modules if the ones specified are newer
warnings --  controls the listing of warning messages
IV. promcop
17. Introduction
18. Invocation
options
error level return
error messages
V. dumpcoff
19. Introduction
20. Operation and Invocation
options
error level return
21. Examples
dumpcoff sample1
dumpcoff /b /s /t /l main
dumpcoff /e /h main