05-07-2011، 10:27 PM
با کد زیر میتونید با اسمبلی یک پوشه بسازید.
کد پیاچپی:
;----------------------------------------------
;CRETING DIRECTORY
; ---------------------------------------------
ermac macro ;//print error message if can't creat directory
lea dx,errormsg
mov ah,09h
int 21h
endm
;//////////////////////////////////
okmac macro ;//print the directory created succsesfuly if it can creat directory
lea dx,okmsg
mov ah,09h
int 21h
endm
;//////////////////////////////////
datasg segment 'code'
dir db 'c:\moji',00h
okmsg db 'the directory created succsesfuly',"$"
errormsg db 'error in creatin directory',"$"
datasg ends
;--------------------------------
codesg segment 'code'
main proc far
assume ds:datasg,cs:codesg
mov ax,datasg
mov ds,ax
lea dx,dir ;/directory name that maust be created
mov ah,39h ;/function for creatin directory
int 21h ;/interupt for creating directory
jnc l1 ;/go to l1 if creating directory is succsess full
ermac ;/call error macro and print error message if can't creat directory
jmp l2 ;/goto end program
l1: okmac ;/call okmac if it can creat directory and print successfull
l2: mov ax,4c00h;/end of program
int 21h
main endp
codesg ends
end main