flat assembler
Message board for the users of flat assembler.
Index
> Main > segment registers |
Author |
|
revolution 09 Feb 2009, 01:30
Erm, what do you mean?
The CPU uses segment registers, they are impossible to avoid. Windows sets them up for all flat access to memory but they are still there in the background. fasm has a DOS version which uses FRM. So, just like Windows, the segment registers are set for flat memory access. |
|||
09 Feb 2009, 01:30 |
|
phenix 09 Feb 2009, 01:56
Thanks for the reply.
I realize that the segment registers are still there. When I used an old version of MASM I had to program for segments and far jumps. That is not necessary in a true flat assembler. How does FASM handle far jumps? For instance MASM32 is a true flat assembler. But alas it only works in Windows...... |
|||
09 Feb 2009, 01:56 |
|
LocoDelAssembly 09 Feb 2009, 02:16
fasm allows you to create flat binaries (no segments), ELF objects and executables (the ones used on Linux, FreeBSD, Solaris, etc), and Windows binaries. In all the mentioned cases the memory model is flat.
fasm also support the creation of MZ executables and those are segmented and for DOS only. [edit]Better check the examples in the Windows package and also the Linux package to see by yourself how the coding is being done. Also, to understand how the windows headers work, check http://flatassembler.net/docs.php?article=win32 |
|||
09 Feb 2009, 02:16 |
|
phenix 12 Feb 2009, 22:58
I'm still confused about whether this assembler does short or far calls.
This would NOT make it a flat assembler. I am not interested in 16 bit code. Therefore I would be using 32 bit code and should NOT have to get involved in short and far jumps. From the reading I have done it is not clear what this assembler does. Could someone clarify this for me, Please? |
|||
12 Feb 2009, 22:58 |
|
revolution 12 Feb 2009, 23:44
32 code does not use far calls unless you code those instructions. All calls are near.
Code: call [somewhere] ;near call, no segment used call far [somewhereElse] ;far call because you told the assembler you want it call anotherPlace ;direct call, cannot be far |
|||
12 Feb 2009, 23:44 |
|
DOS386 13 Feb 2009, 07:46
phenix wrote: When I used an old version of MASM I had to program for segments and far jumps. Problem specific to MASM or some 16-bit HLL compilers Quote: That is not necessary in a true flat assembler. How does FASM Not at all. FASM can compile all types of jumps you might need. No problem at all (except you need 16-bit OMF). Quote: I'm still confused about whether this assembler does short or far calls. Calls can be near or far only. They are all near except you deliberately make them far. Jumps can be short, near or far. FASM makes them short whenever possible, otherwise near, and far only if you deliberately make them far. Also, there is no "memory model" (small, compact, medium, large, huge, insane) support/trouble in FASM. Quote: For instance MASM32 is a true flat assembler We don't need FASM anymore Quote: But alas it only works in Windows...... RTFL |
|||
13 Feb 2009, 07:46 |
|
Tomasz Grysztar 13 Feb 2009, 09:58
revolution wrote:
Well, direct call can be far, too. And even in the long mode. |
|||
13 Feb 2009, 09:58 |
|
MazeGen 13 Feb 2009, 10:37
Tomasz Grysztar wrote:
If you refer to opcodes 9A and EA, they are invalid in 64-bit mode. I was looking forward to report another bug, but FASM conforms to this rule |
|||
13 Feb 2009, 10:37 |
|
Tomasz Grysztar 13 Feb 2009, 10:40
Oh, right, I mistook it with opcode FF.
So... I correct myself: except for the long mode. |
|||
13 Feb 2009, 10:40 |
|
revolution 13 Feb 2009, 11:05
I think because we never use far calls that we easily get confused about what can be done and what cannot. I mean honestly, who uses far calls these days, who? All those that use far calls shout out "me". ... ... ... <sounds of crickets chirping> ... ... I thought so.
|
|||
13 Feb 2009, 11:05 |
|
Madis731 13 Feb 2009, 11:25
@phenix: You don't seem to agree that 'F' in FASM means 'flat'. This assembler's name comes from its capabilities. Is it really that hard to accept?
|
|||
13 Feb 2009, 11:25 |
|
phenix 13 Feb 2009, 13:25
Thanks guys for all the info.
It has finally dawned on me that FASM is a true flat assembler. |
|||
13 Feb 2009, 13:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.