

Passing parameters to a macro Display MACRO MSG mov dx, offset msg mov ah,09h int 21h ENDM The parameter MSG can be replaced by msg1 or msg2 while calling Calling macro: DISPLAY MSG1 DISPLAY MSG2 MSG1 db I am Fine $ MSG2 db Hello, How are you.? $ Here parameter is MSG 16. Syntax of macro: Read MACRO mov ah,01h int 21h ENDM Display MACRO mov dl,al Mov ah,02h int 21h ENDM 15. Macro with in a macro is a nested MACRO A macro can be defined anywhere in program using the directives MACRO and ENDM 14. MACROS A macro is a group of repetitive instructions in a program which are codified only once and can be used as many times as necessary. Syntax: Procedure name PROC near instruction 1 instruction 2 RET Procedure name ENDP Example: ADD2 PROC near ADD AX,BX RET ADD2 ENDP ADD2 PROC FAR ADD AX,BX RET ADD2 ENDP 13. Intrasegment procedure(IP in stack) Intersegment procedure(CS:IP in stack) 12. At the time of invoking a procedure the address of the next instruction of the program is kept on the stack so that, once the flow of the program has been transferred and the procedure is done, one can return to the next line of the original program, the one which called the procedure.
#Compare letters emu8086 code#
Procedures A procedure is a collection of instructions to which we can direct the flow of our program, and once the execution of these instructions is over control is given back to the next line to process of the code which called on the procedure. List of Assembler Directives ASSUME DB DW DD DQ DT END ENDP ENDS EQU EVEN EXTRN GLOBAL GROUP INCLUDE LABEL LENGTH NAME OFFSET ORG PROC PTR SEGMENT SHORT TYPE 11. They also direct the assembler how program and data should be arranged in the memory. They indicate how an operand is treated by the assembler and how assembler handles the program. Assembler directives are the commands to the assembler that direct the assembly process. Assembler Directives Assembler Directives are directions to the assembler. Assembler Directives Procedures Macros 9. code Start: Mov Mov ds,ax Mov ax,op1 Mov bx,op2 Add ax,bx Int 3 End start Assume CS:code segment,DS:Data segment DATA SEGMENT Mes db Hello $ Op1 db 20h Op2 db 30h DATA ENDS CODE SEGMENT Start: Mov ax,data Mov ds,ax Mov ax,op1 Mov bx,op2 Add ax,bx Int 3 CODE ENDS End start Mov ax,20 Mov bx,30 Add ax,bx Int 3 8.

data Mes db Hello $ Op1 db 20h Op2 db 30h. program syntax Type 1( MASM) TYPE 2(MASM) Kit. Operation L1: cmp bx, cx Compare bx with cx all fields present add ax, 25 operation and 2 operands inc bx operation and 1 operand ret operation field only Comment: whatever you wish !! comment field only 7. Format of Assembly Language Instructions Operation Example: Examples of instructions with varying numbers of fields. Mode of data representation Integer Representation Floating Point Representation 6.

Types Of Encoding American Standard Code For Information Interchange ( ASCII ) Binary Coded Decimal ( BCD ) Extended Binary Coded Decimal Interchange Code ( EBCDIC ) 5. Data Representation & Numbering Systems Binary Numbering Systems Octal Numbering Systems Decimal Numbering Systems Hexadecimal Numbering Systems 4. Introduction To Programming Languages Machine Languages -natural language of a computer Low Level Languages-In low level language, instructions are coded using mnemonics High Level Languages 3. Assembly Language Programming Fundamentals Presented By: Shehrevar Davierwala Do Visit: Ģ.
