News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Setting up irvine libs with default masm install.

Started by jimmm, December 05, 2010, 09:09:59 AM

Previous topic - Next topic

jimmm

To make a long story short, I have been working on a quicksort program for a project due on monday, and now that the code works, I am looking to spruce it up some.  However, my problem is some calls I want to use in the Irvine32.inc are inaccessible to me, as whenever I try to link and build I receive a set of errors, that probably stem from the fact that I grabbed the setupfile from the irvine site for visio studio, since I saw no "base file."

Basically, whenever I try to link I get this:    (the include path is correct in my program)

Assembling: C:\Users\Public\Documents\masm stuff\quicksort.asm
\irvine\SmallWin.inc(11) : warning A4011: multiple .MODEL directives found : .MO
DEL ignored
\irvine\SmallWin.inc(22) : error A2008: syntax error : TEXTEQU
\irvine\SmallWin.inc(73) : error A2005: symbol redefinition : FILE_ATTRIBUTE_ENC
RYPTED
\irvine\SmallWin.inc(184) : error A2008: syntax error : EQU
exit(1): Macro Called From
  \irvine\SmallWin.inc(184): Include File
\irvine\SmallWin.inc(184) : error A2034: must be in segment block
exit(2): Macro Called From
  \irvine\SmallWin.inc(184): Include File
\irvine\SmallWin.inc(184) : fatal error A1010: unmatched block nesting
exit(3): Macro Called From
  \irvine\SmallWin.inc(184): Include File


I can only assume this is because I do not have the right libraries for a "vanilla" install...

If anyone could set me in the right direction to get these libraries working with a basic install that would be amazing, I do not have the means to install any of the Microsoft development environments at the moment.

MichaelW

It looks to me like you have a problem with your code structure. All of my Irvine components are old, but I think you need something like this:

include Irvine32.inc
include macros.inc
includelib \masm32\lib\kernel32.lib
.data
  hw db "Hello World",0
.code
; your procedures here
start:
    mov edx, OFFSET hw
    call WriteString
    call ReadChar
    exit
end start

eschew obfuscation

jimmm

Thanks for the amazingly fast response.

I did not have a included macros.inc, just Irvine32, with that added, the assembler explodes again, but differently:

Assembling: C:\Users\Public\Documents\masm stuff\quicksort.asm
\Irvine\SmallWin.inc(11) : warning A4011: multiple .MODEL directives found : .MODEL ignored
\masm32\include\windows.inc(35) : error A2111: conflicting parameter definition
\masm32\include\windows.inc(150) : error A2008: syntax error : typedef
\masm32\include\windows.inc(7652) : error A2161: non-benign structure redefinition: too few labels : FILETIME
\masm32\include\windows.inc(8128) : error A2161: non-benign structure redefinition: too few labels : COORD
\masm32\include\windows.inc(8143) : error A2163: non-benign structure redefinition: incorrect initializers : MOUSE_EVENT_RECORD
\masm32\include\windows.inc(8147) : error A2161: non-benign structure redefinition: too few labels : MOUSE_EVENT_RECORD
\masm32\include\windows.inc(8155) : error A2163: non-benign structure redefinition: incorrect initializers : KEY_EVENT_RECORD
\masm32\include\windows.inc(8158) : error A2163: non-benign structure redefinition: incorrect initializers : KEY_EVENT_RECORD
\masm32\include\windows.inc(8159) : error A2161: non-benign structure redefinition: too few labels : KEY_EVENT_RECORD
\masm32\include\windows.inc(8159) : error A2163: non-benign structure redefinition: incorrect initializers : KEY_EVENT_RECORD
\masm32\include\windows.inc(8162) : error A2163: non-benign structure redefinition: incorrect initializers : WINDOW_BUFFER_SIZE_RECORD
\masm32\include\windows.inc(8163) : error A2164: non-benign structure redefinition: too few initializers : WINDOW_BUFFER_SIZE_RECORD
\masm32\include\windows.inc(8175) : error A2163: non-benign structure redefinition: incorrect initializers : INPUT_RECORD
\masm32\include\windows.inc(8177) : error A2163: non-benign structure redefinition: incorrect initializers : INPUT_RECORD
\masm32\include\windows.inc(8177) : fatal error A1016: Internal Assembler Error
_
Assembly Error


I would guess this means I am missing some sort of libary or something, but I am not that sure.



Here is what the current includes are:
include \Irvine\Irvine32.inc
include \Irvine\macros.inc     
include \masm32\include\windows.inc   
include \masm32\macros\macros.asm
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

donkey

no, it means that there are multiple definitions for various structures and they are incompatible. I would guess you don't need Windows.inc.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jimmm

Well, I am not sure why I ended up with all these includes, I did not need a vast majority of them, but when I need one last one (macros.asm) for my print statements, I get this batch of errors:
\Irvine\SmallWin.inc(11) : warning A4011: multiple .MODEL directives found : .MODEL ignored
\masm32\macros\macros.asm(2850) : error A2005: symbol redefinition : MsgBox
\masm32\macros\macros.asm(2851) : error A2006: undefined symbol : styl
\masm32\macros\macros.asm(2851) : error A2114: INVOKE argument type mismatch : argument : 4
\masm32\macros\macros.asm(2851) : error A2006: undefined symbol : titlemsg
\masm32\macros\macros.asm(2851) : error A2114: INVOKE argument type mismatch : argument : 3
\masm32\macros\macros.asm(2851) : error A2006: undefined symbol : txtmsg
\masm32\macros\macros.asm(2851) : error A2114: INVOKE argument type mismatch : argument : 2
\masm32\macros\macros.asm(2851) : error A2006: undefined symbol : hndl
\masm32\macros\macros.asm(2851) : error A2114: INVOKE argument type mismatch : argument : 1
\masm32\macros\macros.asm(2851) : error A2034: must be in segment block
\masm32\macros\macros.asm(2852) : fatal error A1008: unmatched macro nesting
_


Now, my best guess is its having stuff redefined by smallwin.inc, but what I don't understand is that I am commenting it out of my code, so I would think that it would not override whatever libraries are still in the code.  Clearly this is not the case, so I am still unsure how to fix it, but for now I need to sleep.  I really appreciate the quick responses.

MichaelW

Considering the limitations of the Irvine components, why not just eliminate them and go with MASM32 for everything.
eschew obfuscation

dedndave

if it's for school, you are probably expected to use Kip's LIB
Michael has the right stuff....
include Irvine32.inc
include macros.inc
includelib \masm32\lib\kernel32.lib

don't use the masm32 stuff, including windows.inc
but - you may want to put your Irvine stuff in a seperate folder, like \masm32\Irvine
then, specify that path...
include    \masm32\Irvine\Irvine32.inc
include    \masm32\Irvine\macros.inc
includelib \masm32\lib\kernel32.lib


Michael - shouldn't there be an includelib for Irvine32.lib also ???
or is it all text
do you not need:
include    \masm32\include\kernel32.inc

jimmm

When I just include:

include \Irvine\Irvine32.inc
include \Irvine\macros.inc     
includelib \masm32\lib\kernel32.lib

I end up with the following set of errors:
\Irvine\SmallWin.inc(11) : warning A4011: multiple .MODEL directives found : .MODEL ignore
C:\Users\Public\Documents\masm stuff\quicksort.asm(110) : error A2008: syntax error : print

And a bunch more print errors, obviously caused because I am not referencing the appropriate print macros.

How can I link to them without blowing up the program?

EDIT: In relation to the comment about abandoning Irvine libs, I emailed the professor and I am not required to use them it turns out, the only reason I am interested is the functionality of some fileio and the readint command.  If someone could point me the right direction for using stdin/stdout I would use that instead.

jj2007

Quote from: jimmm on December 05, 2010, 06:51:45 PM
If someone could point me the right direction for using stdin/stdout I would use that instead.

\masm32\macros\macros.asm

Search the file for a case-sensitive Std

dedndave

well - i don't recall what readint is (read integer maybe?)
but - the masm32 macros and libraries take care of just about everything else
if readint is read integer, you can use input and one of the string/math conversion routines together to replace it

however - there is every possibility that fixing your current program is something simple

(1)
in Irvine32.lib, WriteString is used to output strings - not print
well - i can't find the macros file - i only have the lib

(2)
any program written for masm should begin with something like this...
       .486
       .MODEL  Flat,StdCall
       OPTION  CaseMap:None


fix those 2 things and it may work
it is easier for us if you post your code
below the reply window is a link for Additional Options
you may attach ZIP files to the post

dedndave

found the macro file

look up mWrite, mWriteLn, and mWriteStr in the macro file

dedndave

hang on - those macros are for 16-bit
i don't find a 32-bit macro file

SmallWin.inc takes care of the startup code

jimmm

dave: I am using that  set of opening flags:

Ill check the syntax for writestring and try replacing all my prints with that if what I am currently working on fails:

inputloop:
           mov edi, input("Enter number: ")
           mov array[esi],edi
           add esi,4
           sub count,1
           jnz inputloop


Is this what I should be doing?  I understand I will still need to find out how to convert string to int (working on that now) but for reading in numbers into an array, this would be the correct idea yes?

But depending on if I can replace all prints with the write stuff that I will look at now, I might not even need this, thank you.

dedndave

well - i may have a really old Irvine library, here

using input and print as you are indicates that you are mixing the masm32 library with the Irvine32 library
the Irvine stuff i have uses mWrite for print and mReadStr for input

for mReadStr....
        mReadStr offset Buffer,sizeof Buffer-1
i think sizeof Buffer-1 is correct

dedndave

it may be easier for you to use the masm32 library - lol
        include \masm32\include\masm32rt.inc
that takes care of all the startup code
then you can use input and print