Assembler Developer

Moderators: None (Apply to moderate this forum)
Number of threads: 1030
Number of posts: 1832

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