Professional Documents
Culture Documents
Coal After Mid 2
Coal After Mid 2
Class: BSAI-4TH
include irvine32.inc
.data
fileName BYTE 80 DUP(0)
.code
main PROC
mov edx,OFFSET fileName
mov ecx,SIZEOF fileName -1
call ReadString
CALL WriteSTring
Invoke ExitProcess,0
main endp
end main
READINT
include irvine32.inc
.data
dwordVal dword ?
.code
main PROC
call ReadInt ; input the integer
mov dwordVal,eax ; save in a variable
call writeint
Invoke ExitProcess,0
main endp
end main
include irvine32.inc
.code
main proc
call Clrscr
mov eax,500
call Delay
call DumpRegs
Invoke ExitProcess,0
main endp
end main
RANDOM 32
include irvine32.inc
.code
main PROC
mov eax,0
mov al, 'A'
or al,00100000b
call writechar ;6th bit 0 tw uppercase 1 ho tw lowercase "or"
upper ko lower ma chnage krta hai
Invoke ExitProcess,0
main endp
end main
XOR OPERATOR
include irvine32.inc
.code
main PROC
mov eax,0
mov al, 00111011b
xor al,00001111b
call writebin
Invoke ExitProcess,0
main endp
end main
NOT OPERATOR
include irvine32.inc
.code
main PROC
mov eax,0
mov al, 00111011b
not al
call writebin
Invoke ExitProcess,0
main endp
end main
TEST OPERATOR
include irvine32.inc
.code
main proc
mov eax,0
mov al,0000001100b
test al,0000000011b
jnz ValueFound ; if not zero it will work
ValueFound:
mov eax,8
call writeint
jmp bypass ; to out from ValueFound label
jz ValueNotFound ;if zero it will work
ValueNotFound:
mov eax,7
call writeint
bypass:
exit
main endp
end main
CMP OPERATOR
include irvine32.inc
.code
main proc
mov al,5
cmp al,5 ; Zero flag set
call dumpregs
mov al,4
cmp al,5 ; Carry flag set
call dumpregs
mov al,6
cmp al,5 ; ZF = 0, CF = 0
call dumpregs
exit
main endp
end main
REMARKS:
In this lab we learnt the use of different operators like and, or,
not, xor, test and cmp. We also learnt taking input from the user.