<--  back   Last regenerated: 2016-10-25 19:49:19 kio

zasm - Z80 Assembler – Version 4.0

8080 Assembler

$> zasm --asm8080 mysource.asm

zasm can assemble source which is in the historic 8080 assembler format Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if it is started with Differences from v3 to v4: Command line options
Command Line Options
Command Line Options: Command line options
command line option '--asm8080'.

zasm supports most of a typical 8080 assembler source files, but only as an addition to it's standard Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 source handling. It expects one instruction per line, comments start with a semicolon ";" and label definitions should start in column 1 except Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if you also define '--reqcolon'.

All identifiers (mnenonics, register names and directives) and Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label names are not case sensitive!

The 8080 assembler is provided to assemble existing source. New programs should be written in the much better readable Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 syntax. zasm can assemble Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 source files restricted to the 8080 instruction Pseudo instructions: defl, set and '='
Labels: SET
set and registers Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if started with Differences from v3 to v4: Command line options
Command Line Options
Command Line Options: Command line options
command line option '--8080'.

8080 code example
inpl2:  LXI     H,IBUFF         ;Input buffer addr
        SHLD    IBUFP
        MVI     C,0             ;Init count to zero

inpli:  CALL    intt            ;Get char from console

        CPI     ' '             ;Control char?
        JC      inplc           ;Yes

        CPI     DEL             ;Delete char?
        JZ      inplb           ;Yes

        CPI     'Z'+1           ;Upper case?
        JC      inpl3           ;Yes
        ANI     5Fh             ;No - so make upper case

inpl3:  MOV     M,A             ;Into buffer
        MVI     A,IBL           ;Buffer size
        CMP     C               ;Full?
        JZ      inpli           ;Yes, loop
        MOV     A,M             ;Get char from buffer
        INX     H               ;Incr pointer
        INR     C               ; and count
inple:  CALL    OUTT            ;Show char
        JMP     inpli           ;Next char

8080 pseudo instructions

8080 Pseudo instructions
8080 Assembler: 8080 pseudo instructions
pseudo instructions occure at the position of a real 8080 opcode and must normally be preceded with some spaces, except Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if Differences from v3 to v4: Command line options
Command Line Options
Command Line Options: Command line options
command line option '--reqcolon' is used.

zasm knows the following 8080 assembler Pseudo instructions
8080 Assembler: 8080 pseudo instructions
pseudo instructions:

ORG <nnnn>

Pseudo instructions: defl, set and '='
Labels: SET
Set the logical origin (code address) for the following code.

    ORG 0C000h
END

Define the logical Pseudo instructions: end, .end
8080 pseudo instructions: END
end of your source. Pseudo instructions: end, .end
8080 pseudo instructions: END
END is optional.

IF .. ENDIF

Conditionally include a range of source source lines.
Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
IF and Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
ENDIF are just an alias to #IF and #ENDIF and therefore may be used interchangeable with #IF, #ELIF, #ELSE and #ENDIF. This may change.

    Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
IF option_foo=1 Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
IF option_bar ; <-- some code --> Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
ENDIF Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
endif
DB

Insert bytes. Pseudo instructions: defb, db, .db and .byte
8080 pseudo instructions: DB
DB is handled like 'defb' or 'defm' in Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler: You can put in strings here which may be enclosed in ' or ".

    Pseudo instructions: defb, db, .db and .byte
8080 pseudo instructions: DB
DB lf,cr,'Hello You: ',0
DW

Insert words. Like 'defw' in Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler.

    Pseudo instructions: defw, dw, .dw, .word
8080 pseudo instructions: DW
DW foo, bar*2, stuff+33, 0xFFFF
DS

Insert space. Like 'defs' in Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler.

    Pseudo instructions: defs, ds, .ds, .block, .blkb and data
8080 pseudo instructions: DS
DS 66h - $
MACRO

Define a Pseudo instructions: macro, .macro, endm and .endm
8080 pseudo instructions: MACRO
macro which can be invocated later like a 8080 instruction. The Pseudo instructions: macro, .macro, endm and .endm
8080 pseudo instructions: MACRO
macro definition is terminated by the Pseudo instructions: macro, .macro, endm and .endm
Pseudo instructions: rept, .rept, endm and .endm
ENDM instruction. Pseudo instructions: macro, .macro, endm and .endm
8080 pseudo instructions: MACRO
Macros may have arguments.

foo     MACRO   ARG1, ARG2
        mov a,&ARG1
        jmp &ARG2
        Pseudo instructions: macro, .macro, endm and .endm
Pseudo instructions: rept, .rept, endm and .endm
ENDM ... foo 42,$0008 ; use Pseudo instructions: macro, .macro, endm and .endm
8080 pseudo instructions: MACRO
macro
REPT

Define a range of source lines which shall be repeated multiple time.

        Pseudo instructions: rept, .rept, endm and .endm
8080 pseudo instructions: REPT
REPT $2000 - $ Pseudo instructions: defb, db, .db and .byte
8080 pseudo instructions: DB
DB 0 Pseudo instructions: macro, .macro, endm and .endm
Pseudo instructions: rept, .rept, endm and .endm
ENDM

Labels

EQU

Assign a value to a Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label. Behaves like 'Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ' for the Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler.

foobar  Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ 5 foo Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ 2 bar Pseudo instructions: equ
Types of labels: Named values
Labels: EQU
equ foobar - FOO

In contrast to the Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler, Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label names are not case sensitive!

Register names can be used as Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label names. (but, really really, shouldn't.)
The names for the 8080 assembler directives are not allowed for Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label names.

Types of labels: Program labels
Types of labels: Program labels
Program labels must start in column 1 and may be followed by a colon ':' (optional), except Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if option '--reqcolon' was used. Then they may start in any column and the colon is required. (sic!)

start:  CALL  fii
        CPI   'Z'
        JC    in3
        ...
in3:    ...
SET

Define a redefinable Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label. Most useful Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if used with Pseudo instructions: macro, .macro, endm and .endm
8080 pseudo instructions: MACRO
macros

foo     Pseudo instructions: defl, set and '='
Labels: SET
set 1 ... foo Pseudo instructions: defl, set and '='
Labels: SET
set foo+1

Expressions

Basically all possibilities of the Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler are allowed, because the Expressions
8080 Assembler: Expressions
expression parser of the Command Line Options: --z80
Pseudo instructions: .z80, .z180 and .8080
Targets: #target Z80
Z80 assembler is used.

Valid HTML   Valid CSS