home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / doc / nasm65.txt < prev    next >
Text File  |  1993-01-20  |  49KB  |  1,365 lines

  1.    ----------------------------------------------------------------------
  2.                      Copyright (C) 1990 by Natürlich!
  3.                         This file is copyrighted!
  4.                   Refer to the documentation for details.
  5.    ----------------------------------------------------------------------
  6.  
  7.    NASM65 --- an Atari 8-Bit Crossassembler for the Atari ST (et al.)
  8.  
  9.  
  10.                          Manual v1.9* for NASM65
  11.                          Currently not quite up to date
  12.  
  13.          Copyright © 1992 by Natürlich!
  14.             on sources, binaries and manuals
  15.  
  16.  
  17.                   »» Bang that Bit that doesn't Bang ««
  18.  
  19.  
  20.  
  21.  
  22.    I n t r o d u c t i o n
  23.  
  24.    NASM65 is a <portable> single-pass cross-assembler that produces 6502
  25.    code. NASM65 currently runs on 680x0 Ataris under TOS, on the AMIGA 
  26.    and apparently under UNIX. It its conceivably portable to MSDOS.
  27.    The assembler produces two kinds of output, directly executable code 
  28.    for the Atari 8-Bit computer (FF FF headers and all that...) or 
  29.    linkable modules to be used with NLINK65. Instantly executable code 
  30.    (furtheron referred to as "runnable") is non-relocatable and 
  31.    non-linkable. The other kind of output are relocatable and linkable 
  32.    object files. That production mode is further on referred to as 
  33.    "relocatable". NASM65 is closely compatible to MAC65 from OSS 
  34.    (now ICD), but not 100%. The differences will be noted later on. 
  35.    Compatibility worsens somewhat when relocatable output is produced. 
  36.    (Apple and C64 users, have a peek at XTRCTBIN)
  37.  
  38.  
  39.  
  40.    U s a g e
  41.  
  42.    nasm65 [-{rwbqx}][-{tn}][-e number][-o binary][-h includedir] <source>
  43.  
  44.    -t    TOS switch, wait for a keypress after running
  45.  
  46.    -w    The "what the ...." switch, even though errors occured an output
  47.          file is generated.
  48.  
  49.    -r    The runnable switch. NASM65 will create an Atari 8-Bit binary
  50.          file for direct execution
  51.  
  52.    -h    Supply alternate header directory (Default is taken from the
  53.          Environment variable >INCLUDE<)
  54.  
  55.    -e    Limit the number of errors: 0 = show all
  56.  
  57.    -o    Specify alternate output file pathname (or filename)
  58.  
  59.    -b    Don't emulate MAC/65 too closely (will improve output in the
  60.          runnable mode)
  61.  
  62.    -x    List all global variables. Defined globals appear with a '*'
  63.          in front.
  64.          
  65.    -q    Quiet flag, probably turns up the volume
  66.    
  67.    -n    Noisy tokenization. Try it on your ST.
  68.    
  69.    There is no order in which switches or the source file have to appear.
  70.  
  71.  
  72.  
  73.    C r e a t i n g   r u n n a b l e   A T A R I   8 - B i t   f i l e s
  74.  
  75.    Type from a shell:
  76.    nasm65 -r <source.s65>
  77.  
  78.    That will create a output file {source}.COM
  79.    Transfer this file (with NASTY for instance) to a 8-Bit Atari computer
  80.    and execute it there.
  81.  
  82.  
  83.  
  84.    C r e a t i n g   l i n k a b l e   m o d u l e s
  85.  
  86.    Type from a shell
  87.    nasm65 <source.s65>
  88.    That will create a output file {source}.o65, that can then be linked
  89.    together with other relocatable output files.
  90.  
  91.  
  92.  
  93.    H o w   N A S M 6 5   f i n d s   i t s   f i l e s
  94.  
  95.    Source files:
  96.  
  97.    NASM65 first looks in the current directory for the file you specified
  98.    on the command line. After that it tries again by replacing the filename
  99.    extension with .S65. If that doesn't work either, NASM65 signals an
  100.    error. This means if you type "nasm65 foo" and you have a file FOO and a
  101.    file FOO.S65, the file "FOO" will be loaded.
  102.  
  103.  
  104.    Include files:
  105.  
  106.    If the extension has been omitted and it looks like a filename,
  107.    not a pathname, NASM65 will append the default extension .H65 and
  108.    insert the default header path at the front.
  109.    Else NASM65 looks first in the current directory for the include file.
  110.    Afterwards NASM65 replaces the extension with .H65 and it will look
  111.    in the directory given either by the environment variable INCLUDE or 
  112.    by the command option '-h'.
  113.    If NASM65 fails again, it will try last to open the file without the
  114.    .H65 extension.
  115.  
  116.  
  117.  
  118.    S o u r c e   c o d e   f o r   N A S M 6 5
  119.  
  120.    Generally speaking MAC65 style code  w i l l  work with NASM65. Other
  121.    assemblers' source (like SYNASM or MAE) might need to be converted to
  122.    NASM65 syntax before assembly [a SED script might be helpful...].
  123.    Problems may appear because of the single-pass structure of the
  124.    assembler. Conventional assemblers use two passes, one pass collects
  125.    all the symbols and if possible assigns values to them. The second pass
  126.    actually produces the code. NASM65 tries to do it all in one pass.
  127.    Of course there is the problem with forward references f.e.:
  128.             ...
  129.             bne   bar
  130.             inx
  131.         bar clc
  132.             ...
  133.  
  134.    When the assembler encounters "bne bar" it doesn't yet know, what
  135.    value "bar" has and so can't produce proper code for that branch
  136.    yet. Only when the bar label is encountered is generation possible.
  137.    Therefore NASM65 has some limitations on the code that it can produce.
  138.    You will find out about it...
  139.  
  140.  
  141.  
  142.    A   f e w   g o l d e n   r u l e s
  143.  
  144.          [Take those marked with a ! really seriously]
  145.  
  146.     1! Don't produce code for zeropage ($00-$FF), be careful of
  147.        wraparounds $FFFF-$00 if you assemble ROM-code.
  148.  
  149.     2! Define macros and equates EARLY! the sooner the better.
  150.  
  151.     3. The fewer forward references you use, the less trouble you and
  152.        NASM65 will have. Forward references are neccessary only for
  153.        »Branches«, »Subroutines« and »Data«. Coding like this
  154.                 lda   #$40
  155.                 sta   nmien
  156.           nmien =     $D40E
  157.        is not only in bad style, it's screamingly inefficient and doesn't
  158.        work with NASM65 in the module mode.
  159.  
  160.     4! In the "relocatable" mode, all label settings that are not PC-
  161.        relative (f.e. `FOO=$D4'  but not  `FOO:   LDA #2') must be
  162.        done before the label is used.
  163.        <label> = <value>
  164.  
  165.     5! Never put macro definitions after their first invocation.
  166.  
  167.     6. Try to define everything (labels and macros) ahead of its first 
  168.        usage
  169.  
  170.     7. Put macros and equates, especially if they are used in several
  171.        different sources, in common include files. Never mind that
  172.        file foo.s65 needs only one of the 100 macro definitions of
  173.        "macro.h65" and 10 of the 500 equates of "defines.h65", NASM65 will
  174.        be grateful! Be sure to keep PC-relative labels out of the
  175.        include files as MUCH AS POSSIBLE. It makes for better style and
  176.        also keeps the error count down, when linking your objects.
  177.  
  178.     8. Always remember that MAC65 is a three/two-pass NASM65 is a 
  179.        single-pass assembler.
  180.  
  181.     9. Always define everything ahead of its usage, except PC-relative
  182.        labels like branch, subroutine and data labels.
  183.  
  184.    10. Use local labels as much as possible. Use global labels only for
  185.        system equates and subroutines and data that are accessed by out-
  186.        side files.
  187.  
  188.    11! If you are into conditional assembly and you like to control that
  189.        with a central include file, be sure to use non-PC relative labels
  190.        as switches.
  191.        e.g.
  192.        "header.h65"
  193.        errorchecking
  194.  
  195.        "source.s65"
  196.           .if .def errorchecking
  197.              ...
  198.           .endif
  199.  
  200.        will **FAIL**, when two files using the same include file are lin-
  201.        ked together. Rather use
  202.  
  203.        "header.h65"
  204.        errorchecking = 1
  205.  
  206.        "source.s65"
  207.           .if .def errorchecking
  208.              ...
  209.           .endif
  210.        or even better
  211.           .if errorchecking
  212.              ...
  213.           .endif
  214.  
  215.    12! Undefine forward referenced labels in .MACRO definitions. It pays!
  216.    
  217.    13. Apple and C64 users oughta ensure that addresses in their object
  218.        files are ascending from start to end. No code like this will
  219.        work for you:
  220.        
  221.             *=$4000
  222.             clc
  223.             bcc foo
  224.             *=$30F0
  225.          foo rts
  226.              
  227.  
  228.    T h e   " r e l o c a t a b l e "   m o d e
  229.  
  230.    The relocatable mode is the default mode, you did not supply a -r
  231.    switch on the command line. That means NASM65 will produce an object
  232.    file suitably for linking and relocation at runtime. The relocatable
  233.    mode imposes some restrictions on your source code.
  234.  
  235.    Forward references can only be made to PC-relative addresses, that
  236.    means that all System-equates like (STACK=$100) have to be done before
  237.    they are used the first time. This is not really a problem since it is
  238.    good style to use a central include file for global symbols that
  239.    is read in at the beginning of the source. Since the linker can also
  240.    only link PC-relative global symbols (local symbols and not PC-relative
  241.    labels are not saved in the object file) NASM65 makes it a necessity.
  242.    There is one exception to this rule, see 'Linking Zeropage-labels'.
  243.  
  244.    e.g.
  245.    File "sys.h65" :
  246.  
  247.    NMIEN = $D40E
  248.    STACK = $100
  249.  
  250.  
  251.    File "s1.s65":
  252.  
  253.       .include #sys.h65
  254.  
  255.    foo:
  256.       lda   #$C0
  257.       sta   NMIEN    ;; from sys.h65
  258.       jsr   bar      ;; not in s1.65 or sys.s65 !! -> open reference
  259.       bcc   foo
  260.       rts
  261.  
  262.  
  263.    File "s2.s65":
  264.  
  265.       .include #sys.h65
  266.  
  267.    bar:              ;; here it gets defined. NLINK s1 s2 would
  268.       lda   STACK    ;; produce a file with bar in s1 correctly
  269.       clc            ;; set to the address of bar in s2
  270.       adc   STACK+1
  271.       rts
  272.  
  273.    The second goal that was set for NASM65 (apart from being a MAC65
  274.    compatible cross-assembler) was relocatability and linkability. And
  275.    as far as *I* know, no assembler exists that does produce run-time 
  276.    relocatable 6502 code. The greatest problem with relocating 6502 code 
  277.    is with source code like this:
  278.  
  279.             lda   #>foo    ; get 16-Bit address into A an X
  280.             ldy   #bar-foo ; get length in Y
  281.             ldx   #<foo
  282.             jsr   print    ; JSR to some routine
  283.             bcc   out
  284.  
  285.    foo:    .byte "F.T.O.E. coming soon.." ; the message to be printed
  286.    bar:
  287.  
  288.    Now for you the human, it's quite easy to figure out that the
  289.    "lda" and "ldx" belong together, but for the relocating code it's not
  290.    so easy. Semantic checking of this kind easily slides into the black
  291.    magic dept. of computer science (--> A.I.) and that would be just
  292.    overkill.
  293.    Ok so there are some limitations in what you can do, here are a
  294.    couple of things to know about NASM65.
  295.  
  296.    0. Linkable labels are:
  297.          ZEROpage labels declared with ==
  298.          All PC-relative global labels
  299.          All PC-relative macro labels, except those starting with @
  300.          
  301.         
  302.    1. Arithmetic with relative addresses is a tricky thing, since
  303.       you don't know at assembly time, what the value is. Therefore
  304.       many operations don't make sense any more. There are only a few
  305.       operations you _can_ use with PC-relative labels. This does not
  306.       apply to the runnable mode by the way.
  307.       Coming up the only valid operations possible in the relocatable
  308.       mode. Refer to the appendix for <words>...
  309.  
  310.          <value> <operation> <value> -> <value>
  311.          <operation> <value>         -> <value>
  312.  
  313.          <address> '+'  <value>      -> <address>
  314.          <address> '-'  <value>      -> <address>
  315.          <value>   '+'  <address>    -> <address>
  316.          <address> '-'  <address>    -> <value>
  317.  
  318.          '<' <address>               -> <saddress> (* careful!! *)
  319.          '>' <address>               -> <saddress> (* careful!! *)
  320.  
  321.       For example:
  322.  
  323.          bput  1,:header,:l_header,X_IS_READY
  324. :header  .byte    "Starting off with this little test...",155
  325. :l_header   = *-:header
  326.  
  327.       That ain't working...
  328.       This will give a warning (not an error, although that might
  329.       be changed in the future), because :l_header was assumed to
  330.       be an address, but is in fact a value.
  331.  
  332.          bput  1,:header,:e_header-:header,X_IS_READY
  333. :header  .byte    "Starting off with this little test...",155
  334. :e_header
  335.  
  336.       THAT's the way you do it.
  337.  
  338.    2. An immediate expression that takes either the LSB or the MSB of an 
  339.       PC-relative address like this
  340.    
  341.             lda   #>bar    ; grab MSB of `bar'
  342.       bar:
  343.             lda   #<bar    ; grab LSB of `bar'
  344.  
  345.       must start off with a '>' (that is  "#>foo" or "#>[foo+1]")
  346.       or with a '<'. Although in MAC65 "lda #LABEL" and "lda #<LABEL" is 
  347.       the same, it isn't for NASM65. Actually the same code will be 
  348.       assembled, but relocatability and linkability will be impaired.
  349.       Note that there has been a change in operator precedence from MAC65
  350.       concerning the unary '>' and '<' operators. Refer to the table in
  351.       the appendix. MAC65 treated "lda #>foo-2" as "lda #[>foo]-2, but
  352.       NASM65 treats it as lda #>[foo-2]. This might make recoding of some
  353.       old code necessary.
  354.  
  355.    3. .DS works very much different in the relocatable mode than in the
  356.       runnable mode (see also "Other Useful Stuff To Know"). Since you 
  357.       can't use *= anyway, this is not the way to define zeropage labels 
  358.       or any other non-PC relative labels for that matter. Like
  359.  
  360.           *=$F0            ;;; WRONG
  361.       SRC .ds 2            
  362.           *=$2000          
  363.           etc.
  364.            
  365.    4.  .= works different from the way it does in the runnable mode. MAC/65
  366.        allows pass conditional assembly like this:
  367.          pass .= pass + 1
  368.             .if pass=1
  369.                .include ...
  370.             .endif
  371.  
  372.        Since NASM65 is single-pass, this isn't a useful technique anymore.
  373.        Normally NASM65 would think that 'pass' on the right side of .= is
  374.        a forward reference. But in the runnable, for enhanced com-
  375.        patibility with MAC/65, pass will get the value of the program 
  376.        counter. 
  377.        In the relocatable mode, 'pass' on the right side of .= WILL be
  378.        treated as a forward reference, resulting in numerous errors.
  379.  
  380.  
  381.  
  382.    L i n k i n g    Z e r o p a g e - l a b e l s
  383.    
  384.  
  385.    There is a way to link zeropage labels with NASM65, so that for
  386.    example common vectors can be shared. As you have come to like
  387.    it, here is an example to make the point:
  388.  
  389.    "a.s65"
  390.          foo == $88           ; declare this 0-page label as linkable
  391.  
  392.          lda   #>BAR          ; just some stuff to fill up space
  393.          sta   FOO+1          ; simple expressions are OK
  394.          lda   #<BAR
  395.          sta   FOO
  396.          jmp   FUBAR
  397.  
  398.    bar:  .byte    $74
  399.  
  400.  
  401.    "b.s65"
  402.          .zext foo            ; tell that foo is an external 1 byte address
  403.                               ; that shouldn't be relocated
  404.    fubar:
  405.          ldy   #0             ; Let's use FOO
  406.          lda   (FOO),y
  407.          sta   $2C8
  408.          rts
  409.  
  410.    NASM65 won't mind some simple arithemtic, as long as you don't use
  411.    PC relative addresses. Note that $45 + $120 = $65 and not $165. Don't
  412.    try to be overly clever with this feature, keep it simple and stupid
  413.    and be happy that this works at all.
  414.  
  415.    What you must not do by the way is this:
  416.    
  417.          .ZEXT FOO            ; that's ok
  418.       
  419.    FOOLSB = FOO               ; but this and
  420.    FOOMSB = FOO + 1           ; that won't work
  421.  
  422.    .ZEXT is more or a less a hack and conflicts with the generality of
  423.    the rest of NASM65. Sorry. But doing this right would require
  424.    a whole new internal assembler structure. 
  425.  
  426.  
  427.  
  428.    D i f f e r e n c e s   b e t w e e n   M A C 6 5   a n d   N A S M 6 5
  429.  
  430.    Text after a correctly parsed instruction is assumed to be part of the
  431.    comment field by MAC65. NASM65 treats this as garbage. Every comment
  432.    has to start with a semicolon ';'.
  433.    f.e.
  434.       lda  #2loser comment w/NASM65
  435.    is treated by MAC65 as
  436.       lda  #2    loser comment w/NASM65
  437.    but generates an error with NASM65.
  438.  
  439.    obsolete directives
  440.    .PAGE
  441.    .TITLE
  442.    .SET
  443.    .OPT
  444.    .TAB
  445.    are parsed but nothing will happen.
  446.  
  447.    '>' and '<' (unary) have lower precedence.
  448.  
  449.    MAC65 generates a new binary header at least every 252 bytes (don't
  450.    ask me why). You can check with CHKFFFF that actually the same amount
  451.    of code (in the runnable mode of course) was generated by NASM65 but
  452.    with much less headers. That makes by the way loading of binary files
  453.    much faster and decreases overall size.
  454.  
  455.    The include syntax is similiar, but adjusts to your kind of OS. So
  456.    you can't expect to assemble instructions like
  457.                            .include #D3:foo.bar
  458.    properly on the ST for instance.
  459.  
  460.    NASM65 currently produces no listing file!
  461.  
  462.    .REF may now be used anywhere in an expression, whereas MAC65
  463.    allowed .REF only in .IF expressions.
  464.  
  465.    .SET doesn't work anymore. Compiling with an offset must be (clumsily ?) 
  466.    simulated by using the linker.
  467.  
  468.    Due to the single-pass nature of NASM65, NASM65 does not do a third
  469.    pass over macros like MAC65 does. For example:
  470.    
  471.                      .macro   bar
  472.                         jmp  foo
  473.                 foo
  474.                      .endm
  475.       
  476.                      *=$2000
  477.                      bar
  478.                      bar
  479.                      bar
  480.                      
  481.     MAC/65 produces:          NASM65 produces:
  482.       $2000 jmp   $2003          jmp   $2003
  483.       $2003 jmp   $2006          jmp   $2003
  484.       $2006 jmp   $2009          jmp   $2006
  485.  
  486.  
  487.    To alleviate this problem rewrite the macro as:
  488.    
  489.                      .macro   bar
  490.                         .if .def foo
  491.                            .undef foo
  492.                         .endif
  493.                         jmp   foo
  494.                foo
  495.                      .endm
  496.  
  497.                        
  498.  
  499.    O t h e r   u s e f u l   s t u f f   t o   k n o w
  500.  
  501.    When assembling in the runnable mode, NASM defines a label "__RUN"
  502.    for you. This way you can with the use of a simple .IF statement
  503.    have a file that can be both, assembled as a standalone program and
  504.    as a linkable module.
  505.    e.g.:
  506.          .if .def __RUN
  507.             *=$3000
  508.          .endif
  509.  
  510.    You have one new directive at your disposal. It's called .ALIGN and 
  511.    aligns the module on a given boundary (like a page f.i.).
  512.  
  513.    Also NASM always defines the label __NASM65, for conditional assembly
  514.    depending on the assembler used for example.
  515.    
  516.  
  517.  
  518.    U s i n g   r u n t i m e   r e l o c a t i o n
  519.  
  520.    The bad news is that the mover isn't quite as smart as the linker
  521.    and can't properly move all the code there is. To keep the MOVER happy
  522.    you should obey these golden rules:
  523.  
  524.    |R_START means beginning of your code. This is the first assembled
  525.                   byte of the first object file linked.
  526.    |R_END   means end of your code. This is the last assembled byte of
  527.                   the last object file or library. (Excluding the mover)
  528.  
  529.    1. The MOVER fixes all addresses that point into the program space
  530.       starting from |R_START - 1  to |R_END, If you somehow managed to
  531.       convince NASM65 to assemble |R_START-$100, you will surely lose.
  532.       Also bad is coding like this:
  533.       
  534.       start:
  535.          jmp   *+40
  536.          .byte "Fooble"
  537.       end:
  538.       
  539.       This probably won't work anyway, but the MOVERs sure won't relocate
  540.       it as well.   
  541.  
  542.    2. The MOVER needs some information about the program it has to move.
  543.       This is done with the aid of two tables. I won't discuss the makeup
  544.       of these tables, as it would be too much type work. But you can
  545.       keep the size of these tables down, by keeping data and code as
  546.       seperate as possible. But this is something you should only consider,
  547.       if your program needs 32K file space.
  548.  
  549.    3. Don't expect to get 65C02 insructions relocated correctly. 65C02
  550.       compatibility was a last ditch effort on my part. Since the Atari 
  551.       8-Bit doesn't have a 65C02 this isn't really a problem. Try it out 
  552.       though, maybe it will even work.
  553.       
  554.  
  555.  
  556.    E r r o r s
  557.  
  558.    Yes it can happen to the best of us. Errors in the source code. NASM65
  559.    will try to tell you as clearly as possibly in 1000 words or less, where
  560.    and why you lost. The form of the message is in most cases, something
  561.    like this:
  562.  
  563.    "source filename"[ linenumber in source], <continued>
  564.       macroname[ linenumber in macro], ...  "Error [error message]"
  565.  
  566.    There are several different error levels
  567.       a) normal errors         -- f.e. syntax, undefined macro...
  568.       b) fatal errors          -- f.i. out of memory. file not found...
  569.       c) internal errors       -- this shouldn't happen
  570.       d) serious ....up errors -- NASM65 crashed downright. VERY VERY BAD!
  571.  
  572.    You can fix errors of type 'a' and 'b', they are your problem. Errors
  573.    of type 'c' and 'd' are NASM65's problem, there is probably nothing you
  574.    can do.
  575.  
  576.       
  577.  
  578.    W a r n i n g s
  579.  
  580.    Warnings aren't errors 'cause there is a good chance that the assembler
  581.    will actually do what you want to happen. BUT if things go wrong it
  582.    isn't a bad idea to look at the warnings.
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.    A p p e n d i x
  594.  
  595.  
  596.  
  597.    M e m o r y   r e q u i r e m e n t s
  598.  
  599.    NASM65 is memory hungry. Although it does use dynamic memory allocation
  600.    instead of fixed tables it needs after its load about 150K space to
  601.    work in. For larger files figure about 1/4 MB. There is a real, true,
  602.    honest-to-goodness garbage collector coming up in version 3.0 (sorry).
  603.    (Well just maybe *NOT*)
  604.  
  605.  
  606.  
  607.    S o u r c e   C o d e
  608.  
  609.    The lines of source must adhere to some positional restrictions as
  610.    you may easily figure out from the schemata below. Just in case you
  611.    never saw an assembler before.
  612.  
  613.    Beforehand introducing a few shortcuts
  614.       [..] = optional something '..' enclosed in square brackets
  615.       ^    = Start of line
  616.       $    = End of line
  617.       .    = any number of SPACE or TAB but at least one
  618.       _    = any number of SPACE or TAB possibly none
  619.       X    = any characters except LF possibly none
  620.       other characters represent themselves
  621.  
  622.    ^_[;X]$
  623.    ^[label]_;[X]$
  624.    ^[label].[instruction.[#][_expr]]_[;X]$
  625.    ^[label].[directive.[stuff][,stuff]*]_[;X]$
  626.    ^[label].[macroname.[parameter][_,_parameter]*]_[;X]$
  627.    ^[label].[assignment.[expr]]_[;X]$
  628.  
  629.    Examples:
  630.    foo
  631.          inx
  632.    foo   inx
  633.          lda   foo
  634.    foo   lda   foo
  635.          lda   #2
  636.    foo   lda   #2     ; this is a comment
  637.          .byte 2
  638.    foo   .byte 2
  639.          .byte 2,"FOO"
  640.    foo   .byte 2,"FOO"
  641.    foo   POKE  foo,3
  642.    foo   = 34
  643.  
  644.  
  645.  
  646.    S p e c i a l s
  647.  
  648.    *
  649.       * denotes the program counter or PC, and can be used in expressions
  650.       like any other label.
  651.  
  652.    A
  653.       Used by ROL ROR LSL LSR to indicate usage of the 6502 A-register.
  654.       Therefore you can't use A as a label.
  655.       
  656.    X  
  657.    Y
  658.       Used by indexed or indirect instruction such as LDA (FOO,X) or
  659.       STA BAR,Y. Don't use X or Y as labels as well.
  660.  
  661.  
  662.  
  663.    I d e n t i f i e r
  664.  
  665.    An identifier is either a label or a macroname. The morphological
  666.    structure of an identifier is simply any string of characters that
  667.    is taken from this character set [A-Z a-z 0-9 $ @ _ . : ?].
  668.    An identifier may not begin with a number. Non macro identifiers should 
  669.    not begin with a '@' and user identifiers should generally not start
  670.    with a '_' (underscore), but this isn't enforced. An identifier must 
  671.    not just be "A" or "a", "X" or "x", "Y" or "y". Internally all 
  672.    identifiers are converted to uppercase, so that there is no difference 
  673.    between "small" and "SMALL". A label that begins with a ':' or '?' is 
  674.    always a local label.
  675.    Label definitions may optionally be directly followed by a ':', which
  676.    isn't part of the label. An <equate> is a label that gets its value
  677.    by a '=' assignment.
  678.  
  679.    Examples:
  680.    A = 45      ;; wrong!, you can't use A as a label name
  681.    FOO = 23    ;; OK!
  682.    FOO:  inx   ;; OK global label = "FOO"
  683.    Foo:: inx   ;; OK global label = "FOO:"
  684.    :FoO: inx   ;; OK local label  = ":FOO"
  685.    FoO:: inx   ;; WRONG! This is the same label as the one two lines up
  686.    ?_:_:   DEX ;; OK local label  = "?_:_"
  687.    01234       ;; WRONG! label would start off with a digit
  688.    ?01234      ;; OK local label  = "?01234"
  689.    :01234      ;; OK local label  = ":01234"
  690.    ?01234      ;; WRONG! label is already defined (two lines up)
  691.       .macro FOO  ;; OK. Macros may have the same name as labels!
  692.  
  693.  
  694.  
  695.    A s s i g n m e n t s
  696.  
  697.    There are four different possibilities to assign a value to a label.
  698.    Note that '^' denotes the beginning of a source line (as above). Also
  699.    be aware that some of these <labels> are <equates>. The distinction
  700.    is important when you look at macros.
  701.  
  702.    Type A:
  703.    ^<label> =  <expr>
  704.       This assigns the value of <expr> to <label>. You can't overload
  705.       this label with another assignment.
  706.       Examples:
  707.       foo = 2     ;; lda #foo would assemble to A9 02
  708.       bar = *+foo ;; bar = PC + 2. PC-relative!
  709.       NMIEN=$D40E ;; sta NMIEN would assemble to 8D 0E D4
  710.       foo = 3     ;; doesn't work, cause foo is already defined!
  711.  
  712.    Type B
  713.    ^<label> .= <expr>
  714.       This is almost the same as <label> = <expr> with the difference
  715.       that you can overload <label> again! Using .= with forward references
  716.       is possibly dangerous.
  717.       Examples:
  718.       foo .= 2     ;; lda #foo would assemble to A9 02     <-+
  719.       bar .= *+foo ;; bar = PC + 2. PC-relative!             |
  720.       NMIEN.=$D40E ;; sta NMIEN would assemble to 8D 0E D4   |
  721.       foo .= 3     ;; Works fine, cause its a .= assignment -+
  722.       
  723.    Type C
  724.    ^<label> == <expr>
  725.       This is used in conjunction with .ZEXT. Tells the assembler to
  726.       include this zeropage! label in the list of linkable symbols.
  727.       Examples:
  728.       foo == $56   ;; OK!
  729.       foo == $456  ;; WRONG! only zeropage allowed
  730.  
  731.    Type D
  732.    ^<label>
  733.       A label that isn't followed by '==', '=' or '.=' takes on the
  734.       value of *, the program counter.
  735.       Example:
  736.       foo  jmp foo ;; endless loop!
  737.  
  738.  
  739.  
  740.    O p e r a t o r s
  741.  
  742.    [<expr>]             Parenthesis (actually brackets)
  743.    <expr> + <expr>      Addition
  744.    <expr> - <expr>      Subtraction
  745.    - <expr>             Minus
  746.    <expr> * <expr>      Multiplication
  747.    <expr> / <expr>      Division
  748.    <expr> \ <expr>      Modulo
  749.       These are the normal operators for unsigned 16-Bit values, that you
  750.       know from C. And they behave that way too, 'cause NASM65 is written
  751.       in C. Note that 16-Bits overflow after 65535 to 0.
  752.       Some examples of results to expect
  753.       5/3=1    5/2=2       5/1=5    5/2*2=4  4+1-6=65535
  754.       4-2+2=4  4-[2+2]=0   4-2*2=0  5\3=1    8\2=0
  755.       -1=65535 8+[-1]=7
  756.  
  757.    <expr> .NOT <expr>   Boolean negation
  758.    <expr> .AND <expr>   Boolean AND
  759.    <expr> .OR  <expr>   Boolean OR
  760.    <expr>  =   <expr>   Equality
  761.    <expr>  <>  <expr>   Inequality
  762.    <expr>  <   <expr>   Less than
  763.    <expr>  >   <expr>   More than
  764.    <expr>  >=  <expr>   More or equal
  765.    <expr>  <=  <expr>   Less or equal
  766.       These too are quite like C. Everything which isn't 0 is taken to
  767.       be 'true'. 0 therefore means 'false'.
  768.       .NOT 0   = 1   0 .AND -2 = 0   1 .AND 1 = 1
  769.       5 .OR 0  = 1   0 .OR  0  = 0   .NOT 1 .OR .NOT 0 .AND .1 = 0
  770.       43 > 43  = 0   43 > -1   = 0   43 > 0   = 1
  771.       43 < 43  = 1   43 < -1   = 1   43 < 0   = 0
  772.       43 >= 43 = 1   43 >= -1  = 0   43 >= 0  = 1
  773.       43 <= 43 = 1   43 <= -1  = 1   43 <= 0  = 0
  774.       43 =  43 = 1   43  = -1  = 0   43 =  0  = 0
  775.       43 <> 43 = 0   43 <> -1  = 1   43 <> 0  = 1
  776.  
  777.    <expr> & <expr>      Bitwise AND
  778.    <expr> ! <expr>      Bitwise OR
  779.    <expr> ^ <expr>      Bitwise EOR
  780.       These are your regular bitwise operators, what is there to say ?
  781.       Some examples just for fun:
  782.       $0001 & $FFFE = $0000   $5AF0 & $5555 = $5050
  783.       $0001 ! $FFFE = $FFFF   $5AF0 ! $5555 = $5FF5
  784.       $0001 ^ $FFFE = $FFFF   $5AF0 ^ $5555 = $0FA5
  785.  
  786.    .DEF <label>         Label defined ?
  787.    .REF <label>         Label referenced ?
  788.       .DEF and .REF can be used to determine, whether a label has already
  789.       been defined or whether it has been referenced already. There is
  790.       unlike MAC65 no restriction on usage.
  791.       Examples:
  792.          .if .not .def foobar
  793.             .error "Should have included fooble.foobar first!"
  794.          .endif
  795.          lda   #.ref leopold * 6  ;; senseless, but it works!
  796.  
  797.  
  798.  
  799.    O p e r a t o r   p r e c e d e n c e
  800.  
  801.    Associativity   Precedence level  Operator  Description
  802.  
  803.          -              9              .DEF     Special
  804.          -              9              .REF     Special
  805.  
  806.          L              8               -       Unary minus
  807.          L              8              .NOT     Boolean NOT
  808.  
  809.          L              7               *       Multiplication
  810.          L              7               /       Division
  811.          L              7               \       Modulo
  812.  
  813.          L              6               +       Addition
  814.          L              6               -       Subtraction
  815.  
  816.          L              5               !       Bitwise OR
  817.          L              5               ^       Bitwise EOR
  818.          L              5               &       Bitwise AND
  819.  
  820.          L              4               <       Most significant byte
  821.          L              4               >       Least significant byte
  822.  
  823.          -              3               <=      Less or equal
  824.          -              3               >=      Greater or equal
  825.          -              3               =       Equal
  826.          -              3               <>      Not equal
  827.          -              3               >       Greater than
  828.          -              3               <       Less than
  829.  
  830.          L              2              .AND     Boolean AND
  831.  
  832.          L              1              .OR      Boolean OR
  833.  
  834.          L              0               ,       Seperator
  835.  
  836.  
  837.  
  838.    D i r e c t i v e s
  839.  
  840.    1. A s s e m b l e r   D i r e c t i v e s
  841.  
  842.    .ALIGN <expr>
  843.       This is a special directive, that only works in the relocatable
  844.       mode and only if no code yet has been generated! The point is
  845.       that you sometimes want to align code on a page boundary for
  846.       example display lists or display list interrupt routines. 
  847.      
  848.       Aligns code to the next boundary given by <expr>.
  849.       0x1  == word align   (2 bytes)
  850.       0x3  == lword align  (4 bytes)
  851.       0xFF == page align   (256 bytes)
  852.       f.e.
  853.          .align $FF
  854.         
  855.  
  856.    .CALL <macroname> *** unimplemented, sorry ***
  857.       This special directive may only be used IN macro definitions. It
  858.       acts like a regular macro call, except that all the parameters of
  859.       the macro, that does the call, are passed over to the newly called
  860.       macro.
  861.       Ex.:
  862.          .macro x
  863.             .dbyte %1,%2
  864.          .endm
  865.          .macro y
  866.             .call x
  867.          .endm
  868.          y $0123,$4567
  869.       produces, predictably, 01 23 45 67
  870.       
  871.  
  872.    .END
  873.       When NASM65 encounters this directive, the processing of source 
  874.       code is preempted.
  875.  
  876.  
  877.    .IF <bexpr>
  878.       <lines>
  879.    .ELSE
  880.       <lines>
  881.    .ENDIF
  882.       These directives provide the ability to selectively assemble some
  883.       parts of the program and to leave some parts out. The use for this
  884.       feature lies most importantly in macros as you can see in the
  885.       supplied "MACROS.H65" file.
  886.       This for example is the macro code, for the "generic" store
  887.       absolute instruction. Actually only one of STA STX or STY will
  888.       be assembled.
  889.       
  890.          .macro @stt
  891.       @0 .= @a
  892.          .if %0 = 2
  893.       @0 .= %2
  894.          .endif
  895.          .if  @0 = @a
  896.             sta   %1
  897.          .else
  898.             .if @0 = @x
  899.                stx   %1
  900.             .else
  901.                sty   %1
  902.             .endif
  903.          .endif
  904.       .endm
  905.       
  906.       Note that for .IF there has to be an .ENDIF and at most one .ELSE.
  907.  
  908.  
  909.    .LOCAL
  910.       Tells the assembler to "forget" all local labels up to this point.
  911.       This means that the following will get you an error with a .LOCAL,
  912.  
  913.       ; Start of file
  914.          jmp   :foo
  915.          .local
  916.       :foo
  917.       ; end of file
  918.  
  919.       whereas the second piece of code, will only work with the .LOCAL.
  920.       Else you would have a doubly defined label.
  921.  
  922.       ; Start of file
  923.       :loop  dex
  924.              bne :loop
  925.              .local
  926.       :loop  inx
  927.              bne :loop
  928.       ; End of file
  929.  
  930.  
  931.    .INCLUDE #<filename>
  932.       Reads in the file specified by <filename> and treats this input as
  933.       if it would have appeared in the original file. Technically you first
  934.       .INCLUDE is your source!
  935.  
  936.  
  937.    .ERROR  <string>
  938.       Creates a user error. This is like any other error that NASM65
  939.       generates, but you can supply the error string (required). This may
  940.       be useful, when writing .MACROs and you want to check that certain
  941.       values are in the required range. This feature isn't really all that
  942.       useful as OSS thinks it is. The assembler catches for example
  943.       missing parameter errors anyway. MAC65 did too...
  944.  
  945.  
  946.    .MACRO  <macroname>
  947.       <lines>
  948.    .ENDM
  949.       All <lines> are saved in an internal buffer and released upon
  950.       invocation of <macroname>. f.e.
  951.  
  952.       LEOPOLD = $1234
  953.          lda   #0       ;; gets assembled as A9 00
  954.          .macro  foo    ;; start of macro definition called "FOO"
  955.           sta   LEOPOLD ;; this will not be assembled at this time
  956.          .endm          ;; end of macro definition. Continue assembly
  957.          nop            ;; NOP gives an EA
  958.          foo            ;; Assembles now STA LEOPOLD into 8D 34 12
  959.  
  960.       The interesting thing about macros is that you can pass values to
  961.       them. These are accessed with the % placeholder. Lets consider an
  962.       example
  963.       
  964.          ;; simple POKE à la ATARI BASIC  "POKE address,value"
  965.          .macro poke
  966.           lda   #%2     ;; %2 means value from second parameter
  967.           sta   %1      ;; %1 means value from first  parameter
  968.          .endm
  969.          ;; macro invocation
  970.          poke  $4000,124   ;; will assemble as  LDA #124  STA $4000
  971.  
  972.       %0 contains the number of arguments passed to the macro.
  973.  
  974.       You can not only pass values but also strings to a macro. These
  975.       are accessed with %$.
  976.       f.e:
  977.          .macro drop_printable
  978.             .byte %$1,155,0      ;; Parameter %1 as string
  979.          .endm
  980.  
  981.          drop_printable "Foo"    ;; converts to .BYTE "Foo",155,0
  982.  
  983.       Parameters can have these four forms:
  984.          %<value>      ;; <value> gives index of integer parameter
  985.          %(<label>)    ;; value of label gives index of integer parameter
  986.          %$<value>     ;; <value> gives index of string parameter
  987.          %$(<label>)   ;; value of <label> gives index of string parameter
  988.          
  989.       No forward referencing is allowed with %[$](<label>). The label
  990.       you use there must already be defined.
  991.       
  992.       Another example:
  993.          .macro foo
  994.       which .= %2       ;; use '.=' NOT '=' !!
  995.          .byte %1
  996.          .byte %$1
  997.          .byte %(WHICH)
  998.          .byte %$(WHICH)
  999.          .endm                                    
  1000.       MAGIC = $12
  1001.          foo  MAGIC,4,"UNUSED","Hello"
  1002.  
  1003.       would be expanded to
  1004.  
  1005.       which .= 4       ;; which has value of 4
  1006.          .byte $12     ;; MAGIC (=$12) was passed as the first parameter
  1007.          .byte "MAGIC" ;; Yup! Useless but it works!
  1008.          .byte 5       ;; String length of "Hello World"
  1009.          .byte "Hello" ;; String of "Hello"
  1010.  
  1011.       
  1012.       Type D labels that appear in macro definitions can be reused again. 
  1013.       The next example will not give errors on compilation, since "LEO" is 
  1014.       reset every time foo is called.
  1015.       
  1016.          .macro foo
  1017.       leo   inx
  1018.          .endm
  1019.             foo
  1020.             foo   ;; OK!
  1021.             foo   ;; OK!
  1022.             
  1023.       "LEO" is visible for code outside the macro after an invocation of
  1024.       "FOO". Forward references to labels in macros are OK! You should not
  1025.       put local variables in macros.
  1026.  
  1027.  
  1028.    .REPT <expr> <macroname> [parameter[,<parameter>]*]
  1029.    
  1030.       This is a recent addition to NASM65, inspired by the 68000 
  1031.       assemblers. It repeatedly calls a macro (optionally with parameters). 
  1032.       The <expr> contains the number of repetitions.
  1033.       Ex:   REPT 3 LSL.W $3000   ; calls the MACRO `LSL.W' 3 times
  1034.  
  1035.  
  1036.    .WARNING  <string>
  1037.       Creates a user warning. This is much more useful than the .ERROR
  1038.       directive. For instance in macros you can explain possible hazards.
  1039.       Ex:   .WARNING "The world comes to an end soon!"
  1040.  
  1041.  
  1042.    .ZEXT <label>
  1043.       If you want to link two files together that share zeropage labels
  1044.       and you don't want to use a central include file to share zero
  1045.       page symbols, as would be inconvenient for library files that
  1046.       already exist in assembled form, you need to declare in one file
  1047.       the zeropage labels as external and in the other file as linkable
  1048.       zeropage labels. As usual an example will clear up things...
  1049.       File #1:
  1050.             .ZEXT src         ;; tells NASM65 that src, dst
  1051.             .ZEXT dst         ;; are zeropage addresses.
  1052.                               ;; Call with amount to move in X
  1053.       move: ldy   #0          ;; this isn't a very good mover
  1054.       :loop lda   (src),y     ;; but this is just for illustrating
  1055.             sta   (src),y     ;; a point
  1056.             iny
  1057.             dex
  1058.             bne   :loop
  1059.             rts
  1060.  
  1061.       File #2:
  1062.       SRC==$F0                ;; == means declare as linkable zeropage
  1063.       DST==$F2
  1064.  
  1065.       ROM=$FF02
  1066.       RAM=$0610
  1067.  
  1068.       start ldx   #56
  1069.             lda   #<ROM
  1070.             sta   SRC
  1071.             lda   #>ROM
  1072.             sta   SRC+1
  1073.             lda   #<RAM
  1074.             sta   DST
  1075.             lda   #>RAM
  1076.             sta   DST+1
  1077.             ldx   #16
  1078.             jmp   move
  1079.             brk
  1080.  
  1081.       When linking the values of SRC and DST of file #1 will be set to
  1082.       those of file #2.
  1083.  
  1084.  
  1085.    .ORG <value>
  1086.       *=<value>
  1087.       This can only be used in the runnable mode to set the assembly
  1088.       program counter. f.e:
  1089.          *=$600
  1090.          lda   #0       ;; useless ditty in PAGE 6
  1091.          sta   $2F4
  1092.          rts
  1093.  
  1094.          .org  $3000    ;; main program in PAGE $30
  1095.          jsr   $600
  1096.          nop
  1097.  
  1098.          *=RUNAD        ;; let DOS start program @$3000
  1099.          .word $3000
  1100.       Using .ORG in the relocatable mode yields an error.
  1101.  
  1102.  
  1103.  
  1104.    2.  C o d e   p r o d u c i n g   d i r e c t i v e s
  1105.  
  1106.    .BYTE [+offset,][[<string>],[<expr>]]*  ;; incorrect! guess the meaning
  1107.       Deposits BYTE values in memory. Strings are treated as arrays
  1108.       of ATASCII characters. There is no '\0' implicitly appended
  1109.       after a string like in C.
  1110.  
  1111.    .SBYTE [+offset,][[<string>],[<expr>]]* ;; Comment as above
  1112.       Same as above, except that bytes are converted for direct screen
  1113.       representation. (if you wanted to poke "HELLO WORLD" directly
  1114.       into screen memory.)
  1115.  
  1116.    .CBYTE [+offset,][[<string>],[<expr>]]* ;; Comment as above
  1117.       Same as .BYTE except that the last byte of a <string> is EORed with
  1118.       $80. This is supposedly useful, when you wan't to check for EOS with
  1119.       BMI.
  1120.  
  1121.    .WORD <expr>[,<expr>]*                  ;; that's correct
  1122.       Deposits words (LSB MSB) in memory.
  1123.  
  1124.    .DBYTE <expr>[,<expr>]*
  1125.       Deposits 16Bit values in MSB LSB order.
  1126.  
  1127.    .FLOAT   <float>[,<float>]*
  1128.       Deposits floating point exprs into memory. Expressions are not
  1129.       allowed with floats. This is only kept in NASM65 for MAC65
  1130.       compatibility.
  1131.  
  1132.    .DS      <expr>
  1133.       Reserves <expr> bytes of memory. Not that useful in relocatable
  1134.       mode (see elsewhere). This is quite like writing *=*+<expr>.
  1135.       .DS is a code producing directive in relocatable mode.
  1136.  
  1137.  
  1138.    3.  O b s o l e t e   D i r e c t i v e s
  1139.  
  1140.    .TITLE   <string>
  1141.    .PAGE    <string>
  1142.    .SET     <expr>,<expr>
  1143.    .OPT     [NO]<option>[,[NO]<option>]*
  1144.    .TAB     <expr>
  1145.       These are all obsolete. The SET directive had some influence on
  1146.       code generation, but is NOT SUPPORTED anymore.
  1147.  
  1148.  
  1149.  
  1150.    E r r o r s   a n d   W a r n i n g s
  1151.    
  1152.    These are some errors and warnings that may need a bit more 
  1153.    explanation:
  1154.    
  1155.    Error:   "Label still has open references"
  1156.       This could happen in a case like this:
  1157.       foo   .= s1 
  1158.          lda   foo
  1159.       foo   .= s2    ; ERROR
  1160.          lda   foo
  1161.       s1:
  1162.       s2:
  1163.       NASM65 is single pass. On line 1 FOO is set to a forward as of yet
  1164.       unknown reference. In line 3 the value in FOO is overwritten although,
  1165.       we didn't yet had a chance to resolve the earlier forward reference.
  1166.       
  1167.    
  1168.    Warning: "Some non PC-relative labels point into code"
  1169.       If you used any of these labels to access memory, you might
  1170.       get into trouble. If you used those labels for benign purposes
  1171.       such as those from STDDEF, you can ignore those warnings"
  1172.       
  1173.  
  1174.    "Expression must be preceded by '<' or '>'"  [relocatable only]
  1175.       This occurs when you tried to assemble either  .BYTE <expr>  or an
  1176.       immediate instruction like  ADC   #<expr> and <expr> is PC-relative.
  1177.       In this case you must specify, whether to use the MSB '<' or the
  1178.       LSB '>' of the value. 
  1179.       Ex.
  1180.          .BYTE B8       ;; **ERROR** B8 undefined -> PC-relative fwd ref
  1181.          .BYTE <B8      ;; OK!
  1182.                
  1183.  
  1184.    T h i n g s   y o u   s a w   e n c l o s e d   i n   ' < > '
  1185.  
  1186.    address  : means a PC-relative address like foo in "foo: inx".
  1187.  
  1188.    bexpr    : Boolean expression. 0 is considered to mean 'false' and
  1189.               everything else means 'true'.
  1190.  
  1191.    continued: Just means next line should actually stand where you found
  1192.               continued
  1193.  
  1194.    equate   : This is a label, that has come into existance via a '='
  1195.               assignment.
  1196.  
  1197.    expr     : Arithmetic expression, like 4 + 5, [2 .AND 4] * [300 & 20]
  1198.  
  1199.    filename : System dependent character-string, that represents a path
  1200.               to a file in your filesystem.
  1201.               f.e.   TOS   ..\mystuff\n65\foo.h65
  1202.                      UNIX  /usr/lib/n65/fo.h65
  1203.               A filename can contain any characters that are valid for
  1204.               your filesystem. Note that this will bring in a slight
  1205.               source incompatibility between systems!
  1206.  
  1207.    float    : Atari's own fun floating point format. 6 Bytes. BCD.
  1208.               Avoid! E.g.:  -3.123E+24, +23.0, 0.1E-1
  1209.  
  1210.    label    : A label is a character string that represents an address or
  1211.               a value. You define labels by putting them in the first
  1212.               column of your source code. f.e.
  1213.               label  = 45
  1214.                    - or -
  1215.               label  .= 2
  1216.                    - or -
  1217.               label  lda   #2    ;; here label gets the value of *
  1218.               Labels have the same characterwise restriction as
  1219.               <macroname>s
  1220.  
  1221.    lines    : zero or more lines of ASCII/ATASCII text.
  1222.  
  1223.    macroname: Any character string derived from the following character
  1224.               set [A-Z,a-z,0-9,$,@,_,.]. Cannot start of with a digit!
  1225.  
  1226.  
  1227.    operation: Either an arithmetic operation ( * + - & etc.) or a
  1228.               boolean operation (.AND .NOT etc.)
  1229.  
  1230.    option   : ¡Obsolete! Any of the following list
  1231.                      (LIST CLIST OBJ MLIST XREF NUM EJECT)
  1232.  
  1233.    parameter: a macro parameter. In POKE 2300,23 the numbers 2300 and
  1234.               23 which are passed to the macro as arguments are called
  1235.               parameters.
  1236.  
  1237.    portable : Portability is a relative thing. NASM65 will probably go 
  1238.               belly up on anything with 7-Bit chars or EBCDIC.
  1239.  
  1240.    saddress : means a short PC-relative address that can't be used
  1241.               in another expression. For example the least
  1242.               significant of a PC-relative address is a saddress.
  1243.  
  1244.    source   : The <filename> of the source file.
  1245.  
  1246.    string   : Any number of characters enclosed inbetween >"<.
  1247.  
  1248.    value    : means numbers or non-PC-relative labels like
  1249.               STACK=$100 or expressions made of the two like
  1250.               4*5, STACK/4, 2*STACK, STACK-STACK+1...
  1251.  
  1252.  
  1253.  
  1254.    G l o s s a r y
  1255.  
  1256.    ACK       Acknowledgement
  1257.  
  1258.    ASCII     ASCII != EBCDIC. 7-bit really
  1259.  
  1260.    Assembler Go back to your wordprocessor, you are reading the wrong
  1261.              file.
  1262.  
  1263.    ATASCII   Atari extension of ASCII. 8-Bit
  1264.  
  1265.    BMI       ..            ..
  1266.    LDA       ....  6502  ....  What       LDA #<expr> = A9 ..
  1267.    STA       .... mnemos ....    else ?   STA <word>  = 8D .. ..
  1268.    NOP       ..            ..
  1269.  
  1270.    Byte      8 bits unsigned
  1271.  
  1272.    CR        Carriage Return, '\r',  ASCII  13
  1273.  
  1274.    EOS       End of string
  1275.  
  1276.    ICD       ? . Just as great as OSS. Hardware mostly though. Bought
  1277.              OSS.
  1278.  
  1279.    Linker    A program that produces an executable program from one
  1280.              or more object files and libraries of object files.
  1281.  
  1282.    LSB       Least significant byte of a word -> $12[34]
  1283.                           LSB MSB order would be [34]12
  1284.  
  1285.    LF        Linefeed, '\n',  ASCII 10
  1286.  
  1287.    MAC65     Assembler distributed by OSS.
  1288.  
  1289.    MSB       Most significant byte of a word  -> $[12]34
  1290.                            MSB LSB order would be [12]34
  1291.  
  1292.    OS        Operating System
  1293.  
  1294.    OSS       Optimized Systems Software. Makers of great Software for
  1295.              the Atari 8-Bit. You could buy their stuff eyes closed.
  1296.  
  1297.    PC        Program counter
  1298.  
  1299.    REF       Reference
  1300.  
  1301.    SPACE     Space, ' ', ASCII 32
  1302.  
  1303.    TAB       Tabulator, '\t', ASCII 9
  1304.  
  1305.    THANX     Thanks
  1306.  
  1307.    TOS       Takes up 192K ROM-space in the ST. Contains fragments of
  1308.              OS-code.
  1309.  
  1310.    UNIX      An OS.
  1311.  
  1312.    WORD      16 bits 8 of them comprise the LSB the other 8 the MSB
  1313.  
  1314.  
  1315.  
  1316.    B U G S  ( k n o w n )
  1317.       There is a serious bug in the documentation, which doesn't properly
  1318.       follow thru with the distinction of <equate> and <label>.
  1319.  
  1320.       The assembler does not print linenumber and filename, when the
  1321.       error or warning occurred on the last line.
  1322.       
  1323.       The assembler does no checking for overflow of it's program
  1324.       buffer space (assuming that noone would assemble more than
  1325.       48K in one run anyway). There is a limit imposed on many
  1326.       data structures in the object file, by virtue of using unsigned
  1327.       integers instead of lwords. If ANYONE runs into problems please
  1328.       tell me, changing stuff to LWORDs isn't that big a deal, it just
  1329.       wastes more filespace.
  1330.       
  1331.       On UNIX systems all include files must start with a lowercase
  1332.       character.
  1333.  
  1334.  
  1335.    A C K S ,  R E F S  &  T H A N X    (nö special order)
  1336.  
  1337.       Werner (Ex-Meister)  für moralische Unterstützung
  1338.       Dinadan              for porting this to the AMIGA and finding
  1339.                            some bugs, that escaped me
  1340.       J. Richter           for helping to debug the MSDOS code and lending 
  1341.                            me his KONTRON AT for a few days.
  1342.       Matthias Reichel     for making a valiant (and successful) attempt
  1343.                            at porting 2.0 to the PC
  1344.                            
  1345.       Harbison/Steele      C - A Reference Manual Second Edition
  1346.       Poole/McNiff/Cook    Your Atari Computer
  1347.       Chadwick             Mapping the Atari
  1348.       Dripke               6502 Assembler Kurs für Beginner
  1349.       OSS                  MAC/65™ Manual
  1350.       Lawrow               MAC/65
  1351.       Wilkinson            Atari Basic Source Book (?)
  1352.       
  1353.       Van Halen            (everything 'xcept maybe OU812) read the
  1354.       Metallica            (everything) sources
  1355.       Megadeth             (RIP *GREAT*, SFSG...SW? PS...BWIB? *GREAT*) to
  1356.       Chris Poland         (RTM) find some
  1357.       Joe Satriani         (everything) of 
  1358.       Steve Vai            (P&W) the hidden
  1359.       The Police           (RDB TGH) capabilities
  1360.       David Lee Roth       (ALAE *WHOA*) like
  1361.       Steve Morse          (SS *MASTERPIECE*) in the
  1362.       Suicidal Tendencies  (LCR) linker (har har) (is that outdated? nat/92)
  1363.       Front 242            (*FBF*)
  1364.             for continous (I mean continous) entertainment
  1365.