flat assembler
Message board for the users of flat assembler.
Index
> Main > Does FLAT support typed variables, or not? |
Author |
|
okasvi 23 Apr 2006, 00:57
Code: testvar dw 0 mov [testvar], 1 works just fine i really suggest reading these: http://flatassembler.net/docs.php?article=ufasm and http://flatassembler.net/docs.php?article=design should give you good view what Tomasz wants to achieve in fasm |
|||
23 Apr 2006, 00:57 |
|
RedGhost 23 Apr 2006, 03:30
Al wrote: We use MASM to teach students the basics of assembly programming etc. We use it for years, and it has one significant drawback: no Linux support. Maybe some COFF-->ELF converter would also help a little bit, but we don't know one. A few years ago we tried to switch to NASM, but we decided to stay at MASM, because NASM doesn't support data types at all, which makes the programming really horrible. dw is "d word" (data, define, can't recall), it is 16bits not 32, and would not be 32bits even under MASM.... the reason Code: mov thevarible,1 Code: mov [thevarible],1 _________________ redghost.ca |
|||
23 Apr 2006, 03:30 |
|
Tomasz Grysztar 23 Apr 2006, 09:27
The first section of Design Principles is about this topic (among other things).
RedGhost: the point here is that with NASM, even this: Code: mov [thevarible],1 wouldn't assemble (for fasm it is OK though, as fasm remembers that variable was defined with DW). EVEN WORSE, this: Code: mov al,[thevarible] would assemble under NASM, even though there's most probably a programmer's mistake here, as 16-bit variable cannot fit in 8-bit register. fasm, just like TASM and MASM, catches this kind of error. |
|||
23 Apr 2006, 09:27 |
|
f0dder 23 Apr 2006, 09:53
It's really nice that FASM remembers type (or size, whatever ) of variables while still being a low-level assembler. IMHO, not remember variable type/size is plain lazyness from the assembler writers side.
Kudos, Tomasz! |
|||
23 Apr 2006, 09:53 |
|
RedGhost 24 Apr 2006, 06:07
Tomasz Grysztar wrote: The first section of Design Principles is about this topic (among other things). ah how could i forget having to prefix everything with 'dword' 'word' 'byte' in NASM, made some of the code look ugly imo _________________ redghost.ca |
|||
24 Apr 2006, 06:07 |
|
Al 27 May 2006, 15:11
Sorry for the error in my first post - dw surely is always 16 bits, I just mistyped or something
So Flat Assembler remembers the types (or better said sizes) of variables. That's nice to hear! |
|||
27 May 2006, 15:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.