PDA

Click to See Complete Forum and Search --> : !!!!!!!!!!! PLEASE HELP !!!!!!!!!!!!!!!!! ARGH!!!!!!!!


Sep 25th, 2000, 09:06 PM
Ok, im trying to get this example to work. Im using TASM 5.0. Here are the files...

tut_01.asm

.386
locals
jumps
.model flat, STDCALL

extrn GetModuleHandleA:Proc
extrn MessageBoxA:Proc
extrn ExitProcess:Proc

.data

AppHWnd dd 0
MsgBoxCaption db "Lesson 1", 0
MsgBoxContent db "Just saying hello.", 13, 10
db "And goodbye.", 0

.code

Start:
push 0h
call GetModuleHandleA
mov [AppHWnd], eax

push 20h
push offset MsgBoxCaption
push offset MsgBoxContent
push [AppHWnd]
call MessageBoxA

push 0h
call ExitProcess
End Start


tut_01.def

NAME TUT_01
DESCRIPTION 'ASM Program'
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE
DATA PRELOAD MOVEABLE MULTIPLE


makefile

# make -B Will build .EXE
# make -B -DDEBUG Will build the debug version.

NAME = TUT_01
OBJS = $(NAME).obj
DEF = $(NAME).def

!if $d(DEBUG)
TASMDEBUG=/zi
LINKDEBUG=/v
!else
TASMDEBUG=
LINKDEBUG=
!endif

!if $d(MAKEDIR)
IMPORT=$(MAKEDIR)\..\lib\import32
!else
IMPORT=import32
!endif

$(NAME).EXE: $(OBJS) $(DEF)
tlink32 /Tpe /aa /c $(LINKDEBUG) $(OBJS), $(NAME),, $(IMPORT), $(DEF)

.asm.obj:
tasm32 $(TASMDEBUG) /m1 /m2 $&.asm


When i run the "makefile" i get these errors...

Error: Unresolved external 'GETMODULEHANDLEA' referenced from module TUT_01.asm
Error: Unresolved external 'MESSAGEBOXA' referenced from module TUT_01.asm
Error: Unresolved external 'EXITPROCESS' referenced from module TUT_01.asm

Any ideas?

Sophtware
Sep 26th, 2000, 01:24 AM
Sorry to make you think there was a answer..but can you tell me where you got your TASM5.0? and was it free?

Thanks man:)

Sep 26th, 2000, 12:04 PM
Yes i did get it for free of some japanese site, but i dont remember the url though. If you look up "tasm downloads" on altavista, you should find something.

Das Mad
Sep 30th, 2000, 01:00 PM
I am not really familiar with Tasm.
But I Know that if U just want to show a msgbox
you can skip the hwnd(push 0). Here is a example 4 pass32


.COMMENT
****************************************************************************
HELLOWIN.ASM Example Win32 file
(c) 1998,1999 by Dieter Pawelczak - Pass32 Version 3.0alpha
============================================================================
****************************************************************************


.MODEL WIN32 ; - all you have to do ...

.MEM 32 ; - just like in old times
.STACK 32



.data
szDisplayName db 'Hello World Demo',0
szMessage db 'Hello, World with Pass32',0
hwin dd 0
.code

; WIN 32 Prototypes :

proc MessageBox
.win32 'USER32.MessageBoxA'
endp MessageBox


Start:
mov ecx,0
loop:
push ecx
push ecx ; Style
push OFFSET szDisplayName ; Message-Window-Title
push OFFSET szMessage ; Message
push 0 ; hwin
call MessageBox ; call via Prototype
pop ecx
cmp eax,4 ; = REPEAT
je short L1
inc ecx
L1:
cmp ecx,5
jb loop
push 0
.invoke .win32 'KERNEL32.ExitProcess' ; call direct

end start


end