Dec BP JMP Repeat
Dec BP JMP Repeat
JMP Repeat
Quit:
RET
;;
;;
; create c:\emu8086\vdrive\C\test1
int 21h
; create c:\emu8086\MyBuild\test2
int 21h
; rename directory: c:\emu8086\MyBuild\test2 to c:\emu8086\MyBuild\newname
int 21h
mov cx, 0
int 21h
jc err
mov handle, ax
; write to file:
int 21h
; close c:\emu8086\vdrive\C\test1\file1.txt
int 21h
; rename fileL c:\emu8086\vdrive\C\test1\file1.txt to c:\test1\newfile.txt
int 21h
int 21h
int 21h
mov cx, 0
int 21h
jc err2
mov handle, ax
; seek:
mov al, 0
mov cx, 0
mov dx, 10
int 21h
; write to file:
int 21h
; seek:
mov al, 0
mov cx, 0
mov dx, 2
int 21h
; write to file:
int 21h
; close c:\emu8086\MyBuild\t1.txt
mov ah, 3eh
int 21h
err2:
nop
int 21h
int 21h
; Program Nou
;org 100h
;jmp start
; c:\emu8086\MyBuild
; c:\emu8086\vdrive\
; relative paths such as "c:\mydir\..\autoexec.bat" are disabled for the same reasons.
; declarations:
; 00 1 buffer size
;filename db 30,?, 30 dup(' ') ; file name should be in 8.3 - dos compatible format.
; file handle:
;handle dw 0
;jmp m1
; mov ah, 9
; int 21h
; input a string:
; int 21h
;jmp m2
; mov ah, 9
; int 21h
; input filename:
; int 21h
; xor bx, bx
; mov filename[bx+2], 0
; mov cx, 0
; int 21h
; jc error
; mov handle, ax
; xor cx, cx
; int 21h
; jc error
; close file
; int 21h
; jc error
; int 21h
; jc error
; mov handle, ax
; xor cx, cx
; int 21h
; jc error
; mov t2[1], al
; close file
; int 21h
; jc error
;jmp m3
; mov ah, 9
; int 21h
; xor bx, bx
; mov ah, 9
; int 21h
; jmp ok
;error: jmp m5
; msg5 db 0Dh,0Ah,"error...",0Dh,0Ah,'$'
; mov ah, 9
; int 21h
;
;ok:
;jmp m4
; mov ah, 9
; int 21h
; mov ah, 0
; int 16h
; int 21h
name "Evaluare_2"
Crearea mapei
Codul
name "exerc2"
org 100h
jmp start
dir1 db "c:\Mapa_1", 0
dir2 db "c:\Mapa_2", 0
file1 db "c:\Mapa_1\File_1.txt", 0
file2 db "c:\Mapa_2\File_2.txt", 0
handle dw ?
start:
mov ax, cs
mov dx, ax
mov es, ax
; create c:\emu8086\vdrive\Mapa_1
int 21h
; create c:\emu8086\vdrive\Mapa_2
int 21h
mov cx, 0
int 21h
mov handle, ax
; write to file:
int 21h
; create and open file: c:\emu8086\vdrive\Mapa_2\File_2.txt
mov cx, 0
int 21h
mov handle, ax
; write to file:
int 21h
ret