Coal Assignment1
Coal Assignment1
Coal Assignment1
Code:
include 'emu8086.inc'
org 100h
.data
.code
print "Hello World"
ret
name,
father name,
Your study level,
about your job?
Code:
org 100h
.data
msg1 db 13,10, "Name: Musa Jamil$"
msg2 db 13,10,"Father Name: Jamil Anwar$"
msg3 db 13,10,"Study Level: BS Computer Science$"
msg4 db 13,10,"Job: Website Developer$"
.code
main proc
mov dx, offset msg1
mov ah, 9
int 21h
mov dl, 13
mov ah, 2
int 21h
mov dl, 10
mov ah, 2
int 21h
mov dx, offset msg2
mov ah, 9
int 21h
mov dl, 13
mov ah, 2
int 21h
mov dl, 10
mov ah, 2
int 21h
mov dx, offset msg3
mov ah, 9
int 21h
mov dl, 13
mov ah, 2
int 21h
mov dl, 10
mov ah, 2
int 21h
mov dx, offset msg4
mov ah, 9
int 21h
mov dl, 13
mov ah, 2
int 21h
mov dl, 10
mov ah, 2
int 21h
main endp
end main
ret
Task.3: Write a program in assembly language to print the data in this form:
Superior 123 University 123 Lahore
Pakistan 123 Zindabad
Code:
org 100h
.data
msg1 db 10,13, "Superior",9,"123",9,"University",9,"123",9,"Lahore$"
msg2 db "Pakistan",9,"123",9,"Zindabad$"
main proc
.code
mov dx, offset msg1
mov ah, 9
int 21h
mov dl, 13
mov ah, 2
int 21h
mov dl, 10
mov ah, 2
int 21h
mov dx, offset msg2
mov ah, 9
int 21h
main endp
end main
ret
CR equ 0DH
LF equ 0AH
main:
mov AH,02H
mov CX,26
mov DL, 'A'
while1:
cmp DL, 'A'
add DL, 01H
int 21H
mov DL, 0DH
mov DL, 0AH
int 21H
cmp DL, 'Z'
je Next
jmp while1
Next:
mov AH,4CH
int 21h
Code:
CR equ 0DH
LF equ 0AH
main:
mov AH, 02H ; Function to print a character
mov CX, 26 ; Loop counter
mov DL, 'A' ; Initial character
while1:
int 21H
inc DL ; Increment DL (character)
int 21H ; Print character
mov DL, CR ; Carriage return
int 21H ; Print CR
mov DL, LF ; Line feed
int 21H ; Print LF
cmp DL, 'Z'
je Next
jmp while1
Next:
mov AH, 4CH ; DOS program termination interrupt
int 21H
mov ax,numB
mov bx,3
imul bx
add ax,6
mov bx,numX
add bx,numD
idiv bx
mov res,ax
int 21h
;Display Result
mov ax,@data
mov ds,ax
lea dx,ResPrompt
mov ah,09h
int 21h
mov ax,@data
mov ds,ax
lea dx,res
mov ah,09h
int 21h
Code:
; Assuming numB, numX, numD, and res are declared elsewhere in the program.
; Display Result
mov ah, 09h ; Function to print a string
lea dx, ResPrompt
int 21h
.DATA
array WORD 10,20
WORD 30,40
WORD 50,60
.CODE
mov eax, LENGTHOF array ; 2
mov ebx, SIZEOF array ; 4