News:

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

Dont Thread The BOX!

Started by StatusQuo, December 07, 2011, 05:45:04 PM

Previous topic - Next topic

mineiro

Allright, I'm going to my work StatusQuo. You need change the invoke's:
      INVOKE   GetConsoleCursorInfo, Handit1, ADDR Curs
to this:
      push offset Curs
      push Handit1
      call GetConsoleCursorInfo

StatusQuo

Quote from: mineiro on December 09, 2011, 05:10:42 AM
Allright, I'm going to my work StatusQuo. You need change the invoke's:
      INVOKE   GetConsoleCursorInfo, Handit1, ADDR Curs
to this:
      push offset Curs
      push Handit1
      call GetConsoleCursorInfo

Thanks for the info, good day.
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

anunitu

Here is a link for the help file I mentioned..The Hardware book.

http://margo.student.utwente.nl/stefan/hwb/hwb.html

Very good reference for making your own cables.

Scroll down to where it says download.
Lots of other hardware stuff also.

StatusQuo

Quote from: anunitu on December 13, 2011, 04:25:57 PM
Here is a link for the help file I mentioned..The Hardware book.

http://margo.student.utwente.nl/stefan/hwb/hwb.html

Very good reference for making your own cables.

Scroll down to where it says download.
Lots of other hardware stuff also.

I am actually at the same problem you mentioned much earlier. I got it to Assemble, but for some odd reason, it is complaining about the compatibility within my machine, so it is not running. I will check this site out now. Thank you for thinking of me.   :bg
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

StatusQuo

Okay guys I got the code working and I played around with the PROC calling, and now my program works but it doesnt run, does anyone have a second opinion that you guys might give? Please check the attachment
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

Gunner

in your FORMAT proc, you have a ret THEN call WriteScreenTitle, guess what... you won't reach WriteScreenTitle since the proc returns before that.

same thing in CURPOS you have a call AFTER the ret...  same thing in WINDESC and WriteScreenTitle and InitProc

fix those and you should be good to go

EDIT:
I missed...  You invoke MAKEWIN with parameters when it takes 2 parameters which is correct..  but on line 63, you call MAKEWIN without pushing 2 args onto the stack... that might/will give you problems.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

StatusQuo

Quote from: Gunner on December 14, 2011, 01:42:49 AM
in your FORMAT proc, you have a ret THEN call WriteScreenTitle, guess what... you won't reach WriteScreenTitle since the proc returns before that.

same thing in CURPOS you have a call AFTER the ret...  same thing in WINDESC and WriteScreenTitle and InitProc

fix those and you should be good to go

EDIT:
I missed...  You invoke MAKEWIN with parameters when it takes 2 parameters which is correct..  but on line 63, you call MAKEWIN without pushing 2 args onto the stack... that might/will give you problems.

I fixed it, yet the program still crashes. Perhaps it is the form I have them calling each other, that is getting the program to crash. I dont know yet, I still need reference. Behold the corrections....
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

Gunner

Have you tried stepping through your program in a debugger?

Still on line 63, you are not pushing 2 parameters on the stack when MAKEWIN expects 2 parameters so the stack pointer will be messed up.

On line 67 you do:
INVOKE MAKEWIN, 1, 3 which is correct

So line 63 should be like:
push    2 ; or whatever number you need
push    3 ; another number you need
CALL MAKEWIN
            
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

StatusQuo

Quote from: Gunner on December 14, 2011, 02:00:09 AM
Have you tried stepping through your program in a debugger?

Still on line 63, you are not pushing 2 parameters on the stack when MAKEWIN expects 2 parameters so the stack pointer will be messed up.

On line 67 you do:
INVOKE MAKEWIN, 1, 3 which is correct

So line 63 should be like:
push    2 ; or whatever number you need
push    3 ; another number you need
CALL MAKEWIN
            


Could you explain that just a little bit? Because invoking it would mean the same way as pushing it. Or rather, they both mean the samething doesnt it?
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

StatusQuo

By The Way, I made the changes and I still get the same effect, nothing but crash and burn.
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

Gunner

In one place you are invoking correctly with 2 parameters, MASM will assemble it to 2 pushes an a call

so when you do inovke MAKEWIN, 1, 3

MASM will assemble it to
push 3
push 1
call MAKEWIN

BUT on line 63 you only do call MAKEWIN WITHOUT pushing any paramters onto the stack so the stack pointer will be screwed up and probably the cause of your crash.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

StatusQuo

Quote from: Gunner on December 14, 2011, 02:08:52 AM
In one place you are invoking correctly with 2 parameters, MASM will assemble it to 2 pushes an a call

so when you do inovke MAKEWIN, 1, 3

MASM will assemble it to
push 3
push 1
call MAKEWIN

BUT on line 63 you only do call MAKEWIN WITHOUT pushing any paramters onto the stack so the stack pointer will be screwed up and probably the cause of your crash.


I understand now, but weither it is pushed into the stack, it will still crash.
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

StatusQuo

Quote from: Gunner on December 14, 2011, 02:08:52 AM
In one place you are invoking correctly with 2 parameters, MASM will assemble it to 2 pushes an a call

so when you do inovke MAKEWIN, 1, 3

MASM will assemble it to
push 3
push 1
call MAKEWIN

BUT on line 63 you only do call MAKEWIN WITHOUT pushing any paramters onto the stack so the stack pointer will be screwed up and probably the cause of your crash.

I fixed it actually, now I get a box, the trick was to take OUT the CALL MAKEWIN because your right, i wasnt passing anything, so from there, I can play along a little bit further.
Then God sad, "In the beginning....There was SCOPE!", Then I asked, "What is Scope?", and God said...."A Stack Frame, geeze I forgot to include you with common sense, BUT a prototype you are, too wierd to live, to rare to die...", and it was written....

Gunner

Step through a debugger.  It is your best friend.

in CURPOS you are calling format WITHOUT pushing anything onto the stack when the FORMAT proc expects 1 argument.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

Gunner

Yes, I found that out too by running the code through a debugger so I make a number bigger... but you should handle that in code to catch a small number.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com