Lab Coal Mid
Lab Coal Mid
Code:
include \masm32\include\masm32rt.inc
.data
result DWORD 0
New db 13,10,0
Message db"The answer is : ", 0
m db"Register value is :" ,0
.code
start:
mov ax, 160
mov bx, 150
sub ax,bx
movzx eax,ax
invoke dwtoa, eax ,addr result
invoke StdOut, addr Message
invoke StdOut, addr result
invoke StdOut, addr New
invoke StdOut, addr m
lahf
shr ah,6
movzx eax, ah
invoke dwtoa, eax ,addr result
invoke StdOut, addr result
invoke ExitProcess, 0
end start
Code:
include \masm32\include\masm32rt.inc
.data
result DWORD 0
New db 13,10,0
Message db"The answer is : ", 0
m db"Register value is :" ,0
.code
start:
mov ax, 5
mov bx, 6
Test ax,bx
movzx eax,ax
invoke dwtoa, eax ,addr result
invoke StdOut, addr Message
invoke StdOut, addr result
invoke StdOut, addr New
invoke StdOut, addr m
lahf
shr ah,6
movzx eax, ah
invoke dwtoa, eax ,addr result
invoke StdOut, addr result
invoke ExitProcess, 0
end start
Task 2: encryption:
include \masm32\include\masm32rt.inc
.data
DATA BYTE "mehwish",0
Sizee = ($ - DATA) - 1
.code
start:
mov ecx,Sizee
mov esi,0
L1:
movzx eax,DATA[esi]
push eax
inc esi
loop L1
mov ecx,Sizee
mov esi,0
L2:
pop eax
mov DATA[esi],al
inc esi
loop L2
Output: