2

I am trying to run the following code in Visual Studio 2015 that has MASM built in to it. I am trying to link the Irvine library files to the program. However, I get like 49 of the following errors.

A2C \Irvine\SmallWin.inc(11)or specified size
A2C \Irvine\SmallWin.inc(12)or specified size
A2C \Irvine\SmallWin.inc(299)for specified size

Here is my code

ExitProcess PROTO

includelib C:\Irvine\Kernel32.Lib
includelib C:\Irvine\User32.Lib
includelib C:\Irvine\Irvine32.lib
include Irvine32.inc

.data
str1 BYTE "This line is displayed in color",0

.code
main PROC

    mov eax, black + (white * 16) ; black on white backgrouund
    mov ecx,4 ; loop counter

L1: call SetTextColor
    mov edx,OFFSET str1
    call WriteString
    call Crlf
    add eax,2 ; add 2 to foreground color
    loop L1

    call ExitProcess
main ENDP
END

Why are the Irvine libraries not linking?

rkhb
  • 14,159
  • 7
  • 32
  • 60
ISM34
  • 21
  • 5
  • What edition of the Irvine32 library do you have? (i.e. what edition of the Kip Irvine's book is it from?) Also, can you paste a snippet of what is at and around the error lines in SmallWin.inc. It almost sounds like Visual Studio is using the 64-bit MASM to assemble this 32-bit code, but that's just a guess. – byteptr Oct 24 '16 at 19:32
  • You are right, I was trying to use x64 MASM to assemble 32-bit code. – ISM34 Oct 25 '16 at 17:47

1 Answers1

0

Trying to compile a 32-bit program in a 64-bit MASM program application. Need to setup Visual Studios for 32-bit assembly language project.

ISM34
  • 21
  • 5
  • To switch between a different MASM platform (i.e. 32-bit=ml.exe / 64-bit=ml64.exe), drop down the platform box in the Visual Studio toolbar and toggle between x86/Win32 and x64. You can also edit specific platform build configurations in from the Configuration Manager dialog. – byteptr Oct 27 '16 at 04:44