0% found this document useful (0 votes)
102 views10 pages

Roll No: 190803 Subject: COAL Lab Class: BSCYS-F-19-B-556: Name: Muhammad Adnan Haider

This document contains details of 6 lab tasks completed by a student named Muhammad Adnan Haider with roll number 190803 for the subject COAL lab in class BSCYS-F-19-B-556. Each task involves writing assembly language code to perform various operations, and displaying the output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views10 pages

Roll No: 190803 Subject: COAL Lab Class: BSCYS-F-19-B-556: Name: Muhammad Adnan Haider

This document contains details of 6 lab tasks completed by a student named Muhammad Adnan Haider with roll number 190803 for the subject COAL lab in class BSCYS-F-19-B-556. Each task involves writing assembly language code to perform various operations, and displaying the output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Name: Muhammad Adnan Haider

Roll no: 190803


Subject: COAL lab
Class: BSCYS-F-19-B-556

Lab task
Lab task no 01:
Source code:
include irvine32.inc
.data

var1 byte 255


var3 sbyte +127
var sbyte -128
.code
main proc
mov eax,0
mov ebx,0
mov ecx,0

movzx eax,var1
movsx ecx,var3
movsx ebx,var

call dumpregs
call waitmsg
exit
main endp
end main

Output:
Lab task no 02:
Source Code:
include irvine32.inc

.data
var1 byte 15h
var2 byte 18h
.code
main proc
mov a1,0
mov b1,0
mov a1, var1
mov b1, var2
call dumpregs
xchg a1,b1
call dumpregs
call waitmsg
exit
main endp
and main
Output:

Lab task no 03:


Source Code:
include irvine32.inc
.data

array byte 20h,30h

.code
main proc
mov eax,0
mov ebx,0

mov al,array
mov bl,array+1

call dumpregs
add al,bl
call dumpregs
call waitmsg
exit
main endp
end main

Output:

Lab task no 04:


include irvine32.inc
.data
Rval DWORD ?
Xval DWORD 56
Yval DWORD 90
Zval DWORD 54

.code
main proc
mov eax,0
mov ebx,0
mov edx,0
mov ecx,0

mov ebx,Yval
neg ebx
add ebx,Zval
mov eax,Xval
sub eax,ebx
mov Rval,eax
call dumpregs
call waitmsg

exit
main endp
end main
Output:

Task no 05;
Source code:

include irvine32.inc

.data

X byte 9h
Y byte 2h
Z byte 3h

.code
main PROC

mov eax, 0
mov ebx, 0
mov ecx, 0
mov edx, 0

mov bl, X
mov cl, Y
mov dl, Z
call dumpregs
neg cl ; -Y
call dumpregs

add cl, dl ;-Y+Z


call dumpregs

sub bl, cl ;X-(-Y+Z)


call dumpregs

call waitmsg
exit
main endp
end main

Output:

Task no 06:
Source code:
include irvine32.inc
.data
result dword ?
num dword ?
msg byte "Enter number You Want To Print Table",0,13h,10h
msg1 byte " * ",0
msg2 byte " = ",0
.code
main proc
call clrscr
call crlf
mov edx,offset msg
call writestring
call crlf
call readint
mov num,eax
mov ecx,10
mov ebx,1
;1
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;2
mov eax,num

call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;3
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;4
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;5
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;6
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;7
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;8
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;9
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
inc ebx
;10
mov eax,num
call writeint
mul ebx
mov edx,offset msg1
call writestring
mov result,eax
mov eax,ebx
call writeint
mov edx,offset msg2
call writestring
mov eax,result
call writeint
call crlf
call waitmsg
inc ebx

exit
main endp
end main

Output:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy