flat assembler
Message board for the users of flat assembler.
Index
> Main > [help needed] Converting MASM to FASM. |
Author |
|
bitRAKE 09 May 2008, 13:31
add eax,@SendDta - @ThreadSendDta + 4
on the later piece you want to use .if/.endif _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
09 May 2008, 13:31 |
|
revolution 09 May 2008, 13:52
Make sure you have included "if.inc" (win32ax.inc will automatically include it), and use lower case for .if/.endif like bitRAKE mentioned.
|
|||
09 May 2008, 13:52 |
|
SomeoneNew 09 May 2008, 13:56
I tried doing add eax,SendDta - ThreadSendDta + 4 and sure it works (apparently) but the point is, I don't like to hard-code values such as that, even if DWORD is a constant 4 bytes :/
what bitRAKE suggested (with the @) gives me undefined symbol error, any ideas? - again, they are labels. thanks |
|||
09 May 2008, 13:56 |
|
revolution 09 May 2008, 14:03
How did you define the symbols? If you define them with a @... then you must also reference them with the @.
Are SendDta and ThreadSendDta structures? If so how are you defining them? Are you using the fasm macro struct or the assembler struc (note the trailing t, is it there or not)? IIRC the fasm macro struct will also define sizeof.SendDta and sizeof.ThreadSendDta. |
|||
09 May 2008, 14:03 |
|
bitRAKE 09 May 2008, 14:20
SomeoneNew wrote: I tried doing add eax,SendDta - ThreadSendDta + 4 and sure it works (apparently) but the point is, I don't like to hard-code values such as that, even if DWORD is a constant 4 bytes :/ Let us pretend it is a pointer: Code: virtual at 0 POINTER rd 1 POINTER.bytes = $-POINTER end virtual add eax,SendDta - ThreadSendDta + POINTER.bytes Maybe adding a comment to the code line is sufficient? _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
09 May 2008, 14:20 |
|
SomeoneNew 09 May 2008, 14:54
Hi, thanks
The symbols are actually labels in the code, I defined them without the @ so my bad for asking (I become even dumber after 24hs of straight coding). I see theres no need to use PTR or OFFSET in FASM because its got a cleaner syntax, right?. I got confused at first but now its crystal clear! _________________ Im new, sorry if I bothered with any stupid question |
|||
09 May 2008, 14:54 |
|
bitRAKE 10 May 2008, 01:02
SomeoneNew wrote: I see theres no need to use PTR or OFFSET in FASM because its got a cleaner syntax, right?. I got confused at first but now its crystal clear! _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
10 May 2008, 01:02 |
|
rugxulo 24 May 2008, 22:14
You could also try JWasm, a fork of OpenWatcom's assembler that's intended to have better MASM support.
|
|||
24 May 2008, 22:14 |
|
ic2 25 May 2008, 04:45
Just FYI... When I finally try FASM seriously, I had tranlanted years of MASM basic coding to POASM than this year I hit FASM. Lucky me, most of my project was FASM ready becaause of that... POASM is really something special and I hope no one of MASM ever overlook that fact.
|
|||
25 May 2008, 04:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.