home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CPM3 / CCP105P.ARK / SUBMOD1.ASM < prev    next >
Assembly Source File  |  1986-10-17  |  1KB  |  58 lines

  1. ;
  2. ;Patch to allow Submit to execute .SUB files from different
  3. ;user numbers.  The user number is passed in the SCB from the CCP.
  4. ;The SYSINxx.$$$ file is always created in user 0 of the submit drive
  5. ;
  6.  
  7. bdos    equ    5
  8. getscb    equ    3e4h
  9. read    equ    38fh
  10. open    equ    35ch
  11. start    equ    278h
  12.  
  13.     org    103h
  14.  
  15.     mvi    c,3ah
  16.     call    getscb        ;get address of System control block
  17.     mvi    l,0e0h        ;point to BDOS user number
  18.     shld    useraddr
  19.     mov    a,m        ;get current user
  20.     sta    subuser        ;save it
  21.     xra    a        ;set to zero
  22.     mov    m,a        ;set user number to zero
  23.     mvi    l,0a4h        ;point to submit user number
  24.     mov    a,m
  25.     ani    1fh        ;strip of high bits
  26.     jz    start        ;jump if no sub user
  27.     dcr    a        ;adjust
  28.     sta    subuser        ;save submit user
  29.     jmp    start
  30.  
  31. testuser:
  32.     lda    subuser        ;get submit file user
  33.     lhld    useraddr    ;get user number addr in SCB
  34.     mov    m,a        ;set the BDOS user #
  35.     push    h
  36.     call    bdos        ;do the function
  37.     pop    b
  38.     push    psw        ;save return code
  39.     xra    a        ;get current user #
  40.     stax    b        ;set current BDOS user #
  41.     pop    psw
  42.     ret
  43.  
  44. useraddr:
  45.     dw    0
  46. subuser:
  47.     db    0
  48.  
  49.     org    open
  50.  
  51. call    testuser
  52.  
  53.     org    read
  54.  
  55. call    testuser
  56.  
  57.     end
  58.