Hello everyone,
how should someone go about adding their own libraries into the MASM32 linker and assembler? I have a library, Irvine32.lib, to be added into the assembler. I also have the include file for it, Irvine32.inc. I have placed the include file in C:\masm32\include and the library file in C:\masm32\lib. The program I am trying to assembly has the line include \masm32\include\Irvine32.inc
. It loads the file fine but when I try to use the function DumpRegs it gives me an error that it could not be found, the function that is. Here is the include file,
; Include file for Irvine32.lib (Irvine32.inc)
;----Removed in favor of kernel32.inc --Abe
;INCLUDE SmallWindows.inc ; MS-Windows prototypes, structures, and constants
.NOLIST
; Last update: 1/27/02
;----------------------------------------
; Procedure Prototypes
;----------------------------------------
ClrScr PROTO ; clear the screen
Crlf PROTO ; output carriage-return / linefeed
Delay PROTO ; delay for n milliseconds
DumpMem PROTO ; display memory dump
DumpRegs PROTO ; display register dump
GetCommandTail PROTO ; get command-line string
GetDateTime PROTO, ; get system date and time
startTime:PTR QWORD
GetMseconds PROTO ; get milliseconds past midnight
Gotoxy PROTO
IsDigit PROTO ; return ZF=1 if AL is a decimal digit
Randomize PROTO ; reseed random number generator
RandomRange PROTO ; generate random integer in specified range
Random32 PROTO ; generate 32-bit random integer
ReadInt PROTO ; read signed integer from console
ReadChar PROTO ; reach single character from console
ReadHex PROTO ; read hexadecimal integer from console
ReadString PROTO ; read string from console
SetTextColor PROTO ; set console text color
WaitMsg PROTO ; display wait message, wait for Enter key
WriteBin PROTO ; write integer to output in binary format
WriteChar PROTO ; write single character to output
WriteDec PROTO ; write unsigned decimal integer to output
WriteHex PROTO ; write hexadecimal integer to output
WriteInt PROTO ; write signed integer to output
WriteString PROTO ; write null-terminated string to output
; Copy a source string to a target string.
Str_copy PROTO,
source:PTR BYTE,
target:PTR BYTE
; Return the length of a null-terminated string..
Str_length PROTO,
pString:PTR BYTE
; Compare string1 to string2. Set the Zero and
; Carry flags in the same way as the CMP instruction.
Str_compare PROTO,
string1:PTR BYTE,
string2:PTR BYTE
; Trim a given trailing character from a string.
; The second argument is the character to trim.
Str_trim PROTO,
pString:PTR BYTE,
char:BYTE
; Convert a null-terminated string to upper case.
Str_ucase PROTO,
pString:PTR BYTE
;-----------------------------------
; Standard 4-bit color definitions
;-----------------------------------
black = 0000b
blue = 0001b
green = 0010b
cyan = 0011b
red = 0100b
magenta = 0101b
brown = 0110b
lightGray = 0111b
gray = 1000b
lightBlue = 1001b
lightGreen = 1010b
lightCyan = 1011b
lightRed = 1100b
lightMagenta = 1101b
yellow = 1110b
white = 1111b
.LIST
It has some built in functions I would like to use. I am extremely new to the assembly programming language and low-level languages in general. Any help would be appreciated greatly, regards, Canute.
If you are trying to combine the irvine32 library with the MASM32 assembler, linker, and import libraries, I recommend that you just put your source and the irvine32 components all in a working directory somewhere and do everything from there. Here is the source for a minimal test:
INCLUDE Irvine32.inc
.data
.code
start:
call DumpRegs
exit
end start
And a batch file to assemble and link, and run the resulting program:
set file="test"
if exist %file%.obj del %file%.obj
if exist %file%.exe del %file%.exe
set lib=c:\masm32\lib
set path=c:\masm32\bin
ml /c /coff %file%.asm
pause
Link %file%.obj irvine32.lib kernel32.lib /SUBSYSTEM:CONSOLE
pause
%file%.exe
pause
The kernel32 import library is always required. Depending on what function calls the source makes other import libraries may be required (for example, user32 or msvcrt).
I would advise against combining the two libraries as you may end up with conflicts between them but there is no reason why you cannot have both and include them on a needs basis to get the functions you require. MASM easily handles more than 1 library so its no big deal.
Ahhh thank you both so much! What I ended up doing was editing the makeit.bat file so thank you!