PDA

View Full Version : فایل



سارا کامپایلر
یک شنبه 04 بهمن 1388, 18:44 عصر
وقفه مورد نیاز برای تعویض دایرکتوری و کپی فایل خواستم

$ M 3 H R D A D $
یک شنبه 04 بهمن 1388, 19:03 عصر
این کار با دایرکتوره ببین نیازتو رفع میکنه همینو اشتم



.model small
clrscr macro
mov ah,06h
mov al,25
mov cx,0
mov dh,25
mov dl,80
mov bh,0fh
int 10h
gotoxy row,col
endm
;***************************
;****************************
showerror macro
mov ah,09h
int 21h
call readchar
endm
;***************************
gotoxy macro row,col
mov ah,02h
mov dh,row
mov dl,col
mov bh,0
int 10h
endm
;***************************
.stack 64

.data
intruptdeletedirectory equ 3ah
lenstring dw ?
strerror db 'Error To Run Command.$'
rstrf label byte
max db 30
len dw ?
path db 30 dup('$')
mdd db "enter directory for delete :","$"
mcd db "Enter Directory For Create :","$"
mfd db "Enter File Name For Delete :","$"
number db ?
row db 0
col db 0
prompt db "farman:\$"
num db " ","$"
;***********
.code
main proc far
mov ax,@data
mov ds,ax
clrscr
Repeat:
add row,1
gotoxy row,col
lea dx,prompt
call display

call readchar
add row,2

cmp number,'1'
je Item1
cmp number,'2'
je Item2
cmp number,'3'
je Item3
cmp number,'4'
je Item4
cmp number,'5'
je Item5
cmp number,'6'
je Item6
cmp number,'7'
je Item7
;cmp number,'8'
;je Item8
jmp Repeat
;Item7:
;call helps
;jmp repeat
Item1:
lea dx,prompt
mov row,0
mov col,0
clrscr
jmp Repeat
Item2:
call CreateDirectory
jmp Repeat
Item3:
call time
jmp Repeat
Item4:
call DeleteDirectory
jmp Repeat
Item5:
call DATE
jmp Repeat
Item6:
call Deletefile
jmp Repeat
Item7:
mov ax,4c00h
int 21h
jmp Repeat
ret

main endp
;***************************
display proc near
mov ah,09h
int 21h
ret
display endp
;***************************
;***************************
readchar proc near
mov ah,01h
int 21h
mov number,al
ret
readchar endp
;***************************
;***************************
time proc near

gotoxy row,col
CALL TIMEr
MOV AL,CH
CALL DISPLA1
CALl COLON
MOV AL,CL
CALL DISPLA1
CALL COLON
MOV AL,DH
CALL DISPLA1
;mov ax,4c00h
;int 21h
ret
time endp
;***************************
DATE PROC NEAR
gotoxy row,col
CALL dater
MOV AL,CL
CALL DISPLA1
MOV AL,CH
CALL DISPLA1
CALL COLON
MOV AL,DH
CALL DISPLA1
CALL COLON
MOV AL,Dl
CALL DISPLA1
;mov ax,4c00h
;int 21h
ret
DATE ENDP
;***************************
TIMEr PROC NEAR
MOV AH,2CH
INT 21H
RET
TIMEr ENDP
;_________________________________________________ _____
dater PROC NEAR
mov ah,2ah
int 21h
RET
dater ENDP
;_________________________________________________ _____
COLON PROC NEAR
PUSH DX
MOV DL,':'
MOV AH,02H
INT 21H
POP DX
RET
COLON ENDP
;_________________________________________________ _____
DISPLA1 PROC NEAR
PUSH DX
MOV BL,10
MOV AH,00H
DIV BL
MOV BX,AX
ADD BL,30H
MOV AH,02H
MOV DL,BL
INT 21H
ADD BH,30H
MOV DL,BH
INT 21H
POP DX
RET
DISPLA1 ENDP
;*******************************************
;***************************
DeleteDirectory proc near
lea dx,mdd
call display
lea dx,rstrf
call getstring
call getlenstring
mov si,lenstring
mov path[si],00h
lea dx,path-1
mov ah,3ah ;intruptdeletedirectory
int 21h
jnc DDk
lea dx,strerror
showerror
DDk:
ret
DeleteDirectory endp
;***************************
;***************************
CreateDirectory proc near
lea dx,mcd
call display
lea dx,rstrf
call getstring
call getlenstring
mov si,lenstring
mov path[si],00h
lea dx,path-1
mov ah,39h ;intruptcreatedirectory
int 21h
jnc CDk
lea dx,strerror
showerror
CDk:
ret
CreateDirectory endp
;***************************
;***************************
getstring proc near
mov ah,0ah
int 21h
ret
getstring endp
;***************************
getlenstring proc near
lea bx,path
mov cx,0
mov si,0
lop1:
cmp byte ptr [bx+si],13
je exit1
inc si
inc cx
jmp lop1
exit1:
mov lenstring,cx
ret
getlenstring endp

;***************************
Deletefile proc near
lea dx,mfd
call display
lea dx,rstrf
call getstring
call getlenstring
mov si,lenstring
mov path[si],00h
lea dx,path-1
mov ah,41h
int 21h
jnc DeletefileOk
lea dx,strerror
showerror
DeletefileOk:
ret
Deletefile endp
;***************************
end main

$ M 3 H R D A D $
یک شنبه 04 بهمن 1388, 19:16 عصر
کپی و این هارو باید شبیه سازی کنی