BR6502.TXT

Beschreibung zum CALM-Assembler fr 6502/65C02/65SC02/MELPS740

Gewhlte Adressierung
   Bei Sprungbefehlen wird, wo dies mglich ist, die relative (nicht beim 6502)
8-Bit-Adressierung gewhlt. Ansonsten wird die absolute Adressierung gewhlt.
Diese kann bei einigen Befehlen eine 8- (Seite 0) oder 16-Bit-Adresse sein.

Automatische Optimisierung des Befehlscodes
   Beim Befehl JUMP sind folgende Codeoptimisierungen mglich:

    JUMP    R8^Adresse   [ 2 Bytes ] (ohne den 6502)
    JUMP    16^Adresse   [ 3 Bytes ]

Der CALM-Assembler whlt die relative Adressierung, wenn die Adresse im
ersten Durchlauf bekannt ist, keine Adressenangabe angegeben ist und wenn sich
die Adresse innerhalb der Grenzen einer relativen 8-Bit-Adressierung befindet.
   Bei den Operanden sind ebenfalls Optimisierungen mglich:

    MOVE    8^Adresse,A  [ 2 Bytes ]
    MOVE    16^Adresse,A [ 3 Bytes ]

Der erste Fall wird automatisch kodiert, wenn der Assembler im ersten Durchlauf
den Wert der Adresse kennt und der Wert innerhalb eines 8-Bit-Wertes liegt.
   Mit den Adressenangaben (8^, R8^, usw.) kann man dem CALM Assembler
helfen, den kompaktesten Code zu generieren.

Bemerkungen
   Die indirekte Adressierung mit den Registern X und Y bentigt
normalerweise einen Abstandswert. Der CALM-Assembler akzeptiert aber auch:

    MOVE    {X}!,A       [ 2 Bytes ]
    MOVE    {{X}!},A     [ 2 Bytes ]
    JUMP    {{X}}        [ 3 Bytes ]
    MOVE    {X},A        [ 3 Bytes ]

d.h. setzt automatisch den Abstandswert Null ein.
   Das Modul R6502.PRO erkennt mit   .PROCSET R65SC02   auch die zustzlichen
Befehle des R65SC02 und mit   .PROCSET R65C02   die Befehle des R65C02. Mit
.PROCSET MELPS740   werden die Befehle der MELPS740-Prozessoren erkannt. Mit
.PROCSET SP_FF, SP_3F oder SP_1F kann die Sonderseite fr diese Serie fest-
gelegt werden (auf 16'FFxx, 16'3Fxx oder 16'1Fxx; Prfix: SP^Adresse).
   Liste aller Befehle: Testdatei assemblieren (mit /L) und ausdrucken.

Unterschiede zum Herstellerassembler
   Die unterschiedlichen Bezeichnungen der Operationscodes sind in den
Befehlslisten angegeben.
   Schreibweise        CALM                   Rockwell
   der                 #Wert                  Wert
   Adressierung:       Adresse                Adresse
                       {Adresse}              (Adresse)
                       {Register}+Abstand     Abstand,Register
                       {Register}+{Abstand}   (Abstand),Register
                       {{Register}!+Abstand}  (Abstand,Register)

   Pseudobefehle:      .ASCII                 ASC
                       .END                   END
                       .LOC                   ORG
                       .8                     BYT,HEX

Description du 6502/65C02/65SC02/MELPS740 pour l'assembleur CALM

Adressage choisi
   Pour les instructions de saut, l'adressage relatif 8 bits (sauf pour le
6502) est choisi si c'est possible. Sinon, l'adressage absolu est choisi. Ceci
peut tre une adresse de 8 (page 0) ou de 16 bits pour quelques instructions.

Optimisation automatique du code machine
   Pour l'instruction JUMP, les optimisations possibles sont:

    JUMP    R8^adresse   [ 2 octets ] (sans le 6502)
    JUMP    16^adresse   [ 3 octets ]

L'assembleur CALM choisit l'adressage relatif si l'adresse est connue dans la
premire passe, s'il n'y a pas d'indicateur d'adresses et si l'adresse se
trouve  l'intrieur des limites d'un adressage relatif 8 bits.
   Pour les oprandes, les optimisations possibles sont:

    MOVE    8^adresse,A  [ 2 octets ]
    MOVE    16^adresse,A [ 3 octets ]

Le premier cas est cod automatiquement si l'assembleur CALM connat la valeur
de l'adresse dans la premire passe et si la valeur ne dpasse pas 8 bits.
Par les indicateurs d'adresses (8^, R8^, etc.), on peut aider l'assembleur
 gnrer le code le plus compact.

Remarques
   L'adressage indirect avec les registres X et Y ncessite normalement
une valeur de dplacement. Mais l'assembleur accepte aussi:

    MOVE    {X}!,A       [ 2 octets ]
    MOVE    {{X}!},A     [ 2 octets ]
    JUMP    {{X}}        [ 3 octets ]
    MOVE    {X},A        [ 3 octets ]

c..d. il met automatiquement la valeur nulle.
   Le module R6502.PRO reconnat avec   .PROCSET R65SC02   aussi les
instructions additionnelles du R65SC02 et avec   .PROCSET R65C02   les
instructions du R65C02. Un   .PROCSET MELPS740   reconnat les instructions
des processeurs MELPS740. Un   .PROCSET SP_FF, SP_3F ou SP_1F   fixe la page
spciale de cette srie ( 16'FFxx, 16'3Fxx ou 16'1Fxx; prfixe: SP^adresse).
   Liste des instructions: assemblez le fichier de test (/L) et imprimez-le.

Diffrences par rapport  l'assembleur du fabricant
   Les diffrents noms des codes opratoires sont indiqus dans la carte de
rfrence.
   notation de         CALM                   Rockwell
   l'adressage:        #valeur                valeur
                       adresse                adresse
                       {adresse}              (adresse)
                       {registre}+dpl        dpl,registre
                       {registre}+{dpl}      (dpl),registre
                       {{registre}!+dpl}     (dpl,registre)

   pseudo-             .ASCII                 ASC
   instructions:       .END                   END
                       .LOC                   ORG
                       .8                     BYT,HEX

CALM assembler description for the 6502/65C02/65SC02/MELPS740

Chosen addressing mode
   The CALM assembler chooses for jump instructions the relative 8 bit
addressing mode (except for the 6502), if it is possible. Otherwise, the
absolute addressing mode is chosen. This could be for some instructions an
8 bit (page 0) or a 16 bit address.

Automatic optimisation of the instruction codes
   The following code optimisations are possible for the instruction JUMP:

    JUMP    R8^address   [ 2 bytes ]  (without the 6502)
    JUMP    16^address   [ 3 bytes ]

If the address is known in the first pass and no address specifier is
indicated, the CALM assembler trys first the relative addressing mode.
   Optimisations are also possible with some operands:

    MOVE    8^address,A  [ 2 bytes ]
    MOVE    16^address,A [ 3 bytes ]

The first case is automatically coded, when the CALM assembler knows the
value of the address in the first pass and when the value is an 8 bit value.
   With the address specifiers (8^, R8^, etc.) you can help the CALM
assembler to generate the most compact code.

Remarks
   The indirect addressing mode with the registers X and Y needs normally
an offset value. But the CALM assembler accepts also:

    MOVE    {X}!,A       [ 2 bytes ]
    MOVE    {{X}!},A     [ 2 bytes ]
    JUMP    {{X}}        [ 3 bytes ]
    MOVE    {X},A        [ 3 bytes ]

and puts automatically zero for the offset value in the code.
   The module R6502.PRO knows with   .PROCSET R65SC02   also the additional
instructions of the R65SC02 and with   .PROCSET R65C02   the instructions of
the R65C02. With   .PROCSET MELPS740   , the instructions of the MELPS740
processors are recognized. A   .PROCSET SP_FF, SP_3F, or SP_1F   sets the
special page for this series (16'FFxx, 3Fxx, or 1Fxx; prefix: SP^address).
   List of all instructions: assemble the test file (with /L) and print it.

Differences to the producer assembler
   The different notations of the operation codes are given in the CALM
reference card.
   notation of the     CALM                   Rockwell
   addressing          #value                 #value
   mode:               address                address
                       {address}              (address)
                       {register}+offset      offset,register
                       {register}+{offset}    (offset),register
                       {{register}!+offset}   (offset,register)

   pseudo-             .ASCII                 ASC
   instructions:       .END                   END
                       .LOC                   ORG
                       .8                     BYT,HEX
