flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
madmatt
could you show the code where this structure is defined?
|
|||
![]() |
|
FrozenKnight
never mind i figured it out
|
|||
![]() |
|
Angler
could you help me?
How to translate code like (Delphi) try ... finally ... end; into FASM? |
|||
![]() |
|
vid
![]() 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 |
|||
![]() |
|
Tomasz Grysztar
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.
|
|||
![]() |
|
zhak
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.
|
|||
![]() |
|
Mr_Silent
|
|||
![]() |
|
Tomasz Grysztar
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. |
|||
![]() |
|
Angler
Спасибо!!! Thank you!!
|
|||
![]() |
|
Angler
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? |
|||
![]() |
|
Angler
Anyway, thanx..
|
|||
![]() |
|
vid
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 |
|||
![]() |
|
okasvi
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? ![]() ![]() _________________ When We Ride On Our Enemies support reverse smileys |: |
|||
![]() |
|
Angler
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. |
|||
![]() |
|
Angler
And as for macrocall and opcode you are right, but i thought that they are the same.
|
|||
![]() |
|
Reverend
Win32 API Reference wrote: mciSendCommand |
|||
![]() |
|
Angler
Thank you Reverend i figured out the problem. =)
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.