flat assembler
Message board for the users of flat assembler.

Index > Linux > section '.bss' and buffers...

Author
Thread Post new topic Reply to topic
Patrick_



Joined: 11 Mar 2006
Posts: 53
Location: 127.0.0.1
Patrick_ 12 Mar 2006, 17:01
Hello all. I'm beginning to learn assembly, and I'm reading a PDF (Programming from the Ground Up) that uses GNU Assembler. Now, I'd use as, but the syntax is horrible.

Anyway, up until now I've been able to convert from as to fasm syntax. But now, I need to declare a buffer in section .bss of a certain length. How would I do this? I searched through the fasm manual, and some other docs, but couldn't find what I was looking for. Any help would be appreciated.

By the way, here is the code that was in the book:

Code:
.section .bss (section '.bss' writeable)
.equ BUFFER_SIZE, 500 (BUFFER_SIZE equ 500)
.lcomm BUFFER_DATA, BUFFER_SIZE (?)
    


Also, would you happen to know why, if I have at the top of my source, "format ELF executable", that fasm gives me "extra characters at end" when I have "section '.bss' writeable) in my code, but if I leave out the "executable" part, it doesn't? Just curious.

Thanks! Smile [/code]
Post 12 Mar 2006, 17:01
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi 12 Mar 2006, 22:30
This compiles, and isnt there any examples on linux package of fasm?
Code:
format ELF executable
entry start
section readable executable
start:
; your code goes here.
section readable writeable
BUFFER_SIZE equ 500
BUFFER_DATA rd BUFFER_SIZE    

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 12 Mar 2006, 22:30
View user's profile Send private message MSN Messenger Reply with quote
Patrick_



Joined: 11 Mar 2006
Posts: 53
Location: 127.0.0.1
Patrick_ 12 Mar 2006, 23:05
Thank you, I figured it out. Yes, I guess I passed over it...
Post 12 Mar 2006, 23:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.