home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n002 / 4.ddi / ECLSRCA.ZIP / XC_UPEND.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-08-16  |  2.6 KB  |  81 lines

  1. ;
  2. ;   xc_upend.asm        Unpended Output assembler
  3. ;
  4. ;       Copyright 1989, South Mountain Software Inc
  5. ;   All Rights Reserved
  6. ;
  7. ;   Build instructions:
  8. ;       MASM  xc_upend,, /Dmodel;
  9. ;
  10. ;   Revision history:
  11. ;       2.0         ken     New addition
  12. ;
  13.  
  14.     INCLUDE ECLMACRO.INC                ; Default ECL assembler macros
  15.     modstart    xc_upend                ; Module start
  16.  
  17.  
  18. port_no     DB          0                   ; CS:current port number from xc_upend1
  19.  
  20. ;       ==================================================================
  21. ;       xc_upend1       First step for unpended output - load port number
  22. ;       ==================================================================
  23. ;
  24. ;       C invocation:
  25. ;           int port_no = COM2;
  26. ;           extern int xc_vectr;
  27. ;           ...
  28. ;           xc_upend1(port_no, xc_vectr);
  29. ;
  30. ;       Save the port number away for the next xc_upend2() call
  31. ;       ==================================================================
  32. ;
  33.  
  34.             entry       xc_upend1
  35.             pushreg
  36.  
  37.             loadint1    AX                      ; Load the port number into AX
  38.             MOV         CS:port_no, AL          ; Save it for next xc_upend2
  39.             loadint2    BX                      ; Load the XCOMMS vector
  40.             MOV         CS:vector, BL
  41.             popreg
  42.             RET
  43.             endit       xc_upend1
  44.  
  45.  
  46. ;       ==================================================================
  47. ;       xc_upend2       Second step for unpended output - execute block
  48. ;       ==================================================================
  49. ;
  50. ;       C invocation:
  51. ;           int port_no = COM2;
  52. ;           char    buffer[1000];
  53. ;           ...
  54. ;           xc_upend1(port_no);
  55. ;           xc_upend2(sizeof(buffer), buffer);
  56. ;
  57. ;
  58. ;       ==================================================================
  59. ;
  60.  
  61.             entry       xc_upend2
  62.             pushreg
  63.             PUSH        SI
  64.             PUSH        ES
  65.             loadint1    CX                      ; Load the count in AX
  66.             loadptr2                            ; Load the buffer pointer in DX:BX
  67.  
  68.             MOV         SI, DX
  69.             MOV         AX, 01412h              ; XCOMMS COMMS_Uxmit function code
  70.             MOV         DL, CS:port_no
  71.             DB          0CDh                    ; <int> XCOMMS
  72. vector      DB          0                       ; XCOMMS vector
  73.  
  74.             POP         ES
  75.             POP         SI
  76.             popreg
  77.             RET
  78.             endit       xc_upend2
  79.             modend      xc_upend
  80.             END
  81.