#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
\lyxformat 276
\begin_document
\begin_header
\textclass book
\language english
\inputencoding default
\font_roman times
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize 10
\spacing single
\papersize letterpaper
\use_geometry true
\use_amsmath 1
\use_esint 0
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\leftmargin 34mm
\rightmargin 34mm
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\end_header

\begin_body

\begin_layout Title
gputils 0.13.6
\end_layout

\begin_layout Author
James Bowman, Craig Franklin, and David Barnett
\end_layout

\begin_layout Date
November 20, 2007
\end_layout

\begin_layout Standard
\begin_inset LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Chapter
Introduction
\end_layout

\begin_layout Standard
gputils is a collection of tools for Microchip (
\shape smallcaps
TM
\shape default
) PIC microcontrollers.
 It includes gpasm, gplink, and gplib.
 Each tool is intended to be an open source replacement for a corresponding
 Microchip (TM) tool.
 This manual covers the basics of running the tools.
 For more details on a microcontroller, consult the manual for the specific
 PICmicro product that you are using.
\end_layout

\begin_layout Standard
This document is part of gputils.
\end_layout

\begin_layout Standard
gputils is free software; you can redistribute it and/or modify it under
 the terms of the 
\begin_inset LatexCommand index
name "GNU"

\end_inset

GNU General Public 
\begin_inset LatexCommand index
name "License"

\end_inset

License as published by the Free Software Foundation; either version 2,
 or (at your option) any later version.
\end_layout

\begin_layout Standard
gputils is distributed in the hope that it will be useful, but WITHOUT ANY
 
\begin_inset LatexCommand index
name "NO WARRANTY"

\end_inset

WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.
 See the GNU General Public License for more details.
\end_layout

\begin_layout Standard
You should have received a copy of the GNU General Public License along
 with gputils; see the file COPYING.
 If not, write to the Free Software Foundation, 59 Temple Place - Suite
 330, Boston, MA 02111-1307, USA.
\end_layout

\begin_layout Section
Tool Flows
\end_layout

\begin_layout Standard
gputils can be used in two different ways: absolute asm mode and relocatable
 asm mode.
\end_layout

\begin_layout Subsection
Absolute Asm Mode
\end_layout

\begin_layout Standard
In absolute asm mode, an assembly language source file is directly converted
 into a hex file by gpasm.
 This method is absolute because the final addresses are hard coded into
 the source file.
\end_layout

\begin_layout Subsection
Relocatable Asm Mode
\end_layout

\begin_layout Standard
In relocatable asm mode, the microcontroller assembly source code is divided
 into separate modules.
 Each module is assembled into an object using gpasm.
 That object can be placed 
\begin_inset Quotes eld
\end_inset

anywhere
\begin_inset Quotes erd
\end_inset

 in microcontroller's memory.
 Then gplink is used to resolve symbols references, assign final address,
 and to patch the machine code with the final addresses.
 The output from gplink is an absolute executable object.
\end_layout

\begin_layout Subsection
Which Tool Flow is best?
\end_layout

\begin_layout Standard
Absolute mode is simple to understand and to use.
 It only requires one tool, gpasm.
 Most of the examples on Microchip's website use absolute mode.
 So why use relocatable mode?
\end_layout

\begin_layout Itemize
Code can be written without regard to addresses.
 This makes it easier to write and reuse.
\end_layout

\begin_layout Itemize
The objects can be archived to create a library, which also simplifies reuse.
\end_layout

\begin_layout Itemize
Recompiling a project can be faster, because you only compile the portions
 that have changed.
\end_layout

\begin_layout Itemize
Files can have local name spaces.
 The user chooses what symbols are global.
\end_layout

\begin_layout Standard
Most develpment tools use relocatable objects for these reasons.
 The few that don't are generally microcontroller tools.
 Their applications are so small that absolute mode isn't impractical.
 For PICs, relocatable mode has one big disadvantage.
 The bank and page control is a challenge.
\end_layout

\begin_layout Section
Supported processors 
\end_layout

\begin_layout LyX-Code
gputils currently supports the following processors:
\newline
eeprom8    gen        p10f200    p10f202    p10f204    p10f206    
\newline
p10f220    p10f222    p12c508    p12c508a   p12c509    p12c509a   
\newline
p12c671    p12c672    p12ce518   p12ce519   p12ce673   p12ce674   
\newline
p12cr509a  p12f508    p12f509    p12f510    p12f629    p12f635    
\newline
p12f675    p12f683    p14000     p16c5x     p16cxx     p16c432    
\newline
p16c433    p16c505    p16c52     p16c54     p16c54a    p16c54b    
\newline
p16c54c    p16c55     p16c55a    p16c554    p16c557    p16c558    
\newline
p16c56     p16c56a    p16c57     p16c57c    p16c58a    p16c58b    
\newline
p16c61     p16c62     p16c62a    p16c62b    p16c620    p16c620a   
\newline
p16c621    p16c621a   p16c622    p16c622a   p16c63     p16c63a    
\newline
p16c64     p16c64a    p16c642    p16c65     p16c65a    p16c65b    
\newline
p16c66     p16c662    p16c67     p16c71     p16c710    p16c711    
\newline
p16c712    p16c715    p16c716    p16c717    p16c72     p16c72a    
\newline
p16c73     p16c73a    p16c73b    p16c74     p16c745    p16c74a    
\newline
p16c74b    p16c76     p16c765    p16c77     p16c770    p16c771    
\newline
p16c773    p16c774    p16c781    p16c782    p16c84     p16c923    
\newline
p16c924    p16c925    p16c926    p16ce623   p16ce624   p16ce625   
\newline
p16cr54    p16cr54a   p16cr54b   p16cr54c   p16cr56a   p16cr57a   
\newline
p16cr57b   p16cr57c   p16cr58a   p16cr58b   p16cr62    p16cr620a  
\newline
p16cr63    p16cr64    p16cr65    p16cr72    p16cr83    p16cr84    
\newline
p16f505    p16f54     p16f57     p16f59     p16f610    p16f627    
\newline
p16f627a   p16f628    p16f628a   p16f630    p16f636    p16f639    
\newline
p16f648a   p16f676    p16f684    p16f685    p16f687    p16f688    
\newline
p16f689    p16f690    p16f716    p16f72     p16f73     p16f737    
\newline
p16f74     p16f747    p16f76     p16f767    p16f77     p16f777    
\newline
p16f785    p16f818    p16f819    p16f83     p16f84     p16f84a    
\newline
p16f87     p16f870    p16f871    p16f872    p16f873    p16f873a   
\newline
p16f874    p16f874a   p16f876    p16f876a   p16f877    p16f877a   
\newline
p16f88     p16f882    p16f883    p16f884    p16f886    p16f887    
\newline
p16f913    p16f914    p16f916    p16f917    p16hv540   p17cxx     
\newline
p17c42     p17c42a    p17c43     p17c44     p17c752    p17c756    
\newline
p17c756a   p17c762    p17c766    p17cr42    p17cr43    p18cxx     
\newline
p18c242    p18c252    p18c442    p18c452    p18c601    p18c658    
\newline
p18c801    p18c858    p18f1220   p18f1230   p18f1320   p18f1330   
\newline
p18f2220   p18f2320   p18f2321   p18f2331   p18f2410   p18f242    
\newline
p18f2420   p18f2431   p18f2439   p18f2450   p18f2455   p18f248    
\newline
p18f2480   p18f24j10  p18f2510   p18f2515   p18f252    p18f2520   
\newline
p18f2523   p18f2525   p18f2539   p18f2550   p18f258    p18f2580   
\newline
p18f2585   p18f25j10  p18f2610   p18f2620   p18f2680   p18f2681   
\newline
p18f2682   p18f2685   p18f4220   p18f4320   p18f4321   p18f4331   
\newline
p18f4410   p18f442    p18f4420   p18f4431   p18f4439   p18f4450   
\newline
p18f4455   p18f448    p18f4480   p18f44j10  p18f4510   p18f4515   
\newline
p18f452    p18f4520   p18f45k20  p18f4525   p18f4539   p18f4550   
\newline
p18f458    p18f4580   p18f4585   p18f45j10  p18f4610   p18f4620   
\newline
p18f4680   p18f4681   p18f4682   p18f4685   p18f6310   p18f6390   
\newline
p18f6410   p18f6490   p18f64j15  p18f6520   p18f6525   p18f65j10  
\newline
p18f65j15  p18f65j50  p18f6585   p18f6620   p18f6621   p18f6627   
\newline
p18f6680   p18f66j10  p18f66j15  p18f66j60  p18f66j65  p18f6720   
\newline
p18f6722   p18f67j10  p18f67j60  p18f8310   p18f8390   p18f8410   
\newline
p18f8490   p18f84j15  p18f8520   p18f8525   p18f8585   p18f85j10  
\newline
p18f85j15  p18f8620   p18f8621   p18f8627   p18f8680   p18f86j10  
\newline
p18f86j15  p18f86j60  p18f86j65  p18f8720   p18f8722   p18f87j10  
\newline
p18f87j60  p18f96j60  p18f96j65  p18f97j60  rf509af    rf509ag    
\newline
rf675f     rf675h     rf675k     sx18       sx20       sx28
\newline
            
\end_layout

\begin_layout Chapter
gpasm
\end_layout

\begin_layout Section
Running gpasm
\begin_inset LatexCommand index
name "gpasm options"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gpasm is
\end_layout

\begin_layout LyX-Code
gpasm [options] asm-file
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="24" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
a <format>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Produce 
\begin_inset LatexCommand index
name "hex file"

\end_inset

hex file in one of four formats: inhx8m, inhx8s, inhx16, inhx32 (the default).
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
c
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output a relocatable object in the older version of the Microchip COFF format
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
C
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output a relocatable object in the new Microchip COFF format
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
d
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output debug messages
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
D symbol[=value] 
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Equivalent to 
\begin_inset Quotes eld
\end_inset

#define <symbol> <value>
\begin_inset Quotes erd
\end_inset


\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
e [ON|OFF]
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Expand macros in listing file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
g
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Use debug directives for COFF
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
i
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
\begin_inset LatexCommand index
name "case"

\end_inset

Ignore case in source code.
 By default gpasms to treats 
\begin_inset Quotes eld
\end_inset

fooYa
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

FOOYA
\begin_inset Quotes erd
\end_inset

 as being different.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
I <directory>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Specify an include directory
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
l
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
List the supported processors
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
L
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Ignore nolist directives
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
m
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Memory dump
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
M
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output a dependency file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
n
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Use DOS style newlines (CRLF) in hex file.
 This option is disabled on win32 systems.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
o <file>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Alternate name of hex output file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
p<processor> 
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Select target processor
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
q
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Quiet
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r <radix>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set the 
\begin_inset LatexCommand index
name "radix"

\end_inset

radix, i.e.
 the number base that gpasm uses when interpreting numbers.<radix> can be
 one of 
\begin_inset Quotes eld
\end_inset

oct
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Quotes eld
\end_inset

dec
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

hex
\begin_inset Quotes erd
\end_inset

 for bases eight, ten, and sixteen respectively.
 Default is 
\begin_inset Quotes eld
\end_inset

hex
\begin_inset Quotes erd
\end_inset

.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
u
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Use absolute paths
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gpasm version information and exit
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
w [ 0 | 1 | 2 ]
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set the message level
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
y
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enable 18xx extended mode
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
Unless otherwise specified, gpasm removes the 
\begin_inset Quotes eld
\end_inset

.asm
\begin_inset Quotes erd
\end_inset

 suffix from its input file, replacing it with 
\begin_inset Quotes eld
\end_inset

.lst
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

.hex
\begin_inset Quotes erd
\end_inset

 for the list and hex output files respectively.
 On most modern operating systems case is significant in filenames.
 For this reason you should ensure that filenames are named consistently,
 and that the 
\begin_inset Quotes eld
\end_inset

.asm
\begin_inset Quotes erd
\end_inset

 suffix on any source file is in lower case.
\end_layout

\begin_layout Standard
gpasm always produces a 
\begin_inset Quotes eld
\end_inset

.lst
\begin_inset Quotes erd
\end_inset

 file.
 If it runs without errors, it also produces a 
\begin_inset Quotes eld
\end_inset

.hex
\begin_inset Quotes erd
\end_inset

 file or a 
\begin_inset Quotes eld
\end_inset

.o
\begin_inset Quotes erd
\end_inset

 file.
\end_layout

\begin_layout Subsection
Using gpasm with 
\begin_inset Quotes eld
\end_inset

make
\begin_inset Quotes erd
\end_inset


\begin_inset LatexCommand index
name "make"

\end_inset


\end_layout

\begin_layout Standard
On most operating systems, you can build a project using the make utility.
 To use gpasm with make, you might have a 
\begin_inset Quotes eld
\end_inset

makefile
\begin_inset Quotes erd
\end_inset

 like this:
\end_layout

\begin_layout LyX-Code
tree.hex: tree.asm treedef.inc
\newline
        gpasm tree.asm
\end_layout

\begin_layout Standard
This will rebuild 
\begin_inset Quotes eld
\end_inset

tree.hex
\begin_inset Quotes erd
\end_inset

 whenever either of the 
\begin_inset Quotes eld
\end_inset

tree.asm
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

treedef.inc
\begin_inset Quotes erd
\end_inset

 files change.
 A more comprehensive example of using gpasm with makefiles is included
 as example1 in the gpasm source distribution.
\end_layout

\begin_layout Subsection
Dealing with errors
\begin_inset LatexCommand index
name "error file"

\end_inset


\end_layout

\begin_layout Standard
gpasm doesn't specifically create an error file.
 This can be a problem if you want to keep a record of errors, or if your
 assembly produces so many errors that they scroll off the screen.
 To deal with this if your shell is 
\begin_inset LatexCommand index
name "sh"

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset LatexCommand index
name "bash"

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset LatexCommand index
name "ksh"

\end_inset


\begin_inset Quotes eld
\end_inset

ksh
\begin_inset Quotes erd
\end_inset

, you can do something like:
\end_layout

\begin_layout LyX-Code
gpasm tree.asm 2>&1 | tee tree.err
\end_layout

\begin_layout Standard
This redirects standard error to standard output (
\begin_inset Quotes eld
\end_inset

2>&1
\begin_inset Quotes erd
\end_inset

), then pipes this output into 
\begin_inset Quotes eld
\end_inset


\begin_inset LatexCommand index
name "tee"

\end_inset

tee
\begin_inset Quotes erd
\end_inset

, which copies it input to 
\begin_inset Quotes eld
\end_inset

tree.err
\begin_inset Quotes erd
\end_inset

, and then displays it.
\end_layout

\begin_layout Section
Syntax
\end_layout

\begin_layout Subsection
File structure
\end_layout

\begin_layout Standard
gpasm source files consist of a series of lines.
 Lines can contain a 
\begin_inset LatexCommand index
name "labels"

\end_inset

label (starting in column 1) or an operation (starting in any column after
 1), both, or neither.
 
\begin_inset LatexCommand index
name "comments"

\end_inset

Comments follow a 
\begin_inset Quotes eld
\end_inset

;
\begin_inset Quotes erd
\end_inset

 character, and are treated as a newline.
 Labels may be any series of the letters A-z, digits 0-9, and the underscore
 (
\begin_inset Quotes eld
\end_inset

_
\begin_inset Quotes erd
\end_inset

); they may not begin with a digit.
 Labels may be followed by a colon (
\begin_inset Quotes eld
\end_inset

:
\begin_inset Quotes erd
\end_inset

).
\end_layout

\begin_layout Standard
An operation is a single identifier (the same rules as for a label above)
 followed by a space, and a comma-separated list of parameters.
 For example, the following are all legal source lines:
\end_layout

\begin_layout LyX-Code
                              ; Blank line
\newline
loop    sleep                 ; Label and operation
\newline
        incf    6,1           ; Operation with 2 parameters
\newline
        goto    loop          ; Operation with 1 parameter
\end_layout

\begin_layout Subsection
Expressions
\end_layout

\begin_layout Standard
gpasm supports a full set of 
\begin_inset LatexCommand index
name "operators"

\end_inset

operators, based on the C operator set.
 The operators in the following table are arranged in groups of equal precedence
, but the groups are arranged in order of increasing precedence.
 When gpasm encounters operators of equal precedence, it always evaluates
 from left to right.
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="26" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Operator
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
assignment
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
||
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
logical or
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
&&
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
logical and
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
&
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise and
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
|
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise or
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
^
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise exclusive-or
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
<
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
less than
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
greater than
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
==
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
equals
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
!=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
not equals
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
>=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
greater than or equal
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
<=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
less than or equal
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
<<
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
left shift
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
>>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
right shift
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
+
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
addition
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
-
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
subtraction
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
*
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
multiplication
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
/
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
division
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
modulo
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
UPPER
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
upper byte
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
HIGH
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
high byte
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
LOW
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
low byte
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
-
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
negation
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
!
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
logical not
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
~
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise no
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align left
Any symbol appearing in column 1 may be assigned a value using the assignment
 operator (=) in the previous table.
 Additionally, any value previously assigned may be modified using one of
 the operators in the table below.
 Each of these operators evaluates the current value of the symbol and then
 assigns a new value based on the operator.
 
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="14" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Operator
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
assignment
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
++
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
increment by 1
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
--
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
decrement by 1
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
+=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
increment
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
-=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
decrement
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
*=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
multiply
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
/=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
divide
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
%=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
modulo
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
<<=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
left shift
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
>>=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
right shift
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
&=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise and
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
|=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise or
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
^=
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
bitwise exclusive-or
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Subsection
Numbers
\begin_inset LatexCommand index
name "radix"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset LatexCommand label
name "sec:numbers"

\end_inset

gpasm gives you several ways of specifying numbers.
 You can use a syntax that uses an initial character to indicate the number's
 base.
 The following table summarizes the alternatives.
 Note the C-style option for specifying hexadecimal numbers.
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="3">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
base
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
general syntax
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
21 decimal written as
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
binary
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
B'[01]*'
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
B'10101'
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
octal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
O'[0-7]*'
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
O'25'
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
decimal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
D'[0-9]*'
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
D'21'
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
hex
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
H'[0-F]*'
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
H'15'
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
hex
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
0x[0-F]*
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
0x15
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
When you write a number without a specifying prefix such as 
\begin_inset Quotes eld
\end_inset

45
\begin_inset Quotes erd
\end_inset

, gpasm uses the current radix (base) to interpret the number.
 You can change this radix with the RADIX directive, or with the 
\begin_inset Quotes eld
\end_inset

-r
\begin_inset Quotes erd
\end_inset

 option on gpasm's command-line.
 The default radix is hexadecimal.
 
\end_layout

\begin_layout Standard
If you do not start hexadecimal numbers with a digit, gpasm will attempt
 to interpret what you've written as an identifier.
 For example, instead of writing C2, write either 0C2, 0xC2 or H'C2'.
\end_layout

\begin_layout Standard
Case is not significant when interpreting numbers: 0ca, 0CA, h'CA' and H'ca'
 are all equivalent.
\end_layout

\begin_layout Standard
Several legacy mpasm number formats are also supported.
 These formats have various shortcomings, but are still supported.
 The table below summarizes them.
 
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="3">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
base
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
general syntax
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
21 decimal written as
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
binary
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
[01]*b
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
10101b
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
octal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
q'[0-7]*'
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
q'25'
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
octal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
[0-7]*o
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
25o
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
octal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
[0-7]*q
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
25q
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
decimal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
0-9]*d
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
21d
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
decimal
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
.[0-9]*
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
.21
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
hex
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
[0-F]*h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
15h
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
You can write the 
\begin_inset LatexCommand index
name "ASCII"

\end_inset

ASCII code for a 
\begin_inset LatexCommand index
name "character"

\end_inset

character X using 'X', or A'X'.
 
\end_layout

\begin_layout Subsection
Preprocessor
\end_layout

\begin_layout Standard
\begin_inset LatexCommand index
name "include"

\end_inset

A line such as:
\end_layout

\begin_layout LyX-Code
include foo.inc
\end_layout

\begin_layout Standard
will make gpasm fetch source lines from the file 
\begin_inset Quotes eld
\end_inset

foo.inc
\begin_inset Quotes erd
\end_inset

 until the end of the file, and then return to the original source file
 at the line following the include.
\end_layout

\begin_layout Standard
Lines beginning with a 
\begin_inset Quotes eld
\end_inset

#
\begin_inset Quotes erd
\end_inset

 are preprocessor directives, and are treated differently by gpasm.
 They may contain a 
\begin_inset Quotes eld
\end_inset

#define
\begin_inset Quotes erd
\end_inset

, or a 
\begin_inset Quotes eld
\end_inset

#undefine
\begin_inset Quotes erd
\end_inset

 directive.
\end_layout

\begin_layout Standard
Once gpasm has processed a line such as:
\end_layout

\begin_layout LyX-Code
#define X Y
\end_layout

\begin_layout Standard
every subsequent occurrence of X is replaced with Y, until the end of file
 or a line
\end_layout

\begin_layout LyX-Code
#undefine X
\end_layout

\begin_layout Standard
appears.
\end_layout

\begin_layout Standard
The preprocessor will replace an occurance of #v(expression) in a symbol
 with the value of 
\begin_inset Quotes eld
\end_inset

expression
\begin_inset Quotes erd
\end_inset

 in decimal.
 In the following expression:
\end_layout

\begin_layout LyX-Code
number equ 5
\newline
label_#v( (number +1) * 5 )_suffix equ 0x10
\end_layout

\begin_layout Standard
gpasm will place the symbol 
\begin_inset Quotes eld
\end_inset

label_30_suffix
\begin_inset Quotes erd
\end_inset

 with a value of 0x10 in the symbol table.
\end_layout

\begin_layout Standard
The preprocessor in gpasm is only 
\shape italic
like
\shape default
 the C preprocessor; its syntax is rather different from that of the C preproces
sor.
 gpasm uses a simple internal preprocessor to implement 
\begin_inset Quotes eld
\end_inset

include
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Quotes eld
\end_inset

#define
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

#undefine
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsection
Processor header files
\end_layout

\begin_layout Standard
gputils distributes the Microchip processor header files.
 These files contain processor specific data that is helpful in developing
 PIC applications.
 The location of these files is reported in the gpasm help message.
 Use the INCLUDE directive to utilize the appropriate file in your source
 code.
 Only the name of the file is required.
 gpasm will search the default path automatically.
 
\end_layout

\begin_layout Section
Directives
\end_layout

\begin_layout Subsection
Code generation
\end_layout

\begin_layout Standard
In absolute mode, use the ORG directive to set the PIC memory location where
 gpasm will start assembling code.
 If you don't specify an address with ORG, gpasm assumes 0x0000.
 In relocatable mode, use the CODE directive.
\end_layout

\begin_layout Subsection
Configuration
\end_layout

\begin_layout Standard
You can choose the fuse settings for your PIC implementation using the __CONFIG
 directive, so that the hex file set the fuses explicitly.
 Naturally you should make sure that these settings match your PIC hardware
 design.
\end_layout

\begin_layout Standard
The __MAXRAM and __BADRAM directives specify which RAM locations are legal.
 These directives are mostly used in processor-specific configuration files.
\end_layout

\begin_layout Subsection
Conditional assembly
\end_layout

\begin_layout Standard
The IF, IFNDEF, IFDEF, ELSE and ENDIF directives enable you to assemble
 certain sections of code only if a condition is met.
 In themselves, they do not cause gpasm to emit any PIC code.
 The example in section 
\begin_inset LatexCommand ref
reference "sec:macros"

\end_inset

 for demonstrates conditional assembly.
\end_layout

\begin_layout Subsection
Macros
\end_layout

\begin_layout Standard
\begin_inset LatexCommand label
name "sec:macros"

\end_inset

gpasm supports a simple macro scheme; you can define and use macros like
 this:
\end_layout

\begin_layout LyX-Code
any     macro parm
\newline
        movlw parm
\newline
        endm
\newline
...
\newline
        any   33
\end_layout

\begin_layout Standard
A more useful example of some macros in use is:
\end_layout

\begin_layout LyX-Code
; Shift reg left
\newline
slf     macro   reg
\newline
        clrc
\newline
        rlf     reg,f
\newline
endm
\newline
 
\end_layout

\begin_layout LyX-Code
; Scale W by 
\begin_inset Quotes eld
\end_inset

factor
\begin_inset Quotes erd
\end_inset

.
  Result in 
\begin_inset Quotes eld
\end_inset

reg
\begin_inset Quotes erd
\end_inset

, W unchanged.
\end_layout

\begin_layout LyX-Code
scale   macro   reg, factor
\newline
        if (factor == 1)
\newline
            movwf reg                 ; 1 X is easy
\newline
        else
\newline
            scale   reg, (factor / 2) ; W * (factor / 2)
\newline
            slf     reg,f             ; double reg
\newline
            if ((factor & 1) == 1)    ; if lo-bit set ..
\newline
                addwf   reg,f         ; ..
 add W to reg
\newline
            endif
\newline
        endif
\newline
endm
\end_layout

\begin_layout Standard
This recursive macro generates code to multiply W by a constant 
\begin_inset Quotes eld
\end_inset

factor
\begin_inset Quotes erd
\end_inset

, and stores the result in 
\begin_inset Quotes eld
\end_inset

reg
\begin_inset Quotes erd
\end_inset

.
 So writing:
\end_layout

\begin_layout LyX-Code
        scale   tmp,D'10'
\end_layout

\begin_layout Standard
is the same as writing:
\end_layout

\begin_layout LyX-Code
        movwf   tmp      ; tmp = W
\newline
        clrc
\newline
        rlf     tmp,f    ; tmp = 2 * W
\newline
        clrc
\newline
        rlf     tmp,f    ; tmp = 4 * W
\newline
        addwf   tmp,f    ; tmp = (4 * W) + W = 5 * W
\newline
        clrc
\newline
        rlf     tmp,f    ; tmp = 10 * W
\end_layout

\begin_layout Subsection
$
\end_layout

\begin_layout Standard
$ expands to the address of the instruction currently being assembled.
 If it's used in a context other than an instruction, such as a conditional,
 it expands to the address the next instruction would occupy, since the
 assembler's idea of current address is incremented after an instruction
 is assembled.
  $ may be manipulated just like any other number:
\end_layout

\begin_layout LyX-Code
$
\newline
$ + 1
\newline
$ - 2
\end_layout

\begin_layout Standard
and can be used as a shortcut for writing loops without labels.
\end_layout

\begin_layout LyX-Code
LOOP:  BTFSS flag,0x00
\newline
       GOTO LOOP
\newline

\newline
       BTFSS flag,0x00
\newline
       GOTO  $ - 1
\end_layout

\begin_layout Subsection
Suggestions for structuring your code
\end_layout

\begin_layout Standard
\begin_inset LatexCommand label
name "sec:structuring"

\end_inset

Nested IF operations can quickly become confusing.
 Indentation is one way of making code clearer.
 Another way is to add braces on IF, ELSE and ENDIF, like this:
\end_layout

\begin_layout LyX-Code
        IF (this) ; {
\newline
          ...
\newline
        ELSE      ; }{
\newline
          ...
\newline
        ENDIF     ; }
\end_layout

\begin_layout Standard
After you've done this, you can use your text editor's show-matching-brace
 to check matching parts of the IF structure.
 In vi this command is 
\begin_inset Quotes eld
\end_inset

%
\begin_inset Quotes erd
\end_inset

, in emacs it's M-C-f and M-C-b.
\end_layout

\begin_layout Subsection
Directive summary
\begin_inset LatexCommand label
name "sec:directivesummary"

\end_inset


\end_layout

\begin_layout Subsection*
__BADRAM
\begin_inset LatexCommand index
name "\\_\\_BADRAM"

\end_inset


\end_layout

\begin_layout LyX-Code
__BADRAM <expression> [, <expression>]*
\end_layout

\begin_layout Standard
Instructs gpasm that it should generate an error if there is any use of
 the given RAM locations.
 Specify a range of addresses with <lo>-<hi>.
 See any processor-specific header file for an example.
\end_layout

\begin_layout Standard
See also: __MAXRAM
\end_layout

\begin_layout Subsection*
__BADROM
\begin_inset LatexCommand index
name "\\_\\_BADROM"

\end_inset


\end_layout

\begin_layout LyX-Code
__BADROM <expression> [, <expression>]*
\end_layout

\begin_layout Standard
Instructs gpasm that it should generate an error if there is any use of
 the given ROM locations.
 Specify a range of addresses with <lo>-<hi>.
 See any processor-specific header file for an example.
\end_layout

\begin_layout Standard
See also: __MAXROM
\end_layout

\begin_layout Subsection*
__CONFIG
\begin_inset LatexCommand index
name "\\_\\_CONFIG"

\end_inset


\end_layout

\begin_layout LyX-Code
__CONFIG <expression>
\end_layout

\begin_layout Standard
Sets the PIC processor's configuration fuses.
\end_layout

\begin_layout Standard
See also: CONFIG, __FUSES
\end_layout

\begin_layout Subsection*
__FUSES
\begin_inset LatexCommand index
name "\\_\\_FUSES"

\end_inset


\end_layout

\begin_layout LyX-Code
__FUSES <expression>
\end_layout

\begin_layout Standard
Alias for __CONFIG.
Sets the PIC processor's configuration fuses.
\end_layout

\begin_layout Standard
See also: CONFIG
\end_layout

\begin_layout Subsection*
__IDLOCS
\begin_inset LatexCommand index
name "\\_\\_IDLOCS"

\end_inset


\end_layout

\begin_layout LyX-Code
__IDLOCS <expression> or __IDLOCS <expression1>,<expression2>
\end_layout

\begin_layout Standard
Sets the PIC processor's identification locations.
 For 12 and 14 bit processors, the four id locations are set to the hexadecimal
 value of expression.
 For 18cxx devices idlocation expression1 is set to the hexadecimal value
 of expression2.
\end_layout

\begin_layout Subsection*
__MAXRAM
\begin_inset LatexCommand index
name "\\_\\_MAXRAM"

\end_inset


\end_layout

\begin_layout LyX-Code
__MAXRAM <expression>
\end_layout

\begin_layout Standard
Instructs gpasm that an attempt to use any RAM location above the one specified
 should be treated as an error.
 See any processor specific header file for an example.
\end_layout

\begin_layout Standard
See also: __BADRAM
\end_layout

\begin_layout Subsection*
__MAXROM
\begin_inset LatexCommand index
name "\\_\\_MAXROM"

\end_inset


\end_layout

\begin_layout LyX-Code
__MAXROM <expression>
\end_layout

\begin_layout Standard
Instructs gpasm that an attempt to use any ROM location above the one specified
 should be treated as an error.
 See any processor specific header file for an example.
\end_layout

\begin_layout Standard
See also: __BADROM
\end_layout

\begin_layout Subsection*
BANKISEL
\begin_inset LatexCommand index
name "BANKISEL"

\end_inset


\end_layout

\begin_layout LyX-Code
BANKISEL <label>
\end_layout

\begin_layout Standard
This directive generates bank selecting code for indirect access of the
 address specified by <label>.
 The directive is not available for all devices.
 It is only available for 14 bit and 16 bit devices.
 For 14 bit devices, the bank selecting code will set/clear the IRP bit
 of the STATUS register.
 It will use MOVLB or MOVLR in 16 bit devices.
\end_layout

\begin_layout Standard
See also: BANKSEL, PAGESEL
\end_layout

\begin_layout Subsection*
BANKSEL
\begin_inset LatexCommand index
name "BANKSEL"

\end_inset


\end_layout

\begin_layout LyX-Code
BANKSEL <label>
\end_layout

\begin_layout Standard
This directive generates bank selecting code to set the bank to the bank
 containing <label>.
 The bank selecting code will set/clear bits in the FSR for 12 bit devices.
 It will set/clear bits in the STATUS register for 14 bit devices.
 It will use MOVLB or MOVLR in 16 bit devices.
 MOVLB will be used for enhanced 16 bit devices.
\end_layout

\begin_layout Standard
See also: BANKISEL, PAGESEL
\end_layout

\begin_layout Subsection*
CONFIG
\begin_inset LatexCommand index
name "CBLOCK"

\end_inset


\end_layout

\begin_layout LyX-Code
CONFIG <expression>[, <expression>]*
\end_layout

\begin_layout Standard
Sets configuration fuses on 16-bit PIC devices.
\end_layout

\begin_layout Standard
See also: __CONFIG
\end_layout

\begin_layout Subsection*
CBLOCK
\begin_inset LatexCommand index
name "CBLOCK"

\end_inset


\end_layout

\begin_layout LyX-Code
CBLOCK [<expression>]
\newline
       <label>[:<increment>][,<label>[:<increment>]]
\newline
ENDC
\end_layout

\begin_layout Standard
Marks the beginning of a block of constants <label>.
 gpasm allocates values for symbols in the block starting at the value <expressi
on> given to CBLOCK.
 An optional <increment> value leaves space after the <label> before the
 next <label>.
\end_layout

\begin_layout Standard
See also: EQU
\end_layout

\begin_layout Subsection*
CODE
\begin_inset LatexCommand index
name "CODE"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> CODE <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new machine code section in the output object file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.code
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: IDATA, UDATA, CODE_PACK
\end_layout

\begin_layout Subsection*
CODE_PACK
\begin_inset LatexCommand index
name "CODE\\_PACK"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> CODE_PACK <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new byte-packed machine code section in the output object file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.code
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: IDATA, UDATA, CODE
\end_layout

\begin_layout Subsection*
CONSTANT
\begin_inset LatexCommand index
name "CONSTANT"

\end_inset


\end_layout

\begin_layout LyX-Code
CONSTANT <label>=<expression> [, <label>=<expression>]*
\end_layout

\begin_layout Standard
Permanently assigns the value obtained by evaluating <expression> to thesymbol
 <label>.
 Similar to SET and VARIABLE, except it can not be changed once assigned.
\end_layout

\begin_layout Standard
See also: EQU, SET, VARIABLE
\end_layout

\begin_layout Subsection*
DA
\begin_inset LatexCommand index
name "DA"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> DA <expression> [, <expression]*
\end_layout

\begin_layout Standard
Stores Strings in program memory.
 The data is stored as one 14 bit word representing two 7 bit ASCII characters.
\end_layout

\begin_layout Standard
See also: DT
\end_layout

\begin_layout Subsection*
DATA
\begin_inset LatexCommand index
name "DATA"

\end_inset


\end_layout

\begin_layout LyX-Code
DATA <expression> [, <expression]*
\end_layout

\begin_layout Standard
Generates the specified data.
\end_layout

\begin_layout Standard
See also: DA, DB, DE, DW
\end_layout

\begin_layout Subsection*
DB
\begin_inset LatexCommand index
name "DB"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> DB <expression> [, <expression]*
\end_layout

\begin_layout Standard
Declare data of one byte.
 The values are packed two per word.
\end_layout

\begin_layout Standard
See also: DA, DATA, DE, DW
\end_layout

\begin_layout Subsection*
DE
\begin_inset LatexCommand index
name "DE"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> DE <expression> [, <expression]*
\end_layout

\begin_layout Standard
Define EEPROM data.
 Each character in a string is stored in a separate word.
\end_layout

\begin_layout Standard
See also: DA, DATA, DB, DW
\end_layout

\begin_layout Subsection*
DT
\begin_inset LatexCommand index
name "DT"

\end_inset


\end_layout

\begin_layout LyX-Code
DT <expression> [, <expression]*
\end_layout

\begin_layout Standard
Generates the specified data as bytes in a sequence of RETLW instructions.
\end_layout

\begin_layout Standard
See also: DATA
\end_layout

\begin_layout Subsection*
DW
\begin_inset LatexCommand index
name "DW"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> DW <expression> [, <expression]*
\end_layout

\begin_layout Standard
Declare data of one word.
\end_layout

\begin_layout Standard
See also: DA, DATA, DB, DW
\end_layout

\begin_layout Subsection*
ELSE
\begin_inset LatexCommand index
name "ELSE"

\end_inset


\end_layout

\begin_layout LyX-Code
ELSE
\end_layout

\begin_layout Standard
Marks the alternate section of a conditional assembly block.
\end_layout

\begin_layout Standard
See also: IF, IFDEF, IFNDEF, ELSE, ENDIF
\end_layout

\begin_layout Subsection*
END
\begin_inset LatexCommand index
name "END"

\end_inset


\end_layout

\begin_layout LyX-Code
END
\end_layout

\begin_layout Standard
Marks the end of the source file.
\end_layout

\begin_layout Subsection*
ENDC
\begin_inset LatexCommand index
name "ENDC"

\end_inset


\end_layout

\begin_layout LyX-Code
ENDC
\end_layout

\begin_layout Standard
Marks the end of a CBLOCK.
\end_layout

\begin_layout Standard
See also: CBLOCK
\end_layout

\begin_layout Subsection*
ENDIF
\begin_inset LatexCommand index
name "ENDIF"

\end_inset


\end_layout

\begin_layout LyX-Code
ENDIF
\end_layout

\begin_layout Standard
Ends a conditional assembly block.
\end_layout

\begin_layout Standard
See also: IFDEF, IFNDEF, ELSE, ENDIF
\end_layout

\begin_layout Subsection*
ENDM
\begin_inset LatexCommand index
name "ENDM"

\end_inset


\end_layout

\begin_layout LyX-Code
ENDM
\end_layout

\begin_layout Standard
Ends a macro definition.
\end_layout

\begin_layout Standard
See also: MACRO
\end_layout

\begin_layout Subsection*
ENDW
\begin_inset LatexCommand index
name "ENDW"

\end_inset


\end_layout

\begin_layout LyX-Code
ENDW
\end_layout

\begin_layout Standard
Ends a while loop.
\end_layout

\begin_layout Standard
See also: WHILE
\end_layout

\begin_layout Subsection*
EQU
\begin_inset LatexCommand index
name "EQU"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> EQU <expression>
\end_layout

\begin_layout Standard
Permanently assigns the value obtained by evaluating <expression> to the
 symbol <label>.
 Similar to SET and VARIABLE, except it can not be changed once assigned.
\end_layout

\begin_layout Standard
See also: CONSTANT, SET
\end_layout

\begin_layout Subsection*
ERROR
\begin_inset LatexCommand index
name "ERROR"

\end_inset


\end_layout

\begin_layout LyX-Code
ERROR <string>
\end_layout

\begin_layout Standard
Issues an error message.
\end_layout

\begin_layout Standard
See also: MESSG
\end_layout

\begin_layout Subsection*
ERRORLEVEL
\begin_inset LatexCommand index
name "ERRORLEVEL"

\end_inset


\end_layout

\begin_layout LyX-Code
ERRORLEVEL {0 | 1 | 2 | +<msgnum> | -<msgnum>}[, ...]
\end_layout

\begin_layout Standard
Sets the types of messages that are printed.
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Setting
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Affect
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Messages, warnings and errors printed.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Warnings and error printed.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Errors printed.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
-<msgnum>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Inhibits the printing of message <msgnum>.
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
+<msgnum>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enables the printing of message <msgnum>.
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
EXTERN
\begin_inset LatexCommand index
name "EXTERN"

\end_inset


\end_layout

\begin_layout LyX-Code
EXTERN <symbol> [ , <symbol> ]*
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Delcare a new symbol that is defined in another object file.
\end_layout

\begin_layout Standard
See also: GLOBAL
\end_layout

\begin_layout Subsection*
EXITM
\begin_inset LatexCommand index
name "EXITM"

\end_inset


\end_layout

\begin_layout LyX-Code
EXITM
\end_layout

\begin_layout Standard
Immediately return from macro expansion during assembly.
\end_layout

\begin_layout Standard
See also: ENDM
\end_layout

\begin_layout Subsection*
EXPAND
\begin_inset LatexCommand index
name "EXITM"

\end_inset


\end_layout

\begin_layout LyX-Code
EXPAND
\end_layout

\begin_layout Standard
Expand the macro in the listing file.
\end_layout

\begin_layout Standard
See also: ENDM
\end_layout

\begin_layout Subsection*
FILL
\begin_inset LatexCommand index
name "FILL"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> FILL <expression>,<count>
\end_layout

\begin_layout Standard
Generates <count> occurrences of the program word or byte <expression>.
 If expression is enclosed by parentheses, expression is a line of assembly.
 
\end_layout

\begin_layout Standard
See also: DATA DW ORG
\end_layout

\begin_layout Subsection*
GLOBAL
\begin_inset LatexCommand index
name "GLOBAL"

\end_inset


\end_layout

\begin_layout LyX-Code
GLOBAL <symbol> [ , <symbol> ]*
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Delcare a symbol as global.
\end_layout

\begin_layout Standard
See also: GLOBAL
\end_layout

\begin_layout Subsection*
IDATA
\begin_inset LatexCommand index
name "IDATA"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> IDATA <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new initialized data section in the output object file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.idata
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 Data memory is allocated and the initialization data is placed in ROM.
 The user must provide the code to load the data into memory.
 
\end_layout

\begin_layout Standard
See also: CODE, UDATA
\end_layout

\begin_layout Subsection*
IF
\begin_inset LatexCommand index
name "IF"

\end_inset


\end_layout

\begin_layout LyX-Code
IF <expression>
\end_layout

\begin_layout Standard
Begin a conditional assembly block.
 If the value obtained by evaluating <expression> is true (i.e.
 non-zero), code up to the following ELSE or ENDIF is assembled.
 If the value is false (i.e.
 zero), code is not assembled until the corresponding ELSE or ENDIF.
\end_layout

\begin_layout Standard
See also: IFDEF, IFNDEF, ELSE, ENDIF
\end_layout

\begin_layout Subsection*
IFDEF
\begin_inset LatexCommand index
name "IFDEF"

\end_inset


\end_layout

\begin_layout LyX-Code
IFDEF <symbol>
\end_layout

\begin_layout Standard
Begin a conditional assembly block.
 If <symbol> appears in the symbol table, gpasm assembles the following
 code.
\end_layout

\begin_layout Standard
See also: IF, IFNDEF, ELSE, ENDIF
\end_layout

\begin_layout Subsection*
IFNDEF
\begin_inset LatexCommand index
name "IFNDEF"

\end_inset


\end_layout

\begin_layout LyX-Code
IFNDEF <symbol>
\end_layout

\begin_layout Standard
Begin a conditional assembly block.
 If <symbol>does not appear in the symbol table, gpasm assembles the following
 code.
\end_layout

\begin_layout Standard
See also: IF, IFNDEF, ELSE, ENDIF
\end_layout

\begin_layout Subsection*
LIST
\begin_inset LatexCommand index
name "LIST"

\end_inset


\end_layout

\begin_layout LyX-Code
LIST <expression> [ , <expression> ] *
\end_layout

\begin_layout Standard
Enables output to the list (
\begin_inset Quotes eld
\end_inset

.lst
\begin_inset Quotes erd
\end_inset

) file.
 All arguments are interpreted as decimal regardless of the current radix
 setting.
 
\begin_inset Quotes eld
\end_inset

list n=0
\begin_inset Quotes erd
\end_inset

 may be used to prevent page breaks in the code section of the list file.
 Other options are listed in the table below:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
b=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the tab spaces
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
f=<format>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set the hex file format.
 Can be inhx8m, inhx8s, inhx16, or inhx32.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
mm=[ON|OFF]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Memory Map on or off
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
n=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the number of lines per page
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
p = <symbol>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the current processor
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
pe = <symbol>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the current processor and enables the 18xx extended mode 
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r= [ oct | dec | hex ]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the radix
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
st = [ ON | OFF ]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Symbol table dump on or off
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
w=[0 | 1| 2]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the message level.
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
x=[ON|OFF]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Macro expansion on or off
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
See also: NOLIST, RADIX, PROCESSOR
\end_layout

\begin_layout Subsection*
LOCAL
\begin_inset LatexCommand index
name "LOCAL"

\end_inset


\end_layout

\begin_layout LyX-Code
LOCAL <symbol>[[=<expression>], [<symbol>[=<expression>]]*]
\end_layout

\begin_layout Standard
Declares <symbol> as local to the macro that's currently being defined.
 This means that further occurrences of <symbol> in the macro definition
 refer to a local variable, with scope and lifetime limited to the execution
 of the macro.
\end_layout

\begin_layout Standard
See also: MACRO, ENDM
\end_layout

\begin_layout Subsection*
MACRO
\begin_inset LatexCommand index
name "MACRO"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> MACRO [ <symbol> [ , <symbol> ]* ]
\end_layout

\begin_layout Standard
Declares a macro with name <label>.
 gpasm replaces any occurrences of <symbol> in the macro definition with
 the parameters given at macro invocation.
\end_layout

\begin_layout Standard
See also: LOCAL, ENDM
\end_layout

\begin_layout Subsection*
MESSG
\begin_inset LatexCommand index
name "MESSG"

\end_inset


\end_layout

\begin_layout LyX-Code
MESSG <string>
\end_layout

\begin_layout Standard
Writes <string> to the list file, and to the standard error output.
\end_layout

\begin_layout Standard
See also: ERROR
\end_layout

\begin_layout Subsection*
NOEXPAND
\begin_inset LatexCommand index
name "NOEXPAND"

\end_inset


\end_layout

\begin_layout LyX-Code
NOEXPAND
\end_layout

\begin_layout Standard
Turn off macro expansion in the list file.
\end_layout

\begin_layout Standard
See also: EXPAND
\end_layout

\begin_layout Subsection*
NOLIST
\begin_inset LatexCommand index
name "NOLIST"

\end_inset


\end_layout

\begin_layout LyX-Code
NOLIST
\end_layout

\begin_layout Standard
Disables list file output.
\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
ORG
\begin_inset LatexCommand index
name "ORG"

\end_inset


\end_layout

\begin_layout LyX-Code
ORG <expression>
\end_layout

\begin_layout Standard
Sets the location at which instructions will be placed.
 If the source file does not specify an address with ORG, gpasm assumes
 an ORG of zero.
\end_layout

\begin_layout Subsection*
PAGE
\begin_inset LatexCommand index
name "PAGE"

\end_inset


\end_layout

\begin_layout LyX-Code
PAGE
\end_layout

\begin_layout Standard
Causes the list file to advance to the next page.
\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
PAGESEL
\begin_inset LatexCommand index
name "PAGESEL"

\end_inset


\end_layout

\begin_layout LyX-Code
PAGESEL <label>
\end_layout

\begin_layout Standard
This directive will generate page selecting code to set the page bits to
 the page containing the designated <label>.
 The page selecting code will set/clear bits in the STATUS for 12 bit and
 14 bit devices.
 For 16 bit devices, it will generate MOVLW and MOVWF to modify PCLATH.
 The directive is ignored for enhanced 16 bit devices.
\end_layout

\begin_layout Standard
See also: BANKISEL, BANKSEL, PAGESELW
\end_layout

\begin_layout Subsection*
PAGESELW
\begin_inset LatexCommand index
name "PAGESELW"

\end_inset


\end_layout

\begin_layout LyX-Code
PAGESELW <label>
\end_layout

\begin_layout Standard
This directive will generate page selecting code to set the page bits to
 the page containing the designated <label>.
 The page selecting code will generate MOVLW and MOVWF to modify PCLATH.
 The directive is ignored for enhanced 16 bit devices.
\end_layout

\begin_layout Standard
See also: BANKISEL, BANKSEL, PAGESEL
\end_layout

\begin_layout Subsection*
PROCESSOR
\begin_inset LatexCommand index
name "PROCESSOR"

\end_inset


\end_layout

\begin_layout LyX-Code
PROCESSOR <symbol>
\end_layout

\begin_layout Standard
Selects the target processor.
 See section 
\begin_inset LatexCommand ref
reference "sec:processors"

\end_inset

 for more details.
\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
RADIX
\begin_inset LatexCommand index
name "RADIX"

\end_inset


\end_layout

\begin_layout LyX-Code
RADIX <symbol>
\end_layout

\begin_layout Standard
Selects the default radix from 
\begin_inset Quotes eld
\end_inset

oct
\begin_inset Quotes erd
\end_inset

 for octal, 
\begin_inset Quotes eld
\end_inset

dec
\begin_inset Quotes erd
\end_inset

 for decimal or 
\begin_inset Quotes eld
\end_inset

hex
\begin_inset Quotes erd
\end_inset

 for hexadecimal.
 gpasm uses this radix to interpret numbers that don't have an explicit
 radix.
\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
RES
\begin_inset LatexCommand index
name "RES"

\end_inset


\end_layout

\begin_layout LyX-Code
RES <mem_units>
\end_layout

\begin_layout Standard
Causes the memory location pointer to be advanced <mem_units>.
 Can be used to reserve data storage.
\end_layout

\begin_layout Standard
See also: FILL, ORG
\end_layout

\begin_layout Subsection*
SET
\begin_inset LatexCommand index
name "SET"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> SET <expression>
\end_layout

\begin_layout Standard
Temporarily assigns the value obtained by evaluating <expression> to the
 symbol <label>.
\end_layout

\begin_layout Standard
See also: SET
\end_layout

\begin_layout Subsection*
SPACE
\begin_inset LatexCommand index
name "SPACE"

\end_inset


\end_layout

\begin_layout LyX-Code
SPACE <expression>
\end_layout

\begin_layout Standard
Inserts <expression> number of blank lines into the listing file.
\end_layout

\begin_layout Standard
See also: LIST
\end_layout

\begin_layout Subsection*
SUBTITLE
\begin_inset LatexCommand index
name "SUBTITLE"

\end_inset


\end_layout

\begin_layout LyX-Code
SUBTITLE <string>
\end_layout

\begin_layout Standard
This directive establishes a second program header line for use as a subtitle
 in the listing output.
 <string> is an ASCII string enclosed by double quotes, no longer than 60
 characters.
\end_layout

\begin_layout Standard
See also: TITLE
\end_layout

\begin_layout Subsection*
TITLE
\begin_inset LatexCommand index
name "TITLE"

\end_inset


\end_layout

\begin_layout LyX-Code
TITLE <string>
\end_layout

\begin_layout Standard
This directive establishes a program header line for use as a title in the
 listing output.
 <string> is an ASCII string enclosed by double quotes, no longer than 60
 characters.
\end_layout

\begin_layout Standard
See also: SUBTITLE
\end_layout

\begin_layout Subsection*
UDATA
\begin_inset LatexCommand index
name "UDATA"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> UDATA <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new uninitialized data section in the output object file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.udata
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: CODE, IDATA, UDATA_ACS, UDATA_OVR, UDATA_SHR
\end_layout

\begin_layout Subsection*
UDATA_ACS
\begin_inset LatexCommand index
name "UDATA ACS"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> UDATA_ACS <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new uninitialized accessbank data section in the output object
 file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.udata_acs
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: CODE, IDATA, UDATA
\end_layout

\begin_layout Subsection*
UDATA_OVR
\begin_inset LatexCommand index
name "UDATA OVR"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> UDATA_OVR <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new uninitialized overlaid data section in the output object
 file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.udata_ovr
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: CODE, IDATA, UDATA
\end_layout

\begin_layout Subsection*
UDATA_SHR
\begin_inset LatexCommand index
name "UDATA SHR"

\end_inset


\end_layout

\begin_layout LyX-Code
<label> UDATA_SHR <expression>
\end_layout

\begin_layout Standard
Only for relocatable mode.
 Creates a new uninitialized sharebank data section in the output object
 file.
 <label> specifies the name of the section.
 If <label> is not specified the default name 
\begin_inset Quotes eld
\end_inset

.udata_shr
\begin_inset Quotes erd
\end_inset

 will be used.
 <expression> is optional and specifies the absolute address of the section.
 
\end_layout

\begin_layout Standard
See also: CODE, IDATA, UDATA
\end_layout

\begin_layout Subsection*
VARIABLE
\begin_inset LatexCommand index
name "VARIABLE"

\end_inset


\end_layout

\begin_layout LyX-Code
VARIABLE <label>[=<expression>, <label>[=<expression>]]*
\end_layout

\begin_layout Standard
Delcares variable with the name <label>.
 The value of <label> may later be reassigned.
 The value of <label> does not have to be assigned at declaration.
\end_layout

\begin_layout Standard
See also: CONSTANT
\end_layout

\begin_layout Subsection*
WHILE
\begin_inset LatexCommand index
name "WHILE"

\end_inset


\end_layout

\begin_layout LyX-Code
WHILE <expression>
\end_layout

\begin_layout Standard
Performs loop while <expression> is true.
\end_layout

\begin_layout Standard
See also: ENDW
\end_layout

\begin_layout Subsection
High level extensions
\end_layout

\begin_layout Standard
gpasm supports several directives for use with high level languages.
 These directives are easily identified because they start with 
\begin_inset Quotes eld
\end_inset

.
\begin_inset Quotes erd
\end_inset

.
 They are only available in relocatable mode.
\end_layout

\begin_layout Standard
These features are advanced and require knowledge of how gputils relocatable
 objects work.
 These features are intended to be used by compilers.
 Nothing prevents them from being used with assembly.
\end_layout

\begin_layout Subsection*
.DEF
\begin_inset LatexCommand index
name ".DEF"

\end_inset


\end_layout

\begin_layout LyX-Code
.DEF <symbol> [, <expression> ]*
\end_layout

\begin_layout Standard
Create a new COFF <symbol>.
 Options are listed in the table below:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
absolute
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Absolute symbol keyword 
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
class=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the symbol class (byte sized)
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
debug
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Debug symbol keyword 
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
extern
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
External symbol keyword
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
global
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Global symbol keyword
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
size=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Reserve words or bytes for the symbol
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
static
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Static Symbol keyword
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
type=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the symbol type (short sized)
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
value=nnn
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Sets the symbol value
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
This directive gives the user good control of the symbol table.
 This control is necessary, but if used incorrectly it can have many undesirable
 consequences.
 It can easily cause errors during linking or invalid machine code.
 The user must fully understand the operation of gputils COFF symbol table
 before modifying its contents.
\end_layout

\begin_layout Standard
For best results, only one of the single keywords should be used.
 The keyword should follow the symbol name.
 The keyword should then be followed by any expressions that directly set
 the values.
 Here is an example:
\end_layout

\begin_layout Standard
.def global_clock, global, type = T_ULONG, size = 4
\end_layout

\begin_layout Standard
See also: .DIM
\end_layout

\begin_layout Subsection*
.DIM
\begin_inset LatexCommand index
name ".DIM"

\end_inset


\end_layout

\begin_layout LyX-Code
.DIM <symbol>, <number>, <expression> [, <expression> ] *
\end_layout

\begin_layout Standard
Create <number> auxiliary symbols, attached to <symbol>.
 Fill the auxilary symbols with the values specified in <expression>.
 The expressions must result in byte sized values when evaluated or be strings.
 The symbol must be a COFF symbol.
\end_layout

\begin_layout Standard
This directive will generate an error if the symbol already has auxiliary
 symbols.
 This prevents the user from corrupting automatically generated symbols.
\end_layout

\begin_layout Standard
Each auxiliary symbol is 18 bytes.
 So the contents specified by the expressions must be less than or equal
 to 18 * <number>.
\end_layout

\begin_layout Standard
gpasm does not use auxilary symbols.
 So the contents have no effect on its operation.
 However, the contents may be used by gplink or a third party tool.
\end_layout

\begin_layout Standard
See also: .DEF
\end_layout

\begin_layout Subsection*
.DIRECT
\begin_inset LatexCommand index
name ".DIRECT"

\end_inset


\end_layout

\begin_layout LyX-Code
.DIRECT <command>, <string>
\end_layout

\begin_layout Standard
Provides a mechanism for direct communication from the program to the debugging
 environment.
 This method has no impact on the executable.
 The symbols will appear in both the COFF files and the COD files.
\end_layout

\begin_layout Standard
Each directive creates a new COFF symbol 
\begin_inset Quotes eld
\end_inset

.direct
\begin_inset Quotes erd
\end_inset

.
 An auxilary symbol is attached that contains <command> and <string>.
 The string must be less than 256 bytes.
 The command must have a value 0 to 255.
 There are no restrictions on the content, however these messages must conform
 to the debugging environment.
 The typical values are summarized in the table below:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ASCII command
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
a
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
User defined assert
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
A
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Assembler/Compiler defined assert
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
e
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
User defined emulator commands
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
E
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Assembler/Compiler defined emulator commands
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
f
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
User defined printf
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
F
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Assembler/Compiler defined printf
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
l
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
User defined log command
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
L
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Assembler/Compiler/Code verification generated log command
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
The symbols also contain the address where the message was inserted into
 the assembly.
 The symbols, with the final relocated addresses, are available in executable
 COFF.
 The symbols are also written to the COD file.
 They can be viewed using gpvc.
\end_layout

\begin_layout Standard
See also: .DEF, .DIM
\end_layout

\begin_layout Subsection*
.EOF
\begin_inset LatexCommand index
name ".EOF"

\end_inset


\end_layout

\begin_layout LyX-Code
.EOF
\end_layout

\begin_layout Standard
This directive causes an end of file symbol to be placed in the symbol table.
 Normally this symbol is automatically generated.
 This directive allows the user to manually generate the symbol.
 The directive is only processed if the 
\begin_inset Quotes eld
\end_inset

-g
\begin_inset Quotes erd
\end_inset

 command line option is used.
 When that option is used, the automatic symbol generation is disabled.
\end_layout

\begin_layout Standard
See also: .EOF, .FILE, .LINE
\end_layout

\begin_layout Subsection*
.FILE
\begin_inset LatexCommand index
name ".FILE"

\end_inset


\end_layout

\begin_layout LyX-Code
.FILE <string>
\end_layout

\begin_layout Standard
This directive causes a file symbol to be placed in the symbol table.
 Normally this symbol is automatically generated.
 This directive allows the user to manually generate the symbol.
 The directive is only processed if the 
\begin_inset Quotes eld
\end_inset

-g
\begin_inset Quotes erd
\end_inset

 command line option is used.
 When that option is used, the automatic symbol generation is disabled.
\end_layout

\begin_layout Standard
See also: .EOF, .FILE, .LINE
\end_layout

\begin_layout Subsection*
.IDENT
\begin_inset LatexCommand index
name ".IDENT"

\end_inset


\end_layout

\begin_layout LyX-Code
.IDENT <string>
\end_layout

\begin_layout Standard
Creates an .ident COFF symbol and appends an auxiliary symbol.
 The auxiliary symbol points to an entry in the string table.
 The entry contains <string>.
 It is an ASCII comment of any length.
 This symbol has no impact on the operation of gputils.
 It is commonly used to store compiler versions.
 
\end_layout

\begin_layout Standard
See also: .DEF, .DIM
\end_layout

\begin_layout Subsection*
.LINE
\begin_inset LatexCommand index
name ".LINE"

\end_inset


\end_layout

\begin_layout LyX-Code
.LINE <expression>
\end_layout

\begin_layout Standard
This directive causes and COFF line number to be generated.
 Normally they are automatically generated.
 This directive allows the user to manually generate the line numbers.
 The directive is only processed if the 
\begin_inset Quotes eld
\end_inset

-g
\begin_inset Quotes erd
\end_inset

 command line option is used.
 When that option is used, the automatic symbol generation is disabled.
 The <expression> is always evaluated as decimal regardless of the current
 radix setting.
\end_layout

\begin_layout Standard
See also: .EOF, .FILE, .LINE
\end_layout

\begin_layout Subsection*
.TYPE
\begin_inset LatexCommand index
name ".TYPE"

\end_inset


\end_layout

\begin_layout LyX-Code
.TYPE <symbol>, <expression>
\end_layout

\begin_layout Standard
This directive modifies the COFF type of an existing <symbol>.
 The symbol must be defined.
 The type must be 0 to 0xffff.
 Common types are defined in coff.inc.
 
\end_layout

\begin_layout Standard
COFF symbol types default to NULL in gpasm.
 Although the type has no impact linking or generating an executable, it
 does help in the debug environment.
\end_layout

\begin_layout Standard
See also: .DEF
\end_layout

\begin_layout Section
Instructions 
\end_layout

\begin_layout LyX-Code

\end_layout

\begin_layout Subsection
Instruction set summary
\end_layout

\begin_layout Subsubsection
12 bit Devices (PIC12C5XX)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="35" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Syntax
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ADDLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add immediate to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ADDWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add W to <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ANDLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
And W and literal, result in W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ANDWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
And W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BCF <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Clear <bit> of <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BSF <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set <bit> of <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BTFSC <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip next instruction if <bit> of <f> is clear
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BTFSS <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip next instruction if <bit> of <f> is set
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CALL <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Call subroutine
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Write zero to <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRW
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Write zero to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRWDT
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Reset watchdog timer
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
COMF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Complement <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
DECF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decrement <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
DECFSZ <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decrement <f>, result in <dst>, skip if zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
GOTO <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Go to <addr>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
INCF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Increment <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
INCFSZ <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Increment <f>, result in <dst>, skip if zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
IORLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Or W and immediate
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
IORWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Or W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move <f> to <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move literal to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVWF <f>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move W to <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
NOP
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
No operation
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
OPTION
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Load W with immediate and return
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RLF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Rotate <f> left, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RRF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Rotate <f> right, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SLEEP
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enter sleep mode
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SUBWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Subtract W from <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SWAPF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Swap nibbles of <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
TRIS
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
XORLW
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Xor W and immediate
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
XORWF
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Xor W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
14 Bit Devices (PIC16CXX)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="39" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Syntax
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ADDLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add immediate to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ADDWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add W to <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ANDLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
And immediate to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ANDWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
And W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BCF <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Clear <bit> of <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BSF <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set <bit> of <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BTFSC <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip next instruction if <bit> of <f> is clear
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BTFSS <f>,<bit>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip next instruction if <bit> of <f> is set
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CALL <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Call subroutine
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Write zero to <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRW
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Write zero to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRWDT
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Reset watchdog timer
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
COMF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Complement <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
DECF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decrement <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
DECFSZ <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decrement <f>, result in <dst>, skip if zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
GOTO <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Go to <addr>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
INCF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Increment <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
INCFSZ <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Increment <f>, result in <dst>, skip if zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
IORLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Or W and immediate
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
IORWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Or W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move <f> to <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move literal to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVWF <f>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move W to <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
NOP
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
No operation
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
OPTION
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETFIE
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Return from interrupt
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETLW <imm8>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Load W with immediate and return
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETURN
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Return from subroutine
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RLF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Rotate <f> left, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RRF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Rotate <f> right, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SLEEP
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enter sleep mode
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SUBLW
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Subtract W from literal
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SUBWF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Subtract W from <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SWAPF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Swap nibbles of <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
TRIS
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
XORLW
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Xor W and immediate
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
XORWF
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Xor W and <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Ubicom Processors
\end_layout

\begin_layout Standard
For Ubicom (Scenix) processors, the assembler supports the following instruction
s, in addition to those listed under 
\begin_inset Quotes eld
\end_inset

12 Bit Devices
\begin_inset Quotes erd
\end_inset

 above.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Syntax
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BANK <imm3>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
IREAD
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MODE <imm4>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVMW
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVWM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
PAGE <imm3>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETIW
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETP
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
RETURN
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Special macros
\end_layout

\begin_layout Standard
There are also a number of standard additional macros.
 These macros are:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="19" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Syntax
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Description
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
ADDCF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add carry to <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
B <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Branch
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BC <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Branch on carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BZ <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Branch on zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BNC <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Branch on no carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
BNZ <addr>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Branch on not zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRC
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Clear carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
CLRZ
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Clear zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SETC
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SETZ
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Set zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
MOVFW <f>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Move file to W
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
NEGF <f>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Negate <f>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SKPC
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip on carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SKPZ 
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip on zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SKPNC
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip on no carry
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SKPNZ 
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Skip on not zero
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
SUBCF <f>,<dst>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Subtract carry from <f>, result in <dst>
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
TSTF <f>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Test <f>
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Section
Errors/Warnings/Messages
\end_layout

\begin_layout Standard
gpasm writes every error message to two locations:
\end_layout

\begin_layout Itemize
the standard error output
\end_layout

\begin_layout Itemize
the list file (
\begin_inset Quotes eld
\end_inset

.lst
\begin_inset Quotes erd
\end_inset

)
\end_layout

\begin_layout Standard
The format of error messages is:
\end_layout

\begin_layout LyX-Code
Error <src-file> <line> : <code> <description>
\end_layout

\begin_layout Standard
where:
\end_layout

\begin_layout Description
<src-file> is the source file where gpasm encountered the error
\end_layout

\begin_layout Description
<line> is the line number
\end_layout

\begin_layout Description
<code> is the 3-digit code for the error, given in the list below
\end_layout

\begin_layout Description
<description> is a short description of the error.
 In some cases this contains further information about the error.
\end_layout

\begin_layout Standard
Error messages are suitable for parsing by emacs' 
\begin_inset Quotes eld
\end_inset

compilation mode
\begin_inset Quotes erd
\end_inset

.
 This chapter lists the error messages that gpasm produces.
 
\end_layout

\begin_layout Subsection
Errors
\end_layout

\begin_layout Description
101 ERROR directive
\end_layout

\begin_layout Standard
A user-generated error.
 See the ERROR directive for more details.
\end_layout

\begin_layout Description
108 Illegal character
\end_layout

\begin_layout Standard
gpasm encountered an illegal character in a source file.
\end_layout

\begin_layout Description
113 Symbol not previously defined
\end_layout

\begin_layout Standard
gpasm encountered an unrecognized symbol.
\end_layout

\begin_layout Description
114 Divide by zero
\end_layout

\begin_layout Standard
gpasm encountered a divide by zero.
\end_layout

\begin_layout Description
115 Duplicate Label
\end_layout

\begin_layout Standard
Duplicate label or redefining a symbol that can not be redefined.
\end_layout

\begin_layout Description
116 Address label duplicated or different in second pass
\end_layout

\begin_layout Standard
Label resolved to a different address on gpasm's second pass.
\end_layout

\begin_layout Description
118 Overwriting previous address contents
\end_layout

\begin_layout Standard
gpasm was instructed to write different values into the same address.
\end_layout

\begin_layout Description
120 Call or jump not allowed
\end_layout

\begin_layout Standard
gpasm was instructed to write different values into the same address.
\end_layout

\begin_layout Description
121 Illegal label
\end_layout

\begin_layout Standard
gpasm encountered an illegal label.
\end_layout

\begin_layout Description
123 Illegal directive
\end_layout

\begin_layout Standard
The specified directive is not valid for this processor.
\end_layout

\begin_layout Description
124 Illegal Argument
\end_layout

\begin_layout Standard
gpasm encountered an illegal argument in an expression.
 
\end_layout

\begin_layout Description
125 Illegal Condition
\end_layout

\begin_layout Standard
An illegal condition like a missing ENDIF or ENDW has been encountered.
\end_layout

\begin_layout Description
126 Argument out of Range
\end_layout

\begin_layout Standard
The expression has an argument that was out of range.
\end_layout

\begin_layout Description
127 Too many arguments
\end_layout

\begin_layout Standard
gpasm encountered an expression with too many arguments.
\end_layout

\begin_layout Description
128 Missing argument(s)
\end_layout

\begin_layout Standard
gpasm encountered an expression with at least one missing argument.
\end_layout

\begin_layout Description
129 Expected
\end_layout

\begin_layout Standard
Expected a certain type of argument.
 
\end_layout

\begin_layout Description
130 Processor type previously defined
\end_layout

\begin_layout Standard
The processor is being redefined.
 
\end_layout

\begin_layout Description
131 Undefined processor
\end_layout

\begin_layout Standard
The processor type has not been defined.
 
\end_layout

\begin_layout Description
132 Unknown processor
\end_layout

\begin_layout Standard
The selected processor is not valid.
 Check the processors listed in section 
\begin_inset LatexCommand ref
reference "sec:processors"

\end_inset

.
\end_layout

\begin_layout Description
133 Hex file format INHX32 required
\end_layout

\begin_layout Standard
An address above 32K was specified.
 
\end_layout

\begin_layout Description
135 Macro name missing
\end_layout

\begin_layout Standard
A macro was defined without a name.
 
\end_layout

\begin_layout Description
136 Duplicate macro name
\end_layout

\begin_layout Standard
A macro name was duplicated.
 
\end_layout

\begin_layout Description
140 Illegal WHILE loop
\end_layout

\begin_layout Standard
gpasm encountered an infinite loop or a loop with too many iterations (more
 than 256).
 
\end_layout

\begin_layout Description
145 Unmatched ENDM
\end_layout

\begin_layout Standard
ENDM found without a macro definition.
 
\end_layout

\begin_layout Description
149 Object-only directive
\end_layout

\begin_layout Standard
Attempt to use relocatable-mode directive when generating HEX file directly.
 
\end_layout

\begin_layout Description
151 Unresolvable or too complex label
\end_layout

\begin_layout Standard
Labels must be resolvable to a relocatable address plus a constant.
 
\end_layout

\begin_layout Description
152 Wrong section
\end_layout

\begin_layout Standard
Code or data defined in an invalid section.
 
\end_layout

\begin_layout Description
154 Section names must be unique
\end_layout

\begin_layout Standard
Multiple object sections were defined with the same name.
 
\end_layout

\begin_layout Description
156 Operand must be label
\end_layout

\begin_layout Standard
gpasm encountered a non-label operand where an address label was expected.
 
\end_layout

\begin_layout Description
157 ORG at odd address
\end_layout

\begin_layout Standard
ORG directive must take an even address as the start of an absolute section.
 
\end_layout

\begin_layout Description
159 Odd number of FILL bytes
\end_layout

\begin_layout Standard
In PIC18CXX devices the number of bytes must be even.
 
\end_layout

\begin_layout Description
164 Multiple __IDLOC directives
\end_layout

\begin_layout Standard
Multiple __IDLOC object sections were defined.
 
\end_layout

\begin_layout Description
168 Missing brackets
\end_layout

\begin_layout Standard
Square brackets required around offset operand.
  
\end_layout

\begin_layout Description
176 Unknown CONFIG
\end_layout

\begin_layout Standard
An error occured with the CONFIG directive.
 
\end_layout

\begin_layout Description
177 Cannot mix CONFIG and __CONFIG directives
\end_layout

\begin_layout Standard
CONFIG and __CONFIG directives cannot both be used in the same project.
 
\end_layout

\begin_layout Subsection
Warnings
\end_layout

\begin_layout Description
201 Symbol not previously defined.
\end_layout

\begin_layout Standard
The symbol being #undefined was not previously defined.
\end_layout

\begin_layout Description
202 Argument out of range
\end_layout

\begin_layout Standard
The argument does not fit in the allocated space.
\end_layout

\begin_layout Description
203 Opcode in column 1
\end_layout

\begin_layout Standard
Opcodes should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
205 Directive in column 1
\end_layout

\begin_layout Standard
Directives should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
206 Macro call in column 1
\end_layout

\begin_layout Standard
Macro calls should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
207 Label after column 1
\end_layout

\begin_layout Standard
Labels should be unindented to distinguish them from directives and opcodes.
\end_layout

\begin_layout Description
209 Missing quote
\end_layout

\begin_layout Standard
Inserted close quote after quoted string.
\end_layout

\begin_layout Description
211 Extraneous arguments
\end_layout

\begin_layout Standard
Extra arguments were found on the line.
\end_layout

\begin_layout Description
215 Processor superseded by command line
\end_layout

\begin_layout Standard
The processor was specified on the command line and in the source file.
 The command line has precedence.
\end_layout

\begin_layout Description
216 Radix superseded by command line
\end_layout

\begin_layout Standard
The radix was specified on the command line and in the source file.
 The command line has precedence.
\end_layout

\begin_layout Description
217 Hex format superseded by command line
\end_layout

\begin_layout Standard
The hex file format was specified on the command line and in the source
 file.
 The command line has precedence.
\end_layout

\begin_layout Description
218 Expected DEC, OCT, HEX.
 Will use HEX.
\end_layout

\begin_layout Standard
gpasm encountered an invalid radix.
\end_layout

\begin_layout Description
219 Invalid RAM location specified.
\end_layout

\begin_layout Standard
gpasm encountered an invalid RAM location as specified by the __MAXRAM and
 __BADRAM directives.
\end_layout

\begin_layout Description
220 Exceeded maximum ROM
\end_layout

\begin_layout Standard
Data emitted past maximum ROM address.
\end_layout

\begin_layout Description
222 Error messages can not be disabled
\end_layout

\begin_layout Standard
Error messages can not be disabled using the ERRORLEVEL directive.
\end_layout

\begin_layout Description
223 Redefining processor
\end_layout

\begin_layout Standard
The processor is being reselected by the LIST or PROCESSOR directive.
\end_layout

\begin_layout Description
224 Use of this instruction is not recommanded
\end_layout

\begin_layout Standard
Use of the TRIS and OPTION instructions is not recommended for a PIC16CXX
 device.
\end_layout

\begin_layout Description
228 Invalid ROM location specified.
\end_layout

\begin_layout Standard
gpasm encountered an invalid ROM location as specified by the __MAXROM and
 __BADROM directives.
\end_layout

\begin_layout Subsection
Messages
\end_layout

\begin_layout Description
301 User Message
\end_layout

\begin_layout Standard
User message, invoked with the MESSG directive.
\end_layout

\begin_layout Description
302 Register not in bank 0
\end_layout

\begin_layout Standard
Accessing a register outside of bank 0.
 User must select the appropriate bank with banksel or similar directives.
\end_layout

\begin_layout Description
303 Program word too large.
 Truncated to core size.
\end_layout

\begin_layout Standard
gpasm has encounter a program word larger than the core size of the selected
 device.
 
\end_layout

\begin_layout Description
304 ID Locations value too large.
 Last four hex digits used.
\end_layout

\begin_layout Standard
The ID locations value specified is too large.
\end_layout

\begin_layout Description
305 Using default destination of 1 (file).
\end_layout

\begin_layout Standard
No destination was specified so the default location was used.
\end_layout

\begin_layout Description
306 Crossing page boundary
\end_layout

\begin_layout Standard
ROM address crossed boundary between pages.
 User must select appropriate page with pagesel or similar directives when
 using call or goto directives.
\end_layout

\begin_layout Description
308 Warning level superseded by command line
\end_layout

\begin_layout Standard
The warning level was specified on the command line and in the source file.
 The command line has precedence.
\end_layout

\begin_layout Description
309 Macro expansion superseded by command line
\end_layout

\begin_layout Standard
Macro expansion was specified on the command line and in the source file.
 The command line has precedence.
\end_layout

\begin_layout Description
312 Page or Bank selection not needed
\end_layout

\begin_layout Standard
This device does not use special page or bank selection code.
\end_layout

\begin_layout Description
313 Uninitialized CBLOCK
\end_layout

\begin_layout Standard
First CBLOCK has no initial value.
 Assuming a value of 0.
\end_layout

\begin_layout Description
316 W register modified
\end_layout

\begin_layout Standard
Hidden use of the W register overwrites previous value.
 User may need to save and restore the original value.
\end_layout

\begin_layout Description
318 Special mnemonic used
\end_layout

\begin_layout Standard
Using special instruction mnemonic which may map to one or several instructions.
\end_layout

\begin_layout Chapter
gplink
\end_layout

\begin_layout Standard
gplink relocates and links gpasm COFF objects and generates an absolute
 executable COFF.
\end_layout

\begin_layout Section
Running gplink
\begin_inset LatexCommand index
name "Running gplink"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gplink is
\end_layout

\begin_layout LyX-Code
gplink [options] [objects] [libraries]
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="17" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
a
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Produce hex file in one of four formats: inhx8m, inhx8s, inhx16, inhx32
 (the default)
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
c
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output an executable object
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
d
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display debug messages
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
f <value>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Fill unused unprotected program memory with <value>
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
I <directory>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Specify an include directory
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
l
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Disable the list file output
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
m
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Output a map file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
o <file>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Alternate name of hex output file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
O <level>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Optimization level
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
q
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Quiet
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Attempt to relocate unshared data sections to shared memory if relocation
 fails
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s <file>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Specify linker script
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
-t <value>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Create a stack section
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gplink version information and exit
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
w
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Disable processor mismatch warning.
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Section
gplink outputs
\end_layout

\begin_layout Standard
gplink creates an absolute executable COFF.
 From this COFF a hex file and cod file are created.
 The executable COFF is only written when the 
\begin_inset Quotes eld
\end_inset

-c
\begin_inset Quotes erd
\end_inset

 option is added.
 This file is useful for simulating the design with mpsim.
 The cod file is used for simulating with gpsim.
\end_layout

\begin_layout Standard
gplink can also create a map file.
 The map file reports the final addresses gplink has assigned to the COFF
 sections.
 This is the same data that can be viewed in the executable COFF with gpvo.
\end_layout

\begin_layout Section
Linker scripts
\end_layout

\begin_layout Standard
gplink requires a linker script.
 This script tells gplink what memory is available in the target processor.
 A set of Microchip generated scripts are installed with gputils.
 These scripts were intended as a starting point, but for many applications
 they will work as is.
\end_layout

\begin_layout Standard
If the user does not specify a linker script, gplink will attempt to use
 the default script for the processor reported in the object file.
 The default location of the scripts is reported in the gplink help message.
\end_layout

\begin_layout Section
Stacks
\end_layout

\begin_layout Standard
gplink can create a stack section at link time using a stack directive in
 the linker script.
 The same feature can be utilized with a -t option on the command line.
 gplink will create the section and two symbols.
 _stack points to the beginning of the stack section and _stack_end points
 to the end.
\end_layout

\begin_layout Section
Optimization
\end_layout

\begin_layout Standard
gplink is an optimizing linker.
 There are four different optimzation levels.
 Each level includes all optimizations of lower levels.
 Increasing the level typically increases the link time required.
\end_layout

\begin_layout Subsection
Level 0
\end_layout

\begin_layout Standard
No optimizations.
\end_layout

\begin_layout Subsection
Level 1 (default)
\end_layout

\begin_layout Subsubsection
Weak Symbols
\end_layout

\begin_layout Standard
A weak symbol is an external symbol declaration that isn't used.
 These symbols are typically created by declaring functions or data that
 isn't used.
 Including these symbols might lead to extra objects being extracted from
 archives for symbol resolution.
 That will increase the data and program memory used.
 This optimzation removes all weak symbols when the object file is read
 by the linker.
\end_layout

\begin_layout Subsection
Level 2
\end_layout

\begin_layout Subsubsection
Dead Sections
\end_layout

\begin_layout Standard
A dead section is any section that doesn't have relocations pointing to
 its symbols.
 This means the code or data in the section is never accesed.
 This optimization removes the section and its symbols to reduce program
 and data memory.
 This optimization will not remove any absolute sections.
\end_layout

\begin_layout Subsection
Level 3
\end_layout

\begin_layout Standard
No optimizations.
\end_layout

\begin_layout Chapter
gplib
\end_layout

\begin_layout Standard
gplib creates, modifies and extracts COFF archives.
 This allows a related group of objects to be combined into one file.
 Then this one file is passed to gplink.
 
\end_layout

\begin_layout Section
Running gplib
\begin_inset LatexCommand index
name "Running gplib"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gplib is
\end_layout

\begin_layout LyX-Code
gplib [options] library [member]
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
c
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Create a new library
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
d
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Delete member from library
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
n
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Don't add the symbol index
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
q
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Quiet mode
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Add or replace member from library
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
List global symbols in libary
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
t
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
List member in library
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gplib version information and exit
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
x
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Extract member from library
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Section
Creating an archive
\begin_inset LatexCommand index
name "Creating an archive"

\end_inset


\end_layout

\begin_layout Standard
The most common operation is to create a new archive: 
\end_layout

\begin_layout LyX-Code
gplib -c math.a mult.o add.o sub.o
\end_layout

\begin_layout Standard
This command will create a new archive 
\begin_inset Quotes eld
\end_inset

math.a
\begin_inset Quotes erd
\end_inset

 that contains 
\begin_inset Quotes eld
\end_inset

mult.o add.o sub.o
\begin_inset Quotes erd
\end_inset

.
 
\end_layout

\begin_layout Standard
The name of the archive 
\begin_inset Quotes eld
\end_inset

math.a
\begin_inset Quotes erd
\end_inset

 is arbitrary.
 The tools do not use the file extension to determine file type.
 It could just as easily been 
\begin_inset Quotes eld
\end_inset

math.lib
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

math
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Standard
When you use the library, simply add it to the list of object passed to
 gplink.
 gplink will scan the library and only extract the archive members that
 are required to resolve external references.
 So the application won't necessarily contain the code of all the archive
 members.
\end_layout

\begin_layout Section
Other gplib operations
\begin_inset LatexCommand index
name "Other gplib operations"

\end_inset


\end_layout

\begin_layout Standard
Most of the other are useful , but will be used much less often.
 For example you can replace individual archive members, but most people
 elect to delete the old archive and create a new one.
\end_layout

\begin_layout Section
Archive format
\begin_inset LatexCommand index
name "Archive format"

\end_inset


\end_layout

\begin_layout Standard
The file format is a standard COFF archive.
 A header is added to each member and the unmodified object is copied into
 the archive.
\end_layout

\begin_layout Standard
Being a standard archive they do include a symbol index.
 It provides a simple why to determine which member should be extract to
 resolve external references.
 This index is not included in mplib archives.
 So using gplib archives with Microchip Tools will probably cause problems
 unles the 
\begin_inset Quotes eld
\end_inset

-n
\begin_inset Quotes erd
\end_inset

 option is added when the archive is created.
\end_layout

\begin_layout Chapter
Utilities
\end_layout

\begin_layout Section
gpdasm
\begin_inset LatexCommand index
name "gpdasm"

\end_inset


\end_layout

\begin_layout Standard
gpdasm is a disassembler for gputils.
 It converts hex files generated by gpasm and gplink into disassembled instructi
ons.
\end_layout

\begin_layout Subsection
Running gpdasm
\begin_inset LatexCommand index
name "Running gpdasm"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gpdasm is
\end_layout

\begin_layout LyX-Code
gpdasm [options] hex-file
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
c
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decode special mnemonics
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
i
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display hex file information
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
l
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
List supported processors
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
m
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Memory dump hex file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
p<processor>
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Select processor
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print short form output
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gpdasm version information and exit
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
y
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enable 18xx extended mode
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
gpdasm doesn't specifically create an output file.
 It dumps its output to the screen.
 This helps to reduce the risk that a good source file will be unintentionally
 overwritten.
 If you want to create an output file and your shell is 
\begin_inset LatexCommand index
name "sh"

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset LatexCommand index
name "bash"

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset LatexCommand index
name "ksh"

\end_inset


\begin_inset Quotes eld
\end_inset

ksh
\begin_inset Quotes erd
\end_inset

, you can do something like:
\end_layout

\begin_layout LyX-Code
gpdasm test.hex > test.dis
\end_layout

\begin_layout Standard
This redirects standard output to the file 
\begin_inset Quotes eld
\end_inset

test.dis
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Subsection
Comments on Disassembling
\end_layout

\begin_layout Itemize
The gpdasm only uses a hex file as an input.
 Because of this it has no way to distinguish between instructions and data
 in program memory.
 
\end_layout

\begin_layout Itemize
If gpdasm encounters an unknown instruction it uses the DW directive and
 treats it as raw data.
\end_layout

\begin_layout Itemize
There are DON'T CARE bits in the instruction words.
 Normally, this isn't a problem.
 It could be, however, if a file with data in the program memory space is
 disassembled and then reassembled.
 Example: gpdasm will treat 0x0060 in a 14 bit device as a NOP.
 If the output is then reassembled, gpasm will assign a 0x0000 value.
 The value has changed and both tools are behaving correctly.
\end_layout

\begin_layout Section
gpstrip
\begin_inset LatexCommand index
name "gpvo"

\end_inset


\end_layout

\begin_layout Standard
gpstrip manipulates the sections and symbol tables of gputils object files.
\end_layout

\begin_layout Subsection
Running gpstrip
\begin_inset LatexCommand index
name "Running gpvo"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gpstrip is
\end_layout

\begin_layout LyX-Code
gpstrip [options] object-file
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="13" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
g
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Strip debug symbols
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
k
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Keep symbol
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
n
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Remove symbol
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
o
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Alternate output file
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
p
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Preserve dates
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Remove section
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Remove all symbols
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
u
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Remove all symbols not needed for relocations
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show version
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
V
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Verbose mode
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
x
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Remove non-global symbols
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Section
gpvc
\begin_inset LatexCommand index
name "gpvc"

\end_inset


\end_layout

\begin_layout Standard
gpvc is cod file viewer for gputils.
 It provides an easy way to view the contents of the cod files generated
 by gpasm and gplink.
\end_layout

\begin_layout Subsection
Running gpvc
\begin_inset LatexCommand index
name "Running gpvc"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gpvc is
\end_layout

\begin_layout LyX-Code
gpvc [options] cod-file
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
a
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display all information
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
d
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display directory header
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display symbols
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show the help message.
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
r
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display ROM
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
l
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display source listing
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
m
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Display debug message area
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gpvc version information and exit
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
gpvc doesn't specifically create an output file.
 It dumps its output to the screen.
 If you want to create an output file and your shell is 
\begin_inset LatexCommand index
name "sh"

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset LatexCommand index
name "bash"

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset LatexCommand index
name "ksh"

\end_inset


\begin_inset Quotes eld
\end_inset

ksh
\begin_inset Quotes erd
\end_inset

, you can do something like:
\end_layout

\begin_layout LyX-Code
gpvc test.cod > test.dump
\end_layout

\begin_layout Standard
This redirects standard output to the file 
\begin_inset Quotes eld
\end_inset

test.dump
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Section
gpvo
\begin_inset LatexCommand index
name "gpvo"

\end_inset


\end_layout

\begin_layout Standard
gpvo is COFF object file viewer for gputils.
 It provides an easy way to view the contents of objects generated by gpasm
 and gplink.
\end_layout

\begin_layout Subsection
Running gpvo
\begin_inset LatexCommand index
name "Running gpvo"

\end_inset


\end_layout

\begin_layout Standard
The general syntax for running gpvo is
\end_layout

\begin_layout LyX-Code
gpvo [options] object-file
\end_layout

\begin_layout Standard
Where options can be one of:
\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="11" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" rightline="true" width="4in">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Option
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Meaning
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
b
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Binary data
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
c
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Decode special mnemonics
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
f
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
File header
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
h
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Show the help message
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
n
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Suppress filenames
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
s
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Section data
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
t
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Symbol data
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
v
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Print gpvo version information and exit
\end_layout

\end_inset
</cell>
</row>
<row topline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
x FILE
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Export symbols to an include file.
\end_layout

\end_inset
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
y
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Standard
Enable 18xx extended mode
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset VSpace 0.3cm
\end_inset


\end_layout

\begin_layout Standard
gpvo doesn't specifically create an output file.
 It dumps its output to the screen.
 If you want to create an output file and your shell is 
\begin_inset LatexCommand index
name "sh"

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset LatexCommand index
name "bash"

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset LatexCommand index
name "ksh"

\end_inset


\begin_inset Quotes eld
\end_inset

ksh
\begin_inset Quotes erd
\end_inset

, you can do something like:
\end_layout

\begin_layout LyX-Code
gpvo test.obj > test.dump
\end_layout

\begin_layout Standard
This redirects standard output to the file 
\begin_inset Quotes eld
\end_inset

test.dump
\begin_inset Quotes erd
\end_inset

.
\end_layout

\begin_layout Standard
\begin_inset LatexCommand printindex

\end_inset


\end_layout

\end_body
\end_document
