Professional Documents
Culture Documents
Mid-Term Exam: - Basics & Intuitive - All Materials Till-To-Date - Very Simple! - Ref. Book - Written Exam
Mid-Term Exam: - Basics & Intuitive - All Materials Till-To-Date - Very Simple! - Ref. Book - Written Exam
.DATA
HASINA DW 2
KHALEDA DW 5
ERSHAD EQU 10010001b
; named constants – equates
Stack segment
• To set a block of memory to store the stack
.STACK 100H
; sets 100h Bytes for the stack area.
; if no size is mentioned – 1 KB is assigned
Code segment
• Contains a program’s instructions
MAIN ENDP
; other procedures go here
…together!
A typical form for SMALL model
.MODEL SMALL
.STACK 100h
.DATA
;data definitions go here
.CODE;SMALL – so no name
MAIN PROC
;instructions go here
MAIN ENDP
;other instructions go here
END MAIN
4.8 I/O Instructions
• Instructions to access I/O ports directly –
– IN
– OUT
INT 21h
invokes a large no. of DOS functions
– Appendix C for more
INT 21h
(invokes no. of DOS functions)
• A particular function is requested by placing a
function no. in the AH register &
• invoke INT 21h
Function 1:
Single-key input
Input: AH = 1
Output: AL = ASCII code if character key is pressed
= 0 if non-character key is pressed
Function 2:
Single-character output / control func.
Input: AH = 2
DL = ASCII code of the display char or control char
Output: AL = ASCII code of the display char or control char