News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

except.asm file

Started by component, March 16, 2010, 07:33:11 PM

Previous topic - Next topic

component


:boohoo:

hi i had except.asm before and can't remember what to do about the data type error

Data type given in LOCAL data declaration not recognised:-
OSVERSIONINFO

please help i need this thing up and working  :cheekygreen:

BlackVortex

OSVERSIONINFO is a structure, you have to define it yourself, or better : include some header file with it.

This should work,lol
#include windows.h

component

thanks blackvortex ....
ya i downloaded it from goasm site and its a complete work but it's all in how you set up the assembler line "try it" its an exception tut on jeremy's site
i will try it any how... thanks tons again BlAcKVoRtEx :U

BlackVortex

#DEFINE LINKFILES
#include windows.h

CODE SECTION
START:

push addr handler
fs push [0]
fs mov [0],esp

xor eax,eax
div eax                                  ; we force a division by zero to simulate an error
invoke MessageBox, NULL, "Normal execution code, if there isn't an error !", "Normal", MB_ICONERROR

fs pop [0]
add esp,4h
invoke ExitProcess, NULL

;***********************
handler:
invoke MessageBox, NULL, "Exception occured, exiting !", "Exception !", MB_ICONERROR
invoke ExitProcess, 0DEADh               ; Exiting with some macabre error code


I usually dont use exceptions, I'm a godly programmer and nothing ever goes wrong  :toothy
But check out that lame example I made, note the includes as well.

component

BlackVortex this is funny stuff "Exiting with some macabre error code"
BlackVortex

I needed that exact exception code working it was found here   

http://www.quickersoft.com/donkey/files/Except.zip

ThAnKs Again BllACKKKKVOOOOOOOOOOOooooooooRteeeeeExxxxxxxxxx

donkey

Quote from: component on March 17, 2010, 05:57:45 PM
I needed that exact exception code working it was found here   

http://www.quickersoft.com/donkey/files/Except.zip

I'm not sure what you're saying, is there a bug in my exception handling example ?

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

component

     Edgar      Noooooo im not saying the code has any problem

ya see i lost all my fancy batch files cd rom and i can't remember how to compile except.asm

1. is it that i need to compile the rc files first with gorc
2. did i need to add some line command that i dont remember

please type something that will get me up and running with except.asm

thank you for your reply... thats really nice of ya...


by the way it would be cool if jeremy had a video called "Watch Jeremy Code !!!" and he types out different command's and
assembles some code for newbee's and it would look really user friendly etc...

donkey

The build command for my except.asm is:

\GoAsm\BIN\GORC.EXE /r "Except.rc"
\GoAsm\BIN\GoAsm.EXE "Except.asm"
\GoAsm\BIN\GoLink.EXE "Except.obj" "Except.res"


The zip contains a RadAsm project, you should really look at using Ketil's IDE, all of my examples are RadAsm projects and it does make assembling and building them very easy, just select the project type and it does the rest. Though it will assemble just fine without RadAsm using a batch file.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

component


ASS-embler Edgar

thank you Edgar...
I notice your use of "\" before GoAsm, Very nice reminds me of the nice unix batch file i had on my long lost
batch cd, took me years to get really nice batch files together, i will post some wide dos commands %path% when i get good again
its been awhile since i got to have time ...etc to get back here and enjoy

again thank Edgar and also big thanks to Jeremy's team for making sure i got my new registered debug update
that goes to show how much this site and it's team is on the ball, rock on Assembler Peeps :cheekygreen: