News:

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

Pleas help me iam confused and i tried everything

Started by gonfreez, September 07, 2010, 05:46:02 PM

Previous topic - Next topic

gonfreez

I began to learn Assembley just 2 days ago
i have Assembly Language For Intel-Based Computers Fourth Edition KIP R. I RV I N E
was GREAT and easy  :green2 i started to love Assembley

just few chapters then the firist programme called Addsub.asm ' couldnt wait'

i typed it exactly as he said but when i started to compile DOZENS of problems happened
i am still new so i dont get what it was i think it was about linking something about missing lib

the code
INCLUDE Irvine32.inc ; the same directory to project
.code

main PROC

          mov eax, 10000h
          add  eax, 40000h
          sub  eax, 20000h
         
          call DumpRegs

          exit

main ENDP

END main


and then i tried

.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO,dwExitCode:DWORD
DumpRegs PROTO

.code
main PROC

mov eax,10000h
add eax,50000h
sub eax,20000h
call DumpRegs

INVOKE ExitProcess,0
main ENDP
END main


both didnt work

the error

C:\masm32\bin\Link @"C:\Users\........\Desktop\link.war"

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

/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 "/LIBPATH:C:\masm32\lib" "C:\Users\.......\Desktop\SumaResta.obj" "/OUT:C:\Users\.....\Desktop\SumaResta.exe"
SumaResta.obj : error LNK2001: unresolved external symbol _ExitProcess@4
SumaResta.obj : error LNK2001: unresolved external symbol _DumpRegs@0
C:\Users\........\Desktop\SumaResta.exe : fatal error LNK1120: 2 unresolved externals

Make finished. 2 error(s) occured .


but after searching somethreads here someon said

to write it this way i dont get it yet , ANNOYING >.<
.386
.model flat,stdcall
.stack 4096

includelib "c:\masm32\lib\kernel32.lib"
includelib "c:\irvine32\irvine32.lib"

ExitProcess PROTO,dwExitCode:DWORD
DumpRegs PROTO

.code
main PROC

    mov eax,10000h
    add eax,50000h
    sub eax,20000h
    call DumpRegs

  INVOKE ExitProcess,0
main ENDP
END main


and it was assembeled with no errors i was happy then

I CANT START IT when ever i try to NOTHING happens

So pleas

tell me how to compile link and run my progs the book dont say anything about it
whats the steps to CORRECTLY assemble compile link and run the prog
tell me whats wrong .............. i m getting dizzy  :dazzled: i ve red about 200 pages and couldnt make 1 example which is typed in the book

I know i might be irritant to Pros like U but plz i just Loved this programming lang i want to master it like in 2 days 

                          HELP ME

Vortex

Hi gonfreez,

Welcome the forum.

/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0

Are you sure that your project is a GUI application? Maybe you need to specify /SUBSYSTEM:CONSOLE to see the output in the command line.

Vortex

Here is a quick example for you :


.386
.model flat,stdcall
option casemap:none

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\msvcrt.inc

includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\msvcrt.lib

.data

message     db 'eax = %X',13,10
            db 'edx = %X',13,10,0

.code

start:

    mov     eax,10000h
    add     eax,50000h

    mov     edx,80000h
    sub     edx,30000h

    call    DumpRegs

    invoke  ExitProcess,0

DumpRegs PROC

    invoke  crt_printf,ADDR message,eax,edx
    ret

DumpRegs ENDP

END start


brethren

the 4th edition comes with a cd that installs masm 6.15, an older version of textpad, batch files for easy assembling/linking of irvine16 and irvine32 projects and instructions for integrating everything so you can easily assemble and run your projects from inside textpad. if you haven't got the cd i could maybe find a link:)

GregL

gonfreez,

From your post,  it looks like you are using WinAsm Studio.  Make sure all of your settings in WinAsm are correct, especially the paths to your lib files.




gonfreez

Thanks for ur fast replays

honestly i thought it would take 2-3 days for someone to replay

brethren as for the CD i have it and tried the same in the Masm615 but same thing

Vortex  sorry but as i said i have only been reading for 2 continuous days now i m only in chapter 4

so i cant get

                project is a GUI application  specify /SUBSYSTEM:CONSOLE    :(

i wish u could explain briefly i am fast learner

and ur program u made i tried to copy the code in MASM32 pressed project > link OBJ file ' no

problems'

then Project > assemble & link ' no problems eithr '

then Project > build all     " I THINK THOSE THE STEPS FOR building program as said i don t know

how to do it -.- no one told me and the book didn t say  ::)

AND YET ur program didn t even start

i downloaded ur file and tried to dclick ur program same result NOTHING

Again i m very sorry for bothering u guys with some newbie like me

Yuri

You should open a command prompt window and launch Vortex's program from there if you want to see its output.
And the way to build it (from the MASM32 Editor) is: Project --> Console Assemble & Link.

Vortex

Hi gonfreez,

/SUBSYSTEM:CONSOLE

A console application is a black screen displaying only text output. A GUI application can be a dialog box, a message box or any other kind of visible window with controls like edit boxes, buttons, check boxes etc. If I am not wrong, your application is supposed to output only simple text messages and a console application can easily handle this kind of task.

brethren

follow these instructions for assembling,linking and running the AddSub example from Assembly Language for Intel Based Computers 4thED

1.install setup.exe from the cd that comes with your book (make sure you install to the default location which is \Masm615)
2.open a command prompt
3.type cd \Masm615\Examples\ch03
4.type \Masm615\make32.bat AddSub
5.to run the program type AddSub

its as easy as that


gonfreez

#9
I don t know what  to say ....

I wish i can spam the whole page with THANK YOU but it wont be enough

thanks ,  :green2 , and  i reached ch 10 today i feel kind 'a stupid ,  and still cant make single

EXAMPLE i started cutting my hair off

**** brenthen i copied the Addsub.asm from the ch03 to Masm615 folder and then

thats what i saw after typing make32.bat Addsub

Addsum.asm<6> : fatal error A1000: canot open file :Irvine32.inc   

then i went to INCLUDE file and i found that its the file's name in irvine32.lib NOT Irvine32.lib

i changed it to match the one typed in code but still the same

*****Vortex ur programe worked in command Prompt

but i want those examples to work too










brethren

Quote from: gonfreez on September 09, 2010, 02:19:01 PM

then i went to INCLUDE file and i found that its the file's name in irvine32.lib NOT Irvine32.lib


i don't understand what you mean by this, the .lib files are in \Masm615\LIB.

can you check that there is a file called Irvine32.inc in \Masm615\INCLUDE as that error message, A1000, is usually caused when the file doesn't exist

gonfreez

i meant then code was written with capital letter Irvine32.lib and the file name was irvine.lib small 'charters'

**I will make this Clear as crystal

The lib file contents



The INCLUDE file contents



The code from the example not my wrok :



Comand prompt steps




the Annoying result :




Hopefully , u can solve this ......  ::)


brethren

btw the screenshots really help:)

i notice that you are using 2 partitions c: and e: and i just want to check that the batch file is looking for the files on the right partition

go to \Masm615\make32.bat and right-click the file then select edit
if it looks like this
SET PATH=C:\Masm615
SET INCLUDE=C:\Masm615\INCLUDE
SET LIB=C:\Masm615\LIB

then its wrong and you'll need to change each C:\ to an E:\

gonfreez

OMG i want to scream

AT last it worked ^.^

Thank you thank you thank you million times ^.^ ur the best

and thanks for all of others who tried to help me too

i wish i could be of mush help to u sometime - after million years of learning  :cheekygreen: -