Estex-DSS/DSS/API/Print.asm

74 lines
1.9 KiB
NASM
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;///////////////////////////////////////////////////////////////////////
; ”ã­ªæ¨ï #5F. ‚뢮¤ ᨬ¢®«  ­  ¯à¨­â¥à ¡¥§ ®¦¨¤ ­¨ï.
;
; ˆ­â¥à¯à¥â æ¨ï ¡ ©â  á®áâ®ï­¨ï ¯à¨­â¥à :
; 0..2 - ­¥ ¨á¯®«ì§ãîâáï, ®¡ëç­® ãáâ. ¢ "1"
; 3 - ®è¨¡ª  ¯à¨­â¥à  - ¥áâì/­¥â (1/0)
; 4 - ¯à¨­â¥à ¯®¤ª«î祭/­¥ ¯®¤ª«î祭 (1/0)
; 5 - ¡ã¬ £¨ ­¥â/¥áâì (1/0)
; 6 - ¯à¨­â¥à £®â®¢/¢ë¢®¤¨â ®ç¥à¥¤­®© ᨬ¢®« (1/0)
; 7 - ¯à¨­â¥à ᢮¡®¤¥­/§ ­ïâ (1/0)
;
; ¢å®¤: A - ᨬ¢®«
; ¢ë室: B - ᨬ¢®«
; CF - ®è¨¡ª , A=¡ ©â á®áâ®ï­¨ï (¡¨âë 7..3)
;///////////////////////////////////////////////////////////////////////
Z84_SP:
.LPT_A EQU Z84.SIO.Ch_B.Ctrl
.LPT_B EQU Z84.PIO.Port_A.Data
.LPT1_C EQU Z84.PIO.Port_A.Command
.LPT2_D EQU Z84.PIO.Port_B.Data
.LPT2_C EQU Z84.PIO.Port_B.Command
;
PRINT: AND A
LD B,A ; á®å࠭塞 ᨬ¢®«
;
LD A,R
DI
PUSH AF
; reg 0
XOR A
OUT (Z84_SP.LPT_A),A
LD A,%0001'0000 ; Reset EXT/STATUS interrupts
OUT (Z84_SP.LPT_A),A
XOR A
OUT (Z84_SP.LPT_A),A
IN A,(Z84_SP.LPT_A) ; IN (1Bh): bit 5 - busy, Bit 3 - Ack
LD C,A
BIT 5,A ; IN (19h): bit 5 - Paper Enable, Bit 3 - Select
JR NZ,.LPTBUSY
AND %11011000
JR Z,.LPTBUSY
LD A,B ; ¢®ááâ ­ ¢«¨¢ ¥¬ ᨬ¢®«
OUT (Z84_SP.LPT_B),A
POP AF
RET PO
EI
RET
;
.LPTBUSY: POP AF
LD A,C
SCF
RET PO
EI
RET
; ; ;
; B - SYMBOL
; CF = 1 - PRINTER BUSY
PRINT_INIT: DI
LD A,#CF
; port #1F ⮫쪮 ç¥p¥§ LD BC,1F : Out (BC),reg (¢  «ìâ¥à¥ ¨¤ñâ ¯¥à¥å¢ â í⮣® ¯®àâ  ¯à®æ , ¥á«¨ ®­ ¢ ª®¬ ­¤¥ ® 㪠§ ­)
LD BC,Z84_SP.LPT2_C
OUT (C),A
;[x] 29/9/23
;LD A,#63
LD A,63
;
OUT (C),A
LD A,#C0 ; Bit 7 - Select (1), Bit 6 - Auto_Line_Feed (1)
OUT (Z84_SP.LPT2_D),A
LD A,#0F ; Init printer port for Out
OUT (Z84_SP.LPT1_C),A
RET
;///////////////////////////////////////////////////////////////////////