flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Quantum 31 Jul 2006, 18:55
Quote:
Why not use TLS? |
|||
![]() |
|
LocoDelAssembly 31 Jul 2006, 19:00
If I remember well the TLS slot for the EXE module is 0 so doing "mov dword [fs:0], something" should be enough. For DLLs you should use the API function to get a slot.
Regards |
|||
![]() |
|
Thaorius 31 Jul 2006, 19:12
you could set the CF to 1 and do something like this:
Code: lea eax,ERROR_OOOPPS ERROR_OOOPPS db 'Something is wrong...',13,10,0 then you return from the procedure and that is, you should have the memory address of the message and even you can use something like putting on ah the memory address and in al some error number. Bye |
|||
![]() |
|
vid 01 Aug 2006, 07:32
Thaorious - that's way i use already, but i also need some strings created dynamically (like "Error in procedure %s: arg1 = %8X, arg2 = %8X" etc...), so i need memory for this
what's that TLS? i am not familiar with it |
|||
![]() |
|
Reverend 01 Aug 2006, 12:31
TLS is only in PE files. FASMLIB is supposed to be OS-independent, and so error handling must be the same on all OSes.
|
|||
![]() |
|
shoorick 01 Aug 2006, 13:26
it is possible with additional optional parameter. if caller wish to get error info - it allocates space for error structure and pass pointer as parameter to the function (it has to be able to fill it) - if there is no error - it simply deleted, otherwise - used (filled by called function, of course). if caller do not care about error - 0 passed as this parameter. that structure can be created even in stack as local var, so, no problems with multythreading.
|
|||
![]() |
|
LocoDelAssembly 01 Aug 2006, 14:40
You have Thread Local Store (TLS) on Windows and Thread Specific Data (TSD) on Linux. Again if I remember well on Linux you can use "mov [fs:0], something" but I'd never used it on Linux so you must Google it.
|
|||
![]() |
|
LocoDelAssembly 08 Sep 2006, 15:10
locodelassembly wrote: If I remember well the TLS slot for the EXE module is 0 so doing "mov dword [fs:0], something" should be enough. For DLLs you should use the API function to get a slot. Absolutelly wrong. Microsoft systems journal - Under The Hood [MATT PIETREK] wrote:
http://www.microsoft.com/msj/0298/hood0298.aspx |
|||
![]() |
|
jbojarczuk 09 Sep 2006, 03:34
[fs:0] is the head of the exception handling linked list.
If you want more info, contact me. |
|||
![]() |
|
LocoDelAssembly 09 Sep 2006, 14:51
There was a big mess yesterday for that http://board.flatassembler.net/topic.php?t=5807
Thanks anyway. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.