Verwendete IO-Ports bzw. Hardware:
PN PLOTTER-SCANN
;
; 5.8.92 Dirk Ambras
; ( Tag der Plotterfertig-
; stellung !! )
;
ORG 08000H
BMEM: EQU 09000H
LOAD: EQU 0E003H
SAVE: EQU 0E006H
PDR: EQU 050H
PFL: EQU 052H
PPL: EQU 054H
;
INIT: LD A,0FFH
OUT PPL+1
LD A,0
OUT PPL
LD A,0E0H
OUT PPL+1
CALL CLS
MENU: XOR A
OUT 018H
RST 020H
DB 2
DB 12
DB 13
DB ' '
DB 'Bilder scannen'
DB 13
DB ' **'
DB '**************'
DB 13,13,13
DB ' B - Bild '
DB 'scannen'
DB 13,13
DB ' S - Bild '
DB 'saven'
DB 13,13
DB 'D/d - Bild '
DB 'drucken'
DB 13,13
DB ' - Bild '
DB 'ansehen'
DB 13,13
DB ' ^C - Return'
DB 13,13
DB 08DH
LD HL,(02BH)
LD (CURS),HL
LD HL,0EBFFH
LD (02BH),HL
RST 020H
DB 1
LD HL,MENU
PUSH HL
CMP 'S'
JPZ BSAVE
CMP 'D'
JPZ DRUCK
CMP 'd'
JPZ DRUCK
CMP ' '
JPZ BILD
CMP 'B'
JPZ SCANN
CMP 3
RNZ
RST 020H
DB 2,08CH
RST 038H
;
SCANN: LD HL,0FF00H
LD (PPOS),HL
NLSC: LD B,0FFH
SFF: LD A,B
CPL
LD (PPOS),A
CALL GETP
LD A,4
CALL GNXT
DJNZ SFF-#
CALL NLINE
RZ
LD B,0
SREV: LD A,B
LD (PPOS),A
LD A,12
CALL GNXT
CALL GETP
DJNZ SREV-#
CALL NLINE
RZ
LD A,4
CALL GNXT
JR NLSC-#
GNXT: PUSH BC
LD HL,GREAT
LD B,M
SGO: PUSH BC
LD C,A
CALL STEP
JPC 038H
POP BC
DJNZ SGO-#
POP BC
RET
NLINE: LD A,3
CALL GNXT
RST 020H
DB 4
CMP 3
RZ
LD A,(YPOS)
DEC A
LD (YPOS),A
RET
STEP: SCF
PUSH AF
IN PFL
BIT 1,A
JRZ RDY-#
RST 020H
DB 2
DB 'ERROR: Plotter'
DB ' not present.'
DB 08DH
LD BC,06024H
CALL 0FFDCH
POP AF
RET
RDY: IN PPL
OR C
OUT PPL
LD B,10
KPAU: DJNZ KPAU-#
AND 0FAH
OUT PPL
CALL PAU
AND 0F0H
OUT PPL
POP AF
CCF
RET
PAU: PUSH HL
PUSH AF
LD HL,160
NPAU: DEC HL
LD A,H
OR L
JRNZ NPAU-#
POP AF
POP HL
RET
BILD: LD A,8
OUT 018H
RST 020H
DB 1
RET
CLS: LD A,8
CLS1: OUT 018H
LD HL,0EC00H
LD DE,0EC01H
LD BC,00400H
LD M,0
LDIR
INC A
CMP 010H
JRC CLS1-#
RET
GETP: PUSH HL
PUSH DE
PUSH BC
PUSH AF
IN PPL
LD C,1
BIT 5,A
JRNZ DARK-#
DEC C
DARK: LD A,C
LD (PIX),A
LD DE,(PPOS)
CALL PIX1
POP AF
POP BC
POP DE
POP HL
RET
PIX1: CALL ARG
PRVG: PUSH AF
LD A,(PIX)
OR A
JRZ PRES-#
DEC A
JRZ PSET-#
PINV: POP AF
XOR M
LD M,A
RET
PRES: POP AF
CPL
AND M
LD M,A
RET
PSET: POP AF
OR M
LD M,A
RET
PTEST: CALL ARG
LD C,M
PM3: RLA
JRC PM2-#
RLC C
JR PM3-#
PM2: RLC C
RET
ARG: LD A,E
AND 7
LD B,A
INC B
SRL E
SRL E
SRL E
LD L,E
LD A,D
CPL
LD D,A
AND 7
OR 8
OUT 018H
LD A,D
LD H,03BH
RLA
RL H
RLA
RL H
AND 0E0H
OR L
LD L,A
XOR A
SCF
BIT: RRA
DJNZ BIT-#
RET
BSAVE: CALL READ
XOR A
OUT 018H
LD HL,(CURS)
LD (02BH),HL
LD HL,BMEM
LD (01BH),HL
LD DE,01FFFH
ADD HL,DE
LD (01DH),HL
LD IY,0
LD (023H),IY
JMP SAVE
READ: LD HL,0EC00H
LD DE,BMEM
RE1: LD A,8
RE2: OUT 018H
LD BC,32
PUSH HL
LDIR
POP HL
INC A
CMP 16
JRC RE2-#
LD BC,32
ADD HL,BC
LD A,H
CMP 0F0H
JRC RE1-#
RET
DRUCK: LD B,1
BIT 5,A
JRNZ SETG-#
INC B
SETG: LD A,B
LD (PIX),A
HCPY: LD A,(PIX)
OR A
RZ
CMP 3
RNC
LD HL,0EC00H
LD A,15
OUT PDR+1
LD B,5
LD DE,DINI
CALL INGT
JR PRST-#
NEXT: CALL OUTZ
INC HL
INC C
LD A,(PIX)
CMP 2
LD A,C
JRNZ HCN-#
CMP 64
JRZ PRST-#
CMP 32
JRNZ NEXT-#
LD DE,32
SBC HL,DE
JR PRS2-#
HCN: CMP 32
JRC NEXT-#
PRST: LD C,0
PRS2: LD B,6
LD DE,ITAB
LD A,H
CMP 0F0H
JRNC BRKS-#
RST 020H
DB 4
CMP 3
JRZ BRKS-#
CALL INGT
LD A,(PIX)
CALL OUT
JR NEXT-#
BRKS: LD B,2
CALL INGT
RET
OUTZ: LD E,C
PUSH BC
LD C,1
IGET: LD B,8
PDK3: LD A,16
SUB B
OUT 018H
PUSH BC
LD A,M
PDK2: RLA
DEC C
JRNZ PDK2-#
RL D
POP BC
DJNZ PDK3-#
LD A,(PIX)
CMP 2
JRNZ PDN-#
LD A,E
CMP 32
JRNC UTHA-#
SRL D
SRL D
SRL D
SRL D
UTHA: LD B,4
UT2: RRC D
RRA
RLC D
RRA
SRL D
DJNZ UT2-#
LD D,A
CPL
CALL OUT
PDN: LD A,D
CPL
CALL OUT
INC C
LD A,C
CMP 9
JRC IGET-#
POP BC
RET
INGT: LD A,(DE)
CALL OUT
INC DE
DJNZ INGT-#
RET
OUT: PUSH AF
OUT PDR
WAIT: IN PFL
BIT 0,A
JRNZ WAIT-#
POP AF
RET
DINI: DB 27,'3',24
DB 27,'O'
ITAB: DB 10,13
IT2: DB 27,'*',5,0
GREAT: DB 2
PIX: DB 0
PPOS: DB 0
YPOS: DB 0
CURS: DA 0
END
;
END