home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / DIRHIDE1.ZIP / MDSECRET.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-07-17  |  2.2 KB  |  90 lines

  1. PAGE    58,132
  2. TITLE    MDSECRET    11-2-85    [7-17-91]
  3.  
  4. ;Create "secret" directory (untypeable first char in name).
  5. ;v1.1    Toad Hall disassembly, tweak
  6.  
  7. LF    EQU    0AH
  8. CR    EQU    0DH
  9.  
  10. CSEG    SEGMENT
  11.     ASSUME DS:CSEG, SS:CSEG ,CS:CSEG ,ES:CSEG
  12.     ORG    100H
  13. MDSecret    proc    near
  14. ;v1.1    MOV    AX,CS
  15. ;dumb    MOV    DS,AX
  16. ;dumb    MOV    ES,AX
  17.  
  18.     MOV    AH,9            ;display msg
  19.     MOV    DX,OFFSET msg180    ;'Enter name of subdirectory'
  20.     INT    21H
  21.     MOV    AH,0AH            ;buffered kbd input
  22.     MOV    DX,OFFSET buff1B7    ;to this buffer
  23.     INT    21H
  24. ;v1.1    MOV    CH,0
  25.     xor    ch,ch            ;clear msb
  26.     MOV    CL,len1B8        ;actual input length returned by DOS
  27.     MOV    SI,OFFSET buff1B9    ;actual user input or default
  28.     MOV    DI,OFFSET buff1E1    ;move to here
  29.     REPZ    MOVSB
  30.     MOV    DX,OFFSET dirname1E0    ;dir name begins with untypeable char
  31.     MOV    AH,39H            ;make directory
  32.     INT    21H
  33.     JB    L0140            ;failed
  34.  
  35.     MOV    AX,4300H        ;get file attribs from CX
  36.     MOV    DX,OFFSET dirname1E0    ;this directory
  37.     INT    21H            ;but discard the attrib
  38.     MOV    CX,2            ;new file attrib
  39.     MOV    AX,4301H        ;set new dir attrib per CX
  40. ;noneed    MOV    DX,OFFSET dirname1E0    ;this directory
  41.     INT    21H
  42. ;v1.1    INT    20H            ;terminate
  43.     xor    ax,ax            ;ERRORLEVEL 0            v1.1
  44.     jmp    short Terminate        ;                v1.1
  45.  
  46. ;L0140      L0129 CJ
  47. L0140:
  48.     push    ax            ;save create error        v1.1
  49. ;v1.1    ADD    AX,30H    ;'0'
  50.     mov    al,30H    ;'0'        ;asciify error            v1.1
  51.     MOV    err1F9,AL        ;stuff in error msg
  52.     MOV    AH,9            ;display msg
  53.     MOV    DX,OFFSET errmsg1F0        ;'Error #n'
  54.     INT    21H
  55. ;v1.1    INT    20H            ;terminate
  56.     pop    ax            ;restore error in AL        v1.1
  57.  
  58. Terminate:                ;                v1.1
  59.     mov    ah,4CH            ;terminate            v1.2
  60.     int    21H
  61.  
  62. ;v1.1    DB    31H DUP(0)
  63.  
  64. msg180    DB    'Enter name of subdirectory (7 characters maximum) - $'
  65. ;v1.1    DB    0,0
  66.  
  67. ;v1.1    Moving input buffer down to code end
  68.  
  69. ;buff1B7    DB    7        ;max buffered kbd input
  70. ;len1B8        DB    3        ;actual input length (changed by DOS)
  71. ;buff1B9    DB    'abc',CR,'   '    ;user input (changed by DOS)
  72. ;        DB    20H DUP(0)
  73.  
  74. dirname1E0    DB    7FH
  75. buff1E1        DB    'abc'        ;directory name
  76. ;v1.1        DB    0CH DUP(0)
  77.         db    4 dup(0)    ;max 7 chars            v1.1
  78.  
  79. errmsg1F0    DB    LF,'Error # '
  80. err1F9    DB    ' .',CR,LF,'$'
  81.  
  82. buff1B7        DB    7        ;max buffered kbd input
  83. len1B8        DB    3        ;actual input length (changed by DOS)
  84. buff1B9        DB    'abc',CR,'   '    ;user input (changed by DOS)
  85.  
  86. MDSecret    ENDP
  87.  
  88. CSEG    ENDS
  89.     END    MDSecret
  90.