|
-
Feb 8th, 2004, 09:30 AM
#1
Thread Starter
New Member
beginner Assembler question
could someone tell me just what 'space=data', 'align=1' and 'segment my_data' does?
Yes, it's for schoolwork - unfortunately they didn't bother handing us a book nor explaining it; unless you wanna call 30 lines in notepad an explanation. (and yes, I tried Google, oh Lord how did I try )
DEFINE my_data,space=data ,align=1,ORG=data_ram
and segment my_data
<lots of variables come here>
-
Feb 25th, 2004, 09:33 AM
#2
Fanatic Member
I know what the segment my_data probably means. That is probably your data segment. This is where you put all of your data (variables and constants) in. I find that different assemblers treat this differently (like MASM and NASM.)
I am not sure of the others, atm.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Apr 4th, 2004, 12:24 PM
#3
I would assume the DEFINE part is just like the C equivalent. I also assume this is MASM, since DEFINE isn't a valid statement in Turbo Assembler..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 23rd, 2004, 01:05 PM
#4
Fanatic Member
The problem is that there are several different assemblers and each has their own take of the syntax.
This is evident in the differences between MASM and NASM.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
May 19th, 2004, 11:27 PM
#5
MASM is just different. I like MASM, but its turning into C. They have so many different macros now, that you could almost run a full C file in MASM, and compile it.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 20th, 2004, 03:35 PM
#6
Fanatic Member
( My aside: )
That is the reason why I cannot see large scale projects written in assembler. Most of the end result looks like C and the rest becomes a jumble of loops. Asssembler, however, is excellent for small bits of code that need to be optimized.
( End aside )
Have you taken a look at HLA? The arguments that you send to the instructions are backwards from the regular 80x86 syntax.
I founda site that illustrates this:
http://board.win32asmcommunity.net/p...ddressingModes
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
May 24th, 2004, 07:29 AM
#7
Ah. I've never actually seen this, thanks for the link.
I don't think you'll find many people willing to begin a massive project in any type of ASM.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Jun 14th, 2004, 05:03 AM
#8
New Member
Re: beginner Assembler question
Originally posted by Reck
could someone tell me just what 'space=data', 'align=1' and 'segment my_data' does?
Yes, it's for schoolwork - unfortunately they didn't bother handing us a book nor explaining it; unless you wanna call 30 lines in notepad an explanation. (and yes, I tried Google, oh Lord how did I try )
DEFINE my_data,space=data ,align=1,ORG=data_ram
and segment my_data
<lots of variables come here>
I suspect that the line is saying that you are defining a segment of memory (segments used to be and I assume still are 64k blocks of memory on 64k boundaries 0 - 65535, 65536 - etc...) It's a while since I did any PC assembler language.
The segment type is data
The align=1 I suspect means it is Byte aligned rather than word aligned.
and the ORG tells it that the the space is placed at a memory location referred to by data_ram, usually org would be followed by a memory address eg. ORG $8000 but by using a label, you can change the address of the label to move your data in memory if the preceeding segment gets full.
Hope I have remembered this stuff correctly and that it helps, although I notice this post is fairly old now... only just joined this forum though... soz.
-
Jun 14th, 2004, 11:06 AM
#9
Fanatic Member
What assembler do you suspect that this code was generated for?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jun 14th, 2004, 11:26 AM
#10
New Member
I'm not too sure to be honest, the last time I was doing any assembler on the PC it was in DOS using A86/D86 which was a shareware assembler and it looks similar to what was used then but not identical.
I could of course be completely wrong with my answer as I am speculating on the terminology. I haven't used any of the Windows based assembler packages and it is several years since I did any PC assembler... actually, come to think of it, it's a lot of years... god I'm too old..
-
Jun 14th, 2004, 09:07 PM
#11
Hehe. I'm say you are right. I've never seen this in any assembler I've used.
Tis a stumper
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|