home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / assembler / thesource / volume2 / source / system / asmmacros.lha / CreateDir.i < prev    next >
Encoding:
Text File  |  1990-11-16  |  1.2 KB  |  39 lines

  1.      NOLIST
  2. CreateDir   MACRO              ; 14 Jan 88
  3. *------------------------------; Start of CreateDir macro.
  4.      NOLIST
  5.      IFC '\2','I'              ; If <PointerToDirName> is specified, then
  6.      LIST
  7.                                ; Put <PointerToDirName> in D1.
  8.      MOVE.L #\3,D1
  9.      NOLIST
  10.      ENDC
  11.      IFC '\2','D'              ; If <DirName> is specified, then
  12.      LIST
  13.                                ; Make D1 point to the directory name string.
  14.      MOVE.L #\3.str,D1
  15.      NOLIST
  16.      IFND \3.str               ; Unless it was previously defined,
  17.      LIST
  18.      SECTION DataSection,DATA  ; The ASCII directory name string goes here.
  19. \3.str:
  20.      DC.B '\3',0
  21.      CNOP 0,2
  22.      SECTION   "",CODE
  23.      NOLIST
  24.      ENDC
  25.      ENDC
  26.      LIST
  27.      CallLib CreateDir,dos     ; Call CreateDir to create the directory.
  28.                                ; Put the dir read lock at <DirLockName>.
  29.      MOVE.L D0,\1
  30.      SECTION   BSS_Section,BSS
  31.      CNOP 0,2
  32. \1:
  33.      DS.L 1                    ; This is the location of <DirLockName>.
  34.      SECTION   "",CODE
  35.      TST.L D0                  ; Make the zero flag indicate failure.
  36. *------------------------------; End of CreateDir macro.
  37.      ENDM
  38.      LIST
  39.