Monday, 31 December 2012
Finding Negative Number In Array
Finding negative number in an array, and yes this is assembly language program. You need Irvine32.lib for running this program but even if you don't have you can see the logic.
[Also See: Bubble Sorting Program In Assembly Language]
[code lang="html"]TITLE MASM Template (main.asm)
; Description:
;
; Revision date:
BUFFER=128;
INCLUDE Irvine32.inc
.data
array dword 5,8,7,6,4,1,9,3,-1,-2,2,-3;
sentinel dword 0;
.code
main PROC
mov eax,0;
mov ecx,lengthof array;
mov esi,offset array
L1:
test dword ptr [esi],8000;
pushfd;
;call dumpregs;
add esi,type array;
popfd;
loopz l1;
jz quit
sub esi,type array;
quit:
mov eax,[esi];
call writeint;
call dumpregs;
exit
main ENDP
end main[/code]
[Also See: Printing Star Program In Assembly Language]
[Also See: Bubble Sorting Program In Assembly Language]
[code lang="html"]TITLE MASM Template (main.asm)
; Description:
;
; Revision date:
BUFFER=128;
INCLUDE Irvine32.inc
.data
array dword 5,8,7,6,4,1,9,3,-1,-2,2,-3;
sentinel dword 0;
.code
main PROC
mov eax,0;
mov ecx,lengthof array;
mov esi,offset array
L1:
test dword ptr [esi],8000;
pushfd;
;call dumpregs;
add esi,type array;
popfd;
loopz l1;
jz quit
sub esi,type array;
quit:
mov eax,[esi];
call writeint;
call dumpregs;
exit
main ENDP
end main[/code]
[Also See: Printing Star Program In Assembly Language]









0 comments
Posts a comment