Assembler Developer

Moderators: None (Apply to moderate this forum)
Number of threads: 960
Number of posts: 1753

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Reusing a declared byte in Assembly Posted by The_Apex on 10 Oct 2011 at 10:35 AM
Hi everyone,

I am using NASM on a Linux computer with the Intel x86 syntax.

The problem I am having is that I cannot use a string I declare as an initialized constant more than once.

For example,

section .data

     notDone: db 'Loop not finished.', 0Ah
     nDLength: equ$-notDone

section .text

;loop for checking to see if a number is equal to 0
;if not, print the "notDone" string using the standard
;output


As one can see, I am looping until a number is 0, and while the number is not zero, I am printing the "notDone" string.

Whenever I do this, however, I get a segmentation fault. If I declare the same string with different identifiers, then the code works fine, but I need ten times more code (variables, functions, etc.)

Any help is greatly appreciated.
Report
Re: Reusing a declared byte in Assembly Posted by The_Apex on 10 Oct 2011 at 12:31 PM
My bad on the repost



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.