home *** CD-ROM | disk | FTP | other *** search
- ;
- ; xc_upend.asm Unpended Output assembler
- ;
- ; Copyright 1989, South Mountain Software Inc
- ; All Rights Reserved
- ;
- ; Build instructions:
- ; MASM xc_upend,, /Dmodel;
- ;
- ; Revision history:
- ; 2.0 ken New addition
- ;
-
- INCLUDE ECLMACRO.INC ; Default ECL assembler macros
- modstart xc_upend ; Module start
-
-
- port_no DB 0 ; CS:current port number from xc_upend1
-
- ; ==================================================================
- ; xc_upend1 First step for unpended output - load port number
- ; ==================================================================
- ;
- ; C invocation:
- ; int port_no = COM2;
- ; extern int xc_vectr;
- ; ...
- ; xc_upend1(port_no, xc_vectr);
- ;
- ; Save the port number away for the next xc_upend2() call
- ; ==================================================================
- ;
-
- entry xc_upend1
- pushreg
-
- loadint1 AX ; Load the port number into AX
- MOV CS:port_no, AL ; Save it for next xc_upend2
- loadint2 BX ; Load the XCOMMS vector
- MOV CS:vector, BL
- popreg
- RET
- endit xc_upend1
-
-
- ; ==================================================================
- ; xc_upend2 Second step for unpended output - execute block
- ; ==================================================================
- ;
- ; C invocation:
- ; int port_no = COM2;
- ; char buffer[1000];
- ; ...
- ; xc_upend1(port_no);
- ; xc_upend2(sizeof(buffer), buffer);
- ;
- ;
- ; ==================================================================
- ;
-
- entry xc_upend2
- pushreg
- PUSH SI
- PUSH ES
- loadint1 CX ; Load the count in AX
- loadptr2 ; Load the buffer pointer in DX:BX
-
- MOV SI, DX
- MOV AX, 01412h ; XCOMMS COMMS_Uxmit function code
- MOV DL, CS:port_no
- DB 0CDh ; <int> XCOMMS
- vector DB 0 ; XCOMMS vector
-
- POP ES
- POP SI
- popreg
- RET
- endit xc_upend2
- modend xc_upend
- END