Inter Assembly Language Programming (Irvine) Development Environment Settings

1. Install masm32

Download on the official website:

2. Download and Irvine32.lib  or After unzipping, there is a 12M file, and then unzip the library you need.

Or you can download it directly here masm32.7z (, and Irvine32.lib are already in the Irvine subdirectory of the package. If you installed masm32 and downloaded Irvine libraries from the first two parts, modify the following environment setting script var.bat according to the path you installed or unzipped.

The following configuration was downloaded from masm32.7z The package is decompressed directly to the D drive to set it up.

3. var.bat

@echo off
set include=D:\masm32\include;D:\masm32\Irvine
set lib=D:\masm32\lib;D:\masm32\Irvine
set path=D:\masm32\bin;D:\masm32;%path%
echo on

4. Compile and run:

Place this var.bat in the source directory and execute it so that the compilation run environment is set up. Here are two examples of consol s and windows

Code 1: random.asm

; Demonstrate the random Procedure     (random.asm)

;ml /coff random.asm  /link /subsystem:console


includelib Irvine32.lib
INCLUDELIB Kernel32.lib

	str1 BYTE "I love to sleep", 0
	Base DWORD 10h
	main PROC
		call Randomize 
		mov eax, 16
		mov ecx, 4
		call Crlf
		push eax
		call RandomRange
		mul Base
		mov ebx, eax
		mov eax, Base
		call RandomRange
		add eax, ebx
		call SetTextColor
		mov edx, OFFSET str1
		call WriteString
		call Crlf
		pop eax
		loop L1
		mov eax, black * 16 + 10
		call SetTextColor
	main ENDP
	END main

Compile and run:


D:\prg\Win32Asm\Irvine>ml /coff random.asm  /link /subsystem:console
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

 Assembling: random.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.



I love to sleep
I love to sleep
I love to sleep
I love to sleep

Code 2: msgbox1.asm

; MsgBox demo                     (msgbox1.asm)
;ml /coff msgbox1.asm /link /subsystem:windows

Includelib Irvine32.lib 
Includelib kernel32.lib 
Includelib user32.lib
	msg BYTE "Plus_RE!",0
	msgTitle BYTE "Test MsgBox",0
main PROC
	mov edx, OFFSET msg
	mov ebx, OFFSET msgTitle
	call MsgBox
main ENDP
END main

Compile and run:

Tags: Programming Windows Linker

Posted on Sat, 14 Mar 2020 13:18:03 -0400 by alanlee79