Scopul lucrarii: studierea sistemului de intreruperi al calculatoarelor personale IBM PC si a sistemului de gestiune a fisierelor, a sistemului de operare MS-DOS.
Sarcina pentru lucrarea de laborator:
Macro.lib
CreateFile MACRO Handle, fileName
mov ah, 3Ch
mov cx, 20h
mov dx, offset fileName
int 21h
mov [Handle], ax
ENDM
OpenFile MACRO Handle, fileName
LOCAL E
mov ah, 3Dh
mov dx, offset fileName
mov al, 02h
int 21h
mov [Handle], ax
cmp ax, 02h
jne E
CreateFile Handle, fileName
E:
ENDM
CloseFile MACRO Handle
mov ah, 3Eh
mov bx, Handle
int 21h
ENDM
Seek MACRO Handle, pos
push cx
push dx
xor cx, cx
mov dx, pos
mov ah, 42h
mov al, 2
mov bx, Handle
int 21h
pop dx
pop cx
ENDM
WriteToFile MACRO Handle, strToWrite
mov ah, 40h
mov bx, Handle
mov cx, len
mov dx, offset strToWrite
;lea dx, strToWrite
int 21h
ENDM
ReadFromFile MACRO Handle, strToRead
mov ah, 3Fh
mov bx, Handle
mov dx, offset strToRead
int 21h
ENDM
SetFileAttr MACRO fileName, Attr
mov dx, offset fileName
mov ax, 4300h
int 21h
mov ax, 4301h
add cx, Attr
int 21h
ENDM
RenameFile MACRO oldName, newName
mov ah, 56h
mov dx, offset oldName
mov di, offset newName
int 21h
ENDM
GetDrive MACRO
MOV AH, 19h
INT 21h
ENDM
SetDrive MACRO setDrv
MOV AH, 0Eh
MOV DL, setDrv
INT 21h
ENDM
GetDrive MACRO
MOV AH, 19h
INT 21h
ENDM
SetDrive MACRO setDrv
MOV AH, 0Eh
MOV DL, setDrv
INT 21h
ENDM
MkDir MACRO dirName
MOV AH, 39h
MOV DX, OFFSET dirName
INT 21h
ENDM
RmDir MACRO dirName
MOV AH, 3Ah
MOV DX, OFFSET dirName
INT 21h
ENDM
Documentul este oferit gratuit,
trebuie doar să te autentifici in contul tău.