Miscellaneous > Irvine Book Questions.

What are the double question marks preceding memory addresses in Visual Studio?

(1/2) > >>

TheGodOfKratos:

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

jj2007:
They are local names generated by the macro.
You can use them simply by their name: the real one, not the ??1234 crap.


--- Code: ---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
--- End code ---

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.
--- End quote ---
::)

TheGodOfKratos:
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

hutch--:
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.

jj2007:

--- Quote from: TheGodOfKratos on April 15, 2017, 12:38:13 AM ---I've been using Visual Studio ... since I was in diapers.
--- End quote ---

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.
--- End quote ---

YES. Something like this should do:
--- Code: ---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
--- End code ---

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: ---...
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
--- End code ---


--- Quote from: ragdog on April 15, 2017, 02:18:37 AM ---What your mean is i think "mangled C++ names"
--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

Go to full version