Professional Documents
Culture Documents
Computer Organization and Assembly Language: Subroutines Bscs 5 Lecturer Hashim Javed
Computer Organization and Assembly Language: Subroutines Bscs 5 Lecturer Hashim Javed
and Assembly
Language
Subroutines
BScs 5th
Lecturer Hashim Javed
objectives
• Procedure
• Example program of procedure
What is procedure?
First of all there must be a question if you want to print the 3 strings
then what you will do like
Mov dx,10
Hello? Mov ah,2
Int 21h
How are you?
Mov dx,13
Good to see you Moh ah,2
Int 21h
Procedure/subroutine/Functions
They have similar meaning in Assembly language
• Syntax
Name proc
ret
Name endp
Mov dx,13
Mov ah,2
Int 21h
Ret
Escapeseq proc
How to call a procedure
Simple with the help of CALL keyword with the procedure name
For example
In the previous example we have created the escapeseq procedure if
we want the call that procedure
Then simple we will write that procedure like this