Need help programing in assembly language

Click For Summary
SUMMARY

The discussion focuses on programming in assembly language, specifically for the IA-32 architecture. A user seeks assistance in creating a program that counts the number of zero bits in each integer from a predefined array (X) and stores the results in another array (Y). The provided code snippet utilizes bit manipulation techniques, including the ROL instruction and the ADC instruction, to achieve the desired functionality. The program initializes registers and employs a loop to process each bit of the integers in X.

PREREQUISITES
  • Understanding of IA-32 assembly language syntax and instructions
  • Familiarity with bit manipulation techniques in assembly
  • Knowledge of register usage, particularly EAX, EDX, and ECX
  • Basic concepts of data storage in assembly (.DATA section)
NEXT STEPS
  • Study IA-32 assembly language programming with a focus on bitwise operations
  • Learn about the ROL and ADC instructions in detail
  • Explore techniques for optimizing assembly language loops
  • Research methods for displaying output from assembly programs
USEFUL FOR

Beginner assembly language programmers, computer science students, and anyone interested in low-level programming and bit manipulation techniques.

Cathartics
Messages
27
Reaction score
0
*****need help programing in assembly language*****

Hi there everyone. I am really new to this assembly language and i don't know how to code this simple programe.. Please help me with this. I would very much appreciate it.. here is the question..



Need to design assembly language programe IA-32 that could find the number of 0's [binary] in each integer in x and put and display the value in y.

.DATA

X SWORD -100,200,300,400,-500
Y BYTE 5 DUP (?)
 
Technology news on Phys.org
Bit oriented method:

Assume value in EAX, zero bit count will be in EDX

Code:
        mov     ecx,32
        mov     edx,0
lp0:    rol     eax,1
        cmc
        adc     edx,0
        loop    lp0
 
Last edited:

Similar threads

  • · Replies 397 ·
14
Replies
397
Views
22K
  • · Replies 4 ·
Replies
4
Views
16K
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
1
Views
3K
  • · Replies 18 ·
Replies
18
Views
7K
Replies
60
Views
18K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
10K
  • · Replies 20 ·
Replies
20
Views
6K