Re: HLA v1.69 crashes over this source!
From: NoDot (no_dot_at_msn.com)
Date: 08/21/04
- Next message: The Wannabee: "Re: Structures in Assembly Language"
- Previous message: Betov: "Re: ADK/HLA v2.0 Update"
- In reply to: Purple_Cochoa: "HLA v1.69 crashes over this source!"
- Next in thread: Randall Hyde: "Re: HLA v1.69 crashes over this source!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Aug 2004 10:58:08 -0700
"Purple_Cochoa" <green_cochoa@yahoo.com> wrote
> However, what's surprising is that instead of just
> reporting the error, hlaparse.exe also crashes on my
> WinXP box, bringing up the usual, "hlaparse has encountered
> a error and needs to close bla-bla-bla" XP dialog box.
I never liked having to see those things.
> The source HLA crashes over is a simple, (though probably
> syntactically incorrect), ten liner and is appended to
> this post.
Ten lines? That just plain hurts.
> I just thought I'd bring this to Randy's attention so
> that he'll be able to sort out the fault in HLA v1.69.
Let's hope so.
> program GrandTotal;
> #include( "stdlib.hhf" )
>
> static
> GrandTotal: int32;
> CurrentInput: int32;
> NoOfInputs: int32 := 0;
>
> begin GrandTotal;
>
> stdout.put( nl, "This HLA program keeps track othe
> running total of"
> nl, "signed integer values, and when '0' is entered, it "
> "prints", nl, "the total number of values entered, their"
> " grand total and exits.", nl );
>
> get_next_value:
>
> stdout.put( nl, "Enter ", (NoOfInputs + 1), " value: " );
> stdin.get( CurrentInput );
>
> mov( CurrentInput, eax );
> cmp( eax, 0 );
> jz( do_exit );
> inc( NoOfInputs );
> add( eax, GrandTotal );
> jmp( get_next_value );
>
> do_exit:
> stdout.put( nl, nl, "You entered ", NoOfInputs, " values.", nl,
> "The grand total of all values is: ", GrandTotal, nl );
>
> end GrandTotal;
One or two size optimization faults is all I see. It seems to be
syntactivlly correct.
> sorry if format isn't nice, but I'd think Randy can
> figure it out.
It only has to do with the look of this place, so don't worry.
> I'm also including below, a little of the error
> information reported by WinXP:
>
> Exception info:
> code: 0xc0000005 Flags: 0x00000000
> Record: 0x0000000000000000 Address: 0x0000000000498237
>
> Thread 1
> Thread ID: 0x000006a8
> Context:
> EDI: 0x7ffdf000 ESI: 0x00000000 EAX: 0x01df0000
> EBX: 0x014947e0 ECX: 0x00001000 EDX: 0x00000000
> EIP: 0x7ffe0304 EBP: 0x01494834 SegCs: 0x0000001b
> EFlags: 0x00000202 ESP: 0x01494798 SegCs: 0x00000023
I don't know is this will help, but let's hope so.
I'll now check if it crashes on my computer as well... It crashes
here as well.
Also, here is an error you made:
> stdout.put( nl "Enter ", (NoOfInputs + 1), " value: " );
You made a big mistake trying to do this. You can't try to add one to
a static variable like this. You'd have to load it into a register,
do an inc instruction, and then print the new value. You could also
just declare NoOfInputs as one and dec before printing it at the end.
Something else is that there was a duplicate symbol error with
GrandTotal. You're using it as the program name and as a variable...
Wait one moment...
Changing the GrandTotal variable to "GrandTotal_" and removing the
constant expression removes the crash. The other errors should be
easy for even you to fix. (Such as changing "jz(do_exit);" to "jz
do_exit;".)
- Next message: The Wannabee: "Re: Structures in Assembly Language"
- Previous message: Betov: "Re: ADK/HLA v2.0 Update"
- In reply to: Purple_Cochoa: "HLA v1.69 crashes over this source!"
- Next in thread: Randall Hyde: "Re: HLA v1.69 crashes over this source!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|