The MASM Forum

General => The Campus => Topic started by: kiptron on March 28, 2020, 01:01:14 PM

Title: assembler doesn't like newer opengl32.inc
Post by: kiptron on March 28, 2020, 01:01:14 PM
 Hello again comrades, Trying to get opengl going in a simple 64 bit build. Newer version of
opengl32.inc contains symbol PPROC   The assembler can't find it  "undefined symbol PPROC" 100 times.
I have looked all over for this symbol, no luck. I think it's a 32 bit pointer. Does this .inc file need
work, like getting pointers for all the OGL functions ?  Thanks,  comrade kiptron
Title: Re: assembler doesn't like newer opengl32.inc
Post by: Mikl__ on March 28, 2020, 02:10:20 PM
Hi, kiptron!
There is opengl32.inc with "PPROC" in http://www.masm32.com/download/install64.zip
I repeat, if you wonna that we will help you, you need to show us your asm-/rc-/bat-files, otherwise this is not the help that you are waiting for, but fortune-telling on a crystal ball or Tarot cards (https://cyberstatic.net/images/smilies/ap.gif)
Title: Re: assembler doesn't like newer opengl32.inc
Post by: hutch-- on March 28, 2020, 02:25:40 PM
The main include file "win64.inc" has the macro for PPROC. Include that BEFORE the opengl32 file and it should work OK.
Title: Re: assembler doesn't like newer opengl32.inc
Post by: kiptron on March 28, 2020, 04:11:40 PM
 Thank you Mikl and Hutch,  Yes Mikl, I have that file, PPROC only appears there, or so I thought. I will try
changing the order as Hutch has suggested. The assembler is multi-pass and looks through all files (first pass)
for all symbols before it proceeds, so the order should not matter.  I thought I looked through all the inc's
but apparently missed it. Please forgive my inexperience with this forum, I will try to learn how to include
information and be more clear in the future.  Thanks  kiptron
Title: Re: assembler doesn't like newer opengl32.inc
Post by: kiptron on March 29, 2020, 03:58:04 AM
  Thank you Hutch,  That did the trick. The order of includes is important.
Where did I learn that it was not ? I should have no more issues to bug you with.
   The masm32 project is the best thing of it's kind for an old low level guy.
                                                                      Thank you  kiptron                                                                     
Title: Re: assembler doesn't like newer opengl32.inc
Post by: jj2007 on March 29, 2020, 12:40:33 PM
Quote from: kiptron on March 29, 2020, 03:58:04 AM
The order of includes is important.

Inter alia, you can redefine constants and macros. For example,
this equ <esi>
is valid until you reach the line
this equ <edi>
Title: Re: assembler doesn't like newer opengl32.inc
Post by: jimg on March 29, 2020, 01:05:36 PM
jj-
there are a lot of caveats with that statment

first, you can't use equ like that

this equ <esi> is illegal
you can however say
this equ esi

also, you can only redefine a var set with equ if it's not a number.
and I think that only works because the var in the second equ has already been replaced by the first equ.
Title: Re: assembler doesn't like newer opengl32.inc
Post by: jj2007 on March 30, 2020, 11:19:02 AM
Quote from: jimg on March 29, 2020, 01:05:36 PM
this equ <esi> is illegal
you can however say
this equ esi

I confess that I didn't test this statement. You didn't, either ;-)

These are legal (tested):
  that equ <esi>
  dest equ edi
  mov that, 123
  mov dest, 123
Title: Re: assembler doesn't like newer opengl32.inc
Post by: HSE on March 30, 2020, 11:45:02 AM
Quote from: jj2007 on March 30, 2020, 11:19:02 AM
These are legal (tested):
  that equ <esi>
  dest equ edi
  mov that, 123
  mov dest, 123


I remember that good practice in this case is:that textequ <esi>
dest textequ <edi>

Of course, I don't remember why  :biggrin:
Title: Re: assembler doesn't like newer opengl32.inc
Post by: jj2007 on March 30, 2020, 11:14:17 PM
Quote from: HSE on March 30, 2020, 11:45:02 AMI remember that good practice in this case is:that textequ <esi>
dest textequ <edi>

Jim has yet another version:

Quote from: jimg on March 29, 2020, 01:05:36 PMthis equ <esi> is illegal
you can however say
this equ esi

In any case, I didn't know that this was a reserved word in MASM; and it's not listed in MASM Programmer's Guide :cool:
Title: Re: assembler doesn't like newer opengl32.inc
Post by: HSE on March 31, 2020, 02:29:26 AM

Quote from: jj2007 on March 30, 2020, 11:14:17 PM
In any case, I didn't know that this was a reserved word in MASM; and it's not listed in MASM Programmer's Guide :cool:
RadAsm paint "this" like a reserved word, but I don't see in any code.

Just now I learned about that! Very interesting: is like UNION but for single variables  :thumbsup:    .data
        item2 = this dword
        sujeto2 real4 1.95
main proc
    cls
    print real4$(sujeto2),13,10

    mov item2, 123456
    print real4$(sujeto2),13,10
    print str$(item2),13,10

    fSlv sujeto2 = 6.54
    print real4$(sujeto2),13,10
    ret
main endp

1.950000

0.000000
123456

6.540000
Press any key to continue ...