Professional Documents
Culture Documents
4.0 Outcomes
At the end of this chapter, you should be able to:
4.1 Introduction
You can access the PC system hardware at one of three general levels from assembly
Language.
• Programming the hardware directly
• Use ROM BIOS routines to access the hardware
• Use operating system’s (MS-DOS) calls to access the hardware.
Each level of system access has its own set of advantages and disadvantages.
Use the DOS function 09 to displays Message 1, What is your name ?, on the screen.
Notice the dollar sign, $, at the end of message1 in the data section. The next 3 lines:
mov dx,offset nam ; get offset of name
mov ah,0Ah ; get name from user
int 21h
use DOS function A to allow the user to type his/her name which is stored in the buffer nam .
Notice how the buffer was declared in the data section. The first number, 31, is the maximum
number of character that the user can input. The second number 33 should be always be the
first number plus 2 (31+2 = 33). Next, the DOS function 9 is used again to displays
Message2, It is nice to meet you. Finally, DOS function 4C is used to terminate the
Figure 4.1