#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass book
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding default
\fontencoding global
\font_roman times
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 10
\spacing single
\use_hyperref false
\papersize letterpaper
\use_geometry true
\use_amsmath 1
\use_esint 0
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 34mm
\rightmargin 34mm
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Title
gputils 0.14.1
\end_layout

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

\begin_layout Date
January 1, 2012
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
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 Index idx
status collapsed

\begin_layout Plain Layout
GNU
\end_layout

\end_inset

GNU General Public 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
License
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
NO WARRANTY
\end_layout

\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 Standard
gputils currently supports all processors supported by MPLAB 8.20 and all
 enhanced 14 bit devices from MPLAB 8.80.
 This includes the following processors:
\begin_inset Newline newline
\end_inset


\end_layout

\begin_layout LyX-Code
eeprom8    eeprom16   gen        hcs1365    hcs1370    mcv08a     
\begin_inset Newline newline
\end_inset

mcv14a     mcv18a     mcv28a     p10f200    p10f202    p10f204    
\begin_inset Newline newline
\end_inset

p10f206    p10f220    p10f222    p12c508    p12c508a   p12f508    
\begin_inset Newline newline
\end_inset

p12c509    p12c509a   p12cr509a  p12f509    p12f510    p12ce518   
\begin_inset Newline newline
\end_inset

p12ce519   p12f519    p12f609    p12hv609   p12f615    p12hv615   
\begin_inset Newline newline
\end_inset

p12f629    p12f635    p12c671    p12c672    p12ce673   p12ce674   
\begin_inset Newline newline
\end_inset

p12f675    p12f683    p12f1822   p12lf1822  p12f1840   p12lf1840  
\begin_inset Newline newline
\end_inset

p14000     p16cxx     p16f1455   p16lf1455  p16f1458   p16lf1458  
\begin_inset Newline newline
\end_inset

p16f1459   p16lf1459  p16f1503   p16lf1503  p16f1507   p16lf1507  
\begin_inset Newline newline
\end_inset

p16f1508   p16lf1508  p16f1509   p16lf1509  p16f1516   p16lf1516  
\begin_inset Newline newline
\end_inset

p16f1517   p16lf1517  p16f1518   p16lf1518  p16f1519   p16lf1519  
\begin_inset Newline newline
\end_inset

p16f1526   p16lf1526  p16f1527   p16lf1527  p16f1782   p16lf1782  
\begin_inset Newline newline
\end_inset

p16f1783   p16lf1783  p16f1823   p16lf1823  p16f1824   p16lf1824  
\begin_inset Newline newline
\end_inset

p16f1825   p16lf1825  p16f1826   p16lf1826  p16f1827   p16lf1827  
\begin_inset Newline newline
\end_inset

p16f1828   p16lf1828  p16f1829   p16lf1829  p16f1847   p16lf1847  
\begin_inset Newline newline
\end_inset

p16lf1902  p16lf1903  p16lf1904  p16lf1906  p16lf1907  p16f1933   
\begin_inset Newline newline
\end_inset

p16lf1933  p16f1934   p16lf1934  p16f1936   p16lf1936  p16f1937   
\begin_inset Newline newline
\end_inset

p16lf1937  p16f1938   p16lf1938  p16f1939   p16lf1939  p16f1946   
\begin_inset Newline newline
\end_inset

p16lf1946  p16f1947   p16lf1947  p16c432    p16c433    p16c5x     
\begin_inset Newline newline
\end_inset

p16c505    p16f505    p16f506    p16c52     p16f526    p16c54     
\begin_inset Newline newline
\end_inset

p16c54a    p16c54b    p16c54c    p16cr54    p16cr54a   p16cr54b   
\begin_inset Newline newline
\end_inset

p16cr54c   p16f54     p16hv540   p16c55     p16c55a    p16c554    
\begin_inset Newline newline
\end_inset

p16c557    p16c558    p16c56     p16c56a    p16cr56a   p16c57     
\begin_inset Newline newline
\end_inset

p16c57c    p16cr57a   p16cr57b   p16cr57c   p16f57     p16c58a    
\begin_inset Newline newline
\end_inset

p16c58b    p16cr58a   p16cr58b   p16f59     p16c61     p16f610    
\begin_inset Newline newline
\end_inset

p16hv610   p16f616    p16hv616   p16c62     p16c62a    p16c62b    
\begin_inset Newline newline
\end_inset

p16cr62    p16c620    p16c620a   p16cr620a  p16c621    p16c621a   
\begin_inset Newline newline
\end_inset

p16c622    p16c622a   p16ce623   p16ce624   p16ce625   p16f627    
\begin_inset Newline newline
\end_inset

p16f627a   p16f628    p16f628a   p16c63     p16c63a    p16cr63    
\begin_inset Newline newline
\end_inset

p16f630    p16f631    p16f636    p16f639    p16c64     p16c64a    
\begin_inset Newline newline
\end_inset

p16cr64    p16c642    p16f648a   p16c65     p16c65a    p16c65b    
\begin_inset Newline newline
\end_inset

p16cr65    p16c66     p16c662    p16c67     p16f676    p16f677    
\begin_inset Newline newline
\end_inset

p16f684    p16f685    p16f687    p16f688    p16f689    p16f690    
\begin_inset Newline newline
\end_inset

p16c71     p16c710    p16c711    p16c712    p16c715    p16c716    
\begin_inset Newline newline
\end_inset

p16f716    p16c717    p16c72     p16c72a    p16cr72    p16f72     
\begin_inset Newline newline
\end_inset

p16f722    p16lf722   p16f723    p16lf723   p16f724    p16lf724   
\begin_inset Newline newline
\end_inset

p16f726    p16lf726   p16f727    p16lf727   p16c73     p16c73a    
\begin_inset Newline newline
\end_inset

p16c73b    p16f73     p16f737    p16c74     p16c74a    p16c74b    
\begin_inset Newline newline
\end_inset

p16f74     p16c745    p16f747    p16c76     p16f76     p16c765    
\begin_inset Newline newline
\end_inset

p16f767    p16c77     p16f77     p16c770    p16c771    p16c773    
\begin_inset Newline newline
\end_inset

p16c774    p16f777    p16c781    p16c782    p16f785    p16hv785   
\begin_inset Newline newline
\end_inset

p16f818    p16f819    p16cr83    p16f83     p16c84     p16cr84    
\begin_inset Newline newline
\end_inset

p16f84     p16f84a    p16f87     p16f870    p16f871    p16f872    
\begin_inset Newline newline
\end_inset

p16f873    p16f873a   p16f874    p16f874a   p16f876    p16f876a   
\begin_inset Newline newline
\end_inset

p16f877    p16f877a   p16f88     p16f882    p16f883    p16f884    
\begin_inset Newline newline
\end_inset

p16f886    p16f887    p16f913    p16f914    p16f916    p16f917    
\begin_inset Newline newline
\end_inset

p16c923    p16c924    p16c925    p16c926    p16f946    p17cxx     
\begin_inset Newline newline
\end_inset

p17c42     p17c42a    p17cr42    p17c43     p17cr43    p17c44     
\begin_inset Newline newline
\end_inset

p17c752    p17c756    p17c756a   p17c762    p17c766    p18cxx     
\begin_inset Newline newline
\end_inset

p18f1220   p18f1230   p18f1320   p18f13k22  p18lf13k22 p18f1330   
\begin_inset Newline newline
\end_inset

p18f13k50  p18lf13k50 p18f14k22  p18lf14k22 p18f14k50  p18lf14k50 
\begin_inset Newline newline
\end_inset

p18f2220   p18f2221   p18f2320   p18f23k20  p18f23k22  p18f2321   
\begin_inset Newline newline
\end_inset

p18f2331   p18f2410   p18f24j10  p18f24j11  p18lf24j11 p18c242    
\begin_inset Newline newline
\end_inset

p18f242    p18f2420   p18f24k20  p18f24k22  p18f2423   p18f2431   
\begin_inset Newline newline
\end_inset

p18f2439   p18f2450   p18f24j50  p18lf24j50 p18f2455   p18f2458   
\begin_inset Newline newline
\end_inset

p18f248    p18f2480   p18f2510   p18f25j10  p18f25j11  p18lf25j11 
\begin_inset Newline newline
\end_inset

p18f2515   p18c252    p18f252    p18f2520   p18f25k20  p18f25k22  
\begin_inset Newline newline
\end_inset

p18f2523   p18f2525   p18f2539   p18f2550   p18f25j50  p18lf25j50 
\begin_inset Newline newline
\end_inset

p18f2553   p18f258    p18f2580   p18f2585   p18f2610   p18f26j11  
\begin_inset Newline newline
\end_inset

p18lf26j11 p18f2620   p18f26k20  p18f26k22  p18f26j50  p18lf26j50 
\begin_inset Newline newline
\end_inset

p18f2680   p18f2681   p18f2682   p18f2685   p18f4220   p18f4221   
\begin_inset Newline newline
\end_inset

p18f4320   p18f43k20  p18f43k22  p18f4321   p18f4331   p18f4410   
\begin_inset Newline newline
\end_inset

p18f44j10  p18f44j11  p18lf44j11 p18c442    p18f442    p18f4420   
\begin_inset Newline newline
\end_inset

p18f44k20  p18f44k22  p18f4423   p18f4431   p18f4439   p18f4450   
\begin_inset Newline newline
\end_inset

p18f44j50  p18lf44j50 p18f4455   p18f4458   p18f448    p18f4480   
\begin_inset Newline newline
\end_inset

p18f4510   p18f45j10  p18f45j11  p18lf45j11 p18f4515   p18c452    
\begin_inset Newline newline
\end_inset

p18f4520   p18f45k20  p18f45k22  p18f4523   p18f4525   p18f4539   
\begin_inset Newline newline
\end_inset

p18f4550   p18f45j50  p18lf45j50 p18f4553   p18f458    p18f4580   
\begin_inset Newline newline
\end_inset

p18f4585   p18f4610   p18f46j11  p18lf46j11 p18f4620   p18f46k20  
\begin_inset Newline newline
\end_inset

p18f46k22  p18f46j50  p18lf46j50 p18f4680   p18f4681   p18f4682   
\begin_inset Newline newline
\end_inset

p18f4685   p18c601    p18f6310   p18f63j11  p18f6390   p18f63j90  
\begin_inset Newline newline
\end_inset

p18f6393   p18f6410   p18f64j11  p18f64j15  p18f6490   p18f64j90  
\begin_inset Newline newline
\end_inset

p18f6493   p18f65j10  p18f65j11  p18f65j15  p18f6520   p18f6525   
\begin_inset Newline newline
\end_inset

p18f6527   p18f65j50  p18c658    p18f6585   p18f65j90  p18f66j10  
\begin_inset Newline newline
\end_inset

p18f66j11  p18f66j15  p18f66j16  p18f6620   p18f6621   p18f6622   
\begin_inset Newline newline
\end_inset

p18f6627   p18f6628   p18f66j50  p18f66j55  p18f66j60  p18f66j65  
\begin_inset Newline newline
\end_inset

p18f6680   p18f66j90  p18f67j10  p18f67j11  p18f6720   p18f6722   
\begin_inset Newline newline
\end_inset

p18f6723   p18f67j50  p18f67j60  p18f67j90  p18c801    p18f8310   
\begin_inset Newline newline
\end_inset

p18f83j11  p18f8390   p18f83j90  p18f8393   p18f8410   p18f84j11  
\begin_inset Newline newline
\end_inset

p18f84j15  p18f8490   p18f84j90  p18f8493   p18f85j10  p18f85j11  
\begin_inset Newline newline
\end_inset

p18f85j15  p18f8520   p18f8525   p18f8527   p18f85j50  p18c858    
\begin_inset Newline newline
\end_inset

p18f8585   p18f85j90  p18f86j10  p18f86j11  p18f86j15  p18f86j16  
\begin_inset Newline newline
\end_inset

p18f8620   p18f8621   p18f8622   p18f8627   p18f8628   p18f86j50  
\begin_inset Newline newline
\end_inset

p18f86j55  p18f86j60  p18f86j65  p18f8680   p18f86j90  p18f87j10  
\begin_inset Newline newline
\end_inset

p18f87j11  p18f8720   p18f8722   p18f8723   p18f87j50  p18f87j60  
\begin_inset Newline newline
\end_inset

p18f87j90  p18f96j60  p18f96j65  p18f97j60  ps500      ps810      
\begin_inset Newline newline
\end_inset

rf509af    rf509ag    rf675f     rf675h     rf675k     sx18       
\begin_inset Newline newline
\end_inset

sx20       sx28       sx48       sx52    
\end_layout

\begin_layout Chapter
gpasm
\end_layout

\begin_layout Section
Running gpasm
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
gpasm options
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Produce 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
hex file
\end_layout

\end_inset

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

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

\begin_layout Plain Layout
-c
\end_layout

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

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

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

\begin_layout Plain Layout
-C
\end_layout

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

\begin_layout Plain Layout
Output a relocatable object in the old Microchip COFF format
\end_layout

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

\begin_layout Plain Layout
-d
\end_layout

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

\begin_layout Plain Layout
Output debug messages
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Equivalent to 
\begin_inset Quotes eld
\end_inset

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


\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Expand macros in listing file
\end_layout

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

\begin_layout Plain Layout
-g
\end_layout

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

\begin_layout Plain Layout
Use debug directives for COFF
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Display the help message
\end_layout

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

\begin_layout Plain Layout
-i
\end_layout

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

\begin_layout Plain Layout
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
case
\end_layout

\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>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-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 Plain Layout
Specify an include directory
\end_layout

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

\begin_layout Plain Layout
-l
\end_layout

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

\begin_layout Plain Layout
List the supported processors
\end_layout

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

\begin_layout Plain Layout
-L
\end_layout

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

\begin_layout Plain Layout
Ignore nolist directives
\end_layout

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

\begin_layout Plain Layout
-m
\end_layout

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

\begin_layout Plain Layout
Memory dump
\end_layout

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

\begin_layout Plain Layout
-M
\end_layout

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

\begin_layout Plain Layout
Output a dependency file
\end_layout

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

\begin_layout Plain Layout
-n
\end_layout

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

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

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

\begin_layout Plain Layout
-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 Plain Layout
Alternate name of hex output file
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Select target processor
\end_layout

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

\begin_layout Plain Layout
-q
\end_layout

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

\begin_layout Plain Layout
Quiet
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Set the 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
radix
\end_layout

\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>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-u
\end_layout

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

\begin_layout Plain Layout
Use absolute paths
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
Print gpasm version information and exit
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Set the message level
\end_layout

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

\begin_layout Plain Layout
-y
\end_layout

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

\begin_layout Plain Layout
Enable 18xx extended mode
\end_layout

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

\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 Index idx
status collapsed

\begin_layout Plain Layout
make
\end_layout

\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
\begin_inset Newline newline
\end_inset

        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 Index idx
status collapsed

\begin_layout Plain Layout
error file
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
sh
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
bash
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
ksh
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
tee
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
labels
\end_layout

\end_inset

label (starting in column 1) or an operation (starting in any column after
 1), both, or neither.
 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
comments
\end_layout

\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
\begin_inset Newline newline
\end_inset

loop    sleep                 ; Label and operation
\begin_inset Newline newline
\end_inset

        incf    6,1           ; Operation with 2 parameters
\begin_inset Newline newline
\end_inset

        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 Index idx
status collapsed

\begin_layout Plain Layout
operators
\end_layout

\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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Operator
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
=
\end_layout

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

\begin_layout Plain Layout
assignment
\end_layout

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

\begin_layout Plain Layout
||
\end_layout

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

\begin_layout Plain Layout
logical or
\end_layout

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

\begin_layout Plain Layout
&&
\end_layout

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

\begin_layout Plain Layout
logical and
\end_layout

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

\begin_layout Plain Layout
&
\end_layout

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

\begin_layout Plain Layout
bitwise and
\end_layout

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

\begin_layout Plain Layout
|
\end_layout

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

\begin_layout Plain Layout
bitwise or
\end_layout

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

\begin_layout Plain Layout
^
\end_layout

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

\begin_layout Plain Layout
bitwise exclusive-or
\end_layout

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

\begin_layout Plain Layout
<
\end_layout

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

\begin_layout Plain Layout
less than
\end_layout

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

\begin_layout Plain Layout
>
\end_layout

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

\begin_layout Plain Layout
greater than
\end_layout

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

\begin_layout Plain Layout
==
\end_layout

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

\begin_layout Plain Layout
equals
\end_layout

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

\begin_layout Plain Layout
!=
\end_layout

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

\begin_layout Plain Layout
not equals
\end_layout

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

\begin_layout Plain Layout
>=
\end_layout

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

\begin_layout Plain Layout
greater than or equal
\end_layout

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

\begin_layout Plain Layout
<=
\end_layout

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

\begin_layout Plain Layout
less than or equal
\end_layout

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

\begin_layout Plain Layout
<<
\end_layout

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

\begin_layout Plain Layout
left shift
\end_layout

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

\begin_layout Plain Layout
>>
\end_layout

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

\begin_layout Plain Layout
right shift
\end_layout

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

\begin_layout Plain Layout
+
\end_layout

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

\begin_layout Plain Layout
addition
\end_layout

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

\begin_layout Plain Layout
-
\end_layout

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

\begin_layout Plain Layout
subtraction
\end_layout

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

\begin_layout Plain Layout
*
\end_layout

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

\begin_layout Plain Layout
multiplication
\end_layout

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

\begin_layout Plain Layout
/
\end_layout

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

\begin_layout Plain Layout
division
\end_layout

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

\begin_layout Plain Layout
%
\end_layout

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

\begin_layout Plain Layout
modulo
\end_layout

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

\begin_layout Plain Layout
UPPER
\end_layout

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

\begin_layout Plain Layout
upper byte
\end_layout

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

\begin_layout Plain Layout
HIGH
\end_layout

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

\begin_layout Plain Layout
high byte
\end_layout

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

\begin_layout Plain Layout
LOW
\end_layout

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

\begin_layout Plain Layout
low byte
\end_layout

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

\begin_layout Plain Layout
-
\end_layout

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

\begin_layout Plain Layout
negation
\end_layout

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

\begin_layout Plain Layout
!
\end_layout

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

\begin_layout Plain Layout
logical not
\end_layout

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

\begin_layout Plain Layout
~
\end_layout

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

\begin_layout Plain Layout
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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Operator
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
=
\end_layout

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

\begin_layout Plain Layout
assignment
\end_layout

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

\begin_layout Plain Layout
++
\end_layout

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

\begin_layout Plain Layout
increment by 1
\end_layout

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

\begin_layout Plain Layout
--
\end_layout

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

\begin_layout Plain Layout
decrement by 1
\end_layout

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

\begin_layout Plain Layout
+=
\end_layout

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

\begin_layout Plain Layout
increment
\end_layout

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

\begin_layout Plain Layout
-=
\end_layout

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

\begin_layout Plain Layout
decrement
\end_layout

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

\begin_layout Plain Layout
*=
\end_layout

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

\begin_layout Plain Layout
multiply
\end_layout

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

\begin_layout Plain Layout
/=
\end_layout

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

\begin_layout Plain Layout
divide
\end_layout

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

\begin_layout Plain Layout
%=
\end_layout

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

\begin_layout Plain Layout
modulo
\end_layout

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

\begin_layout Plain Layout
<<=
\end_layout

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

\begin_layout Plain Layout
left shift
\end_layout

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

\begin_layout Plain Layout
>>=
\end_layout

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

\begin_layout Plain Layout
right shift
\end_layout

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

\begin_layout Plain Layout
&=
\end_layout

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

\begin_layout Plain Layout
bitwise and
\end_layout

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

\begin_layout Plain Layout
|=
\end_layout

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

\begin_layout Plain Layout
bitwise or
\end_layout

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

\begin_layout Plain Layout
^=
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
radix
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset label
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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
base
\end_layout

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

\begin_layout Plain Layout
general syntax
\end_layout

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

\begin_layout Plain Layout
21 decimal written as
\end_layout

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

\begin_layout Plain Layout
binary
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
B'10101'
\end_layout

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

\begin_layout Plain Layout
octal
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
O'25'
\end_layout

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

\begin_layout Plain Layout
decimal
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
D'21'
\end_layout

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

\begin_layout Plain Layout
hex
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
H'15'
\end_layout

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

\begin_layout Plain Layout
hex
\end_layout

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

\begin_layout Plain Layout
0x[0-F]*
\end_layout

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

\begin_layout Plain Layout
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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
base
\end_layout

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

\begin_layout Plain Layout
general syntax
\end_layout

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

\begin_layout Plain Layout
21 decimal written as
\end_layout

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

\begin_layout Plain Layout
binary
\end_layout

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

\begin_layout Plain Layout
[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 Plain Layout
10101b
\end_layout

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

\begin_layout Plain Layout
octal
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
q'25'
\end_layout

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

\begin_layout Plain Layout
octal
\end_layout

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

\begin_layout Plain Layout
[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 Plain Layout
25o
\end_layout

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

\begin_layout Plain Layout
octal
\end_layout

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

\begin_layout Plain Layout
[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 Plain Layout
25q
\end_layout

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

\begin_layout Plain Layout
decimal
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
21d
\end_layout

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

\begin_layout Plain Layout
decimal
\end_layout

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

\begin_layout Plain Layout
.[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 Plain Layout
.21
\end_layout

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

\begin_layout Plain Layout
hex
\end_layout

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

\begin_layout Plain Layout
[0-F]*h
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
ASCII
\end_layout

\end_inset

ASCII code for a 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
character
\end_layout

\end_inset

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

\begin_layout Subsection
Preprocessor
\end_layout

\begin_layout Standard
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
include
\end_layout

\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
\begin_inset Newline newline
\end_inset

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 CommandInset ref
LatexCommand ref
reference "sec:macros"

\end_inset

 for demonstrates conditional assembly.
\end_layout

\begin_layout Subsection
Macros
\end_layout

\begin_layout Standard
\begin_inset CommandInset label
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
\begin_inset Newline newline
\end_inset

        movlw parm
\begin_inset Newline newline
\end_inset

        endm
\begin_inset Newline newline
\end_inset

...
\begin_inset Newline newline
\end_inset

        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
\begin_inset Newline newline
\end_inset

slf     macro   reg
\begin_inset Newline newline
\end_inset

        clrc
\begin_inset Newline newline
\end_inset

        rlf     reg,f
\begin_inset Newline newline
\end_inset

endm
\begin_inset Newline newline
\end_inset

 
\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
\begin_inset Newline newline
\end_inset

        if (factor == 1)
\begin_inset Newline newline
\end_inset

            movwf reg                 ; 1 X is easy
\begin_inset Newline newline
\end_inset

        else
\begin_inset Newline newline
\end_inset

            scale   reg, (factor / 2) ; W * (factor / 2)
\begin_inset Newline newline
\end_inset

            slf     reg,f             ; double reg
\begin_inset Newline newline
\end_inset

            if ((factor & 1) == 1)    ; if lo-bit set ..
\begin_inset Newline newline
\end_inset

                addwf   reg,f         ; ..
 add W to reg
\begin_inset Newline newline
\end_inset

            endif
\begin_inset Newline newline
\end_inset

        endif
\begin_inset Newline newline
\end_inset

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
\begin_inset Newline newline
\end_inset

        clrc
\begin_inset Newline newline
\end_inset

        rlf     tmp,f    ; tmp = 2 * W
\begin_inset Newline newline
\end_inset

        clrc
\begin_inset Newline newline
\end_inset

        rlf     tmp,f    ; tmp = 4 * W
\begin_inset Newline newline
\end_inset

        addwf   tmp,f    ; tmp = (4 * W) + W = 5 * W
\begin_inset Newline newline
\end_inset

        clrc
\begin_inset Newline newline
\end_inset

        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
$
\begin_inset Newline newline
\end_inset

$ + 1
\begin_inset Newline newline
\end_inset

$ - 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
\begin_inset Newline newline
\end_inset

       GOTO LOOP
\begin_inset Newline newline
\end_inset


\begin_inset Newline newline
\end_inset

       BTFSS flag,0x00
\begin_inset Newline newline
\end_inset

       GOTO  $ - 1
\end_layout

\begin_layout Subsection
Suggestions for structuring your code
\end_layout

\begin_layout Standard
\begin_inset CommandInset label
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) ; {
\begin_inset Newline newline
\end_inset

          ...
\begin_inset Newline newline
\end_inset

        ELSE      ; }{
\begin_inset Newline newline
\end_inset

          ...
\begin_inset Newline newline
\end_inset

        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 CommandInset label
LatexCommand label
name "sec:directivesummary"

\end_inset


\end_layout

\begin_layout Subsection*
__BADRAM
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

BADRAM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

BADROM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

CONFIG
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

FUSES
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

IDLOCS
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

MAXRAM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

MAXROM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
BANKISEL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
BANKSEL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
CBLOCK
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
CBLOCK
\end_layout

\end_inset


\end_layout

\begin_layout LyX-Code
CBLOCK [<expression>]
\begin_inset Newline newline
\end_inset

       <label>[:<increment>][,<label>[:<increment>]]
\begin_inset Newline newline
\end_inset

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 Index idx
status collapsed

\begin_layout Plain Layout
CODE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
CODE
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
_
\end_layout

\end_inset

PACK
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
CONSTANT
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DA
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DATA
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DB
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DT
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
DW
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ELSE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
END
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ENDC
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ENDIF
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ENDM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ENDW
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
EQU
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ERROR
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ERRORLEVEL
\end_layout

\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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Setting
\end_layout

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

\begin_layout Plain Layout
Affect
\end_layout

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

\begin_layout Plain Layout
0
\end_layout

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

\begin_layout Plain Layout
Messages, warnings and errors printed.
\end_layout

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

\begin_layout Plain Layout
1
\end_layout

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

\begin_layout Plain Layout
Warnings and error printed.
\end_layout

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

\begin_layout Plain Layout
2
\end_layout

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

\begin_layout Plain Layout
Errors printed.
\end_layout

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

\begin_layout Plain Layout
-<msgnum>
\end_layout

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

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

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

\begin_layout Plain Layout
+<msgnum>
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
EXTERN
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
EXITM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
EXITM
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
FILL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
GLOBAL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
IDATA
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
IF
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
IFDEF
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
IFNDEF
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
LIST
\end_layout

\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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
option
\end_layout

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

\begin_layout Plain Layout
description
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the tab spaces
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Set the hex file format.
 Can be inhx8m, inhx8s, inhx16, or inhx32.
\end_layout

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

\begin_layout Plain Layout
m=<expression>
\end_layout

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

\begin_layout Plain Layout
Set the maximum ROM address.
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Memory Map on or off
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the number of lines per page
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the current processor
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the current processor and enables the 18xx extended mode 
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the radix
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Symbol table dump on or off
\end_layout

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

\begin_layout Plain Layout
w=[0 | 1| 2]
\end_layout

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

\begin_layout Plain Layout
Sets the message level.
\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 Index idx
status collapsed

\begin_layout Plain Layout
LOCAL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
MACRO
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
MESSG
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
NOEXPAND
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
NOLIST
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
ORG
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
PAGE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
PAGESEL
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
PAGESELW
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
PROCESSOR
\end_layout

\end_inset


\end_layout

\begin_layout LyX-Code
PROCESSOR <symbol>
\end_layout

\begin_layout Standard
Selects the target processor.
 See section 
\begin_inset CommandInset ref
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 Index idx
status collapsed

\begin_layout Plain Layout
RADIX
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
RES
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
SET
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
SPACE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
SUBTITLE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
TITLE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
UDATA
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
UDATA ACS
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
UDATA OVR
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
UDATA SHR
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
VARIABLE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
WHILE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
.DEF
\end_layout

\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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
option
\end_layout

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

\begin_layout Plain Layout
description
\end_layout

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

\begin_layout Plain Layout
absolute
\end_layout

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

\begin_layout Plain Layout
Absolute symbol keyword 
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the symbol class (byte sized)
\end_layout

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

\begin_layout Plain Layout
debug
\end_layout

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

\begin_layout Plain Layout
Debug symbol keyword 
\end_layout

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

\begin_layout Plain Layout
extern
\end_layout

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

\begin_layout Plain Layout
External symbol keyword
\end_layout

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

\begin_layout Plain Layout
global
\end_layout

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

\begin_layout Plain Layout
Global symbol keyword
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Reserve words or bytes for the symbol
\end_layout

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

\begin_layout Plain Layout
static
\end_layout

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

\begin_layout Plain Layout
Static Symbol keyword
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Sets the symbol type (short sized)
\end_layout

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

\begin_layout Plain Layout
value=nnn
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
.DIM
\end_layout

\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 for Microchip COFF version 1 or 20 bytes
 for Microchip COFF version 2.
 If the byte size of contents specified by the expressions is greater then
 symbol size, several auxiliary symbols are generated.
 The last auxiliary symbol is zero byte padded to the auxiliary symbol length.
\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 Index idx
status collapsed

\begin_layout Plain Layout
.DIRECT
\end_layout

\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 tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ASCII command
\end_layout

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

\begin_layout Plain Layout
description
\end_layout

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

\begin_layout Plain Layout
a
\end_layout

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

\begin_layout Plain Layout
User defined assert
\end_layout

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

\begin_layout Plain Layout
A
\end_layout

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

\begin_layout Plain Layout
Assembler/Compiler defined assert
\end_layout

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

\begin_layout Plain Layout
e
\end_layout

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

\begin_layout Plain Layout
User defined emulator commands
\end_layout

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

\begin_layout Plain Layout
E
\end_layout

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

\begin_layout Plain Layout
Assembler/Compiler defined emulator commands
\end_layout

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

\begin_layout Plain Layout
f
\end_layout

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

\begin_layout Plain Layout
User defined printf
\end_layout

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

\begin_layout Plain Layout
F
\end_layout

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

\begin_layout Plain Layout
Assembler/Compiler defined printf
\end_layout

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

\begin_layout Plain Layout
l
\end_layout

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

\begin_layout Plain Layout
User defined log command
\end_layout

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

\begin_layout Plain Layout
L
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
.EOF
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
.FILE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
.IDENT
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
.LINE
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
.TYPE
\end_layout

\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 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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Syntax
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Add immediate to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Add W to <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
And W and literal, result in W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
And W and <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Clear <bit> of <f>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Set <bit> of <f>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Skip next instruction if <bit> of <f> is clear
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Skip next instruction if <bit> of <f> is set
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Call subroutine
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Write zero to <dst>
\end_layout

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

\begin_layout Plain Layout
CLRW
\end_layout

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

\begin_layout Plain Layout
Write zero to W
\end_layout

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

\begin_layout Plain Layout
CLRWDT
\end_layout

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

\begin_layout Plain Layout
Reset watchdog timer
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Complement <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Decrement <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Decrement <f>, result in <dst>, skip if zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Go to <addr>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Increment <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Increment <f>, result in <dst>, skip if zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Or W and immediate
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Or W and <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move <f> to <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move literal to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move W to <f>
\end_layout

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

\begin_layout Plain Layout
NOP
\end_layout

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

\begin_layout Plain Layout
No operation
\end_layout

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

\begin_layout Plain Layout
OPTION
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Load W with immediate and return
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Rotate <f> left, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Rotate <f> right, result in <dst>
\end_layout

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

\begin_layout Plain Layout
SLEEP
\end_layout

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

\begin_layout Plain Layout
Enter sleep mode
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Subtract W from <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Swap nibbles of <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
TRIS
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
XORLW
\end_layout

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

\begin_layout Plain Layout
Xor W and immediate
\end_layout

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

\begin_layout Plain Layout
XORWF
\end_layout

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

\begin_layout Plain Layout
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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Syntax
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Add immediate to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Add W to <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
And immediate to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
And W and <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Clear <bit> of <f>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Set <bit> of <f>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Skip next instruction if <bit> of <f> is clear
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Skip next instruction if <bit> of <f> is set
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Call subroutine
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Write zero to <dst>
\end_layout

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

\begin_layout Plain Layout
CLRW
\end_layout

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

\begin_layout Plain Layout
Write zero to W
\end_layout

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

\begin_layout Plain Layout
CLRWDT
\end_layout

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

\begin_layout Plain Layout
Reset watchdog timer
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Complement <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Decrement <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Decrement <f>, result in <dst>, skip if zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Go to <addr>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Increment <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Increment <f>, result in <dst>, skip if zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Or W and immediate
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Or W and <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move <f> to <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move literal to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move W to <f>
\end_layout

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

\begin_layout Plain Layout
NOP
\end_layout

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

\begin_layout Plain Layout
No operation
\end_layout

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

\begin_layout Plain Layout
OPTION
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
RETFIE
\end_layout

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

\begin_layout Plain Layout
Return from interrupt
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Load W with immediate and return
\end_layout

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

\begin_layout Plain Layout
RETURN
\end_layout

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

\begin_layout Plain Layout
Return from subroutine
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Rotate <f> left, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Rotate <f> right, result in <dst>
\end_layout

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

\begin_layout Plain Layout
SLEEP
\end_layout

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

\begin_layout Plain Layout
Enter sleep mode
\end_layout

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

\begin_layout Plain Layout
SUBLW
\end_layout

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

\begin_layout Plain Layout
Subtract W from literal
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Subtract W from <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Swap nibbles of <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
TRIS
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
XORLW
\end_layout

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

\begin_layout Plain Layout
Xor W and immediate
\end_layout

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

\begin_layout Plain Layout
XORWF
\end_layout

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

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

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

\end_inset


\end_layout

\begin_layout Subsubsection
14 Bit Devices Enhanced Instruction Set
\end_layout

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

\begin_layout Plain Layout
Syntax
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
ADDFSR <n>, <k>
\end_layout

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

\begin_layout Plain Layout
Add Literal <k> to FSR<n>
\end_layout

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

\begin_layout Plain Layout
ADDWFC <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 Plain Layout
Add with Carry W and <f>
\end_layout

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

\begin_layout Plain Layout
ASRF <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 Plain Layout
Arithmetic Right Shift
\end_layout

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

\begin_layout Plain Layout
BRA <k>
\end_layout

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

\begin_layout Plain Layout
Relative Branch 
\end_layout

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

\begin_layout Plain Layout
BRW
\end_layout

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

\begin_layout Plain Layout
Relative Branch with W
\end_layout

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

\begin_layout Plain Layout
CALLW
\end_layout

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

\begin_layout Plain Layout
Call Subroutine with W
\end_layout

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

\begin_layout Plain Layout
LSLF <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 Plain Layout
Logical Left Shift
\end_layout

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

\begin_layout Plain Layout
LSRF <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 Plain Layout
Logical Right Shift
\end_layout

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

\begin_layout Plain Layout
MOVIW ++FSR<n>
\end_layout

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

\begin_layout Plain Layout
Move Indirect FSR<n> to W with preincrement
\end_layout

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

\begin_layout Plain Layout
MOVIW --FSR<n>
\end_layout

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

\begin_layout Plain Layout
Move Indirect FSR<n> to W with predecrement
\end_layout

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

\begin_layout Plain Layout
MOVIW FSR<n>++
\end_layout

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

\begin_layout Plain Layout
Move Indirect FSR<n> to W with postincrement
\end_layout

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

\begin_layout Plain Layout
MOVIW FSR<n>--
\end_layout

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

\begin_layout Plain Layout
Move Indirect FSR<n> to W with postdecrement
\end_layout

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

\begin_layout Plain Layout
MOVIW <k>[<n>] 
\end_layout

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

\begin_layout Plain Layout
Move INDFn to W, Indexed Indirect
\end_layout

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

\begin_layout Plain Layout
MOVWI ++FSR<n>
\end_layout

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

\begin_layout Plain Layout
Move W to Indirect FSR<n> with preincrement
\end_layout

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

\begin_layout Plain Layout
MOVWI --FSR<n>
\end_layout

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

\begin_layout Plain Layout
Move W to Indirect FSR<n> with predecrement
\end_layout

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

\begin_layout Plain Layout
MOVWI FSR<n>++
\end_layout

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

\begin_layout Plain Layout
Move W to Indirect FSR<n> with postincrement
\end_layout

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

\begin_layout Plain Layout
MOVWI FSR<n>--
\end_layout

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

\begin_layout Plain Layout
Move W to Indirect FSR<n> with postdecrement
\end_layout

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

\begin_layout Plain Layout
MOVWI <k>[<n>]
\end_layout

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

\begin_layout Plain Layout
Move W to INDF<n>, Indexed Indirect
\end_layout

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

\begin_layout Plain Layout
MOVLB <k>
\end_layout

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

\begin_layout Plain Layout
Move literal to BSR
\end_layout

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

\begin_layout Plain Layout
MOVLP <k>
\end_layout

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

\begin_layout Plain Layout
Move literal to PCLATH
\end_layout

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

\begin_layout Plain Layout
RESET
\end_layout

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

\begin_layout Plain Layout
Software device Reset
\end_layout

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

\begin_layout Plain Layout
SUBWFB <f>,<dst>
\end_layout

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

\begin_layout Plain Layout
Subtract with Borrow W from <f>
\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Syntax
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout

\end_layout

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

\begin_layout Plain Layout
IREAD
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
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 Plain Layout

\end_layout

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

\begin_layout Plain Layout
MOVMW
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
MOVWM
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
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 Plain Layout

\end_layout

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

\begin_layout Plain Layout
RETI
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
RETIW
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
RETP
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
RETURN
\end_layout

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

\begin_layout Plain Layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<row>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Syntax
\end_layout

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

\begin_layout Plain Layout
Description
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Add carry to <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Branch
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Branch on carry
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Branch on zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Branch on no carry
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Branch on not zero
\end_layout

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

\begin_layout Plain Layout
CLRC
\end_layout

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

\begin_layout Plain Layout
Clear carry
\end_layout

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

\begin_layout Plain Layout
CLRZ
\end_layout

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

\begin_layout Plain Layout
Clear zero
\end_layout

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

\begin_layout Plain Layout
SETC
\end_layout

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

\begin_layout Plain Layout
Set carry
\end_layout

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

\begin_layout Plain Layout
SETZ
\end_layout

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

\begin_layout Plain Layout
Set zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Move file to W
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Negate <f>
\end_layout

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

\begin_layout Plain Layout
SKPC
\end_layout

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

\begin_layout Plain Layout
Skip on carry
\end_layout

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

\begin_layout Plain Layout
SKPZ 
\end_layout

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

\begin_layout Plain Layout
Skip on zero
\end_layout

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

\begin_layout Plain Layout
SKPNC
\end_layout

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

\begin_layout Plain Layout
Skip on no carry
\end_layout

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

\begin_layout Plain Layout
SKPNZ 
\end_layout

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

\begin_layout Plain Layout
Skip on not zero
\end_layout

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

\begin_layout Plain Layout
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 Plain Layout
Subtract carry from <f>, result in <dst>
\end_layout

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

\begin_layout Plain Layout
TSTF <f>
\end_layout

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

\begin_layout Plain Layout
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
109 Unmatched (
\end_layout

\begin_layout Description
110 Unmatched )
\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 or redefining symbol that cannot 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
117 Address wrapped around 0.
\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 at this address (must be in low half of page)
\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 (Not Valid for this processor).
\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 Processor type is undefined.
\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 CommandInset ref
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 WHILE must terminate within 256 iterations.
\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
143 Illegal nesting.
\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 Directive only allowed when generating an object file.
\end_layout

\begin_layout Standard
Attempt to use relocatable-mode directive when generating HEX file directly.
 
\end_layout

\begin_layout Description
151 Operand contains unresolvable labels or is too complex.
\end_layout

\begin_layout Standard
Labels must be resolvable to a relocatable address plus a constant.
 
\end_layout

\begin_layout Description
152 Executable code and data must be defined in an appropriate section.
\end_layout

\begin_layout Standard
Code or data defined in an invalid section.
 
\end_layout

\begin_layout Description
154 Each object file section must be contiguous.
\end_layout

\begin_layout Description
156 Operand must be an address 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 Cannot use FILL Directive with odd number of bytes.
\end_layout

\begin_layout Standard
In PIC18CXX devices the number of bytes must be even.
 
\end_layout

\begin_layout Description
163 __CONFIG directives must be contiguous.
\end_layout

\begin_layout Description
164 __IDLOC directives must be contiguous.
\end_layout

\begin_layout Description
168 Square brackets required around offset operand.
\end_layout

\begin_layout Description
175 __IDLOCS directives must be listed in ascending order.
\end_layout

\begin_layout Description
176 An error with the CONFIG directive occured.
\end_layout

\begin_layout Description
177 You 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 Description
180 RES directive cannot reserve odd number of bytes in PIC18 absolute mode.
\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.
 Least significant bits used.
\end_layout

\begin_layout Standard
The argument does not fit in the allocated space.
\end_layout

\begin_layout Description
203 Found opcode in column 1.
\end_layout

\begin_layout Standard
Opcodes should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
205 Found directive in column 1.
\end_layout

\begin_layout Standard
Directives should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
206 Found call to macro in column 1.
\end_layout

\begin_layout Standard
Macro calls should be indented to distinguish them from labels.
\end_layout

\begin_layout Description
207 Found 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 on the line.
\end_layout

\begin_layout Standard
Extra arguments were found on the line.
\end_layout

\begin_layout Description
212 Expected.
\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 file format specified on 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 Address exceeds maximum range for this processor.
\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
226 Destination address must be word aligned.
\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 in operand not in bank 0.
 Ensure bank bits are correct.
\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 -- ensure page bits are set.
\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
307 Setting page bits.
\end_layout

\begin_layout Description
308 Warning level superceded by command line value.
\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 superceded by command line value.
\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
310 Superceding current maximum RAM and RAM map
\end_layout

\begin_layout Description
312 Page or Bank selection not needed for this device.
\end_layout

\begin_layout Standard
This device does not use special page or bank selection code.
\end_layout

\begin_layout Description
313 CBLOCK constants will start with a value of 0.
\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 Instruction 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 Index idx
status collapsed

\begin_layout Plain Layout
Running gplink
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-a
\end_layout

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

\begin_layout Plain Layout
Produce hex file in one of four formats: inhx8m, inhx8s, inhx16, inhx32
 (the default)
\end_layout

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

\begin_layout Plain Layout
-c
\end_layout

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

\begin_layout Plain Layout
Output an executable object
\end_layout

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

\begin_layout Plain Layout
-d
\end_layout

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

\begin_layout Plain Layout
Display debug messages
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Fill unused unprotected program memory with <value>
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Show the help message
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Specify an include directory
\end_layout

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

\begin_layout Plain Layout
-l
\end_layout

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

\begin_layout Plain Layout
Disable the list file output
\end_layout

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

\begin_layout Plain Layout
-m
\end_layout

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

\begin_layout Plain Layout
Output a map file
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Alternate name of hex output file
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Optimization level
\end_layout

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

\begin_layout Plain Layout
-q
\end_layout

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

\begin_layout Plain Layout
Quiet
\end_layout

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

\begin_layout Plain Layout
-r
\end_layout

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

\begin_layout Plain Layout
Attempt to relocate unshared data sections to shared memory if relocation
 fails
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Specify linker script
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Create a stack section
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
Print gplink version information and exit
\end_layout

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

\begin_layout Plain Layout
-w
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
Running gplib
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-c
\end_layout

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

\begin_layout Plain Layout
Create a new library
\end_layout

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

\begin_layout Plain Layout
-d
\end_layout

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

\begin_layout Plain Layout
Delete member from library
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Show the help message
\end_layout

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

\begin_layout Plain Layout
-n
\end_layout

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

\begin_layout Plain Layout
Don't add the symbol index
\end_layout

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

\begin_layout Plain Layout
-q
\end_layout

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

\begin_layout Plain Layout
Quiet mode
\end_layout

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

\begin_layout Plain Layout
-r
\end_layout

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

\begin_layout Plain Layout
Add or replace member from library
\end_layout

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

\begin_layout Plain Layout
-s
\end_layout

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

\begin_layout Plain Layout
List global symbols in libary
\end_layout

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

\begin_layout Plain Layout
-t
\end_layout

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

\begin_layout Plain Layout
List member in library
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
Print gplib version information and exit
\end_layout

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

\begin_layout Plain Layout
-x
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
Creating an archive
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Other gplib operations
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Archive format
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
gpdasm
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Running gpdasm
\end_layout

\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="11" columns="3">
<features tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Long option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-c
\end_layout

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

\begin_layout Plain Layout
--mnemonics
\end_layout

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

\begin_layout Plain Layout
Decode special mnemonics
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
-help
\end_layout

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

\begin_layout Plain Layout
Display the help message
\end_layout

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

\begin_layout Plain Layout
-i
\end_layout

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

\begin_layout Plain Layout
--hex-info
\end_layout

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

\begin_layout Plain Layout
Display hex file information
\end_layout

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

\begin_layout Plain Layout
-l
\end_layout

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

\begin_layout Plain Layout
--list-chips
\end_layout

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

\begin_layout Plain Layout
List supported processors
\end_layout

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

\begin_layout Plain Layout
-m
\end_layout

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

\begin_layout Plain Layout
-dump
\end_layout

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

\begin_layout Plain Layout
Memory dump hex file
\end_layout

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

\begin_layout Plain Layout
-p<processor>
\end_layout

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

\begin_layout Plain Layout
--processor <processor>
\end_layout

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

\begin_layout Plain Layout
Select processor
\end_layout

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

\begin_layout Plain Layout
-s
\end_layout

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

\begin_layout Plain Layout
--short
\end_layout

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

\begin_layout Plain Layout
Print short form output
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
--version
\end_layout

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

\begin_layout Plain Layout
Print gpdasm version information and exit
\end_layout

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

\begin_layout Plain Layout
-y
\end_layout

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

\begin_layout Plain Layout
--extended
\end_layout

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

\begin_layout Plain Layout
Enable 18xx extended mode
\end_layout

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

\begin_layout Plain Layout

\end_layout

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

\begin_layout Plain Layout
--strict
\end_layout

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

\begin_layout Plain Layout
Disassemble only opcodes generated by gpasm in case of instructions with
 serveral opcodes
\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 Index idx
status collapsed

\begin_layout Plain Layout
sh
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
bash
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
ksh
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
gpvo
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Running gpvo
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-g
\end_layout

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

\begin_layout Plain Layout
Strip debug symbols
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Show the help message
\end_layout

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

\begin_layout Plain Layout
-k
\end_layout

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

\begin_layout Plain Layout
Keep symbol
\end_layout

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

\begin_layout Plain Layout
-n
\end_layout

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

\begin_layout Plain Layout
Remove symbol
\end_layout

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

\begin_layout Plain Layout
-o
\end_layout

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

\begin_layout Plain Layout
Alternate output file
\end_layout

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

\begin_layout Plain Layout
-p
\end_layout

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

\begin_layout Plain Layout
Preserve dates
\end_layout

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

\begin_layout Plain Layout
-r
\end_layout

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

\begin_layout Plain Layout
Remove section
\end_layout

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

\begin_layout Plain Layout
-s
\end_layout

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

\begin_layout Plain Layout
Remove all symbols
\end_layout

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

\begin_layout Plain Layout
-u
\end_layout

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

\begin_layout Plain Layout
Remove all symbols not needed for relocations
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
Show version
\end_layout

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

\begin_layout Plain Layout
-V
\end_layout

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

\begin_layout Plain Layout
Verbose mode
\end_layout

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

\begin_layout Plain Layout
-x
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
gpvc
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Running gpvc
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-a
\end_layout

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

\begin_layout Plain Layout
Display all information
\end_layout

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

\begin_layout Plain Layout
-d
\end_layout

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

\begin_layout Plain Layout
Display directory header
\end_layout

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

\begin_layout Plain Layout
-s
\end_layout

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

\begin_layout Plain Layout
Display symbols
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Show the help message.
\end_layout

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

\begin_layout Plain Layout
-r
\end_layout

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

\begin_layout Plain Layout
Display ROM
\end_layout

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

\begin_layout Plain Layout
-l
\end_layout

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

\begin_layout Plain Layout
Display source listing
\end_layout

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

\begin_layout Plain Layout
-m
\end_layout

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

\begin_layout Plain Layout
Display debug message area
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
sh
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
bash
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
ksh
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
gpvo
\end_layout

\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 Index idx
status collapsed

\begin_layout Plain Layout
Running gpvo
\end_layout

\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 tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="block" valignment="top" width="4in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Option
\end_layout

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

\begin_layout Plain Layout
Meaning
\end_layout

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

\begin_layout Plain Layout
-b
\end_layout

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

\begin_layout Plain Layout
Binary data
\end_layout

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

\begin_layout Plain Layout
-c
\end_layout

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

\begin_layout Plain Layout
Decode special mnemonics
\end_layout

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

\begin_layout Plain Layout
-f
\end_layout

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

\begin_layout Plain Layout
File header
\end_layout

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

\begin_layout Plain Layout
-h
\end_layout

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

\begin_layout Plain Layout
Show the help message
\end_layout

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

\begin_layout Plain Layout
-n
\end_layout

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

\begin_layout Plain Layout
Suppress filenames
\end_layout

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

\begin_layout Plain Layout
-s
\end_layout

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

\begin_layout Plain Layout
Section data
\end_layout

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

\begin_layout Plain Layout
-t
\end_layout

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

\begin_layout Plain Layout
Symbol data
\end_layout

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

\begin_layout Plain Layout
-v
\end_layout

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

\begin_layout Plain Layout
Print gpvo version information and exit
\end_layout

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

\begin_layout Plain Layout
-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 Plain Layout
Export symbols to an include file.
\end_layout

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

\begin_layout Plain Layout
-y
\end_layout

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

\begin_layout Plain Layout
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 Index idx
status collapsed

\begin_layout Plain Layout
sh
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

sh
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
bash
\end_layout

\end_inset


\begin_inset Quotes eld
\end_inset

bash
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
ksh
\end_layout

\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 CommandInset index_print
LatexCommand printindex
type "idx"

\end_inset


\end_layout

\end_body
\end_document
