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