News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

registers as pointer q

Started by dc, September 08, 2023, 04:00:09 AM

Previous topic - Next topic

zedd151

Quote from: jj2007 on September 13, 2023, 11:05:03 PMGo back six years: fat exe but no source
Yes, I saw that also.

Still waiting for dc's reply. I will close this thread unless dc can furnish his source code.


Edit to add:  Thank you... for posting your project below.

dc

qmaz.zip
sorry about that... sent an admin link by mistake

zedd151

Quote from: dc on September 14, 2023, 12:22:48 AMqmaz.zip
sorry about that... sent an admin link by mistake

Ok. Thanks. Where in the code are you having the issues?
Post that snippet... now we know where it comes from. :smiley:

jj2007, dc, I have removed a couple posts above to tidy up

And dc, I apologize for all the scrutiny.

jj2007

Quote from: dc on September 14, 2023, 12:22:48 AMqmaz.zip
sorry about that... sent an admin link by mistake

We are almost there:
Cannot open file: "dxbase.def"

zedd151

Assembling: maze.asm

***********
ASCII build
***********

dxfunc.inc(12) : fatal error A1000: cannot open file : dxbase.def
Press any key to continue . . .

where is dxbase.def -- ??
btw, the project looks pretty impressive.  :thumbsup:  A good candidate for the Game Development board.
I will leave it to the assembly gurus to assist you from here.  Thank you for posting your code.  :azn:

dc

ooops... it might need all the direct x defs to work. ill experiment and see... maybe only the one is needed

zedd151

Quote from: dc on September 14, 2023, 01:22:03 AMooops... it might need all the direct x defs to work. ill experiment and see... maybe only the one is needed

You can just zip those and post them here. No need to reupload the entire project again.  :smiley:

dc

You cannot view this attachment.

jj2007

Hi dc,

When trying to build your project, I got many error messages. With minor modifications to four files, all attached, I got it running, though - with UAsm but not with ML:
cannot open file : oaidl.inc
cannot open file : olectl.inc

If your project built without errors on your machine, there are two possible reasons:
1. You have an old version of the Masm32 SDK
2. You changed include files of the Masm32 SDK

If the version is old, get the latest one (if \Masm32\include\windows.inc is of 10 Jan 2012 and has 977,412 bytes, you got the latest one).

Under no circumstances, never, should you change the original Masm32 SDK files, for a very simple reason: doing that, your code becomes incompatible with the SDK, and nobody can help you. It is a hundred times better to adapt your sources to the SDK than the other way round!

The exe works, it looks like a big game, compliments :thumbsup:

Now it's time to explain where you see problems to solve: file name, line number, and three lines of code, please, so that we can check what's needed.

dc

im gonna have to assume that a pointer and an index are not used together at all in ml... please prove me wrong...
thanx

jj2007

mov eax, somevar[ecx]

Proved wrong :thumbsup:

NoCforMe

Hmm, JJ: not to split hairs here or anything but isn't

    MOV    EAX, somevar[ECX]

an example of an index (ECX) only? Where's the pointer? I'm assuming that somevar is an array, with ECX indexing into it, right?

How about this--would you say this shows both a pointer (EBX) and an index (ESI)?

LEA EBX, somevar
MOV ESI, indexVal
MOV EAX, [EBX + ESI]

Anyhow, to the OP: Why so much confusion in your mind between pointers and indices? Can you give us a better clue as to where exactly you're having trouble understanding this concept? I know it's not trivial, and trips up a lot of beginners, but at the same time it ain't rocket science ...
Assembly language programming should be fun. That's why I do it.

HSE

Quote from: NoCforMe on September 25, 2023, 07:07:59 AM    LEA    EBX, somevar
    MOV    ESI, indexVal
    MOV    EAX, [EBX + ESI]

If you store dwords usually must be:

    LEA    EBX, somevar
    MOV    ESI, index
    MOV    EAX, [EBX + ESI*4]
Equations in Assembly: SmplMath

dc

i get pointer 'pArray' from globalAlocate
then try to access it like:
mov esi,index
shl esi,2
mov eax,pArray
bt [eax+esi],0
jc @f
i get errors in assembly
ive tried:
bt [eax][esi],0

bt dword ptr eax[esi],0

bt dword ptr pArray[esi]
if anything assembles without error it isn't the allocated memory being accessed...

Caché GB

#59
Quote from: dc on September 25, 2023, 06:10:48 AMim gonna have to assume that a pointer and an index are not used together at all in ml...

Interesting
Caché GB's 1 and 0-nly language:MASM