Name: Bari, Sheina Marie S.
____________________________ Score: ________________
Year and Section: BSCpE 4-1_________________________ Date: January 3, 2023____
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
LEA DX, INFO1 ; load & display the name
MOV AH, 9
INT 21H
MOV AH, 2 ; carriage return
MOV DL, 0DH
INT 21H
MOV DL, 0AH ; line feed
INT 21H
LEA DX, INFO2 ; load & display the age
MOV AH, 9
INT 21H
MOV AH, 2 ; carriage return
MOV DL, 0DH
INT 21H
MOV DL, 0AH ; line feed
INT 21H
LEA DX, INFO3 ; load & display the birthdate
MOV AH, 9
INT 21H
MOV AH, 2 ; carriage return
MOV DL, 0DH
INT 21H
MOV DL, 0AH ; line feed
INT 21H
LEA DX, INFO4 ; load & display the course
MOV AH, 9
INT 21h
MOV AH, 4CH ; return control to DOS
INT 21H
MAIN ENDP
END MAIN
B. Screenshot/print screen of your output
C. Take away (what you have learned from this activity).
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.