Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
58 views5 pages

Coal Lab Journal 4

The document contains code snippets and output from 3 programming tasks. It includes code to: 1. Increment and decrement a register value and output the results 2. Generate 10 random numbers between 0 and 20 and output them 3. Compare two input numbers and output "Equal" or "Not Equal" based on the comparison

Uploaded by

MZ Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views5 pages

Coal Lab Journal 4

The document contains code snippets and output from 3 programming tasks. It includes code to: 1. Increment and decrement a register value and output the results 2. Generate 10 random numbers between 0 and 20 and output them 3. Compare two input numbers and output "Equal" or "Not Equal" based on the comparison

Uploaded by

MZ Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Nishan E Haider

01-134192-070
BSCS-3A
Nishan E Haider
01-134192-070
BSCS-3A
Nishan E Haider
01-134192-070
BSCS-3A
TASK 1:
A)
Answer:
INCLUDE irvine32.inc
.data
.code
main proc
mov eax,0
mov al,255
add al,1
call dumpregs
sub al,1
call dumpregs
sub al,1
call dumpregs
exit
main
endp
END main

Output:

A)
Answer:
INCLUDE irvine32.inc
.data
.code
Nishan E Haider
01-134192-070
BSCS-3A
main proc
mov eax,0
call dumpregs
mov al,255
sub al,100
call dumpregs
exit
main
endp
END main
Output:

TASK 2:
Answer:
INCLUDE irvine32.inc
.data
.code
main proc
call crlf
mov ecx,10
Repp:
mov eax,0
mov eax,20
call randomrange
call writeint
call crlf
Loop Repp
exit
main
endp
END main
Nishan E Haider
01-134192-070
BSCS-3A
Output:

TASK 3:
Answer:
INCLUDE irvine32.inc
.data
msg1 byte "Equal",0
msg2 byte "Not Equal",0
.code
main proc
call readint
mov ebx,eax
call readint
cmp eax,ebx
JE yes
mov edx,offset msg2
call writestring
jmp JUMP
yes:
mov edx,offset msg1
call writestring
JUMP:
exit
main
endp
END main

You might also like