flat assembler
Message board for the users of flat assembler.
Index
> Windows > how do i do this in FASM |
Author |
|
madmatt 27 Jul 2006, 06:46
could you show the code where this structure is defined?
|
|||
27 Jul 2006, 06:46 |
|
FrozenKnight 27 Jul 2006, 07:50
never mind i figured it out
|
|||
27 Jul 2006, 07:50 |
|
Angler 28 Jul 2006, 08:16
could you help me?
How to translate code like (Delphi) try ... finally ... end; into FASM? |
|||
28 Jul 2006, 08:16 |
|
vid 28 Jul 2006, 08:31
hardly.
no, really. i am not sure about delphi, but i believe it something with SEH. There was already something about SEH on this forum, so search it, and google for it |
|||
28 Jul 2006, 08:31 |
|
Tomasz Grysztar 28 Jul 2006, 08:38
Really? I always thought try-finally is just a structural substitute for the error-handling jumps (just to make one more excuse to use GOTO inapplicable). Makes not much sense if you are really into assembly, IMHO.
|
|||
28 Jul 2006, 08:38 |
|
zhak 28 Jul 2006, 09:16
yes, TRY is exception handling in delphi. As far as I remember, you can define a block of code to TRY and set exception handling routine with EXCEPT directive. So, if TRY block fails, then EXCEPT block will be executed. FINALLY is executed in all circumstances, and if EXCEPT block wasn't defined, then program will end with error.
|
|||
28 Jul 2006, 09:16 |
|
Mr_Silent 28 Jul 2006, 10:44
|
|||
28 Jul 2006, 10:44 |
|
Tomasz Grysztar 28 Jul 2006, 13:00
At least for try-throw-catch-finally combination I don't really see why exceptions would be needed. The throw-catch can be implemented with simple conditional jump.
Of course there is also division by zero, etc. - but usually the exceptions are not really needed to handle errors. |
|||
28 Jul 2006, 13:00 |
|
Angler 29 Jul 2006, 09:51
Спасибо!!! Thank you!!
|
|||
29 Jul 2006, 09:51 |
|
Angler 29 Jul 2006, 15:12
Code: proc OpenCD drive mov [Flags],MCI_OPEN_TYPE or MCI_OPEN_ELEMENT mov [OpenParm.dwCallback],0 mov [OpenParm.lpstrDeviceType],szDeviceType ; = 'CDAudio' push [drive] pop [OpenParm.lpstrElementName] invoke mciSendCommand,0,MCI_OPEN,[Flags],OpenParm cmp eax,0 jne .finish push [OpenParm.wDeviceID] pop [DeviceID] invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_OPEN,0 invoke mciSendCommand,[DeviceID],MCI_CLOSE,[Flags],OpenParm .finish: ret endp I've read about SEH.. But it's hard to understand. How to execute last opcode? Code: invoke mciSendCommand,[DeviceID],MCI_CLOSE,[Flags],OpenParm Actually, the question is how to execute this code for sure, if the code: "invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_OPEN,0" is executed? Does anybody have an idea or suggestion? Thank you? |
|||
29 Jul 2006, 15:12 |
|
Angler 29 Jul 2006, 15:13
Anyway, thanx..
|
|||
29 Jul 2006, 15:13 |
|
vid 29 Jul 2006, 15:22
that code is executed always when "invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_OPEN,0" is executed - because it's just behind it and there is no jump between then
btw: Quote: How to execute last opcode? it's macro call, that is assembled to set of instructions opcode is numeric representation for one instruction, for example opcode for NOP is 90h |
|||
29 Jul 2006, 15:22 |
|
okasvi 29 Jul 2006, 16:10
vid wrote: that code is executed always when "invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_OPEN,0" is executed - because it's just behind it and there is no jump between then I've always thought it's macro call which is preprocessed to set of instructions which are assembled to binary(opcodes), no? Might be that I've just read wrong, my english isnt very good _________________ When We Ride On Our Enemies support reverse smileys |: |
|||
29 Jul 2006, 16:10 |
|
Angler 29 Jul 2006, 18:46
vid wrote: that code is executed always when "invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_OPEN,0" is executed - because it's just behind it and there is no jump between then You didn't understand.. When program sends message to CD/DVD Code: invoke mciSendCommand,[DeviceID],MCI_SET,MCI_SET_DOOR_CLOSED,0 there might be some problems with a few types of CD/DVD. And i need to give handle back to the Windows, with Code: invoke mciSendCommand,[DeviceID],MCI_CLOSE,[Flags],OpenParm But due to error in the first statement (the error message appears), the 2nd is not executed. So CD/DVD becomes locked, and it will be unlocked only after restarting Windows. |
|||
29 Jul 2006, 18:46 |
|
Angler 29 Jul 2006, 18:50
And as for macrocall and opcode you are right, but i thought that they are the same.
|
|||
29 Jul 2006, 18:50 |
|
Reverend 29 Jul 2006, 20:46
Win32 API Reference wrote: mciSendCommand |
|||
29 Jul 2006, 20:46 |
|
Angler 03 Aug 2006, 10:00
Thank you Reverend i figured out the problem. =)
|
|||
03 Aug 2006, 10:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.