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

StatusQuo

Quote from: Gunner on December 09, 2011, 03:11:18 AM
What Dave is saying, don't use tabs, or convert them to spaces.  A space is a space.  Your tab might be equal to 5 spaces, someone else - 3.  

I can understand that Gunner, but like i said earlier, use tabs or hear my bigot teacher say "10 points off" because i dont appropiate to HIS terms...Well the scale out weights itself....
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....

Magnum

This is used in 16 bit code.

.MODEL            SMALL
.STACK            100h

You probably ought to be sleeping at 3:45 am.  :bg

;My 3:45AM Buzz Kill.

I get these errors when trying to compile it.

C:\masm32\SOURCE\status.asm(38) : error A2005:symbol redefinition : WINDESC
C:\masm32\SOURCE\status.asm(44) : error A2008:syntax error : ,
C:\masm32\SOURCE\status.asm(52) : fatal error A1010:unmatched block nesting : WINDESC

Have a great day,
                         Andy

StatusQuo

Quote from: mineiro on December 09, 2011, 03:13:02 AM
WINDESC            SMALL_RECT<>   ;you put this in .data section
WINDESC            PROC ;the same name to reference a procedure, but now, this is code
...
Curs   CONSOLE_CURSOR_INFO <> ; first letter Uppercase = Curs
PUSH   OFFSET curs                        ;first letter here is not Uppercase = curs
...
;               INVOKE   SetConsoleWindowInfo, Handit1, TRUE, ADDR WINDESC
push offset WINDESC        ;push last one at right -->Question: What it need push? the WINDESC SMALL_RECT structure or the offset of WINDESC procedure?
push TRUE                       ;push before last one
push Handit1                    ;push before before last one
call SetConsoleWindowInfo
...


the offset of WINDESC procedure, but if noticed on the commented INVOKE above that, it took care of the WINDESC Procedure, but in the sake of downgrading this to a basic make32, I relayed on PUSH & CALL commands like Dave suggested. The WINDESC SMALL_RECT is kind of a structure I took from the professor exaple, i.e:

WINDESC   STRUCT
                UpperRow     BYTE ?
                LeftCol     BYTE ?
                LowerRow     BYTE ?
                RightCol     BYTE ?
                foreColor     BYTE ?
                backColor     BYTE ?
WINDESC   ENDS

then in HIS example, he would have a different .Data, I.E
.DATA
APPLICATION         WINDESC     <05h, 05h, 15h, 45h, 07h, 10h>

the problem is, his example is COMPLETE 16bit...
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: Magnum on December 09, 2011, 03:17:34 AM
This is used in 16 bit code.

.MODEL            SMALL
.STACK            100h

You probably ought to be sleeping at 3:45 am.  :bg

;My 3:45AM Buzz Kill.

I get these errors when trying to compile it.

C:\masm32\SOURCE\status.asm(38) : error A2005:symbol redefinition : WINDESC
C:\masm32\SOURCE\status.asm(44) : error A2008:syntax error : ,
C:\masm32\SOURCE\status.asm(52) : fatal error A1010:unmatched block nesting : WINDESC



Because I zipped the wrong Testdrive, I KNOWWWWWWWWWW LOL, but i am determined, Ive applied the one i am CURRENTLY working on at the moment. That has an ERROR in the bottom on the MAIN, i called it TWICE, maybe thats why.
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....

dedndave

well - i got it to assemble by commenting out the CALL WINDESC line
but - nothing happens
if i press a key, the program terminates   :U

maybe we should have a look at the professor's example code

by the way - i cleaned things up a bit
see if you can read it a little better   :bg

i am going to go visit mom for a few
i will be back later tonight and work on it a little more, if you like

dedndave

you have 3 different posts with attachments named TESTDRIVE4 - lol
no wonder we are having issues   :P

StatusQuo

Quote from: dedndave on December 09, 2011, 03:32:44 AM
you have 3 different posts with attachments named TESTDRIVE4 - lol
no wonder we are having issues   :P

So sorry bro, but the lastest I have been typing up is the 4th one i just put up not to long ago and I dont think i am going to change anymore until i make something up even better. The professors example, which i wrote is a COMPLETE 16bit program that i labled as ProfBox, his method...
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....

mineiro

Quote from: StatusQuo on December 09, 2011, 03:20:42 AM
the offset of WINDESC procedure
So, this will pass a wrong parameter to that call, can you see. The function SetConsoleWindowInfo need that the 3rd parameter be a pointer (offset) to a structure.

StatusQuo

Quote from: mineiro on December 09, 2011, 03:39:51 AM
Quote from: StatusQuo on December 09, 2011, 03:20:42 AM
the offset of WINDESC procedure
So, this will pass a wrong parameter to that call, can you see. The function SetConsoleWindowInfo need that the 3rd parameter be a pointer (offset) to a structure.


o_o awww dude dont say that to me now  :'( I might have to re-evaluate this program, suppose if I push WINDESC SMALL_RECT, I have an idea of the outcome but I want to play the safeside and and rather hear other options you might give.
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....

mineiro

WINDESC procedure need's be called. So search for "call WINDESC" and change to "call descwin".
Search for "WINDESC proc" and change to "descwin proc".
search for "WINDESC endp" and change to "descwin endp"
...
I be honest(diplomatic) with you, I have cleaned your code, but the flow of your code do not do what it is supposed to do.

StatusQuo

Quote from: mineiro on December 09, 2011, 03:54:51 AM
WINDESC procedure need's be called. So search for "call WINDESC" and change to "call descwin".
Search for "WINDESC proc" and change to "descwin proc".
search for "WINDESC endp" and change to "descwin endp"
...
I be honest(diplomatic) with you, I have cleaned your code, but the flow of your code do not do what it is supposed to do.


but how so? I had to work earlier, and I dont see how flip flopping the WINDESC would change that. Could you please explain to me that situation. Also did you see the ZIP file from my professors example? I am basing it on his, in a way.
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....

mineiro

I have download that example, and is very similar to one that I have seen.
What I'm saying to you is; you need review the flow of you code after cleaned it. Inside your code have what you need, but you do not have called it in the right way, following some sequence.
This is your code cleaned, but I have removed your's previous works.

StatusQuo

Quote from: mineiro on December 09, 2011, 04:30:15 AM
I have download that example, and is very similar to one that I have seen.
What I'm saying to you is; you need review the flow of you code after cleaned it. Inside your code have what you need, but you do not have called it in the right way, following some sequence.
This is your code cleaned, but I have removed your's previous works.

I am re-drawing my outline now. So instead of having everything being called in the MAIN, ill just call one PROC upon another. I.E:
1. MAIN PROC
2. MAKEWIN
3.WINDESC1
4.CURPOS
5.PUTCHAR

and etc? An old friend once told me that a MAIN PROC does one thing at a time.
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....

mineiro

No Sr, I will be precise now, in your example, your last line is:
END   speedracer
and need be:
END MAIN

Your program is working, but because that mistake, all changes.
That posted code(your code) is working and clean, but I have only removed your low level.

StatusQuo

Quote from: mineiro on December 09, 2011, 04:52:31 AM
No Sr, I will be precise now, in your example, your last line is:
END   speedracer
and need be:
END MAIN

Your program is working, but because that mistake, all changes.
That posted code(your code) is working and clean, but I have only removed your low level.

But kind Sr, low level is what I NEED. I understand the irrelivancy of MANY of the lines in my programs, the trick is in my mind Sr, I have gone to extent of learning new, for the first time, a man tells me to do it an OLD fashionate way. Meer Basic and OLD to an extent, that i was looping the entire program in a MASM32 laptop that speedrace wasnt the issue. The issue at hand is, how far older can I turn this program into without the use of Irvine32, nor MASM32, but in a basic make32 bit. I got it working on that level with MASM32. With that being said, thank you for the small detail i missed out on. I am having quite better results on the program but still a few errors like the one mentioned in earlier post. Thank You Sincerely minderio
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....