An near procedure in 8086 assembly language that accepts an ASCII value as a parameter in AL register and displays this value on the output screen – IGNOU MCA Assignment 2017 – 18

By | December 18, 2017

MASTER OF COMPUTER APPLICATIONS

Course Code : MCSL-017
Course Title : C and Assembly Language Programming (Lab Course)
Assignment Number : MCA(1)/L-017/Assignment/17-18
Maximum Marks : 50
Weightage : 25%

Write and run (using appropriate calling program) a near procedure in 8086 assembly language that accepts an ASCII value as a parameter in AL register and displays this value on the output screen – IGNOU MCA Assignment 2017 – 18

Code:-

DATA SEGMENT
MSG1 DB 10,13,”ENTER ANY ASCII VALUE : $”
MSG2 DB 10,13,”PRINTING AL VALUE : $”
DATA ENDS

CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX

LEA DX,MSG1
MOV AH,9
INT 21H

CALL PRINT_AL

MOV AH,4CH
INT 21H
CODE ENDS

PRINT_AL PROC NEAR

MOV AH,1
INT 21H
MOV BL,AL

LEA DX,MSG2
MOV AH,9
INT 21H

MOV DL,BL
MOV AH,2
INT 21H

RET
PRINT_AL ENDP
END START

 
DATA SEGMENT
MSG1 DB 10,13,"ENTER ANY ASCII VALUE : $"
MSG2 DB 10,13,"PRINTING AL VALUE : $"
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
CALL PRINT_AL
MOV AH,4CH
INT 21H
CODE ENDS
PRINT_AL PROC NEAR
MOV AH,1
INT 21H
MOV BL,AL
LEA DX,MSG2
MOV AH,9
INT 21H
MOV DL,BL
MOV AH,2
INT 21H
RET
PRINT_AL ENDP
END START

Screen Shots :-

Asm_program_Proc_AL_2_Screen

After Execution :-

Asm_program_Proc_AL_2_Screen_Output

Note :- To see the variable and its value you have to click vars button in the emulator.