Title: COE205
1- COE-205
- Computer Organization Assembly Language
- Section 56
- Experiment3
2Outline
- Review
- Basic Input/Output
3Assembly Language Syntax(Directives)
4Review
TITLE prog.asm .MODEL SMALL .STACK
200 .Data NUM1 DB 2 NUM2 DB 4 .CODE MOV
AX,_at_DATA MOV DS,AX MOV AL,NUM1 MOV
BL,NUM2 MOV AX,4C00H INT 21H END
0B01
STACK
0A3C
DATA
MOV AX,_at_DATA MOV DS,AX MOV AL,NUM1 MOV
BL,NUM2 MOV AX,4C00H INT 21H
0A3B
OCDE
5Review
STACK
0A3C
DATA
MOV AX,_at_DATA MOV DS,AX MOV AL,NUM1 MOV
BL,NUM2 MOV AX,4C00H INT 21H
0A3C
OCDE
6ASCII Table
7How is doing it?
- Do you think that the program does I/O itself?
Program
OS
BIOS, Drivers
HW
8INT 21H
- Do you remember ?
- MOV AH,4CH
- INT 21H
- That was one function(4CH) of INT 21H, to exit
the program.
9Other INT 21H Functions
10Function 01H
- MOV AH,01H
- INT 21H
- Now, AL contains the ASCII code of the read
character
11Function 08H
- MOV AH,08H
- INT 21H
- Now, AL contains the ASCII code of the read
character, but no echo on the screen
12Function 02H/06H
- MOV DL,A or MOV DL,41H or MOV DL,010000001B
- MOV AH,02H
- INT 21H
- Now, the character is now on the screen
13Function 09H
- .DATA
- MSG DB Hello,0DH,0AH,
- .CODE
- LEA DX,MSG or MOV DX,OFFSET MSG
- MOV AH,09H
- INT 21H
- Now, the String is on the screen
14Function 0AH
- Before you read a String you must prepare the
buffer for it. - Buffer size the max string to be read1
- Actual size the actual of char read.
15Function 0AH (Read Student ID)
- .DATA
- Id DB 7,8 DUP(?)
- .CODE
- LEA DX, Id or MOV DX,OFFSET Id
- MOV AH,0AH
- INT 21H
- Now, the String is in memory pointed by Std_ID
16Function 0AH (Read Student ID)