uz80as (Micro Z80 assembler) 1.08

Table of Contents

Micro Z80 assembler

This manual is for uz80as (Micro Z80 assembler) version 1.08 (updated 22 September 2018).


1 About

uz80as is an assembler for the Zilog Z80 and several other microprocessors. It accepts source files with the same syntax accepted by the Telemark Cross Assembler (TASM), with only minor differences.

Currently, uz80as can assemble for these microprocessors:

uz80as is free software.

The latest version of the program, source code and documentation can be found at http://jorgicor.sdfeu.org/uz80as.

For bug reports and suggestions, you can write to Jorge Giner at jorge.giner@hotmail.com .


2 Source syntax

Each line of the source file must be a an assembler statement or a preprocessor directive. Mathematical expressions can be used where a number is expected.


2.1 Statements

Each assembler statement must follow this format:

label operation operands comment

For example:

START	LD	A,5	; Load 5 into A

Everything that starts with an alphabetic character at the first column is considered a label.

A label must be separated by the rest of fields on the line by a space, tab or a colon ‘:’.

The operation can be a microprocessor instruction or an assembler directive (assembler directives start with a dot ‘.’).

Assembler directives can start at column 1, as they start with a dot ‘.’ and cannot be taken for a label. But a microprocessor instruction cannot start at column 1, or it would be taken as a label.

The operation must be separated by the operands (if any) with a space.

The rest of the line is the operands field until we reach the end of line or a semicolon ‘;’.

If we find a semicolon ‘;’ character at any position, the rest of the line is ignored.

All of these fields are optional except the operands field which, if present, must be preceded always by an operation field.

These are examples of statements:

; Program version 3
        .ORG 4000
LABEL   LD A,5
        ADD 6          ; Add 6
MEM     .FILL 2
.END    ; End of program

A backslash character ‘\’ can be used to simulate a new line. Then it is possible to put one or more statements on the same line:

	LD A,B\ LD B,C\ LD C,A

Remember that, as the backslash character simulates a new line, if the first character after it is alphabetic, it will be considered as a label. That is why we leave a space after the backslash in the example above.


2.1.1 Label field

The label field must start with an character from ‘A’ to ‘Z’. The next characters, if any, must be letters, numbers, underscores ‘_’ or periods ‘.’. Any other character terminates the label, and it must be a space, a tab or a colon ‘:’.

A label with more than 31 characters will issue an error.

Labels are case sensitive, so ‘START’ is different from ‘start’.

Each label has a value, which is:


2.1.2 Operation field

The operation field is a microprocessor instruction opcode (like ADD, SUB, CALL, etc) or an assembler directive (like .ORG, .EQU, etc). If it is a microprocessor instruction, it cannot start at the first column of the line, because in that case it would be considered a label. Assembler directives can start at any column as they start with a dot ‘.’.


2.1.3 Operands field

The operands field contains the operands for the instruction or the arguments of assembler directives. They can involve expressions, addressing modes, etc.


2.1.4 Comment field

A comment starts with a semicolon ‘;’ character and extends to the end of the line. It can be the only field on a line.


2.2 Expressions

Wherever a number is accepted in the operands of an instruction or directive, you can use an expression instead. An expression is formed using labels, constants, the program counter symbol, operators and parenthesis.


2.2.1 Numeric constants

A decimal numeric constant is expressed normally by the decimal number, optionally followed by the ‘D’ suffix.

An hexadecimal constant is expressed by using the ‘$’ prefix or by using the ‘H’ suffix. It can be formed by the digits from ‘0’ to ‘9’ and the letters from ‘A’ to ‘F’. Note that an hexadecimal constant that uses the suffix form and starts with a letter must be prefixed with a ‘0’ digit or it will be taken as a label.

An octal constant is expressed by using the ‘@’ prefix or by using the ‘O’ suffix. It can be formed by the digits from ‘0’ to ‘7’.

Binary constants are expressed using the ‘%’ prefix or by using the ‘B’ suffix.

All the letters for hexadecimal constants or suffixes can be in lower case as well.

For example, all these values represent the decimal number 255, using different notations:

Decimal         255 or 255D
Hexadecimal     $FF or 0FFH
Octal           @377 or 377O
Binary          %11111111 or 11111111B

2.2.2 Character constants

Character constants are single characters enclosed in single quotes, for example: ’c’. The ASCII code of the character is used as the value. Non-printable characters cannot be expressed this way, but you can use the .TEXT directive instead.


2.2.3 String constants

String constants are one or more characters enclosed in double quotes, for example: "This is a string." . String constants are not allowed in expressions but can be used with certain directives, like .TITLE, .TEXT, .BYTE, .DB, .WORD and .DW. String constants can contain escape sequences to represent non-printable characters. An escape sequence starts with the backslash ‘\’ character:

\n

Line feed.

\r

Carriage return.

\b

Backspace.

\t

Tab.

\f

Form feed.

\\

Backslash.

\"

Double quote.

You can express any other character by using the backslash ‘\’ followed by an octal constant using exactly 3 digits. For example, \377 represents the character value 255, and is the maximum octal value representable using a backslash.

Examples:

"This ends with a newline.\n"
"\tThe name is \"Bye Bug\"."

2.2.4 Program counter

In an expression you can use the value of the current program counter which is the memory address that will be assigned to the line we are assembling. You can use the dollar character ‘$’ or the asterisk ‘*’ to represent the current program counter.

For example:

START  LD HL,START

is equivalent to

START  LD HL,$

2.2.5 Operators

All operations are done using at least 32 bit signed precision. An expression is evaluated left to right and there is no operator precedence. Use parenthesis if you want to change the precedence. For example:

1 + 2*3 + 4

will be evaluated as:

((1 + 2) * 3) + 4

Use parenthesis to indicate the desired order of evaluation:

1 + (2*3) + 4

Summary of operators:

+

Addition.

-

Subtraction or negation.

*

Multiplication.

/

Integer division.

%

Modulo.

<<

Logical left shift.

>>

Arithmetic right shift (the sign bit fills new positions).

~

One’s complement (invert all bits).

= or ==

Equal. The result is 1 if equal, 0 if not.

!=

Not equal. The result is 1 if not equal, 0 if equal.

<

Less than. The result is 1 if a < b, 0 otherwise.

<=

Less than or equal. The result is 1 if a <= b, 0 otherwise.

<

Greater than. The result is 1 if a > b, 0 otherwise.

<=

Greater than or equal. The result is 1 if a >= b, 0 otherwise.

&

Binary ‘AND’.

|

Binary ‘OR’.

^

Binary ‘XOR’.

For the shift operators >> and <<, the second operand specifies the number of bits to shift the first operand.


2.3 Assembler directives

The assembler directives are distinguished from the microprocessor instructions because they begin with a dot character ‘.’. They are commands to control the assembly process.


2.3.1 BLOCK

[label] .BLOCK expr

expr is evaluated and its value added to the current program counter. Thus .BLOCK n is equivalent to .ORG $+n.


2.3.2 BYTE

[label] .BYTE expr [, expr ...]

The .BYTE directive is supplied with one or more expressions separated by commas. Each expr can be a numeric expression or a string constant. If the expression is numeric, the lower eight bits of the result are output to the object file. If the expression is a string, for each character its ‘ASCII’ value is output to the object file.

START .BYTE 'a', "hello", 5 - START

Note that the program counter symbol used in any of the expressions refers to the value the program counter had at the beginning of the line, and not at the start of each expression.

You can use .DB as an alternative name for .BYTE.


2.3.3 CHK

[label] .CHK expr

The checksum directive, takes all the bytes from the address expr up to the current address, and adds them. The least significant byte of the result is output to the object file. The address defined by expr must be in the range [0, current program counter[.

For example, this will output in the object file the bytes 1, 2, 3, 4 and 10:

START   .DB 1, 2, 3, 4
        .CHK START

2.3.4 CODES

Enables the generation of line numbers, opcodes, etc. in the listing file. This is enabled by default, but can be disabled using the .NOCODES directive.


2.3.5 DB

.DB is an alternate name for .BYTE.


2.3.6 DW

.DW is an alternate name for .WORD.


2.3.7 ECHO

[label] .ECHO expr
[label] .ECHO string

Outputs to the console (stderr) an expression value or a string.

For example,

.ECHO "The code size is "
.ECHO PRG_END - PRG_START
.ECHO " bytes long.\n"

may result in:

The program size is 237 bytes long.

2.3.8 EJECT

The .EJECT directive is accepted but not implemented. In TASM, forces a new page in the listing file.


2.3.9 END

[label]	.END [addr]

The .END directive should be the last one in the program. It is accepted only for compatibility with TASM but, if not used, we will only issue a warning. If it is present, it is an error to use any directive or instruction that generates code after it. It is an error to have more than one .END directive.


2.3.10 EQU

label .EQU expr

Normally, a label takes the value of the current program counter, but you can assign the result of an expression to a label. The label is mandatory in this case.

An alternative syntax uses the equal sign ‘=’ instead of .EQU:

label = 25

2.3.11 EXPORT

[label] .EXPORT label [,label ...]

The .EXPORT directive is accepted but not implemented.


2.3.12 FILL

[label] .FILL number_of_bytes [, fill_value]

Outputs number_of_bytes bytes to the output file. The value output to each byte is the least significant byte of fill_value. If no fill_value is supplied, the value 255 is used. It is an error to supply a negative number_of_bytes.


2.3.13 LIST

Turns on the output to the listing file. This is the default. Use .NOLIST to disable it.


2.3.14 LSFIRST

Turns on little endian mode. When a .WORD directive is found, it will take the 16 lower significant bits of the value, and from these the least significant byte will be output first to the object file, then the most significant byte. This is the default. Use .MSFIRST to change this behavior.

This example will output the byte ‘$34’ and then ‘$12’ to the output file.

        .LSFIRST
        .WORD $1234

2.3.15 MSFIRST

Turns on big endian mode. When a .WORD directive is found, it will take the 16 lower significant bits of the value, and from these the most significant byte will be output first to the object file, then the least significant byte. Use .LSFIRST to change this behavior.

This example output the byte ‘$12’ and then ‘$34’ to the output file.

        .MSFIRST
        .WORD $1234

2.3.16 NOCODES

Disables the generation of line numbers, opcodes, etc. in the listing file. Use .CODES to enable it again.


2.3.17 NOLIST

Turns off the output to the listing file. Use .LIST to enable it again.


2.3.18 NOPAGE

Accepted but currently ignored. See the PAGE directive as well.


2.3.19 ORG

[label] .ORG expr
[label] *=expr
[label] $=expr

Sets the program counter to the value of expr, which must be in the range [0, 65536]. expr can have references to the current program counter. For example, to advance the program counter to the next 256 boundary, we can use:

        .ORG ($ + 0FFH) & 0FF00H

Note that a label that is used with an .ORG directive will take the value of the program counter set by the .ORG.

You can use .ORG or the alternative forms *= and $=.


2.3.20 PAGE

Accepted but currently ignored. See the NOPAGE directive as well.


2.3.21 TEXT

[label] .TEXT string

Outputs the ASCII value of each character of the supplied string to the object file as a byte. Special characters can be embedded in the string using escape sequences. See String constants.

msg1    .TEXT "Enter the file name\n"
msg2    .TEXT "Say \"YES\" or \"NO\""

2.3.22 TITLE

Accepted but currently ignored.

        .TITLE "Program version 1.2"
        .TITLE "Subtitle"

2.3.23 WORD

[label] .WORD expr [, expr ...]

The .WORD directive accepts an expression or a list of expressions, and outputs the 16 bit value of each expression as two bytes. The default is to output the least significant byte first. You can change this behavior with the .MSFIRST and .LSFIRST directives.

Note that if you use the program counter symbol (‘$’) in any expression in a .WORD directive, it takes the value of the program counter at the beginning of the line, and not its value at the start of each expression. For example:

START   .EQU  0
        .WORD $1234, $

will output:

$34 $12 $00

and not:

$32 $12 $02

2.4 Preprocessor directives

The preprocessor directives can be used to assemble or not some parts of the source, to include text from other files to assemble, and to define macros that can cause text substitution.


2.4.1 DEFINE

#DEFINE macro_name[(arg_label [, arg_label ...])] [macro_definition]

The #DEFINE directive is used to define a macro name. Macro names can be used for text substitution. For example, you can define a label to be expanded to arbitrary text prior compilation:

#DEFINE STARTLO (START & 255)

        .DB STARTLO+1

When the assembler finds STARTLO, it will substitute it by the text (START & 255), so it will finally assemble this text:

        .DB (START & 255)+1

The substitution is recursive. For example:

#DEFINE STARTLO (START & 255)
#DEFINE STARTLO_PLUS_1 (STARTLO+1)

        .DB STARTLO_PLUS_1

This will expand first to:

        .DB (STARTLO+1)

And then to:

        .DB ((START & 255)+1)

Note that you can define a macro label that expands to no text:

#DEFINE VOID

        .DB 5
        VOID
        .DB 6

And you can make synonyms for directives to, for example, allow to compile the syntax from other assemblers. For example, imagine an assembler which does not use directives that begin with a dot as we do. To assemble a source that was written for that assembler with uz80as, you can use a set of defines at the beginning of your source file, and use them later:

#DEFINE DB .DB
#DEFINE DW .DW

        ...

        DB 5, 6, 7

You can define macros with arguments, for example:

#DEFINE ADDMAC(x,y) ((x)+(y))

        .DB ADDMAC(5,6)

This works first by taking the text of the ADDMAC macro:

((x)+(y))

and then searches for x in this text and substitutes it by 5. Next, finds y and substitutes it by 6.

((5)+(6))

Finally, the resulting text is substituted in the original location:

        .DB ((5)+(6))

Note that if you do not supply a parameter, nothing will be substituted:

        .DB ADDMAC(5)

will expand into:

        .DB ((5)+(y))

2.4.2 DEFCONT

#DEFCONT can be used to add more text to the previous defined macro. The macro text will always form an unique line, so remember to use the backslash character if you are forming multiline statements:

#DEFINE ADDMAC(x,y)     LD A,x
#DEFCONT                \ LD B,y
#DEFCONT                \ ADD B

2.4.3 INCLUDE

#INCLUDE "filename"

The #INCLUDE directive is used to include the text of another file to be assembled.

For example, if the file ‘common.h’ is:

        .DB 5

and the file ‘prg.asm’ is:

#include "common.h"
        .DB 6

the assembler will compile

        .DB 5
        .DB 6

2.4.4 IF

#IF expr

The #IF directive evaluates the supplied expression. If the value of the expression is zero, the next lines are ignored by the assembler, until an #ENDIF or an #ELSE directive is found.

If the value of the expression is not zero, the next lines are assembled normally, until an #ENDIF or #ELSE directive is found. In this case, if we find an #ELSE directive, the next lines after the #ELSE will be ignored.

In this example, as the expression evaluates to something different than zero, the line LD A,1 will be assembled and LD A,0 ignored:

ASSEMLE .EQU 1

#IF ASSEMBLE
        LD A,1
#ELSE
        LD A,0
#ENDIF

On the other hand, here the opposite will happen:

ASSEMLE .EQU 1

#IF !ASSEMBLE
        LD A,1
#ELSE
        LD A,0
#ENDIF

Note that #IF directives can be nested:

TRUE  .EQU 1
FALSE .EQU 0

#IF TRUE
        #IF FALSE
                LD A,0
        #ELSE
                LD A,1
        #ENDIF
#ELSE
        #IF TRUE
                LD A,2
        #ELSE
                LD A,3
        #ENDIF
#ENDIF

In this example, this code will be assembled:

        LD A,1

2.4.5 IFDEF

#IFDEF macro_name

#IFDEF is like #IF, but tests if a macro name has been defined.

#DEFINE SPECTRUM

#IFDEF SPECTRUM
        CALL spectrum_fun
#ELSE
        CALL amstrad_fun
#ENDIF

will assemble:

        CALL spectrum_fun

2.4.6 IFNDEF

#IFNDEF is like #IFDEF, but tests if a macro name has not been defined.


2.4.7 ELSE

Used to end a section that began with an #IF, #IFDEF or IFNDEF directive.


2.4.8 ENDIF

Used to end a section that began with an #IF, #IFDEF, IFNDEF or #ELSE directive.


3 Reference


3.1 Invoking uz80as

uz80as [OPTION]... ASM_FILE [OBJ_FILE [LST_FILE]]

To assemble program.asm you can use:

uz80as program.asm

If there are no errors, this will generate the file program.obj with the binary machine code of the program. Also, the file program.lst will be generated with the listing of the source program, plus more info like line numbers, the value of the program counter at each line, the generated machine code in hexadecimal, etc.

You can give another names to the object and listing files by specifying their names after the name of the source file. For example, this will generate the object file with the name program.bin and the listing file with the name list.txt:

uz80as program.asm program.bin list.txt

Additional command line options can be used before the these arguments. They are:

-h, --help

Display usage information and exit.

-v, --version

Display version information and exit.

-f nn, --fill n

By default, the entire memory addressable (64K) is filled by zero. You can specify a different value to fill the memory. 'nn' must be formed by two hexadecimal digits. For example, to fill the memory with the value 255 decimal, use '-f FF'.

-dmacro, --define macro

Define a macro. If the macro is simply a label, you can use -dLABEL. If it is a macro for text substitution, you have to enclose the macro definition in double quotes. For example: -d"MUL(a,b) (a*b)".

-q, --quiet

Disables the generation of the listing file.

-x, --extended

Accept an alternative syntax for some instructions.

-u, --undocumented

Accept undocumented instructions.

-t, --target target

Selects the target microprocessor. The default is z80. See --list-targets to know the targets accepted.

-e, --list-targets

Displays a list of the targets accepted and a brief description.


3.2 Implementation-defined features

Limits:

In the places where we can specify an expression, sometimes we require that the labels referenced in the expression have already a well defined value in the first pass of the assembler. The following directives do not allow to specify a label not already defined at the point where the directive appears in the first pass: #IF, .BLOCK, .END, .EQU, .FILL (number of positions), .ORG.


3.3 Differences with TASM


4 Targets

For every instruction accepted for every target:


4.1 z80 target

The z80 target selects the Zilog Z80 instruction set. These are the instructions accepted:

LD B,BLD B,CLD B,DLD B,E
LD B,HLD B,LLD B,A* LD B,B
* LD B,C* LD B,D* LD B,E* LD B,IXH
* LD B,IXL* LD B,A* LD B,B* LD B,C
* LD B,D* LD B,E* LD B,IYH* LD B,IYL
* LD B,ALD B,(HL)LD C,(HL)LD D,(HL)
LD E,(HL)LD H,(HL)LD L,(HL)LD A,(HL)
LD B,(IXi)LD B,(IYi)LD A,ILD A,R
LD A,(BC)LD A,(DE)LD A,(e)LD B,e8
LD C,e8LD D,e8LD E,e8LD H,e8
LD L,e8LD A,e8* LD B,e8* LD C,e8
* LD D,e8* LD E,e8* LD IXH,e8* LD IXL,e8
* LD A,e8* LD B,e8* LD C,e8* LD D,e8
* LD E,e8* LD IYH,e8* LD IYL,e8* LD A,e8
LD I,ALD R,ALD SP,HLLD SP,BC
LD SP,DELD SP,HLLD SP,SPLD HL,(e)
LD BC,(e)LD DE,(e)LD HL,(e)LD SP,(e)
LD BC,eLD DE,eLD HL,eLD SP,e
LD BC,(e)LD DE,(e)LD HL,(e)LD SP,(e)
LD BC,eLD DE,eLD HL,eLD SP,e
LD (HL),BLD (HL),CLD (HL),DLD (HL),E
LD (HL),HLD (HL),LLD (HL),ALD (HL),e8
LD (BC),ALD (DE),ALD (IXi),BLD (IXi),C
LD (IXi),DLD (IXi),ELD (IXi),HLD (IXi),L
LD (IXi),ALD (IXi),e8LD (IYi),e8LD (e),A
LD (e),HLLD (e),BCLD (e),DELD (e),HL
LD (e),SPLD (e),BCLD (e),DELD (e),HL
LD (e),SPPUSH BCPUSH DEPUSH HL
PUSH AFPUSH BCPUSH DEPUSH HL
PUSH SPPOP BCPOP DEPOP HL
POP AFPOP BCPOP DEPOP HL
POP SPEX DE,HLEX AF,AF’EX (SP),HL
EX (SP),BCEX (SP),DEEX (SP),HLEX (SP),SP
EXXLDILDIRLDD
LDDRCPICPIRCPD
CPDRADD HL,BCADD HL,DEADD HL,HL
ADD HL,SPADD IX,BCADD IX,DEADD IX,IX
ADD IX,SPADD IY,BCADD IY,DEADD IY,IY
ADD IY,SPADC HL,BCADC HL,DEADC HL,HL
ADC HL,SPSBC HL,BCSBC HL,DESBC HL,HL
SBC HL,SPADD A,BADD A,CADD A,D
ADD A,EADD A,HADD A,LADD A,A
* ADD A,B* ADD A,C* ADD A,D* ADD A,E
* ADD A,IXH* ADD A,IXL* ADD A,A* ADD A,B
* ADD A,C* ADD A,D* ADD A,E* ADD A,IYH
* ADD A,IYL* ADD A,AADD A,(HL)ADC A,(HL)
SUB A,(HL)SBC A,(HL)AND A,(HL)XOR A,(HL)
OR A,(HL)CP A,(HL)ADD A,(IXi)ADD A,(IYi)
ADD A,e8ADC A,e8SUB A,e8SBC A,e8
AND A,e8XOR A,e8OR A,e8CP A,e8
ADD BADD CADD DADD E
ADD HADD LADD A* ADD B
* ADD C* ADD D* ADD E* ADD IXH
* ADD IXL* ADD A* ADD B* ADD C
* ADD D* ADD E* ADD IYH* ADD IYL
* ADD AADD (HL)ADC (HL)SUB (HL)
SBC (HL)AND (HL)XOR (HL)OR (HL)
CP (HL)ADD (IXi)ADD (IYi)ADD e8
ADC e8SUB e8SBC e8AND e8
XOR e8OR e8CP e8INC B
INC CINC DINC EINC H
INC LINC A* INC B* INC C
* INC D* INC E* INC IXH* INC IXL
* INC A* INC B* INC C* INC D
* INC E* INC IYH* INC IYL* INC A
INC (HL)DEC (HL)INC (IXi)INC (IYi)
INC BCINC DEINC HLINC SP
INC BCINC DEINC HLINC SP
DEC BCDEC DEDEC HLDEC SP
DEC BCDEC DEDEC HLDEC SP
DAACPLNEGCCF
SCFNOPHALTDI
EIIM tRLCARLA
RRCARRA* SLL B* SLL C
* SLL D* SLL E* SLL H* SLL L
* SLL A* SLL (HL)* SLL (IXi)* SLL (IYi)
* SLL (IXi),B* SLL (IXi),C* SLL (IXi),D* SLL (IXi),E
* SLL (IXi),H* SLL (IXi),L* SLL (IXi),ARLC B
RLC CRLC DRLC ERLC H
RLC LRLC ARLC (HL)RRC (HL)
RL (HL)RR (HL)SLA (HL)SRA (HL)
SRL (HL)RLC (IXi)RLC (IYi)* RLC (IXi),B
* RLC (IXi),C* RLC (IXi),D* RLC (IXi),E* RLC (IXi),H
* RLC (IXi),L* RLC (IXi),ARLDRRD
BIT b3,BBIT b3,CBIT b3,DBIT b3,E
BIT b3,HBIT b3,LBIT b3,ABIT b3,(HL)
RES b3,(HL)SET b3,(HL)BIT b3,(IXi)BIT b3,(IYi)
* RES b3,(IXi),B* RES b3,(IXi),C* RES b3,(IXi),D* RES b3,(IXi),E
* RES b3,(IXi),H* RES b3,(IXi),L* RES b3,(IXi),A* SET b3,(IXi),B
* SET b3,(IXi),C* SET b3,(IXi),D* SET b3,(IXi),E* SET b3,(IXi),H
* SET b3,(IXi),L* SET b3,(IXi),AJP (HL)JP (BC)
JP (DE)JP (HL)JP (SP)JP NZ,e
JP Z,eJP NC,eJP C,eJP PO,e
JP PE,eJP P,eJP M,eJP e
JR NZ,r8JR Z,r8JR NC,r8JR C,r8
JR r8DJNZ r8CALL NZ,eCALL Z,e
CALL NC,eCALL C,eCALL PO,eCALL PE,e
CALL P,eCALL M,eCALL eRETI
RETNRET NZRET ZRET NC
RET CRET PORET PERET P
RET MRETRST sIN B,(C)
IN C,(C)IN D,(C)IN E,(C)IN H,(C)
IN L,(C)IN A,(C)IN A,(e8)IN F,(e)
* IN (C)INIINIRIND
INDR* OUT (C),0OUT (C),BOUT (C),C
OUT (C),DOUT (C),EOUT (C),HOUT (C),L
OUT (C),AOUT (e8),AOUTIOTIR
OUTDOTDR

Where:


4.1.1 z80 extended syntax

Note that in the official Zilog documentation, some of the arithmetic group of instructions take the A register as first argument: ADD, ADC and SBC. Others do not: SUB, AND, OR, XOR and CP. So you write:

	ADD A,B

and do not write

	ADD B

And you write:

	SUB B

but do not write

	SUB A,B

By default, it is an error to use the unofficial forms of these instructions, but you can enable them by specifying the -x option at the command line. With this option enabled, you can write any of these instructions with or without the A register as the first argument, like this:

	ADD A,B
	ADD B
	SUB A,B
	SUB B

For compatibility with other assemblers, it is better to keep the official syntax.


4.2 hd64180 target

The hd64180 target selects the Hitachi HD64180 instruction set. The instructions accepted are the same as for the z80 target (except undocumented instructions) plus these new instructions:

IN0 B,(e8)IN0 C,(e8)IN0 D,(e8)IN0 E,(e8)
IN0 H,(e8)IN0 L,(e8)IN0 A,(e8)OUT0 (e8),B
OUT0 (e8),COUT0 (e8),DOUT0 (e8),EOUT0 (e8),H
OUT0 (e8),LOUT0 (e8),AOTDMOTDMR
OTIMOTIMRMLT BCMLT DE
MLT HLMLT SPSLPTST B
TST CTST DTST ETST H
TST LTST ATST (HL)TST e8
TSTIO e8

4.2.1 hd64180 extended syntax

See z80 extended syntax.


4.3 gbcpu target

The gbcpu target selects the Sharp LR35902 CPU used in the Nintendo Gameboy. These are the instructions accepted:

LD B,BLD B,CLD B,DLD B,E
LD B,HLD B,LLD B,ALD B,(HL)
LD C,(HL)LD D,(HL)LD E,(HL)LD H,(HL)
LD L,(HL)LD A,(HL)LD A,(C)LD A,(BC)
LD A,(DE)LD A,(HLI)LD A,(HLD)LD A,(e)
LD B,e8LD C,e8LD D,e8LD E,e8
LD H,e8LD L,e8LD A,e8LD SP,HL
LDHL SP,e8LD BC,eLD DE,eLD HL,e
LD SP,eLD (C),ALD (HL),BLD (HL),C
LD (HL),DLD (HL),ELD (HL),HLD (HL),L
LD (HL),ALD (HL),e8LD (HLI),ALD (HLD),A
LD (BC),ALD (DE),ALD (e),ALD (e),SP
LDH A,(e8)LDH (e8),APUSH BCPUSH DE
PUSH HLPUSH AFPOP BCPOP DE
POP HLPOP AFADD HL,BCADD HL,DE
ADD HL,HLADD HL,SPADD SP,e8ADD A,B
ADD A,CADD A,DADD A,EADD A,H
ADD A,LADD A,AADD A,(HL)ADC A,(HL)
SUB A,(HL)SBC A,(HL)AND A,(HL)XOR A,(HL)
OR A,(HL)CP A,(HL)ADD A,e8ADC A,e8
SUB A,e8SBC A,e8AND A,e8XOR A,e8
OR A,e8CP A,e8ADD BADD C
ADD DADD EADD HADD L
ADD AADD (HL)ADC (HL)SUB (HL)
SBC (HL)AND (HL)XOR (HL)OR (HL)
CP (HL)ADD e8ADC e8SUB e8
SBC e8AND e8XOR e8OR e8
CP e8INC BINC CINC D
INC EINC HINC LINC A
INC (HL)DEC (HL)INC BCINC DE
INC HLINC SPDEC BCDEC DE
DEC HLDEC SPDAACPL
CCFSCFNOPHALT
DIEIRLCARLA
RRCARRARLC BRLC C
RLC DRLC ERLC HRLC L
RLC ARLC (HL)RRC (HL)RL (HL)
RR (HL)SLA (HL)SRA (HL)SWAP (HL)
SRL (HL)BIT b3,BBIT b3,CBIT b3,D
BIT b3,EBIT b3,HBIT b3,LBIT b3,A
BIT b3,(HL)RES b3,(HL)SET b3,(HL)JP (HL)
JP NZ,eJP Z,eJP NC,eJP C,e
JP eJR NZ,r8JR Z,r8JR NC,r8
JR C,r8JR r8STOPCALL NZ,e
CALL Z,eCALL NC,eCALL C,eCALL e
RETIRET NZRET ZRET NC
RET CRETRST s

Where:


4.3.1 gbcpu extended syntax

See z80 extended syntax.


4.4 dp2200 target

The dp2200 target selects the Datapoint 2200 version I instruction set.

Important: the Datapoint 2200 version I can only address 8K at maximum but uz80as at this moment only imposes a 64K limit.

These are the instructions accepted:

SLCSRCRETURNINPUT
ADAADBADCADD
ADEADHADLADM
ACAACBACCACD
ACEACHACLACM
SUASUBSUCSUD
SUESUHSULSUM
SBASBBSBCSBD
SBESBHSBLSBM
NDANDBNDCNDD
NDENDHNDLNDM
XRAXRBXRCXRD
XREXRHXRLXRM
ORAORBORCORD
OREORHORLORM
CPACPBCPCCPD
CPECPHCPLCPM
NOPLABLACLAD
LAELAHLALLAM
LBALBCLBDLBE
LBHLBLLBMLCA
LCBLCDLCELCH
LCLLCMLDALDB
LDCLDELDHLDL
LDMLEALEBLEC
LEDLEHLELLEM
LHALHBLHCLHD
LHELHLLHMLLA
LLBLLCLLDLLE
LLHLLMLMALMB
LMCLMDLMELMH
LMLHALTEX ADREX STATUS
EX DATAEX WRITEEX COM1EX COM2
EX COM3EX COM4EX BEEPEX CLICK
EX DECK1EX DECK2EX RBKEX WBK
EX BSPEX SFEX SBEX REWND
EX TSTOPRFCRFZRFS
RFPRTCRTZRTS
RTPAD e8AC e8SU e8
SB e8ND e8XR e8OR e8
CP e8LA e8LB e8LC e8
LD e8LE e8LH e8LL e8
JFC eJFZ eJFS eJFP e
JTC eJTZ eJTS eJTP e
CFC eCFZ eCFS eCFP e
CTC eCTZ eCTS eCTP e
JMP eCALL e

4.5 dp2200ii target

The dp2200ii target selects the Datapoint 2200 version II instruction set.

Important: the Datapoint 2200 version II can only address 16K at maximum but uz80as at this moment only imposes a 64K limit.

The instruction set accepted is the same as for the dp2200 target, plus these new instructions:

BETADIPOPALPHA
EIPUSH

4.6 i4004 target

The i4004 target selects the Intel 4004 instruction set.

Important: the Intel 4004 can only address 4K at maximum but uz80as at this moment only imposes a 64K limit.

Note that the original Intel syntax was something like this:

LAB,   ISZ 5 255   \ this is a comment

At this moment, you will need to translate that to a syntax acceptable by uz80as, for instance:

LAB:   ISZ 5,255   ; this is a comment

However, we do accept the 0P, 1P, etc. notation to specify a register pair. These are the instructions accepted:

NOPJCN b4,e8FIM 0P,e8FIM 1P,e8
FIM 2P,e8FIM 3P,e8FIM 4P,e8FIM 5P,e8
FIM 6P,e8FIM 7P,e8FIM p,e8SRC 0P
SRC 1PSRC 2PSRC 3PSRC 4P
SRC 5PSRC 6PSRC 7PSRC p
FIN 0PFIN 1PFIN 2PFIN 3P
FIN 4PFIN 5PFIN 6PFIN 7P
FIN pJIN 0PJIN 1PJIN 2P
JIN 3PJIN 4PJIN 5PJIN 6P
JIN 7PJIN pJUN eJMS e
INC b4ISZ b4,e8ADD b4SUB b4
LD b4XCH b4BBL b4LDM b4
WRMWMPWRRWPM
WR0WR1WR2WR3
SBMRDMRDRADM
RD0RD1RD2RD3
CLBCLCIACCMC
CMARALRARTCC
DACTCSSTCDAA
KBPDCL

Where:


4.7 i4040 target

The i4040 target selects the Intel 4040 instruction set.

Important: the Intel 4040 can only address 8K at maximum but uz80as at this moment only imposes a 64K limit.

The instruction set accepted is the same as for the i4004 target, plus these new instructions:

HLTBBSLCROR4
OR5AN6AN7DB0
DB1SB0SB1EIN
DINRPM

4.8 i8008 target

The i8008 target selects the Intel 8008 instruction set.

Important: the Intel 8008 can only address 16K at maximum but uz80as at this moment only imposes a 64K limit.

These are the instructions accepted:

RETRLCRRCRAL
RARRFCRFZRFS
RFPRTCRTZRTS
RTPLAI e8LBI e8LCI e8
LDI e8LEI e8LHI e8LLI e8
LMI e8ADI e8ACI e8SUI e8
SBI e8NDI e8XRI e8ORI e8
CPI e8INBINCIND
INEINHINLDCB
DCCDCDDCEDCH
DCLRST b3JFC eCFC e
JMP eCAL eJFZ eCFZ e
JFS eCFS eJFP eCFP e
JTC eCTC eJTZ eCTZ e
JTS eCTS eJTP eCTP e
INP b3OUT kADAADB
ADCADDADEADH
ADLADMACAACB
ACCACDACEACH
ACLACMSUASUB
SUCSUDSUESUH
SULSUMSBASBB
SBCSBDSBESBH
SBLSBMNDANDB
NDCNDDNDENDH
NDLNDMXRAXRB
XRCXRDXREXRH
XRLXRMORAORB
ORCORDOREORH
ORLORMCPACPB
CPCCPDCPECPH
CPLCPMNOPLAB
LACLADLAELAH
LALLAMLBALBB
LBCLBDLBELBH
LBLLBMLCALCB
LCCLCDLCELCH
LCLLCMLDALDB
LDCLDDLDELDH
LDLLDMLEALEB
LECLEDLEELEH
LELLEMLHALHB
LHCLHDLHELHH
LHLLHMLLALLB
LLCLLDLLELLH
LLLLLMLMALMB
LMCLMDLMELMH
LMLHLT

Where:


4.9 i8021 target

The i8021 target selects the Intel 8021 instruction set.

These are the instructions accepted:

NOPADD A,R0ADD A,R1ADD A,R2
ADD A,R3ADD A,R4ADD A,R5ADD A,R6
ADD A,R7ADD A,@R0ADD A,@R1ADD A,#e8
ADDC A,R0ADDC A,R1ADDC A,R2ADDC A,R3
ADDC A,R4ADDC A,R5ADDC A,R6ADDC A,R7
ADDC A,@R0ADDC A,@R1ADDC A,#e8ANL A,R0
ANL A,R1ANL A,R2ANL A,R3ANL A,R4
ANL A,R5ANL A,R6ANL A,R7ANL A,@R0
ANL A,@R1ANL A,#e8ANLD P4,AANLD P5,A
ANLD P6,AANLD P7,ACALL eCLR A
CLR CCPL ACPL CDA A
DEC ADJNZ R0,e8DJNZ R1,e8DJNZ R2,e8
DJNZ R3,e8DJNZ R4,e8DJNZ R5,e8DJNZ R6,e8
DJNZ R7,e8IN A,P0IN A,P1IN A,P2
INC AINC R0INC R1INC R2
INC R3INC R4INC R5INC R6
INC R7INC @R0INC @R1JC e8
JMP e11JMPP @AJNC e8JNT1 e8
JNZ e8JTF e8JT1 e8JZ e8
MOV A,#e8MOV A,R0MOV A,R1MOV A,R2
MOV A,R3MOV A,R4MOV A,R5MOV A,R6
MOV A,R7MOV A,@R0MOV A,@R1MOV A,T
MOV R0,AMOV R1,AMOV R2,AMOV R3,A
MOV R4,AMOV R5,AMOV R6,AMOV R7,A
MOV R0,#e8MOV R1,#e8MOV R2,#e8MOV R3,#e8
MOV R4,#e8MOV R5,#e8MOV R6,#e8MOV R7,#e8
MOV @R0,AMOV @R1,AMOV @R0,#e8MOV @R1,#e8
MOV T,AMOVD A,P4MOVD A,P5MOVD A,P6
MOVD A,P7MOVD P4,AMOVD P5,AMOVD P6,A
MOVD P7,AMOVP A,@ANOPORL A,R0
ORL A,R1ORL A,R2ORL A,R3ORL A,R4
ORL A,R5ORL A,R6ORL A,R7ORL A,@R0
ORL A,@R1ORL A,#e8ORLD P4,AORLD P5,A
ORLD P6,AORLD P7,AOUTL P0,AOUTL P1,A
OUTL P2,ARETRL ARLC A
RR ARRC ASTOP TCNTSTRT CNT
STRT TSWAP AXCH A,R0XCH A,R1
XCH A,R2XCH A,R3XCH A,R4XCH A,R5
XCH A,R6XCH A,R7XCH A,@R0XCH A,@R1
XCHD A,@R0XCHD A,@R1XRL A,R0XRL A,R1
XRL A,R2XRL A,R3XRL A,R4XRL A,R5
XRL A,R6XRL A,R7XRL A,@R0XRL A,@R1
XRL A,#e8

4.10 i8022 target

The i8022 target selects the Intel 8022 instruction set. The instruction set accepted is the same as for the i8021 target, plus these new instrucions:

DIS IDIS TCNTIEN IEN TCNTI
JNT0 e8JT0 e8RADRETI
SEL AN0SEL AN1

4.11 i8041 target

The i8041 target selects the Intel 8041 instruction set. The instruction set accepted is the same as for the i8021 target, except that these instructions are removed:

IN A,P0OUTL P0,A

And these instructions are added:

ANL P1,#e8ANL P2,#e8CLR F1CLR F0
CPL F0CPL F1DEC R0DEC R1
DEC R2DEC R3DEC R4DEC R5
DEC R6DEC R7DIS IDIS TCNTI
EN DMAEN FLAGSEN IEN TCNTI
IN A,DBBJB0 e8JB1 e8JB2 e8
JB3 e8JB4 e8JB5 e8JB6 e8
JB7 e8JF0 e8JF1 e8JNIBF e8
JNT0 e8JOBF e8JT0 e8MOV A,PSW
MOV PSW,AMOV STS,AMOVP3 A,@AORL P1,#e8
ORL P2,#e8OUT DBB,ARETRSEL RB0
SEL RB1

4.12 i8048 target

The i8048 target selects the Intel 8048 instruction set. The instruction set accepted is the same as for the i8041 target, except that these instructions are removed:

IN A,DBBOUT DBB,AJOBF e8JNIBF e8
MOV STS,AEN DMAEN FLAGS

And these instructions are added:

ANL BUS,#e8ENT0 CLKINS A,BUSJNI e8
MOVX A,@R0MOVX A,@R1MOVX @R0,AMOVX @R1,A
ORL BUS,#e8OUTL BUS,ASEL MB0SEL MB1

4.13 i8051 target

The i8051 target selects the Intel 8021 instruction set.

These are the instructions accepted:

ACALL e11ADD A,R0ADD A,R1ADD A,R2
ADD A,R3ADD A,R4ADD A,R5ADD A,R6
ADD A,R7ADD A,@R0ADD A,@R1ADD A,#e8
ADD A,e8ADDC A,R0ADDC A,R1ADDC A,R2
ADDC A,R3ADDC A,R4ADDC A,R5ADDC A,R6
ADDC A,R7ADDC A,@R0ADDC A,@R1ADDC A,#e8
ADDC A,e8AJMP e11ANL A,R0ANL A,R1
ANL A,R2ANL A,R3ANL A,R4ANL A,R5
ANL A,R6ANL A,R7ANL A,@R0ANL A,@R1
ANL A,#e8ANL A,e8ANL C,/e8ANL C,e8
ANL e,AANL e8,#e8CJNE A,#e8,r8CJNE R0,#e8,r8
CJNE R1,#e8,r8CJNE R2,#e8,r8CJNE R3,#e8,r8CJNE R4,#e8,r8
CJNE R5,#e8,r8CJNE R6,#e8,r8CJNE R7,#e8,r8CJNE @R0,#e8,r8
CJNE @R1,#e8,r8CJNE A,e8,r8CLR ACLR C
CLR e8CPL ACPL CCPL e8
DA ADEC ADEC R0DEC R1
DEC R2DEC R3DEC R4DEC R5
DEC R6DEC R7DEC @R0DEC @R1
DEC e8DIV ABDJNZ R0,r8DJNZ R1,r8
DJNZ R2,r8DJNZ R3,r8DJNZ R4,r8DJNZ R5,r8
DJNZ R6,r8DJNZ R7,r8DJNZ e8,r8INC DPTR
INC AINC R0INC R1INC R2
INC R3INC R4INC R5INC R6
INC R7INC @R0INC @R1INC e8
JB e8,r8JBC e8,r8JC r8JMP @A+DPTR
JNB e8,r8JNC r8JNZ r8JZ r8
LCALL eLJMP eMOV A,R0MOV A,R1
MOV A,R2MOV A,R3MOV A,R4MOV A,R5
MOV A,R6MOV A,R7MOV A,@R0MOV A,@R1
MOV A,#e8MOV A,e8MOV R0,AMOV R1,A
MOV R2,AMOV R3,AMOV R4,AMOV R5,A
MOV R6,AMOV R7,AMOV R0,#e8MOV R1,#e8
MOV R2,#e8MOV R3,#e8MOV R4,#e8MOV R5,#e8
MOV R6,#e8MOV R7,#e8MOV R0,e8MOV R1,e8
MOV R2,e8MOV R3,e8MOV R4,e8MOV R5,e8
MOV R6,e8MOV R7,e8MOV @R0,AMOV @R1,A
MOV @R0,#e8MOV @R1,#e8MOV @R0,e8MOV @R1,e8
MOV C,e8MOV DPTR,#e8MOV e8,AMOV e8,C
MOV e8,R0MOV e8,R1MOV e8,R2MOV e8,R3
MOV e8,R4MOV e8,R5MOV e8,R6MOV e8,R7
MOV e8,@R0MOV e8,@R1MOV e8,#e8MOV e8,e8
MOVC A,@A+DPTRMOVC A,@A+PCMOVX A,@R0MOVX A,@R1
MOVX A,@DPTRMOVX @R0,AMOVX @R1,AMOVX @DPTR,A
MUL ABNOPORL A,R0ORL A,R1
ORL A,R2ORL A,R3ORL A,R4ORL A,R5
ORL A,R6ORL A,R7ORL A,@R0ORL A,@R1
ORL A,#e8ORL A,e8ORL C,/e8ORL C,e8
ORL e8,AORL e8,#e8POP e8PUSH e8
RETRETIRL ARLC A
RR ARRC ASETB CSETB e8
SJMP r8SUBB A,R0SUBB A,R1SUBB A,R2
SUBB A,R3SUBB A,R4SUBB A,R5SUBB A,R6
SUBB A,R7SUBB A,@R0SUBB A,@R1SUBB A,#e8
SUBB A,e8SWAP AXCH A,R0XCH A,R1
XCH A,R2XCH A,R3XCH A,R4XCH A,R5
XCH A,R6XCH A,R7XCH A,@R0XCH A,@R1
XCH A,e8XCHD A,@R0XCHD A,@R1XRL A,R0
XRL A,R1XRL A,R2XRL A,R3XRL A,R4
XRL A,R5XRL A,R6XRL A,R7XRL A,@R0
XRL A,@R1XRL A,#e8XRL A,e8XRL e8,A
XRL e8,#e8

4.14 i8080 target

The i8080 target selects the Intel 8080. These are the instructions accepted:

MOV M,BMOV M,CMOV M,DMOV M,E
MOV M,HMOV M,LMOV M,AMOV B,M
MOV C,MMOV D,MMOV E,MMOV H,M
MOV L,MMOV A,MMOV B,BMOV B,C
MOV B,DMOV B,EMOV B,HMOV B,L
MOV B,AMVI B,e8MVI C,e8MVI D,e8
MVI E,e8MVI H,e8MVI L,e8MVI M,e8
MVI A,e8LXI B,eLXI D,eLXI H,e
LXI SP,eSHLD eLHLD eSTA e
LDA eSTAX BSTAX DXCHG
ADD BADD CADD DADD E
ADD HADD LADD MADD A
ADI e8ACI e8SUI e8SBI e8
ANI e8XRI e8ORI e8CPI e8
INR BINR CINR DINR E
INR HINR LINR MINR A
DCR BDCR CDCR DDCR E
DCR HDCR LDCR MDCR A
INX BINX DINX HINX SP
DCX BDCX DDCX HDCX SP
DAD BDAD DDAD HDAD SP
DAARLCRRCRAL
RARCMASTCCMC
JMP eJNZ eJZ eJNC e
JC eJPO eJPE eJP e
JM eCALL eCNZ eCZ e
CNC eCC eCPO eCPE e
CP eCM eRETRNZ
RZRNCRCRPO
RPERPRMRST b3
PCHLPOP BPOP DPOP H
POP PSWXTHLSPHLOUT e8
IN e8DIEIHLT
NOP

4.15 i8085 target

The i8085 target selects the Intel 8085. The instruction set accepted is the same as for the i8080 target, plus these new instructions:

RIMSIM* ARHL* DSUB
* RDEL* LDHI e8* LDSI e8* RSTV
* SHLX* LHLX* JNK e* JNX5 e
* JNUI e* JK e* JX5 e* JUI e

Where:


4.16 mos6502 target

The mos6502 target selects the MOS Technology 6502. These are the instructions accepted:

BRKJSR eRTIRTS
TXATXSTAXTSX
DEXNOPPHPCLC
PLPSECPHACLI
PLASEIDEYTYA
TAYCLVINYCLD
INXSEDORA #e8AND #e8
EOR #e8ADC #e8LDA #e8CMP #e8
SBC #e8ORA (e8,X)AND (e8,X)EOR (e8,X)
ADC (e8,X)STA (e8,X)LDA (e8,X)CMP (e8,X)
SBC (e8,X)ORA (e8),YAND (e8),YEOR (e8),Y
ADC (e8),YSTA (e8),YLDA (e8),YCMP (e8),Y
SBC (e8),YORA eAND eEOR e
ADC eSTA eLDA eCMP e
SBC eORA e,XAND e,XEOR e,X
ADC e,XSTA e,XLDA e,XCMP e,X
SBC e,XORA e,YAND e,YEOR e,Y
ADC e,YSTA e,YLDA e,YCMP e,Y
SBC e,YASL AROL ALSR A
ROR AASL eROL eLSR e
ROR eASL e,XROL e,XLSR e,X
ROR e,XSTX eSTX e8,YLDX #e8
LDX eLDX e,YDEC eINC e
DEC e,XINC e,XBPL r8BMI r8
BVC r8BVS r8BCC r8BCS r8
BNE r8BEQ r8BIT eJMP (e)
JMP eSTY eSTY e8,XLDY #e8
LDY eLDY e,XCPY #e8CPX #e8
CPY eCPX e

4.17 r6501 target

The r6501 target selects the Rockwell R6501. The instruction set accepted is the same as for the mos6502 target, plus these new instructions:

BBR0 e8,r8BBR1 e8,r8BBR2 e8,r8BBR3 e8,r8
BBR4 e8,r8BBR5 e8,r8BBR6 e8,r8BBR7 e8,r8
BBS0 e8,r8BBS1 e8,r8BBS2 e8,r8BBS3 e8,r8
BBS4 e8,r8BBS5 e8,r8BBS6 e8,r8BBS7 e8,r8
RMB0 e8RMB1 e8RMB2 e8RMB3 e8
RMB4 e8RMB5 e8RMB6 e8RMB7 e8
SMB0 e8SMB1 e8SMB2 e8SMB3 e8
SMB4 e8SMB5 e8SMB6 e8SMB7 e8

4.18 g65sc02 target

The g65sc02 target selects the California Micro Devices G65SC02. The instruction set accepted is the same as for the mos6502 target, plus these new instructions:

ORA (e8)AND (e8)EOR (e8)ADC (e8)
STA (e8)LDA (e8)CMP (e8)SBC (e8)
INC ADEC ABIT #e8BIT e,X
JMP (e,X)TSB eTRB ePHY
PLYPHXPLXBRA r8
STZ e,XSTZ e

4.19 r65c02 target

The r65c02 target selects the Rockwell R65C02. The instruction set accepted is the same as for the mos6502 target, plus the added instructions of the r6501 and g65sc02 targets.


4.20 r65c29 target

The r65c29 target selects the Rockwell R65C29, R65C00/21. The instruction set accepted is the same as for the r65c02 target, plus these new instructions:

MUL

4.21 w65c02s target

The w65c02s target selects the Western Design Center W65C02S. The instruction set accepted is the same as for the r65c02 target, plus these new instructions:

WAISTP

4.22 mc6800 target

The mc6800 target selects the Motorola 6800. These are the instructions accepted:

NOPTAPTPAINX
DEXCLVSEVCLC
SECCLISEISBA
CBATABTBADAA
ABATSXINSPULA
PULBDESTXSPSHA
PSHBRTSRTIWAI
SWIBRA r8BHI r8BLS r8
BCC r8BCS r8BNE r8BEQ r8
BVC r8BVS r8BPL r8BMI r8
BGE r8BLT r8BGT r8BLE r8
NEGACOMALSRARORA
ASRAASLAROLADECA
INCATSTACLRANEGB
COMBLSRBRORBASRB
ASLBROLBDECBINCB
TSTBCLRBNEG e8,XCOM e8,X
LSR e8,XROR e8,XASR e8,XASL e8,X
ROL e8,XDEC e8,XINC e8,XTST e8,X
JMP e8,XCLR e8,XNEG e16COM e16
LSR e16ROR e16ASR e16ASL e16
ROL e16DEC e16INC e16TST e16
JMP e16CLR e16SUBA #e8CMPA #e8
SBCA #e8ANDA #e8BITA #e8LDAA #e8
EORA #e8ADCA #e8ORAA #e8ADDA #e8
SUBB #e8CMPB #e8SBCB #e8ANDB #e8
BITB #e8LDAB #e8EORB #e8ADCB #e8
ORAB #e8ADDB #e8SUBA >e16CMPA >e16
SBCA >e16ANDA >e16BITA >e16LDAA >e16
EORA >e16ADCA >e16ORAA >e16ADDA >e16
SUBB >e16CMPB >e16SBCB >e16ANDB >e16
BITB >e16LDAB >e16EORB >e16ADCB >e16
ORAB >e16ADDB >e16SUBA e8,XCMPA e8,X
SBCA e8,XANDA e8,XBITA e8,XLDAA e8,X
EORA e8,XADCA e8,XORAA e8,XADDA e8,X
SUBB e8,XCMPB e8,XSBCB e8,XANDB e8,X
BITB e8,XLDAB e8,XEORB e8,XADCB e8,X
ORAB e8,XADDB e8,XSUBA eCMPA e
SBCA eANDA eBITA eLDAA e
EORA eADCA eORAA eADDA e
SUBB eCMPB eSBCB eANDB e
BITB eLDAB eEORB eADCB e
ORAB eADDB eSTAA >e16STAA e8,X
STAA eSTAB >e16STAB e8,XSTAB e
CPX #e16CPX >e16CPX e8,XCPX e
LDS #e16LDS >e16LDS e8,XLDS e
STS >e16STS e8,XSTS eLDX #e16
LDX >e16LDX e8,XLDX eSTX >e16
STX e8,XSTX eBSR r8JSR e8,X
JSR e16

Where > forces the use of a 16 bit address.


4.23 mc6801 target

The mc6801 target selects the Motorola 6801. The instruction set accepted is the same as for the mc6800 target, plus these new instructions:

JSR >e16JSR eABXADDD #e16
ADDD >e16ADDD e8,XADDD eASLD
LSLDBHS r8BLO r8BRN r8
LDD #e16LDD >e16LDD e8,XLDD e
LSL e8,XLSL e16LSRDMUL
PSHXPULXSTD >e16STD e8,X
STD eSUBD #e16SUBD >e16SUBD e8,X
SUBD e

5 Source guide


5.1 Modules


6 Copyright

This manual is for uz80as (Micro Z80 assembler) version 1.08 (updated 22 September 2018).

Copyright © 2018 Jorge Giner Cordero

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.