3000 45af 0000 S ... Z1013_AN.A
Monitoraufrufe:
keine:
Verwendete IO-Ports bzw. Hardware:
keine []
;******************************
;* BETRIEBSSYSTEM FÜR  Z 1013 *
;* VERSION 1.2, (Anweisungen) *
;* DIRK AMBRAS , 23.11.1989   *
;******************************
;
	ORG	09000H
CAOS:	EQU	08000H
PRNST:	EQU	CAOS+3
PRKEY:	EQU	CAOS+6
PKEY:	EQU	CAOS+9
ERR1:	EQU	CAOS+12
ZLEN:	EQU	CAOS+15
;
BSST:	EQU	0EB00H
JPM:	EQU	BSST+0FFH
AME:	EQU	BSST
DATA:	EQU	BSST+1
HLM:	EQU	01BH
DEM:	EQU	01DH
BCM:	EQU	023H
MEMA:	EQU	BSST+16
MEMHL:	EQU	BSST+17
MEMDE:	EQU	BSST+19
FLAG:	EQU	BSST+21
MEBL:	EQU	BSST+22
KEYTA:	EQU	BSST+23
R20:	EQU	0F0E8H
R38:	EQU	0F058H
FKZ:	EQU	18
STM:	EQU	06DH
PDR:	EQU	050H
PFL:	EQU	052H
;
KEYM1:	DB	'KEY '
	DB	0
KEYM2:	DB	' : '
	DB	0
	DB	STM,STM
	DB	'ldir'
	DB	1
	CMP	3
	JPC	ERR1
	LDIR
	RET
;
	DB	STM,STM
	DB	'exit'
	DB	1
	LD	A,0BBH
	LD	(JPM),A
	LD	HL,R20
	LD	(021H),HL
	LD	HL,R38
	LD	(039H),HL
	JMP	R38
;
	DB	STM,STM
	DB	'prolog'
	DB	1
	LD	A,L
	LD	(MEBL),A
	RET
;
	DB	STM,STM
	DB	'big'
	DB	1
	LD	A,(FLAG)
	XOR	1
MSE:	LD	(FLAG),A
	RET
;
	DB	STM,STM
	DB	'little'
	DB	1
	LD	A,(FLAG)
	XOR	2
	JR	MSE-#
;
	DB	STM,STM
	DB	'begin'
	DB	1
	LD	A,(FLAG)
	XOR	4
	JR	MSE-#
;
	DB	STM,STM
	DB	'typ'
	DB	1
	LD	A,(FLAG)
	XOR	8
	JR	MSE-#
;
	DB	STM,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