home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / basnet / ibasneta.asm < prev    next >
Assembly Source File  |  1987-06-12  |  27KB  |  1,550 lines

  1. SegZero segment at    0H
  2.         ORG    4f0h        ;Intra-application comm area
  3.  
  4. ComArea_Off    dw    ?        ;Vector pointing to permanent
  5. ComArea_Seg    dw    ?        ;BASIC subroutine.
  6. SegZero     ends
  7.  
  8.  
  9. grp    GROUP    AAAA,RLOADER
  10.  
  11.  
  12.  
  13. AAAA    SEGMENT 'CODE'
  14.  
  15.     jmp    far ptr Loader
  16.  
  17. AAAA    ends
  18.  
  19. public    loader,xtndopn,setattr,eojstat,PRLH_Log,PRLH_Rel,PRLH_Clr
  20. public    PRLF_Log, PRLF_Rel,PRLF_Clr,PRLS_Lck,PRLS_Rel,PRLS_Clr
  21. public    OpenSem,ExamSem,WaitSem,SigSem,ClosSem,setlck,TTS,BLFTran
  22. public    ELFTran,exclog,exclcks,exculkf,exculks,excclrs,reclog,reclck
  23. public    reculk,reculks,recclr,recclrs,eoj,sysout,allocr,dallocr,volstat
  24. public    locdrv,wsid,errmode,bcsmode,ctlspl,splreq,pipreq,dpath,syslog
  25. public    fattr,updfcb,cpyfile,nettod,clsmode,drvmap,retshl,asclog,asculkf
  26. public    ascclrf,Get_PSN,Get_STA,SetServ,ModServ,GetDrv,setspl,loglck
  27.  
  28. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  29. ;                    ;
  30. ;    INTERFACE CODE AREA        ;
  31. ;                    ;
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33.  
  34.  
  35. subseg    segment para public 'CODE'
  36.     assume cs:subseg
  37.  
  38.  
  39. ;     vector table - starts at 0000, with each ensuing call
  40. ;    offset by 3 (the jmp instruction and an offset address)
  41. Subrt:    jmp    near ptr xtndopn
  42.     jmp    near ptr setattr
  43.     jmp    near ptr eojstat
  44.     jmp    near ptr PRLH_Log
  45.     jmp    near ptr PRLH_Rel
  46.     jmp    near ptr PRLH_Clr
  47.     jmp    near ptr PRLF_Log
  48.     jmp    near ptr PRLF_Rel
  49.     jmp    near ptr PRLF_Clr
  50.     jmp    near ptr PRLS_Lck
  51.     jmp    near ptr PRLS_Rel
  52.     jmp    near ptr PRLS_Clr
  53.     jmp    near ptr OpenSem
  54.     jmp    near ptr ExamSem
  55.     jmp    near ptr WaitSem
  56.     jmp    near ptr SigSem
  57.     jmp    near ptr ClosSem
  58.     jmp    near ptr setlck
  59.     jmp    near ptr TTS
  60.     jmp    near ptr BLFTran
  61.     jmp    near ptr ELFTran
  62.     jmp    near ptr exclog
  63.     jmp    near ptr exclcks
  64.     jmp    near ptr exculkf
  65.     jmp    near ptr exculks
  66.     jmp    near ptr excclrf
  67.     jmp    near ptr excclrs
  68.     jmp    near ptr reclog
  69.     jmp    near ptr reclck
  70.     jmp    near ptr reculk
  71.     jmp    near ptr reculks
  72.     jmp    near ptr recclr
  73.     jmp    near ptr recclrs
  74.     jmp    near ptr eoj
  75.     jmp    near ptr sysout
  76.     jmp    near ptr allocr
  77.     jmp    near ptr dallocr
  78.     jmp    near ptr volstat
  79.     jmp    near ptr locdrv
  80.     jmp    near ptr wsid
  81.     jmp    near ptr errmode
  82.     jmp    near ptr bcsmode
  83.     jmp    near ptr ctlspl
  84.     jmp    near ptr splreq
  85.     jmp    near ptr pipreq
  86.     jmp    near ptr dpath
  87.     jmp    near ptr syslog
  88.     jmp    near ptr fattr
  89.     jmp    near ptr updfcb
  90.     jmp    near ptr cpyfile
  91.     jmp    near ptr nettod
  92.     jmp    near ptr clsmode
  93.     jmp    near ptr drvmap
  94.     jmp    near ptr retshl
  95.     jmp    near ptr asclog
  96.     jmp    near ptr asculkf
  97.     jmp    near ptr ascclrf
  98.     jmp    near ptr Get_PSN
  99.     jmp    near ptr Get_STA
  100.     jmp    near ptr SetServ
  101.     jmp    near ptr ModServ
  102.     jmp    near ptr GetDrv
  103.     jmp    near ptr setspl
  104.     jmp    near ptr loglck
  105.  
  106.  
  107. ;--------------------------------
  108. ; Extended Open a File func(61) (3DH)
  109. ;
  110. ; call xtndopn(Mode%, Filename$, Handle%, ErrCode%)
  111. ;
  112.  
  113. xtndopn proc    far
  114.     push    bp
  115.     mov    bp,sp
  116.     mov    si,[bp+12]  ; put the mode in ax
  117.     mov    ax,[si]
  118.     mov    ah,03Dh     ; put the function in ah
  119.     mov    di,[bp+10]  ;ptr to var desc block for ASCIIZ string
  120.     mov    dx,[di+1]   ;add 1 to get the address of the string
  121.                 ;put it in dx
  122.     int    21h
  123.     jnc    noerr
  124.     mov    di,[bp+6]
  125.     mov    [di],ax
  126.     jmp    quit
  127. noerr:
  128.     mov    di,[bp+8]   ;put the handle into the variable
  129.     mov    [di],ax      ;if there is no error
  130.     xor    ax,ax
  131.     mov    di,[bp+6]    ;return a 0 if there is no error
  132.     mov    [di],ax
  133. quit:
  134.     pop    bp
  135.     ret    8
  136. xtndopn endp
  137.  
  138.  
  139. ;--------------------------------
  140. ; Get or Set File Attributes(handle) func(67) (43H)
  141. ;
  142. ; call setattr(Func%, Filename$, Attribute%, ErrCode%)
  143. ;
  144.  
  145.  
  146. setattr proc    far
  147.     push    bp
  148.     mov    bp,sp
  149.     mov    si,[bp+12]  ; put the subfunction in ax
  150.     mov    ax,[si]
  151.     mov    ah,043h     ; put the function in ah
  152.     mov    si,[bp+10]  ;ptr to var desc block for ASCIIZ string
  153.     mov    dx,[si+1]   ;add 1 to get the address of the string
  154.                 ;put it in dx
  155.     mov    si,[bp+8]  ;put the attribute to set in cx
  156.     mov    cx,[si]
  157.     int    21h
  158.     jnc    okay
  159.     mov    di,[bp+6]
  160.     mov    [di],ax
  161.     jmp    getout
  162. okay:
  163.     mov    di,[bp+8]   ;put the returned attributes in the
  164.     mov    [di],cx      ;variable if there is no error
  165.     xor    ax,ax
  166.     mov    di,[bp+6]    ;return a 0 error code if there is no error
  167.     mov    [di],ax
  168. getout:
  169.     pop    bp
  170.     ret    8
  171. setattr endp
  172.  
  173. ;--------------------------------
  174. ; End of Job Flag Status func(187) (BBH)
  175. ;
  176. ; call eojstat(Flag%)
  177. ;
  178.  
  179. eojstat proc    far
  180.     push    bp
  181.     mov    bp,sp
  182.     mov    si,[bp+6]   ; put the flag in ax
  183.     mov    ax,[si]
  184.     mov    ah,0BBh     ; put the function in ah
  185.     int    21h
  186.     mov    ah,0
  187.     mov    di,[bp+6]
  188.     mov    [di],ax
  189.     pop    bp
  190.     ret    2
  191. eojstat endp
  192.  
  193.  
  194. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  195. ;
  196. ; Physical Record Lock: Log Record   BCH
  197. ;
  198. ; call PRLH_Log(FileHandle%,HiByteOffset%,LoByteOffset%,HiLockLen%,
  199. ;        LoLockLen%,Flags%,TimeOut%,ErrCode%);
  200. ;
  201. PRLH_Log proc    far
  202.     push    bp
  203.     mov    bp,sp
  204.  
  205.     mov    si,[bp+20]        ;FileHandle
  206.     mov    bx,[si]
  207.     mov    si,[bp+18]        ;ByteOffset
  208.     mov    cx,[si]
  209.     mov    si,[bp+16]
  210.     mov    dx,[si]
  211.     mov    si,[bp+10]        ;AL = Log Flags
  212.     mov    ax,[si]
  213.     mov    si,[bp+14]        ;LockLen
  214.     mov    si,[si]
  215.     mov    di,[bp+12]
  216.     mov    di,[di]
  217.     push    bp
  218.     mov    bp,[bp+8]           ;time out
  219.     mov    bp,[bp]
  220.     mov    ah,0BCH
  221.     int    21H
  222.     pop    bp
  223.     mov    ah,0
  224.     mov    di,[bp+6]        ;return code
  225.     mov    [di],ax
  226.     pop    bp
  227.     ret    16
  228.  
  229. PRLH_Log endp
  230.  
  231.  
  232.  
  233. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  234. ;
  235. ; Physical Record Lock: Release Rec  BDH
  236. ;
  237. ; call PRLH_Rel(FileHandle%,HiByteOffset%,LoByteOffset%,ErrCode%);
  238. ;
  239. PRLH_Rel proc    far
  240.     push    bp
  241.     mov    bp,sp
  242.  
  243.     mov    si,[bp+12]        ;FileHandle
  244.     mov    bx,[si]
  245.     mov    si,[bp+10]        ;ByteOffset
  246.     mov    cx,[si]
  247.     mov    si,[bp+8]
  248.     mov    dx,[si]
  249.     mov    ah,0BDH
  250.     int    21H
  251.     mov    ah,0
  252.     mov    di,[bp+6]        ;return code
  253.     mov    [di],ax
  254.     pop    bp
  255.     ret    8
  256.  
  257. PRLH_Rel endp
  258.  
  259.  
  260.  
  261. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  262. ;
  263. ; Physical Record Lock: Release Clr  BEH
  264. ;
  265. ; call PRLH_Clr(FileHandle%,HiByteOffset%,LoByteOffset%,Errcode%);
  266. ;
  267. PRLH_Clr proc    far
  268.     push    bp
  269.     mov    bp,sp
  270.  
  271.     mov    si,[bp+12]        ;FileHandle
  272.     mov    bx,[si]
  273.     mov    si,[bp+10]        ;ByteOffset
  274.     mov    cx,[si]
  275.     mov    si,[bp+8]
  276.     mov    dx,[si]
  277.     mov    ah,0BEH
  278.     int    21H
  279.     mov    ah,0
  280.     mov    di,[bp+6]        ;return code
  281.     mov    [di],ax
  282.     pop    bp
  283.     ret    8
  284.  
  285. PRLH_Clr endp
  286.  
  287.  
  288. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  289. ;
  290. ; Physical Record Lock: Log Rec FCB BFH
  291. ;
  292. ; call PRLF_Log(fcb%,HiByteOffset%,LoByteOffset%,HiLockLen%,LoLockLen%,Flags%,TimeOut%,ErrCode%);
  293. ;
  294. PRLF_Log proc    far
  295.     push    bp
  296.     mov    bp,sp
  297.  
  298.     mov    si,[bp+20]          ;FCB
  299.     mov    dx,[si+1]
  300.     mov    si,[bp+18]          ;ByteOffset
  301.     mov    bx,[si]
  302.     mov    si,[bp+16]
  303.     mov    cx,[si]
  304.     mov    si,[bp+10]          ;AL = Log Flags
  305.     mov    ax,[si]
  306.     mov    si,[bp+12]          ;low lock length
  307.     mov    di,[si]
  308.     mov    si,[bp+14]          ;hi lock length
  309.     mov    si,[si]
  310.     push    bp
  311.     mov    bp,[bp+8]         ;timeout value
  312.     mov    bp,[bp]
  313.  
  314.     mov    ah,0BFH
  315.     int    21H
  316.     pop    bp
  317.     mov    ah,0
  318.     mov    di,[bp+6]          ;return code
  319.     mov    [di],ax
  320.     pop    bp
  321.     ret    16
  322. PRLF_Log endp
  323.  
  324.  
  325.  
  326. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  327. ;
  328. ; Physical Record Lock: Rel Rec FCB C0H
  329. ;
  330. ; call PRLF_Rel(fcb%,HiByteOffset%,LoByteOffset%,ErrCode%);
  331. ;
  332. PRLF_Rel proc    far
  333.     push    bp
  334.     mov    bp,sp
  335.  
  336.     mov    si,[bp+12]          ;FCB
  337.     mov    dx,[si+1]
  338.     mov    si,[bp+10]          ;ByteOffset
  339.     mov    bx,[si]
  340.     mov    si,[bp+8]
  341.     mov    cx,[si]
  342.     mov    ah,0C0H
  343.     int    21H
  344.     mov    ah,0
  345.     mov    di,[bp+6]          ;return code
  346.     mov    [di],ax
  347.     pop    bp
  348.     ret    8
  349. PRLF_Rel endp
  350.  
  351.  
  352.  
  353. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  354. ;
  355. ; Physical Record Lock: Clr Rec FCB C1H
  356. ;
  357. ; call PRLF_Clr(fcb%,HiByteOffset%,LoByteOffset%,ErrCode%);
  358. ;
  359. PRLF_Clr proc    far
  360.     push    bp
  361.     mov    bp,sp
  362.  
  363.     mov    si,[bp+12]          ;FCB
  364.     mov    dx,[si+1]
  365.     mov    si,[bp+10]          ;ByteOffset
  366.     mov    bx,[si]
  367.     mov    si,[bp+8]
  368.     mov    cx,[si]
  369.  
  370.     mov    ah,0C1H
  371.     int    21H
  372.     mov    ah,0
  373.     mov    di,[bp+6]        ;return code
  374.     mov    [di],ax
  375.     pop    bp
  376.     ret    8
  377. PRLF_Clr endp
  378.  
  379.  
  380. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  381. ;
  382. ; Lock Record Set  C2H
  383. ;
  384. ; call PRLS_Lck(Flags%,TimeOut%,ErrCode%);
  385. ;
  386. PRLS_Lck proc    far
  387.     push    bp
  388.     mov    bp,sp
  389.     mov    si,[bp+10]        ;AL = Lock flag bits
  390.     mov    ax,[si]
  391.     mov    si,[bp+8]           ;TimeOut Value
  392.     push    bp
  393.     mov    bp,[si]
  394.  
  395.     mov    ah,0C2h
  396.     int    21h
  397.     pop    bp
  398.     mov    ah,0
  399.     mov    di,[bp+6]        ;return code
  400.     mov    [di],ax
  401.     pop    bp
  402.     ret    6
  403. PRLS_Lck endp
  404.  
  405.  
  406.  
  407. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  408. ;
  409. ; Release Record Set  C3H
  410. ;
  411. ; call PRLS_Rel(ErrCode%);
  412. ;
  413. PRLS_Rel proc    far
  414.     push    bp
  415.     mov    bp,sp
  416.  
  417.     mov    ah,0C3h
  418.     int    21h
  419.     mov    ah,0
  420.     mov    di,[bp+6]
  421.     mov    [di],ax
  422.     pop    bp
  423.     ret    2
  424. PRLS_Rel endp
  425.  
  426.  
  427.  
  428. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  429. ;
  430. ; Clear Record Set  C4H
  431. ;
  432. ; call PRLS_Clr(ErrCode%);
  433. ;
  434. PRLS_Clr proc    far
  435.     push    bp
  436.     mov    bp,sp
  437.  
  438.     mov    ah,0C4h
  439.     int    21h
  440.     mov    ah,0
  441.     mov    di,[bp+6]        ;return code
  442.     mov    [di],ax
  443.     pop    bp
  444.     ret    2
  445. PRLS_Clr endp
  446.  
  447.  
  448. ;--------------------------------
  449. ; Semaphores func(197) (C5H) subfunction 00h
  450. ;
  451. ; call OpenSem(Sema4$,SemaValu%,HiHandle%,LoHandle%,OpenCnt%,RetCode%)
  452. ;
  453.  
  454. OpenSem proc    far
  455.     push    bp
  456.     mov    bp,sp
  457.     mov    si,[bp+16]  ;ptr to var desc block for Semaphore string
  458.     mov    dx,[si+1]   ;add 1 to get the address of the string
  459.                 ;put it in dx
  460.     mov    si,[bp+14]  ;set semaphore value
  461.     mov    cx,[si]
  462.     mov    ax,0C500h    ;set the function
  463.     int    21h
  464.     mov    bh,00h
  465.     mov    di,[bp+8]  ;return the open count
  466.     mov    [di],bx
  467.     mov    di,[bp+10]  ;return low handle
  468.     mov    [di],cx
  469.     mov    di,[bp+12]  ;return high handle
  470.     mov    [di],dx
  471.     mov    ah,00h
  472.     mov    di,[bp+6]   ;return code
  473.     mov    [di],ax
  474.     pop    bp
  475.     ret    12
  476. OpenSem endp
  477.  
  478.  
  479. ;--------------------------------
  480. ; Semaphores func(197) (C5H) subfunction 01h
  481. ;
  482. ; call ExamSem(HiHandle%,LoHandle%,SemaValu%,OpenCnt%,RetCode%)
  483. ;
  484.  
  485. ExamSem proc    far
  486.     push    bp
  487.     mov    bp,sp
  488.     mov    si,[bp+14]        ;hi handle
  489.     mov    dx,[si]
  490.     mov    si,[bp+12]        ;lo handle
  491.     mov    cx,[si]
  492.     mov    ax,0C501h         ;set function
  493.     int    21h
  494.     mov    di,[bp+10]        ;return semaphore value
  495.     mov    [di],cx
  496.     mov    dh,00h
  497.     mov    di,[bp+8]
  498.     mov    [di],dx          ;return open count
  499.     mov    ah,00h
  500.     mov    di,[bp+6]        ;return code
  501.     mov    [di],ax
  502.     pop    bp
  503.     ret    10
  504. ExamSem endp
  505.  
  506.  
  507. ;--------------------------------
  508. ; Semaphores func(197) (C5H) subfunction 02h
  509. ;
  510. ; call WaitSem(HiHandle%,LoHandle%,TimeOut%,RetCode%)
  511. ;
  512.  
  513. WaitSem proc    far
  514.     push    bp
  515.     mov    bp,sp
  516.     mov    si,[bp+12]        ;hi handle
  517.     mov    dx,[si]
  518.     mov    si,[bp+10]        ;lo handle
  519.     mov    cx,[si]
  520.     mov    si,[bp+8]
  521.     push    bp
  522.     mov    bp,[si]          ;set time out
  523.     mov    ax,0C502h         ;set function
  524.     int    21h
  525.     pop    bp
  526.     mov    ah,00h
  527.     mov    di,[bp+6]        ;return code
  528.     mov    [di],ax
  529.     pop    bp
  530.     ret    8
  531. WaitSem endp
  532.  
  533.  
  534. ;--------------------------------
  535. ; Semaphores func(197) (C5H) subfunction 03h
  536. ;
  537. ; call SigSem(HiHandle%,LoHandle%,RetCode%)
  538. ;
  539.  
  540. SigSem    proc    far
  541.     push    bp
  542.     mov    bp,sp
  543.     mov    si,[bp+10]        ;hi handle
  544.     mov    dx,[si]
  545.     mov    si,[bp+8]           ;lo handle
  546.     mov    cx,[si]
  547.     mov    ax,0C503h         ;set function
  548.     int    21h
  549.     mov    ah,00h
  550.     mov    di,[bp+6]        ;return code
  551.     mov    [di],ax
  552.     pop    bp
  553.     ret    6
  554. SigSem    endp
  555.  
  556.  
  557. ;--------------------------------
  558. ; Semaphores func(197) (C5H) subfunction 04h
  559. ;
  560. ; call ClosSem(HiHandle%,LoHandle%,RetCode%)
  561. ;
  562.  
  563. ClosSem proc    far
  564.     push    bp
  565.     mov    bp,sp
  566.     mov    si,[bp+10]        ;hi handle
  567.     mov    dx,[si]
  568.     mov    si,[bp+8]           ;lo handle
  569.     mov    cx,[si]
  570.     mov    ax,0C504h         ;set function
  571.     int    21h
  572.     mov    ah,00h
  573.     mov    di,[bp+6]
  574.     mov    [di],ax           ;return code
  575.     pop    bp
  576.     ret    6
  577. ClosSem endp
  578.  
  579.  
  580. ;--------------------------------
  581. ; Get or Set Lock Mode func(198) (C6H)
  582. ;
  583. ; call setlck(Func%,Mode%)
  584. ;
  585.  
  586. setlck    proc    far
  587.     push    bp
  588.     mov    bp,sp
  589.     mov    si,[bp+8]
  590.     mov    ax,[si]           ;set the subfunction
  591.     mov    ah,0C6h          ;set  the function
  592.     int    21h
  593.     mov    ah,0
  594.     mov    di,[bp+6]
  595.     mov    [di],ax         ;return the mode
  596.     pop    bp
  597.     ret    4
  598. setlck endp
  599.  
  600. ;--------------------------------
  601. ; Transactional Calls (C7H)
  602. ;
  603. ; call TTS(Func%,RetCode%)
  604. ;
  605.  
  606. TTS    proc    far
  607.     push    bp
  608.     mov    bp,sp
  609.     mov    si,[bp+8]           ;set the subfunction
  610.     mov    ax,[si]
  611.     mov    ah,0C7h          ;set  the function
  612.     int    21h
  613.     mov    ah,0
  614.     mov    di,[bp+6]
  615.     mov    [di],ax          ;set the return
  616.     pop    bp
  617.     ret    4
  618. TTS    endp
  619.  
  620.  
  621. ;--------------------------------
  622. ; Begin Logical File Transaction  
  623. ; func(200) (C8H)
  624. ;
  625. ; call BLFtran(ReturnCode%, Mode%)
  626. ;
  627.  
  628. BLFTran    proc    far
  629.     mov    ah,0C8h
  630.     call    arg1
  631.     ret    4
  632. BLFTran    endp
  633.  
  634.  
  635.  
  636. ;--------------------------------
  637. ; End Logical File Transaction 
  638. ; func(201) (C9H)
  639. ;
  640. ; call ELFtran(ReturnCode%)
  641. ;
  642.  
  643. ELFTran    proc    far
  644.     mov    ah,0C9H
  645.     call    arg0
  646.     ret    2
  647. ELFTran    endp
  648.  
  649.  
  650. ;--------------------------------
  651. ; Exc.log File (202) (CA)
  652. ;
  653. ; call exclog(ReturnCode%, fcb$)
  654. ;
  655.  
  656. exclog    proc    far
  657.     mov    ah,0CAH
  658.     call    arg1f
  659.     ret    4
  660. exclog    endp
  661.  
  662.  
  663. ;--------------------------------
  664. ; Exc Lock Set    func(203) (CBH)
  665. ;
  666. ; call exclcks(ReturnCode%, Mode%)
  667. ;
  668.  
  669. exclcks proc    far
  670.     mov    ah,0CBH
  671.     call    arg1
  672.     ret    4
  673. exclcks endp
  674.  
  675.  
  676.  
  677. ;--------------------------------
  678. ; Exclusive file unlock (204) (CC)
  679. ;
  680. ; call exculkf(ReturnCode%, fcb$)
  681. ;
  682.  
  683. exculkf proc    far
  684.     mov    ah,0CCH
  685.     call    arg1f
  686.     ret    4
  687. exculkf endp
  688.  
  689.  
  690.  
  691. ;--------------------------------
  692. ; Exclusive Unlock Set (205)(CD)
  693. ;
  694. ; call exculks(ReturnCode%)
  695. ;
  696.  
  697. exculks proc    far
  698.     mov    ah,0CDH
  699.     call    arg0
  700.     ret    2
  701. exculks endp
  702.  
  703.  
  704.  
  705. ;--------------------------------
  706. ; Exc Clear file func(206) (CEH)
  707. ;
  708. ; call excclrf(ReturnCode%, fcb$)
  709. ;
  710.  
  711. excclrf proc    far
  712.     mov    ah,0CEH
  713.     call    arg1f
  714.     ret    4
  715. excclrf endp
  716.  
  717.  
  718.  
  719. ;--------------------------------
  720. ; Exc Clear Set  func(207) (CFH)
  721. ;
  722. ; call excclrs(ReturnCode%)
  723. ;
  724.  
  725. excclrs proc    far
  726.     mov    ah,0CFH
  727.     call    arg0
  728.     ret    2
  729. excclrs endp
  730.  
  731.  
  732.  
  733. ;--------------------------------
  734. ; Log Record(s) func(208) (D0H)
  735. ;
  736. ; call reclog(ReturnCode%,String$,Flags%,Timeout%)
  737. ;
  738.  
  739. reclog    proc    far
  740.     mov    ah,0D0H
  741.     call    arg1a
  742.     ret    4
  743. reclog    endp
  744.  
  745. ;---------------------------------
  746. ; Record Lock func(209) (D1H)  for both old and new lock modes
  747. ;
  748. ; call reclck(ReturnCode%, Mode%) 
  749. ;
  750.  
  751. reclck    proc    far
  752.     push    bp
  753.            mov    bp,sp
  754.            mov     ah,0C6h
  755.     mov    al,02h
  756.     int    21h
  757.     cmp    al,01
  758.     je    newmd
  759.     mov    ah,0D1H
  760.     call    arg1
  761.     jmp    finish
  762. newmd:
  763.     push    bp
  764.     mov    ah,0D1h
  765.     mov    si,[bp+6]
  766.     mov    bp,[si]
  767.     int    21h
  768.     pop    bp
  769.     mov    ah,0
  770.     mov    di,[bp+8]
  771.     mov    [di],ax
  772. finish:
  773.     pop    bp
  774.     ret    4
  775.  
  776. reclck    endp
  777.  
  778.  
  779.  
  780. ;--------------------------------
  781. ; Record Unlock func(210) (D2H)
  782. ;
  783. ; call reculk(ReturnCode%,String$)
  784. ;
  785.  
  786. reculk    proc    far
  787.     mov    ah,0D2H
  788.     call    arg1a
  789.     ret    4
  790. reculk    endp
  791.  
  792.  
  793.  
  794. ;--------------------------------
  795. ; Unlock Record Set func(211) (D3H)
  796. ;
  797. ; call reculks(ReturnCode%)
  798. ;
  799.  
  800. reculks proc    far
  801.     mov    ah,0D3H
  802.     call    arg0
  803.     ret    2
  804. reculks endp
  805.  
  806.  
  807.  
  808. ;--------------------------------
  809. ; Record Clear func(212) (D4H)
  810. ;
  811. ; call recclr(ReturnCode%, Semaphore$)
  812. ;
  813.  
  814. recclr    proc    far
  815.     mov    ah,0D4H
  816.     call    arg1a
  817.     ret    4
  818. recclr    endp
  819.  
  820.  
  821.  
  822. ;--------------------------------
  823. ; Clear record set func(213) (D5H)
  824. ;
  825. ; call recclrs(ReturnCode%)
  826. ;
  827.  
  828. recclrs proc    far
  829.     mov    ah,0D5H
  830.     call    arg0
  831.     ret    2
  832. recclrs endp
  833.  
  834.  
  835.  
  836. ;--------------------------------
  837. ; End of Job  func(214) (D6H)
  838. ;
  839. ; call eoj(ReturnCode%)
  840. ;
  841.  
  842. eoj    proc    far
  843.     mov    ah,0D6H
  844.     call    arg0
  845.     ret    2
  846. eoj    endp
  847.  
  848.  
  849.  
  850. ;--------------------------------
  851. ; Logout System  func(215) (D7H)
  852. ;
  853. ; call sysout(ReturnCode%)
  854. ;
  855.  
  856. sysout    proc    far
  857.     mov    ah,0D7H
  858.     call    arg0
  859.     ret    2
  860. sysout    endp
  861.  
  862.  
  863. ;--------------------------------
  864. ; func(216) (D8H)
  865. ;
  866. ; call allocr OBSOLETE FUNCTION
  867. ;
  868.  
  869. allocr    proc    far
  870. allocr    endp
  871.  
  872.  
  873. ;--------------------------------
  874. ; Logout System  func(217) (D9H)
  875. ;
  876. ; call dallocr OBSOLETE FUNCTION
  877. ;
  878.  
  879. dallocr    proc    far
  880. dallocr    endp
  881.  
  882.  
  883. ;--------------------------------
  884. ; Vol Statistics func(218) (DAH)
  885. ;
  886. ; call volstat(volume%, reply$)
  887.  
  888. volstat proc    far
  889.     mov    ah,0DAh
  890.     push    bp
  891.     mov    bp,sp
  892.     mov    si,[bp+8];addr for the volume number
  893.     mov    dx,[si]   ;get the volume number
  894.     mov    di,[bp+6] ;ptr to var desc block for reply buffer
  895.     mov    cx,[di+1]   ;add 1 to get the address of the string
  896.     mov    di,cx        ;put it in di
  897.     int    21h
  898.     pop    bp
  899.     ret    4
  900. volstat endp
  901.  
  902.  
  903.  
  904. ;--------------------------------
  905. ; Local Disks  func(219) (DBH)
  906. ;
  907. ; call locdrv(NumDisks%)
  908. ;
  909.  
  910. locdrv    proc    far
  911.     mov    ah,0DBH
  912.     call    arg0
  913.     ret    2
  914. locdrv endp
  915.  
  916.  
  917.  
  918. ;--------------------------------
  919. ; WorkStation ID func(220) (DCH)
  920. ;
  921. ; call wsid(ThisStationNum%)
  922. ;
  923.  
  924. wsid   proc    far
  925.        mov     ah,0DCH
  926.        call    arg0
  927.        ret     2
  928. wsid   endp
  929.  
  930.  
  931. ;--------------------------------
  932. ; Set Error mode func(221) (DDH)
  933. ;
  934. ; call errmode(mode%)
  935. ;
  936.  
  937.  
  938. errmode proc    far
  939.     mov    ah,0DDH
  940.     call    arg1wor
  941.     ret 2    
  942. errmode endp
  943.  
  944.  
  945.  
  946. ;--------------------------------
  947. ; Brodcast Mode func(222) (DEH)
  948. ;
  949. ; call bcsmode(mode%)
  950. ;
  951.  
  952.  
  953. bcsmode proc    far
  954.     mov    ah,0DEH
  955.     call    arg1wor
  956.     ret    2
  957. bcsmode endp
  958.  
  959.  
  960.  
  961. ;--------------------------------
  962. ; Modify LST Device  func(223) (DFH)
  963. ;
  964. ; call ctlspl(mode%)
  965. ;
  966.  
  967. ctlspl    proc    far
  968.     push    bp
  969.     mov    bp,sp
  970.     mov    si,[bp+6]
  971.     mov    dx,[si]
  972.     mov    ah,0DFh
  973.     int     21h
  974.     mov    ah,0
  975.     mov    di,[bp+6]
  976.     mov    [di],ax
  977.     pop    bp
  978.     ret    2
  979. ctlspl    endp
  980.  
  981.  
  982.  
  983. ;--------------------------------
  984. ; Spool Request func(224) (E0H)
  985. ;
  986. ; call splreq(ErrCode%, RequestBlock$, Reply$)
  987. ;
  988.  
  989. splreq    proc    far
  990.     mov    ah,0E0h
  991.     call    req_rep
  992.     ret    6
  993. splreq    endp
  994.  
  995.  
  996.  
  997. ;--------------------------------
  998. ; Pipe Request func(225) (E1H)
  999. ;
  1000. ;
  1001. ; call pipreq(ErrCode%, RequestBlock$, Reply$)
  1002. ;
  1003.  
  1004. pipreq    proc    far
  1005.     mov    ah,0E1h
  1006.     call    req_rep
  1007.     ret    6
  1008. pipreq    endp
  1009.  
  1010.  
  1011.  
  1012. ;--------------------------------
  1013. ; Directory Path func(226) (E2H)
  1014. ;
  1015. ; call dpath(ReturnCode%, RequestBlock$, Reply$)
  1016. ;
  1017.  
  1018. dpath    proc    far
  1019.     mov    ah,0E2h
  1020.     call    req_rep
  1021.     ret    6
  1022. dpath    endp
  1023.  
  1024.  
  1025.  
  1026. ;--------------------------------
  1027. ; Login system func(227) (E3H)
  1028. ;
  1029. ; call syslog(ReturnCode%, RequestBlock$, Reply$)
  1030. ;
  1031.  
  1032. syslog    proc    far
  1033.     mov    ah,0E3h
  1034.     call    req_rep
  1035.     ret    6
  1036. syslog    endp
  1037.  
  1038.  
  1039.  
  1040. ;--------------------------------
  1041. ; Set File Attribute func(228) (E4H)
  1042. ;
  1043. ; call fattr(ReturnCode%, fcb$, Attribute%)
  1044. ;
  1045.  
  1046. fattr    proc    far
  1047.     push    bp
  1048.     mov    bp,sp
  1049.     mov    si,[bp+6]
  1050.     mov    cx,[si]  ;cx=attribute
  1051.     mov    si,[bp+8]
  1052.     mov    dx,[si+1]  ;dx=address of fcb
  1053.     mov    ah,0E4h
  1054.     int    21h
  1055.     mov    ah,0
  1056.     mov    di,[bp+10]; address of the return code
  1057.     mov    [di],ax  ;save the return code
  1058.     pop    bp
  1059.     ret    6
  1060. fattr    endp
  1061.  
  1062.  
  1063.  
  1064. ;--------------------------------
  1065. ; Update file size func(229) (E5H)
  1066. ;
  1067. ; call updfcb(ErrCode%,fcb$)
  1068. ;
  1069.  
  1070. updfcb    proc    far
  1071.     mov    ah,0E5H
  1072.     call    arg1f
  1073.     ret    4
  1074. updfcb    endp
  1075.  
  1076.  
  1077.  
  1078. ;--------------------------------
  1079. ; Copy File to File func(230) (E6H)
  1080. ;
  1081. ; call cpyfile(ReturnCode%, FcbSource, FcbDest, CountLow, CountHigh)
  1082. ;
  1083. ; where count-low is the low 16 or 32 bits
  1084. ; specifing the number of bytes to copy
  1085. ; the resulting values are saved back into
  1086. ; these variables
  1087. ;
  1088.  
  1089. cpyfile proc    far            ;
  1090.     mov    ah,0E6h
  1091.     push    bp
  1092.     mov    bp,sp
  1093.     mov    si,[bp+6]   ;addr of the high byte cnt
  1094.     mov    cx,[si]     ;cx=high word of byte cnt
  1095.     mov    si,[bp+8] ;addr low word of byte cnt
  1096.     mov    dx,[si]     ;dx=low 16 bits of count
  1097.     mov    si,[bp+10] ;address of dest fcb
  1098.     mov    di,[si+1]     ;di=addr of dest fcb
  1099.     mov    si,[bp+12] ;address of the source fcb
  1100.     mov    si,[si+1]     ;si=addr of the source fcb
  1101.     int    21h
  1102.     mov    si,[bp+6]   ;get addr of high count
  1103.     mov    [si],cx     ;save high count
  1104.     mov    si,[bp+8] ;get addr of low count
  1105.     mov    [si],dx     ;save remaining low count
  1106.     mov    si,[bp+14] ;address of return code
  1107.     mov    ah,0
  1108.     mov    [si],ax   ;save error code
  1109.     pop    bp
  1110.     ret    10
  1111. cpyfile endp
  1112.  
  1113.  
  1114.  
  1115. ;--------------------------------
  1116. ; get time / date string func(231) (E7H)
  1117. ;
  1118. ; call nettod(time$)
  1119. ; where time is a string of the form Y M D H M S
  1120. ;
  1121.  
  1122. nettod    proc    far
  1123.     mov    ah,0E7h
  1124.     call    arg1awor
  1125.     ret    2
  1126. nettod    endp
  1127.  
  1128.  
  1129.  
  1130. ;--------------------------------
  1131. ; Set Close mode func(232) (E8H)
  1132. ;
  1133. ; call clsmode(mode%)
  1134. ;
  1135.  
  1136. clsmode proc    far
  1137.     mov    ah,0E8H
  1138.     call    arg1wor
  1139.     ret    2
  1140. clsmode endp
  1141.  
  1142.  
  1143. ;--------------------------------
  1144. ; Shell Base Status func(233) (E9H)
  1145. ;
  1146. ;
  1147. ; call drvmap(ReturnFlags%, drive%)
  1148.  
  1149. drvmap    proc    far
  1150.     push    bp
  1151.     mov    bp,sp
  1152.     mov    ax,0E900h
  1153.     mov    si,[bp+6]
  1154.     mov    dx,[si]    ;dx gets the argument
  1155.     int    21h
  1156.     mov    di,[bp+8] ;addr to put the ret code into
  1157.     mov    [di],ax    ;save the result
  1158.     pop    bp
  1159.     ret    4
  1160. drvmap    endp
  1161.  
  1162.  
  1163. ;--------------------------------
  1164. ; Return Shell Version func(234) (EAH)
  1165. ;
  1166. ; call retshl(RetCode%, Mode%)
  1167. ;
  1168.  
  1169. retshl    proc    far
  1170.     mov    ah,0EAh
  1171.     call    arg1
  1172.     ret    4
  1173. retshl    endp
  1174.  
  1175.  
  1176. ;--------------------------------
  1177. ; ascii log File (235) (EB)
  1178. ;
  1179. ; call asclog(RetCode%, Asciiz$)
  1180. ;
  1181.  
  1182. asclog    proc    far
  1183.     mov    ah,0EBH
  1184.     call    arg1a
  1185.     ret    4
  1186. asclog    endp
  1187.  
  1188.  
  1189. ;--------------------------------
  1190. ; ASCIIZ file unlock (236) (EC)
  1191. ;
  1192. ; call asculkf(RetCode%, Asciiz$)
  1193. ;
  1194.  
  1195. asculkf proc    far
  1196.     mov    ah,0ECH
  1197.     call    arg1a
  1198.     ret    4
  1199. asculkf endp
  1200.  
  1201.  
  1202. ;--------------------------------
  1203. ; ASCIIZ Clear file func(237) (EDH)
  1204. ;
  1205. ; call ascclrf(RetCode%, Asciiz$)
  1206. ;
  1207.  
  1208. ascclrf proc    far
  1209.     mov    ah,0EDH
  1210.     call    arg1a
  1211.     ret    4
  1212. ascclrf endp
  1213.  
  1214.  
  1215.  
  1216. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1217. ;
  1218. ; Get Physical Station Number  EEH
  1219. ;
  1220. ; call Get_PSN(StationNo%)
  1221. ;
  1222.  
  1223. Get_PSN proc    far
  1224.  
  1225.     push    bp
  1226.     mov    bp,sp
  1227.     mov    ah,0EEh
  1228.     int    21h
  1229.     mov    ah,0
  1230.     mov    di,[bp+6]
  1231.     mov    [di],ax
  1232.     pop    bp
  1233.     ret    2
  1234.  
  1235. Get_PSN endp
  1236.  
  1237.  
  1238. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1239. ;
  1240. ; Get Shell Table Addresses (239) EFH
  1241. ;
  1242. ; call Get_STA(Mode%,Segment%,Offset%)
  1243. ;
  1244.  
  1245. Get_STA proc    far
  1246.     push    es
  1247.     push    bp
  1248.     mov    bp,sp
  1249.     mov    si,[bp+12]        ;get the mode
  1250.     mov    ax,[si]
  1251.     mov    ah,0EFh         ;set the function
  1252.     int    21h
  1253.     mov    di,[bp+10]        ;segment location
  1254.     mov    [di],es
  1255.     mov    di,[bp+8]        ;offset location
  1256.     mov    [di],si
  1257.     pop    bp
  1258.     pop    es
  1259.     ret    6
  1260. Get_STA endp
  1261.  
  1262.  
  1263. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1264. ;
  1265. ; Set Preferred File Server (240) F0H
  1266. ;
  1267. ; call SetServ(Mode%,NewServ%,CurrServ%)
  1268. ;
  1269.  
  1270. SetServ proc    far
  1271.     push    bp
  1272.     mov    bp,sp
  1273.     mov    si,[bp+10]        ;get the mode
  1274.     mov    ax,[si]
  1275.     mov    si,[bp+8]           ;set the preferred server number
  1276.     mov    dx,[si]
  1277.     mov    ah,0F0h         ;set the function
  1278.     int    21h
  1279.     mov    ah,0
  1280.     mov    di,[bp+6]        ;Current server
  1281.     mov    [di],ax
  1282.     pop    bp
  1283.     ret    6
  1284. SetServ endp
  1285.  
  1286.  
  1287. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1288. ;
  1289. ; Attach/Detach To File Server (241) F1H
  1290. ;
  1291. ; call ModServ(Mode%,NewServ%,RetCode%)
  1292. ;
  1293.  
  1294. ModServ proc    far
  1295.     push    bp
  1296.     mov    bp,sp
  1297.     mov    si,[bp+10]        ;get the mode
  1298.     mov    ax,[si]
  1299.     mov    si,[bp+8]           ;set the preferred server number
  1300.     mov    dx,[si]
  1301.     mov    ah,0F1h         ;set the function
  1302.     int    21h
  1303.     mov    ah,0
  1304.     mov    di,[bp+6]        ;Return Code
  1305.     mov    [di],ax
  1306.     pop    bp
  1307.     ret    6
  1308. ModServ endp
  1309.  
  1310. ;---------------------------
  1311. ;
  1312. ; Get Current Disk - DOS function 19H
  1313. ;
  1314. ; call GetDrv(Drive%)
  1315. ;
  1316.  
  1317. GetDrv    proc    far
  1318.     push    bp
  1319.     mov    bp,sp
  1320.     mov    ah,19h            ;set the function
  1321.     int    21h
  1322.     mov    ah,0
  1323.     mov    di,[bp+6]
  1324.     mov    [di],ax         ;return the drive
  1325.     pop    bp
  1326.     ret    2
  1327. GetDrv    endp
  1328.  
  1329. ;--------------------------------------
  1330. ; Set Default spool flags func(184) (B8h)
  1331. ;
  1332. ; call setspl(buffer$,mode%)
  1333. ;
  1334.  
  1335. setspl    proc    far
  1336.     push    bp
  1337.         mov     bp,sp
  1338.     push    es
  1339.     push    ds
  1340.     pop    es
  1341.     mov    si,[bp+6]    ;load mode into al
  1342.     mov    ax,[si]
  1343.     mov    ah,0B8h
  1344.     mov    si,[bp+8]    ;load size into cx and buff into es:bx
  1345.     mov    cx,[si]
  1346.     xor    ch,ch
  1347.     mov    bx,[si+1]
  1348.     int    21h
  1349.     pop    es
  1350.     pop    bp
  1351.     ret    4
  1352. setspl    endp
  1353.  
  1354.  
  1355. ;--------------------------------
  1356. ;Logical record log and lock(208) (D0H)
  1357. ;
  1358. ; call loglck(returncode%,recname$,flags%,timeout%) Only use for lock mode 01
  1359. ;
  1360.  
  1361. loglck    proc    far
  1362.     push    bp
  1363.     mov    bp,sp
  1364.     mov    di,[bp+10]    ;get address of string structure
  1365.     mov    dx,[di+1]    ;add 1 to get string address
  1366.     mov    di,[bp+8]    ;get flags
  1367.     mov    ax,[di]
  1368.     push    bp
  1369.     mov    bp,[bp+6]    ;load time out value
  1370.     mov    bp,[bp]
  1371.     mov    ah,0D0H
  1372.     int    21H
  1373.     pop    bp
  1374.     mov    ah,0
  1375.     mov    di,[bp+12]    ;load return code
  1376.     mov    [di],ax
  1377.     pop    bp
  1378.     ret    8
  1379. loglck    endp
  1380.  
  1381.  
  1382.  
  1383.  
  1384. ;--------------------------------
  1385. ; Process a single integer argument in a
  1386. ; function call with the return code on the front
  1387.  
  1388. arg1    proc    near
  1389.     push    bp
  1390.     mov    bp,sp
  1391.     mov    si,[bp+8]
  1392.     mov    dx,[si]    ;dx gets the argument
  1393.     int    21h
  1394.     mov    ah,0       ;clear ah for al return code
  1395.     mov    di,[bp+10] ;addr to put the ret code into
  1396.     mov    [di],ax    ;save the result
  1397.     pop    bp
  1398.     ret
  1399. arg1    endp
  1400.  
  1401.  
  1402.  
  1403. ;--------------------------------
  1404. ; Process an fcb address in a
  1405. ; function call with the return code on the front
  1406.  
  1407. arg1f    proc    near
  1408.     push    bp
  1409.     mov    bp,sp
  1410.     mov    si,[bp+8]
  1411.     mov    dx,[si+1]  ;dx gets the argument
  1412.     int    21h
  1413.     mov    ah,0       ;clear ah for al return code
  1414.     mov    di,[bp+10] ;addr to put the ret code into
  1415.     mov    [di],ax    ;save the result
  1416.     pop    bp
  1417.     ret
  1418. arg1f    endp
  1419.  
  1420.  
  1421. ;--------------------------------
  1422. ; Process a single string argument in a
  1423. ; function call with the return code on the front
  1424.  
  1425. arg1a    proc    near
  1426.     push    bp
  1427.     mov    bp,sp
  1428.     mov    di,[bp+8] ;ptr to var desc block for parameter string
  1429.     mov    cx,[di+1]   ;add 1 to get the address of the string
  1430.     mov    di,cx        ;put it in di
  1431.     mov    dx,di
  1432.     int    21h
  1433.     mov    ah,0      ;clear ah for al return code
  1434.     mov    di,[bp+10];addr for the ret code var.
  1435.     mov    [di],ax   ;save the result
  1436.     pop    bp
  1437.     ret
  1438. arg1a    endp
  1439.  
  1440.  
  1441.  
  1442. ;----------------------------
  1443. ; Perform a single integer argument
  1444. ; but without a return code
  1445.  
  1446. arg1wor proc    near
  1447.     push    bp
  1448.     mov    bp,sp
  1449.     mov    si,[bp+8]
  1450.     mov    dx,[si]   ;dx gets the arg (or ptr)
  1451.     int    21h
  1452.     pop    bp
  1453.     ret
  1454. arg1wor endp
  1455.  
  1456.  
  1457. ;----------------------------
  1458. ; Perform a single string argument
  1459. ; but without a return code
  1460.  
  1461. arg1awor proc    near
  1462.     push    bp
  1463.     mov    bp,sp
  1464.     mov    si,[bp+8]
  1465.     mov    dx,[si+1]
  1466.     int    21h
  1467.     pop    bp
  1468.     ret
  1469. arg1awor endp
  1470.  
  1471. ;--------------------------------
  1472. ; Process no arguments - only a return code
  1473.  
  1474. arg0    proc    near
  1475.     push    bp
  1476.     mov    bp,sp
  1477.     int    21h
  1478.     mov    ah,0
  1479.     mov    di,[bp+8]
  1480.     mov    [di],ax
  1481.     pop    bp
  1482.     ret
  1483. arg0    endp
  1484.  
  1485.  
  1486. ;----------------------------
  1487. ; Handle a request$ and reply$ function
  1488. ; with error code
  1489.  
  1490. req_rep proc    near
  1491.     push    bp
  1492.     mov    bp,sp
  1493.     push    es
  1494.     push    ds
  1495.     pop     es
  1496.     mov    si,[bp+10] ;ptr to var desc block for req. string
  1497.     mov    cx,[si+1]   ;add 1 to get the address of the string
  1498.     mov    si,cx        ;put it in si
  1499.     mov    di,[bp+8] ;ptr to var desc block for reply buf
  1500.     mov    cx,[di+1]   ;add 1 to get the address of the string
  1501.     mov    di,cx        ;put it in di
  1502.     pushf              ;save the direction flag
  1503.     int    21h
  1504.     popf
  1505.     pop    es
  1506.     mov    si,[bp+12] ;address for error
  1507.     mov    ah,0
  1508.     mov    [si],ax     ;save error code
  1509.     pop    bp
  1510.     ret
  1511. req_rep endp
  1512.  
  1513.  
  1514. subseg    ends
  1515.  
  1516.  
  1517.  
  1518. RLOADER segment byte 'RLOAD'
  1519.     assume    cs:RLOADER,ss:RStack
  1520.  
  1521. EndRes    equ    $
  1522.  
  1523. LOADER    proc    far            ;Entry from DOS
  1524.     push    es            ;Setup stack to contain a vector
  1525.     xor    ax,ax            ; so RET will return a INT 27H
  1526.     push    ax            ;  instruction at offset 0 in PSP.
  1527.     mov    byte ptr es:1,27H    ;Change INT 20H to INT 27H at start of PSP.
  1528.     xor    ax,ax            ;clear AX register
  1529.     mov    es,ax            ;set ES: to segment 0
  1530.  
  1531.     assume    es:SegZero        ;ES: ref. segment 0
  1532.  
  1533. ;Pass offset to entry point of interface module to the ComArea Vector as
  1534. ;well as the interface module segment.    Pass offset of the end of the
  1535. ;resident code in the DX register.  At exit CS will point to the PSP
  1536. ;which has the exit instruction 27H.
  1537.  
  1538.  
  1539.     mov    ComArea_Off,offset Subrt
  1540.     mov    ComArea_Seg,seg Subrt
  1541.     mov    dx,offset Grp:EndRes+100H
  1542.     ret
  1543. LOADER    endp
  1544. RLOADER ends
  1545.  
  1546. RStack    segment para stack 'STACK'
  1547.     db    16 dup ("STACK")        ;Stack local to Load proc.
  1548. RStack    ends
  1549.     end
  1550.