CS-401 Computer Architecture & Assembly Language Programming Lecture-36 Secondary Storage
Lets revise the last lecture
Logical view of secondary storage
int 0x21 DOS Services Create Truncate File AH = 0x3C CX = file attribute DS:DX = ASCII file name Return On success CF = clear AX = file handle On error CF = set AX = error code
int 0x21 DOS Services Open Existing File AH = 0x3D AL = access and sharing mode DS:DX = ASCII file name CL = attribute mask Return On success CF = clear AX = file handle On error CF = set AX = error code
int 0x21 DOS Services Close File AH = 0x3D BC = file handle Return On success CF = clear AX = undefined On error CF = set AX = error code
int 0x21 DOS Services Read File AH = 0x3F BX = file handle CX = number of bytes to read DS:DX = buffer Return On success CF = clear AX = number of bytes actually read On error CF = set AX = error code
int 0x21 DOS Services Write File AH = 0x40 BX = file handle CX = number of bytes to write DS:DX = buffer Return On success CF = clear AX = number of bytes actually written On error CF = set AX = error code
int 0x21 DOS Services Delete File AH = 0x41 DS:DX = ASCII file name CL = attribute mask Return On success CF = clear AX = undefined On error CF = set AX = error code
Seek –Set Current File Position int 0x21 DOS Services Seek –Set Current File Position AH = 0x42 AL = origin of move (00=start,01=current,02=end) BX = file handle DS:DX = offset from origin Return On success CF = clear DX:AX = new file position On error CF = set AX = error code
int 0x21 DOS Services Get File Attributes AH = 0x43 AL = 0x00 DS:DX = ASCII file name Return On success CF = clear CX = file attributes On error CF = set AX = error code (#01680)
int 0x21 DOS Services Set File Attributes AH = 0x43 AL = 0x01 CX = file attributes DS:DX = ASCII file name Return On success CF = clear AX = undefined On error CF = set AX = error code
PSP
PSP 0x00 – 0x7F 0x80 0x80-(0x80+count) Count DOS Information Chars . . . . .
int 0x21 DOS Services Exec- Load and Execute AH = 0x4B AL = type (0x00 load and exec, 0x01 load) DS:DX = ASCII file name ES:BX = parameter block Return On success CF = clear On error AX = error code
int 0x21 DOS Services 0x01 0x02 0x06 0x0A 0x0E 0x12 0x16 Command Tail First FCB Second FCB SS:SP SS:IP Environment
int 0x21 DOS Services Allocate Memory AH = 0x48 BX = number of paragraphs Return On success CF = clear AX = segment of memory block On error CF = set AX = error code BX = largest available block
int 0x21 DOS Services Free Memory AH = 0x49 ES = segment of block to free Return On success CF = clear On error CF = set AX = error code
int 0x21 DOS Services Resize Memory Block AH = 0x4A BX = number of paragraphs ES = segment of block Return On success CF = clear On error CF = set AX = error code BX = maximum paragraphs available