flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
bitRAKE
add eax,@SendDta - @ThreadSendDta + 4
on the later piece you want to use .if/.endif |
|||
![]() |
|
revolution
Make sure you have included "if.inc" (win32ax.inc will automatically include it), and use lower case for .if/.endif like bitRAKE mentioned.
|
|||
![]() |
|
SomeoneNew
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 ![]() |
|||
![]() |
|
revolution
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. |
|||
![]() |
|
bitRAKE
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? |
|||
![]() |
|
SomeoneNew
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 ![]() |
|||
![]() |
|
bitRAKE
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! |
|||
![]() |
|
rugxulo
You could also try JWasm, a fork of OpenWatcom's assembler that's intended to have better MASM support.
|
|||
![]() |
|
ic2
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.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.