BARI - Activity 5
BARI - Activity 5
Laboratory Exercise #5
Hello World
Create a program that will display the string “Hello World, I’m Learning Assembly!!!”
Solution:
.model small
.stack
.data
message db "Hello world, I'm learning Assembly !!!", "$"
.code
mov ax,seg message
mov ds,ax
mov ah,09
lea dx,message
int 21h
mov ah,4ch
int 21h
end
Problem: Make a program that will display your NAME, AGE, BIRTHDATE and COURSE using different
variables in different rows.
Requirements
A. source code
.MODEL SMALL
.STACK 100H
.DATA
INFO1 db 'NAME: Sheina Marie S. Bari$'
INFO2 db 'AGE: 21$'
INFO3 db 'BIRTHDATE:August 17, 2001$'
INFO4 db 'COURSE: BSCpE$'
.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX
This lab exercise taught me how to use a variety of assembly language routines. Using the
lea instruction as an example, the address given by the first operand is entered into the register
indicated by the second operand. The contents of the memory location are not loaded; it is crucial
to remember that only the effective address is computed and entered into the register. In this
activity, we also used the mov and int functions, which we are already accustomed to from the last
lab activity. In a nutshell, the mov instruction puts the data item referred to by its second operand
into the address referred to by its first operand, whereas the int instruction generates a software
call to an interrupt handler.