Professional Documents
Culture Documents
Abdullah Khurram - Coal Lab 12
Abdullah Khurram - Coal Lab 12
SCREENSHOTS:
Task2:
Write a program that generates and displays 50 random integers between -20 and +20.
CODE:
.686
.MODEL flat, stdcall
.STACK
INCLUDE Irvine32.inc
.data
count BYTE 0
.code
main PROC
MOV ecx,50
l1:
MOV eax,-20d
call randomRange
call writeInt
call crlf
inc count
MOV eax,+20d
call randomRange
call writeInt
call crlf
inc count
loop l1
exit
main ENDP
END main
SCREENSHOTS:
Task3:
The following program demonstrates the compare instruction and the affected flags.
cmp al, bl OF =0 CF =0 SF =0 ZF =1
cmp ax, bx OF =1 CF =1 SF =0 ZF =0
SCREENSHOTS: