Miscellaneous > Irvine Book Questions.

If you know how to use Visual Studio and Irvine's resources for masm, help me!

(1/5) > >>

I've been trying to learn x86 assembly, but instead of learning to program, I've been struggling with INCLUDE libraries, and problems with MASM32 Editor and Visual Studio 2013 compilers fighting each other. I can't even get a simple DumpRegs directive to work for s*** sake:

--- Code: ---; Program template

.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
;INCLUDE C:\Irvine\Irvine32.inc
INCLUDE Irvine32.inc

; declare variables here
main proc
; write your code here
     mov eax,5
add eax,6
     call DumpRegs

invoke ExitProcess,0
main endp
end main

--- End code ---
The errors in Visual Studio:
1>c:\Irvine\SmallWin.inc(11): error A2071: initializer magnitude too large for specified size

1>c:\Irvine\SmallWin.inc(11): warning A4011: multiple .MODEL directives found : .MODEL ignored

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\masm.targets(50,5): error MSB3721: The command "ml.exe /c /nologo /EP /Sa /Sg /WX /Zi /Fo"Debug\SamZone.obj" /Fl"Project.lst" /I "c:\Irvine" /W3 /errorReport:prompt  /Ta..\ch03\SamZone.asm" exited with code 1.

I don't know what to do. But I do know that I can never truly learn and blossom with masm knowledge until this is resolved. I've already wasted nearly two weeks on this issue, unable to test (and, consequently, unable to learn) basic masm syntax.

You are experiencing exactly what I experience every time I touch C++ - a complete mess. The fault is not with Masm, it's not your fault either, no, the culprits are Visual Crap and, to a lesser extent, Kip Irvine who cooks his own soup for his teaching.

My advice: Drop VS and the Irvine lib. Instead, use qEditor's Console build all menu and start with hello world proggies:

--- Code: ---include \masm32\include\masm32rt.inc

MyArray dd 25, 18, 23, 17, 9, 2, 6
HelloW$ db "Hello World", 0

  xor ebx, ebx ; set two non-volatile
  xor esi, esi ; registers to zero
add esi, MyArray[4*ebx]
inc ebx
  .Until ebx>=lengthof MyArray
  MsgBox 0, cat$(str$(esi), " is the sum"), offset HelloW$, MB_OK

end start
--- End code ---

Let me know if it works. If you want to see what the CPU does in this proggie, download Olly and extract it to \Masm32\OllyDbg\ollydbg.exe, then open your helloworld.exe and start hitting F8. Much better than dumpreg.


--- Quote from: jj2007 on February 03, 2016, 07:32:00 PM ---My advice: Drop VS and the Irvine lib. Instead, use qEditor's Console build all menu and start with hello world proggies:

--- End quote ---
Ugh... what a waste of money. To make matters worse, I just scratched off the pearson highered code and activated it too, so Irvine's text book resale value is already lower :(
But I suppose I will have to just cut my losses and try QEditor's Console. It's also called MASM32 Editor, right?

However, there's one more problem. Every time I try to open a .asm file, Visual Studio automatically opens, and displays a text file copy of that same .asm file. I already asked this in my other thread, but didn't get an answer that was straight enough for my taste, so let me ask that same question again:

How do I get Visual Studio to shut up (and mind it's own C++ purpose business), and get the .asm file to compile where it needs to?

- open \Masm32\qeditor.exe
- copy the code I posted above, and paste it
- save the file as \Masm32\MyTest.asm (you need to specify the .asm extension)
- click menu Project/Console Build All
- check the output window for errors
- click menu Project/Run program

If that works, right-click in Explorer on MyTest.asm, then Open With, predefined program, pick qEditor. That should block Visual Crap from interfering with your asm dreams 8)

Bit messy with VS as said here


[0] Message Index

[#] Next page

Go to full version