home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY2 / SPOOL.ZIP / DOSPOOL.ASM next >
Assembly Source File  |  1990-07-09  |  2KB  |  116 lines

  1. ; SPOOL.ASM
  2. ;
  3. ; Written By B. Jones    04/01/90
  4. ;
  5. ; Demonstrates use of the MS-DOS Multiplex Interrupt
  6. ;
  7. ; This program is distributed as an example only.  No claims of
  8. ; merchantability or fitness for any application are supported by
  9. ; the author.
  10.  
  11.     Public    Spool
  12.     Extrn    GET$LOC:far
  13.  
  14. Code    Segment    Byte
  15.     assume cs:code
  16.  
  17. Spool    Proc    Far
  18.  
  19.     push    bp
  20.     mov    bp,sp
  21.     push    ds
  22.  
  23.     les    di,[bp + 6]        ; string variable if needed
  24.     push    word ptr es:[di]
  25.  
  26.     les    di,[bp + 0ah]           ; user selected function
  27.     mov    bx,word ptr es:[di]
  28.  
  29.     cmp    bx,0
  30.     jz    status
  31.     cmp    bx,1
  32.     jz    submit
  33.     cmp    bx,2
  34.     jz    remove
  35.     cmp    bx,3
  36.     jz    cancel
  37.     cmp    bx,4
  38.     jz    hold
  39.     cmp    bx,5
  40.     jz    endhold
  41.  
  42.     mov    ax,0ffffh        ; choice invalid
  43.     pop    bx
  44.     pop    ds
  45.     pop    bp
  46.     retf    8
  47.  
  48. status:
  49.     mov    ax,0100h        ; return install status
  50.     int    2fh
  51.     mov    ah,0
  52.     jmp    done
  53.  
  54. submit:
  55.     pop    bx            ; submit file to spooler
  56.     push    bx
  57.     push    bx
  58.     call    GET$LOC
  59.     mov    ds,dx
  60.     mov    dx,ax
  61.     mov    ax,0101h
  62.     int    2fh
  63.     mov    ah,0
  64.     jc    done
  65.     mov    ax,0
  66.     jmp    done
  67.  
  68. remove:
  69.     pop    bx            ; remove file from spooler
  70.     push    bx
  71.     push    bx
  72.     call    GET$LOC
  73.     mov    ds,dx
  74.     mov    dx,ax
  75.     mov    ax,0102h
  76.     int    2fh
  77.     mov    ah,0
  78.     jc    done
  79.     mov    ax,0
  80.     jmp    done
  81.  
  82. cancel:
  83.     mov    ax,0103h        ; cancell all files in spooler
  84.     int    2fh
  85.     mov    ah,0
  86.     jc    done
  87.     mov    ax,0
  88.     jmp    done
  89.  
  90. hold:
  91.     mov    ax,0104h        ; hold for status read
  92.     int    2fh            ; {ds:si points to files in spooler}
  93.     mov    ah,0            ; {dx = error count}
  94.     jc    done
  95.     mov    ax,0
  96.     jmp    done
  97.  
  98. endhold:
  99.     mov    ax,0105h        ; resume after status read
  100.     int    2fh
  101.     mov    ah,0
  102.     jc    done
  103.     mov    ax,0
  104.  
  105. done:
  106.     pop    bx            ; return to caller
  107.     pop    ds
  108.     pop    bp
  109.     retf    8
  110.  
  111. Spool    EndP
  112.  
  113. Code    EndS
  114.  
  115.     End
  116.