Author Topic: What are the double question marks preceding memory addresses in Visual Studio?  (Read 6660 times)

TheGodOfKratos

  • Regular Member
  • *
  • Posts: 13
  • Because I Can

When using a macro to create lots of LOCAL variables in Visual Studio 2017, in the listing file generated by ml.exe, I see the variable names preceded by a double question mark and then just a 4 digit number. What do these double question marks mean and is it possible to reference these individual variables by name?
https://pastebin.com/Zx8TDgSp
Visual Studio 2017 - Microsoft's MASM

jj2007

  • Member
  • *****
  • Posts: 13946
  • Assembly is fun ;-)
    • MasmBasic
They are local names generated by the macro.
You can use them simply by their name: the real one, not the ??1234 crap.

Code: [Select]
include \masm32\include\masm32rt.inc

bla macro arg
Local foo
  foo CATSTR <long>, <arg>
  % echo My local variable FOO is now foo
  exitm foo
endm 

.data
longvar dd 12345678h

.code
start:
  inkey hex$(bla(var))
  exit

end start

Btw programming in VS is a bad idea. Welcome to the forum :icon14:

P.S.: https://pastebin.com/Zx8TDgSp
Quote
This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff.
::)

TheGodOfKratos

  • Regular Member
  • *
  • Posts: 13
  • Because I Can
Hi,

Thanks for your response. I've been using Visual Studio to program in languages like C, C++, and C# since I was in diapers. Okay, maybe not that long but it's been a few years. I think it's one of the best all around IDEs on planet Earth. So, I'm very curious to know why I shouldn't be using it for assembly language programming? Or should I stop using it for any purpose? :)

Also, I should have given context for my original question. The example code I posted is from Kip Irvines book on x86 Assembly Language programming, 7th edition. It's the strangest example of using the REPEAT directive I've ever seen. He says he uses the REPEAT directive to create an array of 52 DWORDS but why, if your intent is to create an array, would you declare all 52 DWORDS as LOCAL? And why would you create an array in 52 steps? It's just whacky.

 :icon_eek:

I set the expiration for a week on the example code below:

https://pastebin.com/qpyzegpF

Visual Studio 2017 - Microsoft's MASM

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Kip Irvine's book is a different animal to production 32 bit assembler, its designed to get students through a semester at college. EASY is the catch word but it is not compliant with the Intel 32 bit Application Binary Interface and could not be used for useful code.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 13946
  • Assembly is fun ;-)
    • MasmBasic
I've been using Visual Studio ... since I was in diapers.

Valid excuse :icon_mrgreen:

For n00bs trying hello world proggies, \Masm32\qEditor, RichMasm or one of the IDEs that you find in the subforums are easier to use than that behemoth of VS. But since you are used to it, go ahead ;-)

Quote
It's the strangest example of using the REPEAT directive I've ever seen. He says he uses the REPEAT directive to create an array of 52 DWORDS but why, if your intent is to create an array, would you declare all 52 DWORDS as LOCAL? And why would you create an array in 52 steps? It's just whacky.

YES. Something like this should do:
Code: [Select]
WEEKS_PER_YEAR = 52

WR_WEEK STRUCT
  rainfall dd ?
  humidity dd ?
WR_WEEK ENDS

WeatherReadings STRUCT
  location BYTE 50 dup(?)
  weeks WR_WEEK WEEKS_PER_YEAR dup(<?>)
WeatherReadings ENDS

I attach an advanced example, which creates (random) readings for n cities, writes them to a data file, reads them back and displays them e.g. as
Code: [Select]
...
week #50        25      59
week #51        22      58

City #2         rain    umidity
week #0         24      83
week #1         16      43
week #2         19      26
week #3         10      55
week #4         16      96

What your mean is i think "mangled C++ names"

No, he doesn't mean "mangled C++ names".

ragdog

  • Member
  • ****
  • Posts: 609
Visual Studio works good for masm32 programming  :t

https://asmhighlighter.codeplex.com/


https://scriptbucket.wordpress.com/2011/10/19/setting-up-visual-studio-10-for-masm32-programming/

Quote
When using a macro to create lots of LOCAL variables in Visual Studio 2017, in the listing file generated by ml.exe, I see the variable names preceded by a double question mark and then just a 4 digit number. What do these double question marks mean and is it possible to reference these individual variables by name?

What your mean is i think "mangled C++ names"
But i cannot see your pastebin code

Greets,

aw27

  • Guest
Visual Studio works good for masm32 programming  :t

Notepad++ is also great for highlighting ASM.

ragdog

  • Member
  • ****
  • Posts: 609
Quote
Notepad++ is also great for highlighting ASM.

It give enought Editors with support Syntax highlighting. ::)

aw27

  • Guest
Quote
Notepad++ is also great for highlighting ASM.

It give enought Editors with support Syntax highlighting. ::)

True, but some of them are not "great" as well.

ragdog

  • Member
  • ****
  • Posts: 609
Quote
Notepad++ is also great for highlighting ASM.

It give enought Editors with support Syntax highlighting. ::)

True, but some of them are not "great" as well.

That's a matter of opinion.  :P