Home of the original IBM PC emulator for browsers.
[PCjs Machine "ibm5170"]
Waiting for machine "ibm5170" to load....
PSEUDOSAM 80z and 85 are machine language cross-assembler programs for
the ZILOG z80, NATIONAL SEMICONDUCTOR NSC800, and the INTEL 8085
microprocessors. These programs let you construct 80z and 8085
code on your IBM PC, to be transferred to an 80z or 8085-based system
for use.
The PSEUDOSAM (Pseudo-brand Symbolic AsseMbler) assemblers conform to
common syntax, based on the UNIX System V assembler syntax. The opcode
and addressing syntax is compatible with the manufacturer's, but label,
directive, and expression operator syntax will differ.
The author of PSEUDOSAM chose this syntax because of UNIX's popularity,
and to avoid the problem of maintaining compatibility with the many OEM
assemblers. The documentation is well organized and easy to
understand, although no attempt is made to teach 80z or 8085
programming. You should have a good understanding of machine
language programming and also be familiar with basic DOS functions.
; To become familiar with the segment feature you
; should assemble this file with and without the
; single object module swicth enabled.
;
; a80z -o example ;three object module files
; code.seg
; memory.seg
; rom2.seg
;
; a80z example ;one object module file example.obj
jp loop
.org h'20 ;start assembly at location 20 hex.
.segment .memory ;declare a new segmemt for ram memory
;allocation
.memory ;select segment .memory as active(locaton counter)
;for the .code segment(created by the assembler) is
;saved for when we switch back.
.org h'8000 ;assume ram space starts at address h'8000
v1: .rs 2 ;reserve storage for a program variable
array: .rs 100*2 ;reserve storage for an array of 100 words
.eject ;lets start on a fresh page of paper.
.code ;switch back to code segment
; origin is where we left off.
loop: ld a,h'22
ld sp,h'2000
ex (sp),hl
.equ cr,13 ;equated identifiers are constant.
.equ tab,9
.set temp,23 ;set identifiers may be re-set.
.set temp,24
.set temp,25
.db 1,2,3,4,5,'p'
.db 6,7,"this is a test\r\n\0"
.dw 1,h'1234
.drw 1,h'1234
ld b,loop2 >> 8 ;isolate high byte of address
ld b,loop2 & h'ff ;isolate low half of address
.page ;start on a new 256 byte boundary.
loop2: jp loop
.segment .rom2
.rom2
.org h'4000
.db "this is possibly a second rom programmed seperately."
.code
.end loop ;end of assembly, specifying start address.
; Some useful macros to help get you started.
;
; Please note that all of the examples use 6800 instructions and thus
; will generate error messages when assembled on other assemblers. Just
; ignore those messages (or substitute the equivalent opcode for your
; processor)--the macro ideas depicted are still valid.
;
; Unique generated labels.
;
; Some macros will require "local" labels unique to a given expansion.
; The following macros are one way of creating them.
;
; nlabel creates a new unique identifier (of the form l1nnnn, where n varies)
; each invocation.
;
; nlabel returns the current value of glabel, and then redefines glabel to
; the value one greater than glabel.
;
define( glabel,10000)
define( nlabel,``l'glabel`'define(`glabel',iner(glabel))')
;
; Now we have a unique label generator, but each time we call it the label
; will be different, and thus of little use for branches and jumps.
;
; We must assign this unique label string to an identifier for multiple
; uses.
;
define(local1,nlabel)
local1: nop
jmp local1
jsr local1
undefine(`local1')
local1: nop
;
; Above we define local1 to be the string generated by nlabel, use that
; string in several places, and then undefine it. Note that local1 after
; the undefine is "local1" and not a generated string. If defined locals
; are not undefined when we are done with them, we would quickly run out
; of memory space (in the macro table).
;
define(loop, ` define(local1,nlabel)
local1: nop
jmp local1
undefine(`local1')')
loop
loop
loop
; Above the macro loop is genrated three times, each time with unique local
; labels as looping targets.
.org 0 ;z80 mnemonics test
adc a,h'00
adc a,h'ff
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,(hl)
adc a,(ix+-128)
adc a,(ix-128)
adc a,(iy-128)
adc a,(iy+127)
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
add a,h'00
add a,h'ff
add a,a
add a,l
add a,(hl)
add a,(ix+-128)
add a,(iy+127)
add hl,bc
add hl,de
add hl,hl
add hl,sp
add ix,bc
add ix,de
add ix,sp
add iy,bc
add iy,de
add iy,sp
add ix,ix
add iy,iy
and h'00
and h'ff
and a
and l
and (hl)
and (ix+-128)
and (iy+127)
bit 0,a
bit 0,l
bit 0,(hl)
bit 0,(ix+-128)
bit 0,(iy+127)
bit 7,a
bit 7,l
bit 7,(hl)
bit 7,(ix+-128)
bit 7,(iy+127)
call h'00
call h'ff
call longtest
call nz,h'00
call z,h'ff
call nc,longtest
call c,longtest
call po,h'00
call pe,1000
call p,128
call m,0
ccf
cp h'00
cp h'ff
cp a
cp l
cp (hl)
cp (ix+-128)
cp (iy+127)
cpd
cpdr
cpi
cpir
cpl
daa
dec a
dec l
dec (hl)
dec (ix+-128)
dec (iy+127)
dec bc
dec de
dec hl
dec sp
dec ix
dec iy
di
djnz rtest
ei
ex af,af'
ex de,hl
ex (sp),hl
ex (sp),ix
ex (sp),iy
exx
halt
im 0
im 1
im 2
in a,(h'00)
in a,(h'ff)
inc a
inc l
inc (hl)
inc (ix+-128)
inc (iy+127)
inc bc
inc de
inc hl
inc sp
inc ix
inc iy
ind
indr
ini
inir
in a,(c)
in c,(c)
in l,(c)
jp h'00
jp h'ff
jp longtest
jp nz,h'00
jp z,h'ff
jp nc,longtest
jp c,longtest
jp po,h'00
jp pe,1000
jp p,128
jp m,0
jp (hl)
jp (ix)
jp (iy)
jr c,rtest
rtest: jr rtest
djnz rtest
jr nc,rtest
jr nz,rtest
jr z,rtest
ld a,i
ld a,r
ld a,(longtest)
ld a,(h'00)
ld a,(h'ff)
ld a,(hl)
ld a,(bc)
ld a,(de)
ld a,l
ld l,a
ld l,h
ld hl,(h'00)
ld hl,(longtest)
ld bc,(h'00)
ld de,(longtest)
ld sp,(h'ff)
ld ix,(h'00)
ld iy,(h'ff)
ld ix,(longtest)
ld i,a
ld r,a
ld a,h'00
ld l,h'ff
ld bc,h'00
ld de,h'ff
ld sp,h'ff
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(hl)
ld l,(hl)
ld a,(ix+127)
ld a,(iy+127)
ld a,(iy-128)
ld l,(iy+-128)
ld l,(iy-128)
ld sp,hl
ld sp,ix
ld sp,iy
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),de
ld (longtest),de
ld (1000),sp
ld (longtest),sp
ld (1000),ix
ld (longtest),iy
ld (hl),h'00
ld (hl),h'ff
ld (ix+127),h'00
ld (ix+-128),h'ff
ld (iy-128),h'ff
ld (iy-128),-128
ld (iy-128),127
ld (iy+127),0
ld (hl),a
ld (hl),l
ld (ix+127),a
ld (iy+-128),l
ld (iy-128),l
ld (bc),a
ld (de),a
ld (hl),a
ldd
lddr
ldi
ldir
neg
nop
or h'00
or h'ff
or a
or l
or (hl)
or (ix+-128)
or (iy+127)
out (c),a
out (c),l
outd
otdr
outi
otir
out (h'00),a
out (h'ff),a
pop bc
pop de
pop hl
pop af
pop ix
pop iy
push bc
push de
push hl
push af
push ix
push iy
res 0,a
res 0,l
res 0,(hl)
res 0,(ix+-128)
res 0,(iy+127)
res 7,a
res 7,l
res 7,(hl)
res 7,(ix+-128)
res 7,(iy+127)
ret
ret nz
ret z
ret nc
ret c
ret po
ret pe
ret p
ret m
reti
retn
rl a
rl l
rl (hl)
rl (ix+-128)
rl (iy+127)
rla
rlc a
rlc l
rlc (hl)
rlc (ix+-128)
rlc (iy+127)
rlca
rld
rr a
rr l
rr (hl)
rr (ix+-128)
rr (iy+127)
rra
rrc a
rrc l
rrc (hl)
rrc (ix+-128)
rrc (iy+127)
rrca
rrd
rst h'00
rst h'20
rst h'38
sbc a,h'00
sbc a,h'ff
sbc a,a
sbc a,l
sbc a,(hl)
sbc a,(ix+-128)
sbc a,(iy+127)
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
scf
set 0,a
set 0,l
set 0,(hl)
set 0,(ix+-128)
set 0,(iy+127)
set 7,a
set 7,l
set 7,(hl)
set 7,(ix+-128)
set 7,(iy+127)
sla a
sla l
sla (hl)
sla (ix+-128)
sla (iy+127)
sra a
sra l
sra (hl)
sra (ix+-128)
sra (iy+127)
srl a
srl l
srl (hl)
srl (ix+-128)
srl (iy+127)
sub h'00
sub h'ff
sub a
sub l
sub (hl)
sub (ix+-128)
sub (iy+127)
xor h'00
xor h'ff
xor a
xor l
xor (hl)
xor (ix+-128)
xor (iy+127)
synctst1:
adc a,forward2
adc a,forward1
adc a,(ix+forward3)
adc a,(iy+forward4)
add a,forward2
add a,forward1
add a,(ix+forward3)
add a,(iy+forward4)
and forward2
and forward1
and (ix+forward3)
and (iy+forward4)
bit bit0,a
bit bit0,l
bit bit0,(hl)
bit bit0,(ix+forward3)
bit bit0,(iy+forward4)
bit bit7,a
bit bit7,l
bit bit7,(hl)
bit bit7,(ix+forward3)
bit bit7,(iy+forward4)
call forward2
call forward1
call longtest
call nz,forward2
call z,forward1
call nc,longtest
call c,longtest
call po,forward2
call pe,1000
call p,128
call m,0
cp forward2
cp forward1
cp (ix+forward3)
cp (iy+forward4)
dec (ix+forward3)
dec (iy+forward4)
in a,(forward2)
in a,(forward1)
inc (ix+forward3)
inc (iy+forward4)
jp forward2
jp forward1
jp longtest
jp nz,forward2
jp z,forward1
jp nc,longtest
jp c,longtest
jp po,forward2
jp pe,1000
jp p,128
jp m,0
ld a,(longtest)
ld a,(forward2)
ld a,(forward1)
ld ix,(forward2)
ld iy,(forward1)
ld ix,(longtest)
ld a,forward2
ld bc,forward2
ld sp,forward1
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(ix+forward4)
ld l,(iy+forward3)
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),ix
ld (longtest),iy
ld (hl),forward2
ld (hl),forward1
ld (ix+forward4),forward2
ld (ix+forward3),forward1
ld (ix+forward4),a
ld (iy+forward3),l
or forward2
or forward1
or (ix+forward3)
or (iy+forward4)
out (forward2),a
out (forward1),a
res bit0,a
res bit0,l
res bit0,(hl)
res bit0,(ix+forward3)
res bit0,(iy+forward4)
res bit7,a
res bit7,l
res bit7,(hl)
res bit7,(ix+forward3)
res bit7,(iy+forward4)
rl (ix+forward3)
rl (iy+forward4)
rlc (ix+forward3)
rlc (iy+forward4)
rr (ix+forward3)
rr (iy+forward4)
rrc (ix+forward3)
rrc (iy+forward4)
sbc a,forward2
sbc a,forward1
sbc a,(ix+forward3)
sbc a,(iy+forward4)
set bit0,a
set bit0,l
set bit0,(hl)
set bit0,(ix+forward3)
set bit0,(iy+forward4)
set bit7,a
set bit7,l
set bit7,(hl)
set bit7,(ix+forward3)
set bit7,(iy+forward4)
sla (ix+forward3)
sla (iy+forward4)
sra (ix+forward3)
sra (iy+forward4)
srl (ix+forward3)
srl (iy+forward4)
sub forward2
sub forward1
sub (ix+forward3)
sub (iy+forward4)
xor forward2
xor forward1
xor (ix+forward3)
xor (iy+forward4)
synctst2:
longtest:.equ forward1,h'ff
.equ forward2,h'00
.equ forward3,-128
.equ forward4,127
.equ bit0,0
.equ bit7,7
.end
.command +m2 ;64180 level selection
.org 0 ;z80 mnemonics test
tst (hl)
tst 0
tst 255
tst a
tst b
tstio 0
tstio 255
slp
mlt bc
mlt de
mlt hl
mlt sp
in0 a,(0)
in0 b,(255)
out0 (0),a
out0 (255),b
otim
otimr
otdm
otdmr
adc a,h'00
adc a,h'ff
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,(hl)
adc a,(ix+-128)
adc a,(ix-128)
adc a,(iy-128)
adc a,(iy+127)
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
add a,h'00
add a,h'ff
add a,a
add a,l
add a,(hl)
add a,(ix+-128)
add a,(iy+127)
add hl,bc
add hl,de
add hl,hl
add hl,sp
add ix,bc
add ix,de
add ix,sp
add iy,bc
add iy,de
add iy,sp
add ix,ix
add iy,iy
and h'00
and h'ff
and a
and l
and (hl)
and (ix+-128)
and (iy+127)
bit 0,a
bit 0,l
bit 0,(hl)
bit 0,(ix+-128)
bit 0,(iy+127)
bit 7,a
bit 7,l
bit 7,(hl)
bit 7,(ix+-128)
bit 7,(iy+127)
call h'00
call h'ff
call longtest
call nz,h'00
call z,h'ff
call nc,longtest
call c,longtest
call po,h'00
call pe,1000
call p,128
call m,0
ccf
cp h'00
cp h'ff
cp a
cp l
cp (hl)
cp (ix+-128)
cp (iy+127)
cpd
cpdr
cpi
cpir
cpl
daa
dec a
dec l
dec (hl)
dec (ix+-128)
dec (iy+127)
dec bc
dec de
dec hl
dec sp
dec ix
dec iy
di
djnz rtest
ei
ex af,af'
ex de,hl
ex (sp),hl
ex (sp),ix
ex (sp),iy
exx
halt
im 0
im 1
im 2
in a,(h'00)
in a,(h'ff)
inc a
inc l
inc (hl)
inc (ix+-128)
inc (iy+127)
inc bc
inc de
inc hl
inc sp
inc ix
inc iy
ind
indr
ini
inir
in a,(c)
in c,(c)
in l,(c)
jp h'00
jp h'ff
jp longtest
jp nz,h'00
jp z,h'ff
jp nc,longtest
jp c,longtest
jp po,h'00
jp pe,1000
jp p,128
jp m,0
jp (hl)
jp (ix)
jp (iy)
jr c,rtest
rtest: jr rtest
djnz rtest
jr nc,rtest
jr nz,rtest
jr z,rtest
ld a,i
ld a,r
ld a,(longtest)
ld a,(h'00)
ld a,(h'ff)
ld a,(hl)
ld a,(bc)
ld a,(de)
ld a,l
ld l,a
ld l,h
ld hl,(h'00)
ld hl,(longtest)
ld bc,(h'00)
ld de,(longtest)
ld sp,(h'ff)
ld ix,(h'00)
ld iy,(h'ff)
ld ix,(longtest)
ld i,a
ld r,a
ld a,h'00
ld l,h'ff
ld bc,h'00
ld de,h'ff
ld sp,h'ff
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(hl)
ld l,(hl)
ld a,(ix+127)
ld a,(iy+127)
ld a,(iy-128)
ld l,(iy+-128)
ld l,(iy-128)
ld sp,hl
ld sp,ix
ld sp,iy
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),de
ld (longtest),de
ld (1000),sp
ld (longtest),sp
ld (1000),ix
ld (longtest),iy
ld (hl),h'00
ld (hl),h'ff
ld (ix+127),h'00
ld (ix+-128),h'ff
ld (iy-128),h'ff
ld (iy-128),-128
ld (iy-128),127
ld (iy+127),0
ld (hl),a
ld (hl),l
ld (ix+127),a
ld (iy+-128),l
ld (iy-128),l
ld (bc),a
ld (de),a
ld (hl),a
ldd
lddr
ldi
ldir
neg
nop
or h'00
or h'ff
or a
or l
or (hl)
or (ix+-128)
or (iy+127)
out (c),a
out (c),l
outd
otdr
outi
otir
out (h'00),a
out (h'ff),a
pop bc
pop de
pop hl
pop af
pop ix
pop iy
push bc
push de
push hl
push af
push ix
push iy
res 0,a
res 0,l
res 0,(hl)
res 0,(ix+-128)
res 0,(iy+127)
res 7,a
res 7,l
res 7,(hl)
res 7,(ix+-128)
res 7,(iy+127)
ret
ret nz
ret z
ret nc
ret c
ret po
ret pe
ret p
ret m
reti
retn
rl a
rl l
rl (hl)
rl (ix+-128)
rl (iy+127)
rla
rlc a
rlc l
rlc (hl)
rlc (ix+-128)
rlc (iy+127)
rlca
rld
rr a
rr l
rr (hl)
rr (ix+-128)
rr (iy+127)
rra
rrc a
rrc l
rrc (hl)
rrc (ix+-128)
rrc (iy+127)
rrca
rrd
rst h'00
rst h'20
rst h'38
sbc a,h'00
sbc a,h'ff
sbc a,a
sbc a,l
sbc a,(hl)
sbc a,(ix+-128)
sbc a,(iy+127)
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
scf
set 0,a
set 0,l
set 0,(hl)
set 0,(ix+-128)
set 0,(iy+127)
set 7,a
set 7,l
set 7,(hl)
set 7,(ix+-128)
set 7,(iy+127)
sla a
sla l
sla (hl)
sla (ix+-128)
sla (iy+127)
sra a
sra l
sra (hl)
sra (ix+-128)
sra (iy+127)
srl a
srl l
srl (hl)
srl (ix+-128)
srl (iy+127)
sub h'00
sub h'ff
sub a
sub l
sub (hl)
sub (ix+-128)
sub (iy+127)
xor h'00
xor h'ff
xor a
xor l
xor (hl)
xor (ix+-128)
xor (iy+127)
synctst1:
adc a,forward2
adc a,forward1
adc a,(ix+forward3)
adc a,(iy+forward4)
add a,forward2
add a,forward1
add a,(ix+forward3)
add a,(iy+forward4)
and forward2
and forward1
and (ix+forward3)
and (iy+forward4)
bit bit0,a
bit bit0,l
bit bit0,(hl)
bit bit0,(ix+forward3)
bit bit0,(iy+forward4)
bit bit7,a
bit bit7,l
bit bit7,(hl)
bit bit7,(ix+forward3)
bit bit7,(iy+forward4)
call forward2
call forward1
call longtest
call nz,forward2
call z,forward1
call nc,longtest
call c,longtest
call po,forward2
call pe,1000
call p,128
call m,0
cp forward2
cp forward1
cp (ix+forward3)
cp (iy+forward4)
dec (ix+forward3)
dec (iy+forward4)
in a,(forward2)
in a,(forward1)
inc (ix+forward3)
inc (iy+forward4)
jp forward2
jp forward1
jp longtest
jp nz,forward2
jp z,forward1
jp nc,longtest
jp c,longtest
jp po,forward2
jp pe,1000
jp p,128
jp m,0
ld a,(longtest)
ld a,(forward2)
ld a,(forward1)
ld ix,(forward2)
ld iy,(forward1)
ld ix,(longtest)
ld a,forward2
ld bc,forward2
ld sp,forward1
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(ix+forward4)
ld l,(iy+forward3)
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),ix
ld (longtest),iy
ld (hl),forward2
ld (hl),forward1
ld (ix+forward4),forward2
ld (ix+forward3),forward1
ld (ix+forward4),a
ld (iy+forward3),l
or forward2
or forward1
or (ix+forward3)
or (iy+forward4)
out (forward2),a
out (forward1),a
res bit0,a
res bit0,l
res bit0,(hl)
res bit0,(ix+forward3)
res bit0,(iy+forward4)
res bit7,a
res bit7,l
res bit7,(hl)
res bit7,(ix+forward3)
res bit7,(iy+forward4)
rl (ix+forward3)
rl (iy+forward4)
rlc (ix+forward3)
rlc (iy+forward4)
rr (ix+forward3)
rr (iy+forward4)
rrc (ix+forward3)
rrc (iy+forward4)
sbc a,forward2
sbc a,forward1
sbc a,(ix+forward3)
sbc a,(iy+forward4)
set bit0,a
set bit0,l
set bit0,(hl)
set bit0,(ix+forward3)
set bit0,(iy+forward4)
set bit7,a
set bit7,l
set bit7,(hl)
set bit7,(ix+forward3)
set bit7,(iy+forward4)
sla (ix+forward3)
sla (iy+forward4)
sra (ix+forward3)
sra (iy+forward4)
srl (ix+forward3)
srl (iy+forward4)
sub forward2
sub forward1
sub (ix+forward3)
sub (iy+forward4)
xor forward2
xor forward1
xor (ix+forward3)
xor (iy+forward4)
synctst2:
longtest:.equ forward1,h'ff
.equ forward2,h'00
.equ forward3,-128
.equ forward4,127
.equ bit0,0
.equ bit7,7
.end
.opdef defb,.db ;define byte
.opdef defm,.db ;define string
.opdef defs,.rs ;reserve storage
.opdef defw,.drw ;define 16 bit data word(reversed for z80)
.opdef org,.org ;origin
.opdef title,.null ;ignore - not implemented
ld (iy+h'ffc1),h'0
ld (ix+h'c1),h'0
ifelse( a,b,c,a,a,d,e)
ifelse( a,a,b,c)
define( foo, $1 )
foo( z)
errprint(substr(foo,0,1))
define( `denotefirstchar',
`ifelse( errprint(substr($1 ,0,1)),a,the first letter is a,
errprint($1 ),b,the first letter is b,
$1 ,c,the first letter is c,
the first letter is not in ``a..c'')')
denotefirstchar( a)
denotefirstchar( bc)
denotefirstchar( de)
define( `denotefirstchar',
`ifelse( substr( $1,0,1),a,the first letter is a,
substr( $1,0,1),b,the first letter is b)');,
; substr( $1,0,1),c,the first letter is c,
; the first letter is not in ``a..c'')')
denotefirstchar( above)
denotefirstchar( cow)
denotefirstchar( donut)
ld a,(ix+h'c1)
add a,(ix+h'c1)
ld (ix+h'c1),a
ld(ix+h'c1),h'0
inc (ix+h'c1)
dec (ix+h'c1)
cp (ix+h'c1)
sub (ix+h'c1)
ld a,(iy+h'c1)
add a,(iy+h'c1)
ld (iy+h'c1),a
ld(iy+h'c1),h'0
inc (iy+h'c1)
dec (iy+h'c1)
cp (iy+h'c1)
sub (iy+h'c1)
end.
; To become familiar with the segment feature you
; should assemble this file with and without the
; single object module swicth enabled.
;
; a85 -o example ;three object module files
; code.seg
; memory.seg
; rom2.seg
;
; a85 example ;one object module file example.obj
jmp loop
.org h'20 ;start assembly at location 20 hex.
.segment .memory ;declare a new segmemt for ram memory
;allocation
.memory ;select segment .memory as active(locaton counter)
;for the .code segment(created by the assembler) is
;saved for when we switch back.
.org h'8000 ;assume ram space starts at address h'8000
v1: .rs 2 ;reserve storage for a program variable
array: .rs 100*2 ;reserve storage for an array of 100 words
.eject ;lets start on a fresh page of paper.
.code ;switch back to code segment
; origin is where we left off.
loop: mvi a,h'22
lxi sp,h'2000
sphl
.equ cr,13 ;equated identifiers are constant.
.equ tab,9
.set temp,23 ;set identifiers may be re-set.
.set temp,24
.set temp,25
.db 1,2,3,4,5,'p'
.db 6,7,"this is a test\r\n\0"
.dw 1,h'1234
.drw 1,h'1234
mvi b,loop2 >> 8 ;isolate high byte of address
mvi b,loop2 & h'ff ;isolate low half of address
.page ;start on a new 256 byte boundary.
loop2: jmp loop
.segment .rom2
.rom2
.org h'4000
.db "this is possibly a second rom programmed seperately."
.code
.end loop ;end of assembly, specifying start address.
; Some useful macros to help get you started.
;
; Please note that all of the examples use 6800 instructions and thus
; will generate error messages when assembled on other assemblers. Just
; ignore those messages (or substitute the equivalent opcode for your
; processor)--the macro ideas depicted are still valid.
;
; Unique generated labels.
;
; Some macros will require "local" labels unique to a given expansion.
; The following macros are one way of creating them.
;
; nlabel creates a new unique identifier (of the form l1nnnn, where n varies)
; each invocation.
;
; nlabel returns the current value of glabel, and then redefines glabel to
; the value one greater than glabel.
;
define( glabel,10000)
define( nlabel,``l'glabel`'define(`glabel',iner(glabel))')
;
; Now we have a unique label generator, but each time we call it the label
; will be different, and thus of little use for branches and jumps.
;
; We must assign this unique label string to an identifier for multiple
; uses.
;
define(local1,nlabel)
local1: nop
jmp local1
jsr local1
undefine(`local1')
local1: nop
;
; Above we define local1 to be the string generated by nlabel, use that
; string in several places, and then undefine it. Note that local1 after
; the undefine is "local1" and not a generated string. If defined locals
; are not undefined when we are done with them, we would quickly run out
; of memory space (in the macro table).
;
define(loop, ` define(local1,nlabel)
local1: nop
jmp local1
undefine(`local1')')
loop
loop
loop
; Above the macro loop is genrated three times, each time with unique local
; labels as looping targets.
.org 0
aci h'00
aci h'ff
adc a
adc b
adc c
adc d
adc e
adc h
adc l
adc m
add a
add b
add c
add d
add e
add h
add l
add m
adi h'00
adi h'ff
ana a
ana b
ana c
ana d
ana e
ana h
ana l
ana m
ani h'00
ani h'ff
call h'1000
call ltest
cc ltest
cm ltest
cma
cmc
cmp a
cmp b
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cnc ltest
cnz ltest
cp ltest
cpe ltest
cpi h'00
cpi h'ff
cpo ltest
cz ltest
daa
dad b
dad bc
dad d
dad de
dad h
dad hl
dad sp
dcr a
dcr b
dcr c
dcr d
dcr e
dcr h
dcr l
dcr m
dcx b
dcx bc
dcx d
dcx de
dcx h
dcx hl
dcx sp
di
ei
hlt
in h'00
in h'ff
inr a
inr b
inr c
inr d
inr e
inr h
inr l
inr m
inx b
inx bc
inx d
inx de
inx h
inx hl
inx sp
jc ltest
jm ltest
jmp ltest
jnc ltest
jnz ltest
jp ltest
jpe ltest
jpo ltest
jz ltest
lda h'1000
ldax b
ldax d
ldax bc
ldax de
lhld h'1000
lxi b,h'1000
lxi d,h'1001
lxi h,h'2002
lxi sp,h'f000
mov a,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov a,m
mov b,a
mov b,b
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov b,m
mov c,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov c,m
mov d,a
mov d,b
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov d,m
mov e,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov e,m
mov h,a
mov h,b
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov h,m
mov l,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov l,m
mov m,a
mov m,b
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
mvi a,h'00
mvi b,h'00
mvi c,h'00
mvi d,h'00
mvi e,h'00
mvi h,h'00
mvi l,h'00
mvi m,h'00
mvi a,h'ff
mvi b,h'ff
mvi c,h'ff
mvi d,h'ff
mvi e,h'ff
mvi h,h'ff
mvi l,h'ff
mvi m,h'ff
nop
ora a
ora b
ora c
ora d
ora e
ora h
ora l
ora m
ori h'00
ori h'ff
out h'00
out h'ff
pchl
pop b
pop bc
pop d
pop de
pop h
pop hl
pop psw
push b
push bc
push d
push de
push h
push hl
push psw
ral
rar
rc
ret
rim ;8085 only
rlc
rm
rnc
rnz
rp
rpe
rpo
rrc
rst 0
rst 1
rst 2
rst 3
rst 4
rst 5
rst 6
rst 7
rz
sbb a
sbb b
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbi h'00
sbi h'ff
shld h'1000
sim ;8085 only
sphl
sta h'1000
stax b
stax bc
stax d
stax de
stc
sub a
sub b
sub c
sub d
sub e
sub h
sub l
sub m
sui h'00
sui h'ff
xchg
xra a
xra b
xra c
xra d
xra e
xra h
xra l
xra m
xri h'00
xri h'ff
xthl
aci forward2
aci forward1
adc a
adc b
adc c
adc d
adc e
adc h
adc l
adc m
add a
add b
add c
add d
add e
add h
add l
add m
adi forward2
adi forward1
ana a
ana b
ana c
ana d
ana e
ana h
ana l
ana m
ani forward2
ani forward1
call h'1000
call ltest
cc ltest
cm ltest
cma
cmc
cmp a
cmp b
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cnc ltest
cnz ltest
cp ltest
cpe ltest
cpi forward2
cpi forward1
cpo ltest
cz ltest
daa
dad b
dad bc
dad d
dad de
dad h
dad hl
dad sp
dcr a
dcr b
dcr c
dcr d
dcr e
dcr h
dcr l
dcr m
dcx b
dcx bc
dcx d
dcx de
dcx h
dcx hl
dcx sp
di
ei
hlt
in forward2
in forward1
inr a
inr b
inr c
inr d
inr e
inr h
inr l
inr m
inx b
inx bc
inx d
inx de
inx h
inx hl
inx sp
jc ltest
jm ltest
jmp ltest
jnc ltest
jnz ltest
jp ltest
jpe ltest
jpo ltest
jz ltest
lda h'1000
ldax b
ldax d
ldax bc
ldax de
lhld h'1000
lxi b,h'1000
lxi d,h'1001
lxi h,h'2002
lxi sp,h'f000
mov a,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov a,m
mov b,a
mov b,b
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov b,m
mov c,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov c,m
mov d,a
mov d,b
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov d,m
mov e,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov e,m
mov h,a
mov h,b
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov h,m
mov l,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov l,m
mov m,a
mov m,b
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
mvi a,forward2
mvi b,forward2
mvi c,forward2
mvi d,forward2
mvi e,forward2
mvi h,forward2
mvi l,forward2
mvi m,forward2
mvi a,forward1
mvi b,forward1
mvi c,forward1
mvi d,forward1
mvi e,forward1
mvi h,forward1
mvi l,forward1
mvi m,forward1
nop
ora a
ora b
ora c
ora d
ora e
ora h
ora l
ora m
ori forward2
ori forward1
out forward2
out forward1
pchl
pop b
pop bc
pop d
pop de
pop h
pop hl
pop psw
push b
push bc
push d
push de
push h
push hl
push psw
ral
rar
rc
ret
rim ;8085 only
rlc
rm
rnc
rnz
rp
rpe
rpo
rrc
rst 0
rst 1
rst 2
rst 3
rst 4
rst 5
rst 6
rst 7
rz
sbb a
sbb b
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbi forward2
sbi forward1
shld h'1000
sim ;8085 only
sphl
sta h'1000
stax b
stax bc
stax d
stax de
stc
sub a
sub b
sub c
sub d
sub e
sub h
sub l
sub m
sui forward2
sui forward1
xchg
xra a
xra b
xra c
xra d
xra e
xra h
xra l
xra m
xri forward2
xri forward1
xthl
synctst:
ltest: .equ forward1,h'ff
.equ forward2,h'00
.end
.opdef db,.db ;define byte
.opdef ds,.rs ;reserve storage
.opdef dw,.dw ;define 16 bit data word
.opdef org,.org ;origin
.opdef title,.null ;ignore - not implemented
; To become familiar with the segment feature you
; should assemble this file with and without the
; single object module swicth enabled.
;
; a85 -o example ;three object module files
; code.seg
; memory.seg
; rom2.seg
;
; a85 example ;one object module file example.obj
jmp loop
.org h'20 ;start assembly at location 20 hex.
.segment .memory ;declare a new segmemt for ram memory
;allocation
.memory ;select segment .memory as active(locaton counter)
;for the .code segment(created by the assembler) is
;saved for when we switch back.
.org h'8000 ;assume ram space starts at address h'8000
v1: .rs 2 ;reserve storage for a program variable
array: .rs 100*2 ;reserve storage for an array of 100 words
.eject ;lets start on a fresh page of paper.
.code ;switch back to code segment
; origin is where we left off.
loop: mvi a,h'22
lxi sp,h'2000
sphl
.equ cr,13 ;equated identifiers are constant.
.equ tab,9
.set temp,23 ;set identifiers may be re-set.
.set temp,24
.set temp,25
.db 1,2,3,4,5,'p'
.db 6,7,"this is a test\r\n\0"
.dw 1,h'1234
.drw 1,h'1234
mvi b,loop2 >> 8 ;isolate high byte of address
mvi b,loop2 & h'ff ;isolate low half of address
.page ;start on a new 256 byte boundary.
loop2: jmp loop
.segment .rom2
.rom2
.org h'4000
.db "this is possibly a second rom programmed seperately."
.code
.end loop ;end of assembly, specifying start address.
; To become familiar with the segment feature you
; should assemble this file with and without the
; single object module swicth enabled.
;
; a80z -o example ;three object module files
; code.seg
; memory.seg
; rom2.seg
;
; a80z example ;one object module file example.obj
jp loop
.org h'20 ;start assembly at location 20 hex.
.segment .memory ;declare a new segmemt for ram memory
;allocation
.memory ;select segment .memory as active(locaton counter)
;for the .code segment(created by the assembler) is
;saved for when we switch back.
.org h'8000 ;assume ram space starts at address h'8000
v1: .rs 2 ;reserve storage for a program variable
array: .rs 100*2 ;reserve storage for an array of 100 words
.eject ;lets start on a fresh page of paper.
.code ;switch back to code segment
; origin is where we left off.
loop: ld a,h'22
ld sp,h'2000
ex (sp),hl
.equ cr,13 ;equated identifiers are constant.
.equ tab,9
.set temp,23 ;set identifiers may be re-set.
.set temp,24
.set temp,25
.db 1,2,3,4,5,'p'
.db 6,7,"this is a test\r\n\0"
.dw 1,h'1234
.drw 1,h'1234
ld b,loop2 >> 8 ;isolate high byte of address
ld b,loop2 & h'ff ;isolate low half of address
.page ;start on a new 256 byte boundary.
loop2: jp loop
.segment .rom2
.rom2
.org h'4000
.db "this is possibly a second rom programmed seperately."
.code
.end loop ;end of assembly, specifying start address.
Disk No: 778
Disk Title: PseudoSam Cross Assembler 80z and 85
PC-SIG Version: 1.2
Program Title: PseudoSam 80z and 85
Author Version: 1.4.x
Author Registration: $30.00 personal; $100.00 commercial.
Special Requirements: None.
PSEUDOSAM 80z and 85 are machine language cross-assembler programs for
the ZILOG z80, NATIONAL SEMICONDUCTOR NSC800, and the INTEL 8085
microprocessors. These programs let you construct 80z and 8085
code on your IBM PC, to be transferred to an 80z or 8085-based system
for use.
The PSEUDOSAM (Pseudo-brand Symbolic AsseMbler) assemblers conform to
common syntax, based on the UNIX System V assembler syntax. The opcode
and addressing syntax is compatible with the manufacturer's, but label,
directive, and expression operator syntax will differ.
The author of PSEUDOSAM chose this syntax because of UNIX's popularity,
and to avoid the problem of maintaining compatibility with the many
OEM assemblers. The documentation is well organized and easy to
understand, although no attempt is made to teach 80z or 8085
programming. You should have a good understanding of machine
language programming and also be familiar with basic DOS functions.
File Descriptions:
A80Z <DIR>Subdirectory containing the following files:
A80Z EXE PSEUDOSAM 80z assembler.
EXAMPLE ASM Example file for PSEUDOSAM 80z.
LABGEN ASM Assembly source code.
MNEMLEV1 ASM Mnemonics test program.
MNEMLEV2 ASM Mnemonics test program.
READ ME Program information.
READ ME2 More program information.
SYN ASM Synonym file to rename assembler directives.
T ASM Mnemonics test program.
TEST ASM Mnemonics test program.
A85 <DIR>Subdirectory containing the following files:
A85 EXE PSEUDOSAM 85 assembler.
EXAMPLE ASM Example file for PSEUDOSAM 85.
LKABGEN ASM Assembly source code.
MNEMTEST ASM Mnemonics test program.
READ ME Program information.
READ ME2 More program information.
SYN ASM Synonym file to rename assembler directives.
PC-SIG
1030D East Duane Avenue
Sunnyvale Ca. 94086
(408) 730-9291
(c) Copyright 1988,89 PC-SIG, Inc.
╔═════════════════════════════════════════════════════════════════════════╗
║ <<<< Disk #778 PSEUDOSAM 80Z AND 85 CROSS ASSEMBLER >>>> ║
╠═════════════════════════════════════════════════════════════════════════╣
║ ║
║ To print the documentation for the 80Z Cross Assembler you must first ║
║ change to the A80Z subdirectory by typing: CD\A80Z ║
║ ║
║ You will then print the documentation by typing: ║
║ COPY READ.ME PRN ║
║ ║
║ To print the documentation for the 85 Cross Assembler you must first ║
║ change to the A85 subdirectory by typing: CD\A85 ║
║ ║
║ You will then print the documentation by typing: ║
║ COPY READ.ME PRN ║
╚═════════════════════════════════════════════════════════════════════════╝
; Some useful macros to help get you started.
;
; Please note that all of the examples use 6800 instructions and thus
; will generate error messages when assembled on other assemblers. Just
; ignore those messages (or substitute the equivalent opcode for your
; processor)--the macro ideas depicted are still valid.
;
; Unique generated labels.
;
; Some macros will require "local" labels unique to a given expansion.
; The following macros are one way of creating them.
;
; nlabel creates a new unique identifier (of the form l1nnnn, where n varies)
; each invocation.
;
; nlabel returns the current value of glabel, and then redefines glabel to
; the value one greater than glabel.
;
define( glabel,10000)
define( nlabel,``l'glabel`'define(`glabel',iner(glabel))')
;
; Now we have a unique label generator, but each time we call it the label
; will be different, and thus of little use for branches and jumps.
;
; We must assign this unique label string to an identifier for multiple
; uses.
;
define(local1,nlabel)
local1: nop
jmp local1
jsr local1
undefine(`local1')
local1: nop
;
; Above we define local1 to be the string generated by nlabel, use that
; string in several places, and then undefine it. Note that local1 after
; the undefine is "local1" and not a generated string. If defined locals
; are not undefined when we are done with them, we would quickly run out
; of memory space (in the macro table).
;
define(loop, ` define(local1,nlabel)
local1: nop
jmp local1
undefine(`local1')')
loop
loop
loop
; Above the macro loop is genrated three times, each time with unique local
; labels as looping targets.
; Some useful macros to help get you started.
;
; Please note that all of the examples use 6800 instructions and thus
; will generate error messages when assembled on other assemblers. Just
; ignore those messages (or substitute the equivalent opcode for your
; processor)--the macro ideas depicted are still valid.
;
; Unique generated labels.
;
; Some macros will require "local" labels unique to a given expansion.
; The following macros are one way of creating them.
;
; nlabel creates a new unique identifier (of the form l1nnnn, where n varies)
; each invocation.
;
; nlabel returns the current value of glabel, and then redefines glabel to
; the value one greater than glabel.
;
define( glabel,10000)
define( nlabel,``l'glabel`'define(`glabel',iner(glabel))')
;
; Now we have a unique label generator, but each time we call it the label
; will be different, and thus of little use for branches and jumps.
;
; We must assign this unique label string to an identifier for multiple
; uses.
;
define(local1,nlabel)
local1: nop
jmp local1
jsr local1
undefine(`local1')
local1: nop
;
; Above we define local1 to be the string generated by nlabel, use that
; string in several places, and then undefine it. Note that local1 after
; the undefine is "local1" and not a generated string. If defined locals
; are not undefined when we are done with them, we would quickly run out
; of memory space (in the macro table).
;
define(loop, ` define(local1,nlabel)
local1: nop
jmp local1
undefine(`local1')')
loop
loop
loop
; Above the macro loop is genrated three times, each time with unique local
; labels as looping targets.
.org 0 ;z80 mnemonics test
adc a,h'00
adc a,h'ff
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,(hl)
adc a,(ix+-128)
adc a,(ix-128)
adc a,(iy-128)
adc a,(iy+127)
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
add a,h'00
add a,h'ff
add a,a
add a,l
add a,(hl)
add a,(ix+-128)
add a,(iy+127)
add hl,bc
add hl,de
add hl,hl
add hl,sp
add ix,bc
add ix,de
add ix,sp
add iy,bc
add iy,de
add iy,sp
add ix,ix
add iy,iy
and h'00
and h'ff
and a
and l
and (hl)
and (ix+-128)
and (iy+127)
bit 0,a
bit 0,l
bit 0,(hl)
bit 0,(ix+-128)
bit 0,(iy+127)
bit 7,a
bit 7,l
bit 7,(hl)
bit 7,(ix+-128)
bit 7,(iy+127)
call h'00
call h'ff
call longtest
call nz,h'00
call z,h'ff
call nc,longtest
call c,longtest
call po,h'00
call pe,1000
call p,128
call m,0
ccf
cp h'00
cp h'ff
cp a
cp l
cp (hl)
cp (ix+-128)
cp (iy+127)
cpd
cpdr
cpi
cpir
cpl
daa
dec a
dec l
dec (hl)
dec (ix+-128)
dec (iy+127)
dec bc
dec de
dec hl
dec sp
dec ix
dec iy
di
djnz rtest
ei
ex af,af'
ex de,hl
ex (sp),hl
ex (sp),ix
ex (sp),iy
exx
halt
im 0
im 1
im 2
in a,(h'00)
in a,(h'ff)
inc a
inc l
inc (hl)
inc (ix+-128)
inc (iy+127)
inc bc
inc de
inc hl
inc sp
inc ix
inc iy
ind
indr
ini
inir
in a,(c)
in c,(c)
in l,(c)
jp h'00
jp h'ff
jp longtest
jp nz,h'00
jp z,h'ff
jp nc,longtest
jp c,longtest
jp po,h'00
jp pe,1000
jp p,128
jp m,0
jp (hl)
jp (ix)
jp (iy)
jr c,rtest
rtest: jr rtest
djnz rtest
jr nc,rtest
jr nz,rtest
jr z,rtest
ld a,i
ld a,r
ld a,(longtest)
ld a,(h'00)
ld a,(h'ff)
ld a,(hl)
ld a,(bc)
ld a,(de)
ld a,l
ld l,a
ld l,h
ld hl,(h'00)
ld hl,(longtest)
ld bc,(h'00)
ld de,(longtest)
ld sp,(h'ff)
ld ix,(h'00)
ld iy,(h'ff)
ld ix,(longtest)
ld i,a
ld r,a
ld a,h'00
ld l,h'ff
ld bc,h'00
ld de,h'ff
ld sp,h'ff
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(hl)
ld l,(hl)
ld a,(ix+127)
ld a,(iy+127)
ld a,(iy-128)
ld l,(iy+-128)
ld l,(iy-128)
ld sp,hl
ld sp,ix
ld sp,iy
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),de
ld (longtest),de
ld (1000),sp
ld (longtest),sp
ld (1000),ix
ld (longtest),iy
ld (hl),h'00
ld (hl),h'ff
ld (ix+127),h'00
ld (ix+-128),h'ff
ld (iy-128),h'ff
ld (iy-128),-128
ld (iy-128),127
ld (iy+127),0
ld (hl),a
ld (hl),l
ld (ix+127),a
ld (iy+-128),l
ld (iy-128),l
ld (bc),a
ld (de),a
ld (hl),a
ldd
lddr
ldi
ldir
neg
nop
or h'00
or h'ff
or a
or l
or (hl)
or (ix+-128)
or (iy+127)
out (c),a
out (c),l
outd
otdr
outi
otir
out (h'00),a
out (h'ff),a
pop bc
pop de
pop hl
pop af
pop ix
pop iy
push bc
push de
push hl
push af
push ix
push iy
res 0,a
res 0,l
res 0,(hl)
res 0,(ix+-128)
res 0,(iy+127)
res 7,a
res 7,l
res 7,(hl)
res 7,(ix+-128)
res 7,(iy+127)
ret
ret nz
ret z
ret nc
ret c
ret po
ret pe
ret p
ret m
reti
retn
rl a
rl l
rl (hl)
rl (ix+-128)
rl (iy+127)
rla
rlc a
rlc l
rlc (hl)
rlc (ix+-128)
rlc (iy+127)
rlca
rld
rr a
rr l
rr (hl)
rr (ix+-128)
rr (iy+127)
rra
rrc a
rrc l
rrc (hl)
rrc (ix+-128)
rrc (iy+127)
rrca
rrd
rst h'00
rst h'20
rst h'38
sbc a,h'00
sbc a,h'ff
sbc a,a
sbc a,l
sbc a,(hl)
sbc a,(ix+-128)
sbc a,(iy+127)
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
scf
set 0,a
set 0,l
set 0,(hl)
set 0,(ix+-128)
set 0,(iy+127)
set 7,a
set 7,l
set 7,(hl)
set 7,(ix+-128)
set 7,(iy+127)
sla a
sla l
sla (hl)
sla (ix+-128)
sla (iy+127)
sra a
sra l
sra (hl)
sra (ix+-128)
sra (iy+127)
srl a
srl l
srl (hl)
srl (ix+-128)
srl (iy+127)
sub h'00
sub h'ff
sub a
sub l
sub (hl)
sub (ix+-128)
sub (iy+127)
xor h'00
xor h'ff
xor a
xor l
xor (hl)
xor (ix+-128)
xor (iy+127)
synctst1:
adc a,forward2
adc a,forward1
adc a,(ix+forward3)
adc a,(iy+forward4)
add a,forward2
add a,forward1
add a,(ix+forward3)
add a,(iy+forward4)
and forward2
and forward1
and (ix+forward3)
and (iy+forward4)
bit bit0,a
bit bit0,l
bit bit0,(hl)
bit bit0,(ix+forward3)
bit bit0,(iy+forward4)
bit bit7,a
bit bit7,l
bit bit7,(hl)
bit bit7,(ix+forward3)
bit bit7,(iy+forward4)
call forward2
call forward1
call longtest
call nz,forward2
call z,forward1
call nc,longtest
call c,longtest
call po,forward2
call pe,1000
call p,128
call m,0
cp forward2
cp forward1
cp (ix+forward3)
cp (iy+forward4)
dec (ix+forward3)
dec (iy+forward4)
in a,(forward2)
in a,(forward1)
inc (ix+forward3)
inc (iy+forward4)
jp forward2
jp forward1
jp longtest
jp nz,forward2
jp z,forward1
jp nc,longtest
jp c,longtest
jp po,forward2
jp pe,1000
jp p,128
jp m,0
ld a,(longtest)
ld a,(forward2)
ld a,(forward1)
ld ix,(forward2)
ld iy,(forward1)
ld ix,(longtest)
ld a,forward2
ld bc,forward2
ld sp,forward1
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(ix+forward4)
ld l,(iy+forward3)
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),ix
ld (longtest),iy
ld (hl),forward2
ld (hl),forward1
ld (ix+forward4),forward2
ld (ix+forward3),forward1
ld (ix+forward4),a
ld (iy+forward3),l
or forward2
or forward1
or (ix+forward3)
or (iy+forward4)
out (forward2),a
out (forward1),a
res bit0,a
res bit0,l
res bit0,(hl)
res bit0,(ix+forward3)
res bit0,(iy+forward4)
res bit7,a
res bit7,l
res bit7,(hl)
res bit7,(ix+forward3)
res bit7,(iy+forward4)
rl (ix+forward3)
rl (iy+forward4)
rlc (ix+forward3)
rlc (iy+forward4)
rr (ix+forward3)
rr (iy+forward4)
rrc (ix+forward3)
rrc (iy+forward4)
sbc a,forward2
sbc a,forward1
sbc a,(ix+forward3)
sbc a,(iy+forward4)
set bit0,a
set bit0,l
set bit0,(hl)
set bit0,(ix+forward3)
set bit0,(iy+forward4)
set bit7,a
set bit7,l
set bit7,(hl)
set bit7,(ix+forward3)
set bit7,(iy+forward4)
sla (ix+forward3)
sla (iy+forward4)
sra (ix+forward3)
sra (iy+forward4)
srl (ix+forward3)
srl (iy+forward4)
sub forward2
sub forward1
sub (ix+forward3)
sub (iy+forward4)
xor forward2
xor forward1
xor (ix+forward3)
xor (iy+forward4)
synctst2:
longtest:.equ forward1,h'ff
.equ forward2,h'00
.equ forward3,-128
.equ forward4,127
.equ bit0,0
.equ bit7,7
.end
.command +m2 ;64180 level selection
.org 0 ;z80 mnemonics test
tst (hl)
tst 0
tst 255
tst a
tst b
tstio 0
tstio 255
slp
mlt bc
mlt de
mlt hl
mlt sp
in0 a,(0)
in0 b,(255)
out0 (0),a
out0 (255),b
otim
otimr
otdm
otdmr
adc a,h'00
adc a,h'ff
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,(hl)
adc a,(ix+-128)
adc a,(ix-128)
adc a,(iy-128)
adc a,(iy+127)
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
add a,h'00
add a,h'ff
add a,a
add a,l
add a,(hl)
add a,(ix+-128)
add a,(iy+127)
add hl,bc
add hl,de
add hl,hl
add hl,sp
add ix,bc
add ix,de
add ix,sp
add iy,bc
add iy,de
add iy,sp
add ix,ix
add iy,iy
and h'00
and h'ff
and a
and l
and (hl)
and (ix+-128)
and (iy+127)
bit 0,a
bit 0,l
bit 0,(hl)
bit 0,(ix+-128)
bit 0,(iy+127)
bit 7,a
bit 7,l
bit 7,(hl)
bit 7,(ix+-128)
bit 7,(iy+127)
call h'00
call h'ff
call longtest
call nz,h'00
call z,h'ff
call nc,longtest
call c,longtest
call po,h'00
call pe,1000
call p,128
call m,0
ccf
cp h'00
cp h'ff
cp a
cp l
cp (hl)
cp (ix+-128)
cp (iy+127)
cpd
cpdr
cpi
cpir
cpl
daa
dec a
dec l
dec (hl)
dec (ix+-128)
dec (iy+127)
dec bc
dec de
dec hl
dec sp
dec ix
dec iy
di
djnz rtest
ei
ex af,af'
ex de,hl
ex (sp),hl
ex (sp),ix
ex (sp),iy
exx
halt
im 0
im 1
im 2
in a,(h'00)
in a,(h'ff)
inc a
inc l
inc (hl)
inc (ix+-128)
inc (iy+127)
inc bc
inc de
inc hl
inc sp
inc ix
inc iy
ind
indr
ini
inir
in a,(c)
in c,(c)
in l,(c)
jp h'00
jp h'ff
jp longtest
jp nz,h'00
jp z,h'ff
jp nc,longtest
jp c,longtest
jp po,h'00
jp pe,1000
jp p,128
jp m,0
jp (hl)
jp (ix)
jp (iy)
jr c,rtest
rtest: jr rtest
djnz rtest
jr nc,rtest
jr nz,rtest
jr z,rtest
ld a,i
ld a,r
ld a,(longtest)
ld a,(h'00)
ld a,(h'ff)
ld a,(hl)
ld a,(bc)
ld a,(de)
ld a,l
ld l,a
ld l,h
ld hl,(h'00)
ld hl,(longtest)
ld bc,(h'00)
ld de,(longtest)
ld sp,(h'ff)
ld ix,(h'00)
ld iy,(h'ff)
ld ix,(longtest)
ld i,a
ld r,a
ld a,h'00
ld l,h'ff
ld bc,h'00
ld de,h'ff
ld sp,h'ff
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(hl)
ld l,(hl)
ld a,(ix+127)
ld a,(iy+127)
ld a,(iy-128)
ld l,(iy+-128)
ld l,(iy-128)
ld sp,hl
ld sp,ix
ld sp,iy
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),de
ld (longtest),de
ld (1000),sp
ld (longtest),sp
ld (1000),ix
ld (longtest),iy
ld (hl),h'00
ld (hl),h'ff
ld (ix+127),h'00
ld (ix+-128),h'ff
ld (iy-128),h'ff
ld (iy-128),-128
ld (iy-128),127
ld (iy+127),0
ld (hl),a
ld (hl),l
ld (ix+127),a
ld (iy+-128),l
ld (iy-128),l
ld (bc),a
ld (de),a
ld (hl),a
ldd
lddr
ldi
ldir
neg
nop
or h'00
or h'ff
or a
or l
or (hl)
or (ix+-128)
or (iy+127)
out (c),a
out (c),l
outd
otdr
outi
otir
out (h'00),a
out (h'ff),a
pop bc
pop de
pop hl
pop af
pop ix
pop iy
push bc
push de
push hl
push af
push ix
push iy
res 0,a
res 0,l
res 0,(hl)
res 0,(ix+-128)
res 0,(iy+127)
res 7,a
res 7,l
res 7,(hl)
res 7,(ix+-128)
res 7,(iy+127)
ret
ret nz
ret z
ret nc
ret c
ret po
ret pe
ret p
ret m
reti
retn
rl a
rl l
rl (hl)
rl (ix+-128)
rl (iy+127)
rla
rlc a
rlc l
rlc (hl)
rlc (ix+-128)
rlc (iy+127)
rlca
rld
rr a
rr l
rr (hl)
rr (ix+-128)
rr (iy+127)
rra
rrc a
rrc l
rrc (hl)
rrc (ix+-128)
rrc (iy+127)
rrca
rrd
rst h'00
rst h'20
rst h'38
sbc a,h'00
sbc a,h'ff
sbc a,a
sbc a,l
sbc a,(hl)
sbc a,(ix+-128)
sbc a,(iy+127)
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
scf
set 0,a
set 0,l
set 0,(hl)
set 0,(ix+-128)
set 0,(iy+127)
set 7,a
set 7,l
set 7,(hl)
set 7,(ix+-128)
set 7,(iy+127)
sla a
sla l
sla (hl)
sla (ix+-128)
sla (iy+127)
sra a
sra l
sra (hl)
sra (ix+-128)
sra (iy+127)
srl a
srl l
srl (hl)
srl (ix+-128)
srl (iy+127)
sub h'00
sub h'ff
sub a
sub l
sub (hl)
sub (ix+-128)
sub (iy+127)
xor h'00
xor h'ff
xor a
xor l
xor (hl)
xor (ix+-128)
xor (iy+127)
synctst1:
adc a,forward2
adc a,forward1
adc a,(ix+forward3)
adc a,(iy+forward4)
add a,forward2
add a,forward1
add a,(ix+forward3)
add a,(iy+forward4)
and forward2
and forward1
and (ix+forward3)
and (iy+forward4)
bit bit0,a
bit bit0,l
bit bit0,(hl)
bit bit0,(ix+forward3)
bit bit0,(iy+forward4)
bit bit7,a
bit bit7,l
bit bit7,(hl)
bit bit7,(ix+forward3)
bit bit7,(iy+forward4)
call forward2
call forward1
call longtest
call nz,forward2
call z,forward1
call nc,longtest
call c,longtest
call po,forward2
call pe,1000
call p,128
call m,0
cp forward2
cp forward1
cp (ix+forward3)
cp (iy+forward4)
dec (ix+forward3)
dec (iy+forward4)
in a,(forward2)
in a,(forward1)
inc (ix+forward3)
inc (iy+forward4)
jp forward2
jp forward1
jp longtest
jp nz,forward2
jp z,forward1
jp nc,longtest
jp c,longtest
jp po,forward2
jp pe,1000
jp p,128
jp m,0
ld a,(longtest)
ld a,(forward2)
ld a,(forward1)
ld ix,(forward2)
ld iy,(forward1)
ld ix,(longtest)
ld a,forward2
ld bc,forward2
ld sp,forward1
ld hl,longtest
ld hl,1000
ld ix,1000
ld iy,longtest
ld a,(ix+forward4)
ld l,(iy+forward3)
ld (1000),a
ld (longtest),a
ld (1000),hl
ld (longtest),hl
ld (1000),bc
ld (longtest),bc
ld (1000),ix
ld (longtest),iy
ld (hl),forward2
ld (hl),forward1
ld (ix+forward4),forward2
ld (ix+forward3),forward1
ld (ix+forward4),a
ld (iy+forward3),l
or forward2
or forward1
or (ix+forward3)
or (iy+forward4)
out (forward2),a
out (forward1),a
res bit0,a
res bit0,l
res bit0,(hl)
res bit0,(ix+forward3)
res bit0,(iy+forward4)
res bit7,a
res bit7,l
res bit7,(hl)
res bit7,(ix+forward3)
res bit7,(iy+forward4)
rl (ix+forward3)
rl (iy+forward4)
rlc (ix+forward3)
rlc (iy+forward4)
rr (ix+forward3)
rr (iy+forward4)
rrc (ix+forward3)
rrc (iy+forward4)
sbc a,forward2
sbc a,forward1
sbc a,(ix+forward3)
sbc a,(iy+forward4)
set bit0,a
set bit0,l
set bit0,(hl)
set bit0,(ix+forward3)
set bit0,(iy+forward4)
set bit7,a
set bit7,l
set bit7,(hl)
set bit7,(ix+forward3)
set bit7,(iy+forward4)
sla (ix+forward3)
sla (iy+forward4)
sra (ix+forward3)
sra (iy+forward4)
srl (ix+forward3)
srl (iy+forward4)
sub forward2
sub forward1
sub (ix+forward3)
sub (iy+forward4)
xor forward2
xor forward1
xor (ix+forward3)
xor (iy+forward4)
synctst2:
longtest:.equ forward1,h'ff
.equ forward2,h'00
.equ forward3,-128
.equ forward4,127
.equ bit0,0
.equ bit7,7
.end
.org 0
aci h'00
aci h'ff
adc a
adc b
adc c
adc d
adc e
adc h
adc l
adc m
add a
add b
add c
add d
add e
add h
add l
add m
adi h'00
adi h'ff
ana a
ana b
ana c
ana d
ana e
ana h
ana l
ana m
ani h'00
ani h'ff
call h'1000
call ltest
cc ltest
cm ltest
cma
cmc
cmp a
cmp b
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cnc ltest
cnz ltest
cp ltest
cpe ltest
cpi h'00
cpi h'ff
cpo ltest
cz ltest
daa
dad b
dad bc
dad d
dad de
dad h
dad hl
dad sp
dcr a
dcr b
dcr c
dcr d
dcr e
dcr h
dcr l
dcr m
dcx b
dcx bc
dcx d
dcx de
dcx h
dcx hl
dcx sp
di
ei
hlt
in h'00
in h'ff
inr a
inr b
inr c
inr d
inr e
inr h
inr l
inr m
inx b
inx bc
inx d
inx de
inx h
inx hl
inx sp
jc ltest
jm ltest
jmp ltest
jnc ltest
jnz ltest
jp ltest
jpe ltest
jpo ltest
jz ltest
lda h'1000
ldax b
ldax d
ldax bc
ldax de
lhld h'1000
lxi b,h'1000
lxi d,h'1001
lxi h,h'2002
lxi sp,h'f000
mov a,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov a,m
mov b,a
mov b,b
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov b,m
mov c,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov c,m
mov d,a
mov d,b
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov d,m
mov e,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov e,m
mov h,a
mov h,b
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov h,m
mov l,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov l,m
mov m,a
mov m,b
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
mvi a,h'00
mvi b,h'00
mvi c,h'00
mvi d,h'00
mvi e,h'00
mvi h,h'00
mvi l,h'00
mvi m,h'00
mvi a,h'ff
mvi b,h'ff
mvi c,h'ff
mvi d,h'ff
mvi e,h'ff
mvi h,h'ff
mvi l,h'ff
mvi m,h'ff
nop
ora a
ora b
ora c
ora d
ora e
ora h
ora l
ora m
ori h'00
ori h'ff
out h'00
out h'ff
pchl
pop b
pop bc
pop d
pop de
pop h
pop hl
pop psw
push b
push bc
push d
push de
push h
push hl
push psw
ral
rar
rc
ret
rim ;8085 only
rlc
rm
rnc
rnz
rp
rpe
rpo
rrc
rst 0
rst 1
rst 2
rst 3
rst 4
rst 5
rst 6
rst 7
rz
sbb a
sbb b
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbi h'00
sbi h'ff
shld h'1000
sim ;8085 only
sphl
sta h'1000
stax b
stax bc
stax d
stax de
stc
sub a
sub b
sub c
sub d
sub e
sub h
sub l
sub m
sui h'00
sui h'ff
xchg
xra a
xra b
xra c
xra d
xra e
xra h
xra l
xra m
xri h'00
xri h'ff
xthl
aci forward2
aci forward1
adc a
adc b
adc c
adc d
adc e
adc h
adc l
adc m
add a
add b
add c
add d
add e
add h
add l
add m
adi forward2
adi forward1
ana a
ana b
ana c
ana d
ana e
ana h
ana l
ana m
ani forward2
ani forward1
call h'1000
call ltest
cc ltest
cm ltest
cma
cmc
cmp a
cmp b
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cnc ltest
cnz ltest
cp ltest
cpe ltest
cpi forward2
cpi forward1
cpo ltest
cz ltest
daa
dad b
dad bc
dad d
dad de
dad h
dad hl
dad sp
dcr a
dcr b
dcr c
dcr d
dcr e
dcr h
dcr l
dcr m
dcx b
dcx bc
dcx d
dcx de
dcx h
dcx hl
dcx sp
di
ei
hlt
in forward2
in forward1
inr a
inr b
inr c
inr d
inr e
inr h
inr l
inr m
inx b
inx bc
inx d
inx de
inx h
inx hl
inx sp
jc ltest
jm ltest
jmp ltest
jnc ltest
jnz ltest
jp ltest
jpe ltest
jpo ltest
jz ltest
lda h'1000
ldax b
ldax d
ldax bc
ldax de
lhld h'1000
lxi b,h'1000
lxi d,h'1001
lxi h,h'2002
lxi sp,h'f000
mov a,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov a,m
mov b,a
mov b,b
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov b,m
mov c,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov c,m
mov d,a
mov d,b
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov d,m
mov e,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov e,m
mov h,a
mov h,b
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov h,m
mov l,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov l,m
mov m,a
mov m,b
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
mvi a,forward2
mvi b,forward2
mvi c,forward2
mvi d,forward2
mvi e,forward2
mvi h,forward2
mvi l,forward2
mvi m,forward2
mvi a,forward1
mvi b,forward1
mvi c,forward1
mvi d,forward1
mvi e,forward1
mvi h,forward1
mvi l,forward1
mvi m,forward1
nop
ora a
ora b
ora c
ora d
ora e
ora h
ora l
ora m
ori forward2
ori forward1
out forward2
out forward1
pchl
pop b
pop bc
pop d
pop de
pop h
pop hl
pop psw
push b
push bc
push d
push de
push h
push hl
push psw
ral
rar
rc
ret
rim ;8085 only
rlc
rm
rnc
rnz
rp
rpe
rpo
rrc
rst 0
rst 1
rst 2
rst 3
rst 4
rst 5
rst 6
rst 7
rz
sbb a
sbb b
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbi forward2
sbi forward1
shld h'1000
sim ;8085 only
sphl
sta h'1000
stax b
stax bc
stax d
stax de
stc
sub a
sub b
sub c
sub d
sub e
sub h
sub l
sub m
sui forward2
sui forward1
xchg
xra a
xra b
xra c
xra d
xra e
xra h
xra l
xra m
xri forward2
xri forward1
xthl
synctst:
ltest: .equ forward1,h'ff
.equ forward2,h'00
.end
.opdef defb,.db ;define byte
.opdef defm,.db ;define string
.opdef defs,.rs ;reserve storage
.opdef defw,.drw ;define 16 bit data word(reversed for z80)
.opdef org,.org ;origin
.opdef title,.null ;ignore - not implemented
.opdef db,.db ;define byte
.opdef ds,.rs ;reserve storage
.opdef dw,.dw ;define 16 bit data word
.opdef org,.org ;origin
.opdef title,.null ;ignore - not implemented
ld (iy+h'ffc1),h'0
ld (ix+h'c1),h'0
ifelse( a,b,c,a,a,d,e)
ifelse( a,a,b,c)
define( foo, $1 )
foo( z)
errprint(substr(foo,0,1))
define( `denotefirstchar',
`ifelse( errprint(substr($1 ,0,1)),a,the first letter is a,
errprint($1 ),b,the first letter is b,
$1 ,c,the first letter is c,
the first letter is not in ``a..c'')')
denotefirstchar( a)
denotefirstchar( bc)
denotefirstchar( de)
define( `denotefirstchar',
`ifelse( substr( $1,0,1),a,the first letter is a,
substr( $1,0,1),b,the first letter is b)');,
; substr( $1,0,1),c,the first letter is c,
; the first letter is not in ``a..c'')')
denotefirstchar( above)
denotefirstchar( cow)
denotefirstchar( donut)
ld a,(ix+h'c1)
add a,(ix+h'c1)
ld (ix+h'c1),a
ld(ix+h'c1),h'0
inc (ix+h'c1)
dec (ix+h'c1)
cp (ix+h'c1)
sub (ix+h'c1)
ld a,(iy+h'c1)
add a,(iy+h'c1)
ld (iy+h'c1),a
ld(iy+h'c1),h'0
inc (iy+h'c1)
dec (iy+h'c1)
cp (iy+h'c1)
sub (iy+h'c1)
end.
Volume in drive A has no label
Directory of A:\
FILE0778 TXT 2173 9-13-89 9:20a
GO BAT 38 6-16-87 2:26p
GO TXT 1233 9-06-89 4:37p
A80Z <DIR>
A85 <DIR>
5 file(s) 3444 bytes
Directory of A:\A80Z
. <DIR>
.. <DIR>
A80Z EXE 64784 6-14-89 7:37p
EXAMPLE ASM 2020 1-04-87 6:55p
LABGEN ASM 1777 5-10-89 5:32p
MNEMLEV1 ASM 10586 3-24-88 9:36p
MNEMLEV2 ASM 10993 3-24-88 9:39p
READ ME 1680 7-19-89 7:32a
READ ME2 4535 7-19-89 7:15a
SYN ASM 321 1-04-87 7:09p
T ASM 951 4-15-88 4:49p
TEST ASM 408 5-10-88 12:41p
12 file(s) 98055 bytes
Directory of A:\A85
. <DIR>
.. <DIR>
A85 EXE 53872 6-14-89 7:35p
EXAMPLE ASM 2018 11-09-86 7:00p
LABGEN ASM 1777 5-10-89 5:32p
MNEMTEST ASM 10185 4-02-88 10:22p
READ ME 1680 7-19-89 7:32a
READ ME2 4535 7-19-89 7:15a
SYN ASM 240 11-02-86 6:03p
9 file(s) 74307 bytes
Total files listed:
26 file(s) 175806 bytes
135168 bytes free