Sie sind auf Seite 1von 28

Microprocessor & Interfacing

(8086 family microprocessors)

Jimmy Mathew
Asst. Professor Sr.,
School of Computing Science & Engineering (SCSE),
VIT University, Vellore, India
Email: jimmym@vit.ac.in / Room: SJT 313 A08
BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 2


BIOS and DOS System Calls
1. Character input functions INT 21h (01h, 06h, 0Ah, 0Bh,
0Ch)

2. Character display functions INT 21h (02h, 09h)

3. File control block functions INT 21h (0Fh, 10h, 13h, 14h,
15h, 16h, 17h, 23h)

4. Device handling functions INT 17h

MP & I/F Module 2 JMW VIT-U 3


BIOS and DOS System Calls
1.1. Character input with echo (Function 01H)

– Reads one character from the keyboard into register AL,


echoes it to the display. It waits until one character is
entered.

MP & I/F Module 2 JMW VIT-U 4


BIOS and DOS System Calls
1.2. Direct console I/O (Function 06H)

– Reads or writes one character (to any output device) from


the console without interruption from OS.

MP & I/F Module 2 JMW VIT-U 5


BIOS and DOS System Calls
1.3. Buffered keyboard input with echo (Function 0AH)

– Reads a string of bytes until a carriage return (0DH or


Enter) from keyboard and stores it to user buffer.

MP & I/F Module 2 JMW VIT-U 6


BIOS and DOS System Calls
1.4. Check input status (Function 0BH)

– Checks if a character is available from the standard input


device.

MP & I/F Module 2 JMW VIT-U 7


BIOS and DOS System Calls
1.5. Flush input buffer and then input (Function 0CH)

– Clears the standard input buffer and reads one new


character from input.

MP & I/F Module 2 JMW VIT-U 8


BIOS and DOS System Calls
2.1. One character output (Function 02H)

– Sends one character from DL to standard output device.

MP & I/F Module 2 JMW VIT-U 9


BIOS and DOS System Calls
2.2. Display a string (Function 09H)

– Sends a string of characters to standard output device.


End of string is '$' character. Address in DS:DX.

MP & I/F Module 2 JMW VIT-U 10


BIOS and DOS System Calls
3.1. Open a file (Function 0FH)

– Opens a file and make it available for subsequent read /


write operations. Address of FCB in DS:DX. FCB – File
Control Block
It contains
Drive id
Block id
Record size
File size
Date stamp
Time stamp

MP & I/F Module 2 JMW VIT-U 11


BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 12


BIOS and DOS System Calls
3.2. Close a file (Function 10H)

– Closes a file after updates are made to the disk image of


the file. FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 13


BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 14


BIOS and DOS System Calls
3.3. Delete a file (Function 13H)

– Deletes a file from the current directory of default or


specified disk drive. FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 15


BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 16


BIOS and DOS System Calls
3.4. Sequential read from a file (Function 14H)

– Reads sequential block data from the file, and increments


file pointer accordingly. FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 17


BIOS and DOS System Calls

Record size is at
an offset of 0Eh
Refer slide 11

MP & I/F Module 2 JMW VIT-U 18


BIOS and DOS System Calls
3.5. Sequential write to a file (Function 15H)

– Writes a sequential block of data to the file, and FP is


incremented accordingly. FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 19


BIOS and DOS System Calls

Record size is at
an offset of 0Eh
Refer slide 11

MP & I/F Module 2 JMW VIT-U 20


BIOS and DOS System Calls
3.6. Create a file (Function 16H)

– Create a new file in the current directory, and opens the


file for subsequent read / write. FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 21


BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 22


BIOS and DOS System Calls
3.7. Rename a file (Function 17H)

– Alters the name of the file in the current directory.


Special FCB address in DS:DX.

MP & I/F Module 2 JMW VIT-U 23


BIOS and DOS System Calls

Special FCB

MP & I/F Module 2 JMW VIT-U 24


BIOS and DOS System Calls
3.8. Get file size (Function 23H)

– Provides file size in terms of number of records. FCB


address in DS:DX. Actual size in bytes = number of
records x size of one record.

MP & I/F Module 2 JMW VIT-U 25


BIOS and DOS System Calls

Relative record
field in FCB at
offset 21h
and 23h

MP & I/F Module 2 JMW VIT-U 26


BIOS and DOS System Calls
4.1. Printer functions (Functions: 00h, 01h)

– An example to print a string with printer.

MP & I/F Module 2 JMW VIT-U 27


BIOS and DOS System Calls

MP & I/F Module 2 JMW VIT-U 28

Das könnte Ihnen auch gefallen