0% found this document useful (0 votes)
10 views3 pages

Mic Exp868

The document outlines an assembly programming experiment focused on displaying a string using macros and BIOS/DOS interrupts. It includes prerequisites, expected outcomes, a theoretical explanation of macros, an algorithm for the experiment, and a sample code written by a student. The conclusion emphasizes the student's ability to program the Intel 8086 processor and demonstrate execution and debugging of assembly language programs.

Uploaded by

YOU NEED TO ALL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Mic Exp868

The document outlines an assembly programming experiment focused on displaying a string using macros and BIOS/DOS interrupts. It includes prerequisites, expected outcomes, a theoretical explanation of macros, an algorithm for the experiment, and a sample code written by a student. The conclusion emphasizes the student's ability to program the Intel 8086 processor and demonstrate execution and debugging of assembly language programs.

Uploaded by

YOU NEED TO ALL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PART A

(PART A : TO BE REFFERED BY STUDENTS)


Experiment No.08

A.1 Aim: Write Assembly program to display string using macro. [Use BIOS/DOS interrupts
to read input and display results.]
A.2 Prerequisite: Basic knowledge of 8086 instruction set, interrupts, procedures and
macros in 8086

A.3 Outcome:
After successful completion of this experiment students will be able to
1. Use appropriate instructions to program microprocessor to perform various
task.
2. Develop the program in assembly/ mixed language for Intel 8086 processor
3. Demonstrate the execution and debugging of assembly/ mixed language program
A.4 Theory:
A macro is an extension to the basic ASSEMBLER language. They provide a
means for generating a commonly used sequence of assembler
instructions/statements. The sequence of instructions/statements will be coded ONE
time within the macro definition.
The Syntax for macro definition −
%macro macro_name number_of_params
<macro body>
%endmacro
Where, number_of_params specifies the number parameters, macro_name specifies
the name of the macro.
The macro is invoked by using the macro name along with the necessary
parameters. When you need to use some sequence of instructions many times in a
program, you can put those instructions in a macro and use it instead of writing the
instructions all the time.
A.5 Algorithm:
1. Start.
2. Initialize data segment and code segment.
3. Start the macro body
4. Write the string to display with macro
eg: msg1 db “message 1 $”
display macro msg1
5. Store the effective address of string in the register
6. End of Macrostring
7. Start the code segment
8. Invoke the macro to display the string
9. End

PART B
(PART B : TO BE COMPLETED BY STUDENTS)

(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded at the end of the practical)

Roll. No: 68 Name: Sandesh Bhagat


Class:SE_C Batch: C4
Date of Experiment: Date of Submission:
Grade:

B.1 Software Code written by student:


data segment
msg1 db " Welcome To Terna Collehe $"
data ends

code segment
assume cs:code, ds:data

; Macro to display string


display macro msg
push ax ; Save AX register
push dx ; Save DX register
lea dx, msg ; Load the address of the string into DX
mov ah, 09h ; DOS function to display string
int 21h ; Call DOS interrupt to display the string
pop dx ; Restore DX register
pop ax ; Restore AX register
endm

start:
; Initialize data segment
mov ax, data
mov ds, ax

; Call the macro to display msg1


display msg1

; Exit the program


mov ah, 4Ch ; DOS function to terminate the program
int 21h ; Call DOS interrupt to exit

code ends
end start

B.2 Input and Output:


B.3 Observations and learning:

A macro is an extension to the basic ASSEMBLER language. They provide a


means for generating a commonly used sequence of assembler
instructions/statements. The sequence of instructions/statements will be coded ONE
time within the macro definition.
The Syntax for macro definition −
%macro macro_name number_of_params
<macro body>
%endmacro
Where, number_of_params specifies the number parameters, macro_name specifies
the name of the macro.

B.4 Conclusion:
After successful completion of this experiment I am able to
Use appropriate instructions to program microprocessor to perform various
task.
1. Develop the program in assembly/ mixed language for Intel 8086 processor
2. Demonstrate the execution and debugging of assembly/ mixed language program

You might also like