Professional Documents
Culture Documents
5 MP
5 MP
: 5
;Rollno. : B-79
;Name : Vaishnavi Goraksh Kaware
; uP- Assigment no-1 Write a Program to calculate number of -ve and +ve elements from
the array.
section .data
array dd 12345678h,87654321h,90ABCDEFh,3A4B5C6Dh,0ABCDEF10h
section .bss
poscnt resb 1 ; resb is pseudo instruction for reserve the a
byte for buffer
negcnt resb 1
section .text
global _start
_start:
mov esi,array ;move content of array into stack index
mov ecx,5 ;total no.of numbers
next: mov eax,dword[esi] ;move first element of stack index into eax
register
bt eax,31 ;to check whether given msb is 0 or 1 ( bit Test)
jc neg_num ;if carry generated -ve number otherwise it is
positive
jmp down
mov eax,1
mov ebx,0 ;Exit from program
int 80h ;Interrupt call FOR EXIT