Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

QUESTION NO 1:

INCLUDE Irvine32.inc
.data
SOURCE BYTE "TASK ONE",0
target BYTE 200 DUP(0)
.code
main proc
mov ecx, LENGTHOF SOURCE
L1:
mov al,SOURCE[ecx-1]
mov target[ecx-1],al
LOOP L1
mov edx, offset target
call writestring
exit
main ENDP
END main
QUESTION NO 2:
INCLUDE Irvine32.inc
.data
arr BYTE 01h,02h,03h,04h,05h,06h,07h,08h,09h
.code
main PROC
mov eax,0
mov ebx,lengthof arr-1
mov ecx,(lengthof arr)/2
l1:
mov dl, arr[eax * type arr]
xchg dl, arr[ebx * type arr]
mov arr[eax * type arr], dl
inc eax
dec ebx
loop l1
mov esi, offset arr
mov ebx, type arr
mov ecx, lengthof arr
call dumpmem
call dumpregs
exit
main ENDP
end main
QUESTION NO 3:
INCLUDE Irvine32.inc
.data
.code
main PROC
mov eax, 1
mov ebx, 0
mov ecx, 10
L1:
mov edx, eax
ADD eax,ebx
call writeint
mov ebx,edx
loop L1
exit
main ENDP
END main
QUESTION NO 4:
INCLUDE Irvine32.inc
.data
var DWORD ?
count DWORD 5
.code
Main PROC
mov ecx,count
mov var,ecx
call crlf
L1:
mov var, ecx
L2:
mov al,' '
call writechar
loop L2
mov ecx,count
sub ecx,var
inc ecx
L3:
mov al,"*"
call writechar
loop L3
mov al,0ah
call writechar
mov ecx,var
loop L1
exit
main ENDP
END main
QUESTION NO 5:
INCLUDE Irvine32.inc
.data
A BYTE "Enter the quantity you want a fibonacci series: ",0
.code
Main PROC
mov edx,offset A
call writestring
call readint
mov ecx,eax
mov eax,0
call writeint
call crlf

mov eax,1
mov ebx,0
mov edx,0
L1:
call writeInt
mov edx,eax
add eax,ebx
mov ebx,edx
call crlf
loop L1
exit
main ENDP
END main
QUESTION NO 6:
INCLUDE Irvine32.inc
.data
var DWORD ?
count DWORD ?
A BYTE "Enter number of lines for triangle ",0
.code
Main PROC
mov edx,offset A
call writestring
call readint
mov count,eax
mov ecx,count
mov var,ecx
call crlf
L1:
mov var, ecx
L2:
mov al,' '
call writechar
loop L2
mov ecx,count
sub ecx,var
inc ecx
L3:
mov al,"*"
call writechar
loop L3
mov al,0ah
call writechar
mov ecx,var
loop L1
exit
main ENDP
END main

You might also like