0% found this document useful (0 votes)
16 views

Lab 3

The document provides code snippets for 3 programs: 1. A program to display the letter 'a' by storing its ASCII code in DL and calling interrupts to output the character and return to MS-DOS. 2. A program to read a character from the keyboard by calling an interrupt to input into AL and then calling another interrupt to output the character in DL and return to MS-DOS. 3. A program to display the message "Hello World" followed by a return and linefeed by defining the message string, copying its address to DS, and calling an interrupt to output the string before returning to MS-DOS.

Uploaded by

Vinod Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lab 3

The document provides code snippets for 3 programs: 1. A program to display the letter 'a' by storing its ASCII code in DL and calling interrupts to output the character and return to MS-DOS. 2. A program to read a character from the keyboard by calling an interrupt to input into AL and then calling another interrupt to output the character in DL and return to MS-DOS. 3. A program to display the message "Hello World" followed by a return and linefeed by defining the message string, copying its address to DS, and calling an interrupt to output the string before returning to MS-DOS.

Uploaded by

Vinod Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

A complete program to display the letter a on the screen: Program:

.model small .stack 100h .code code segment start: mov dl,'a' ; store ascii code of a in dl mov ah, 2h ; ms-dos character output function int 21h ; displays character in dl register mov ax, 4c00h ; return to ms-dos int 21h code ends end start

Write a program to read a character from the keyboard and display it on the screen: Program:
.model small .stack 100h .code Code segment start: mov ah, 1h int 21h mov dl, al mov ah, 2h int 21h mov ax, 4c00h int 21h code ends end start ; display subprogram ; display character in dl ; return to ms-dos ; keyboard input subprogram ; read character into al

Write a program to display the message Hello world followed by Return and Line-feed

Program: .model small .stack 100h .code code segment message db 'Hello World', 13, 10, '$' start: mov ax, code mov ds, ax ; copy address of message to dx mov dx, offset message mov ah, 9h ; string output int 21h ; display string mov ax, 4c00h int 21h code ends end start

You might also like