News:

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

MASM32 problem

Started by pps, May 11, 2010, 04:14:52 PM

Previous topic - Next topic

Neil

I have assembled your code, after changing line 37 as jj suggested, & it assembles & runs perfectly (Windows 7).
So I don't know what you are doing differently to me?

pps

well, that source code is generated when i start to beghin a console aplication. I don't find an example, somthing to find how to start, how to make the sum of two numbers. Just that and then i will try more, but for the moment i just can't finish an .exe program. Even after i link it when i try to lunch from windows it does nothing, even that basic example does nothing and it should work because is automaticaly generated.
And even if i don't know the comands for masm32, why when i try to run the program it does "Not Responding" error on the editor?
Give me a tutorial or something to start with, and then it is ok...

Neil

Are you using qeditor? If so on the Project menu use Console Assemble & Link.
Your code does add 2 values together & displays them correctly in eax.
By the the way we are in the wrong Forum as this is 32 bit code.

pps

Yes i done that, assamble and link or just Assamble and  then link. I know the steps, and the first time when i used this kind of programing i used only cmd and notepad for editing. Even so queditor is making me problems, i think that not the aplication is the problem but is something in windows or computer that doesnţt work... can u hepl me pls_

jj2007

Mysterious. Try opening the source in RichMasm (part of the MB package), then assemble by pressing F6. Practically all Masm32 examples assemble just fine with the default settings.

Neil

Can you be clear that you are using   Console Assemble & Link   & not as you say  Assemble & Link

jj2007

Quote from: Neil on October 08, 2010, 03:10:46 PM
Can you be clear that you are using   Console Assemble & Link   & not as you say  Assemble & Link

That would be a nice addition for QEditor: Autodetection of Subsystem. Finding print vs WM_CREATE etc doesn't take long, about 1ms/1000 lines in a RichEdit control.

dedndave

that could be a small external program, Jochen - good idea   :P

jj2007

Quote from: dedndave on October 09, 2010, 02:16:41 PM
that could be a small external program, Jochen - good idea   :P

Go ahead, Dave :U
To make your job easier, here the autodetect strings of RichMasm:
txOptGuessC1 db "rint", 0 ; ok for print and Print
txOptGuessC2 db "StdOut", 0
txOptGuessC3 db "key", 0 ; Inkey, inkey, getkey
txOptGuessW1 db "MessageBox", 0
txOptGuessW2 db "MsgBox", 0
txOptGuessW3 db "SendMessage", 0
txOptGuessW4 db "CreateWindow", 0
txOptGuessW5 db "GetMessage", 0
txOptGuessW6 db "ShowWindow", 0

dedndave

Quote from: jj2007 on October 09, 2010, 04:13:37 PM
txOptGuessW1 db "MessageBox", 0
txOptGuessW2 db "MsgBox", 0
txOptGuessW3 db "SendMessage", 0
txOptGuessW4 db "CreateWindow", 0
txOptGuessW5 db "GetMessage", 0
txOptGuessW6 db "ShowWindow", 0

just use those
if it isn't GUI, it must be console   :bg

jj2007

I guess you are right, Dave. Also, W1 and W2 can be misleading, I think I should take them out.

pps

Quote from: jj2007 on October 08, 2010, 02:52:33 PM
Mysterious. Try opening the source in RichMasm (part of the MB package), then assemble by pressing F6. Practically all Masm32 examples assemble just fine with the default settings.

I don't find a download link.
About that sample example from staring an console aplication when it does not responding, i tried it on 2 more computers, one of them windows 7 profesional and an windows xp. It does the same....

Am i wrong with something.

I start woth an program like this.

script->create new console aplication, i make a folder, then i open console. asm... (there is a makeit.bat file ??? what is that?)
Then it apears that pattern and then i assable it and link it from project. Then i try to run it from project or with an double click. And it give me a not responding error, then the error disaperars and does nothing... I want to write the sum of 2 numbers. How should i do it in masm. In tasm there was no problem.
Even so, here we don't need mov ax,4c00h, int 21h for ending the program? We don;t have a debuger?

how should a code like this look like in masm 32?
TITLE 1
   .MODEL SMALL
   .STACK 256
   .data
x1   dd 1
x2   dd 3
r   dd ?
.code
start:
mov ax,@DATA
mov ds,ax
add x1,x2
mov r,ax
mov ax,4c00h
int 21h
END start

if i use eax, not ax, i get eroors that cpu does not support that comand. I have a phenom II 920 X4 form AMD.

Neil

  There is nothing wrong with your code it is the way you assemble that is the problem.

I have put your code below with the corrected print statement. Follow these steps :-

Open queditor
copy and paste the code below into queditor
save it as test.asm in a folder of your choice
On the PROJECT menu click Console Assemble & Link
Go to your folder and double click test.exe and your program will run.

include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤


    .data?
     
     
    .data
      item dd 0
      value1 dd 555555h
      value2 dd 666666h

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    cls
    print "Hello World",13,10
    mov eax, value1
    add eax,value2

     print str$(eax),13,10
    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start

jj2007

Quote from: pps on October 12, 2010, 07:20:21 AM
Quote from: jj2007 on October 08, 2010, 02:52:33 PM
Mysterious. Try opening the source in RichMasm (part of the MB package), then assemble by pressing F6. Practically all Masm32 examples assemble just fine with the default settings.

I don't find a download link.

MasmBasic310810.zip at the end of post #1.

pps

Quote from: Neil on October 12, 2010, 07:47:25 AM
  There is nothing wrong with your code it is the way you assemble that is the problem.

I have put your code below with the corrected print statement. Follow these steps :-

Open queditor
copy and paste the code below into queditor
save it as test.asm in a folder of your choice
On the PROJECT menu click Console Assemble & Link
Go to your folder and double click test.exe and your program will run.

include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤


    .data?
     
     
    .data
      item dd 0
      value1 dd 555555h
      value2 dd 666666h

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    cls
    print "Hello World",13,10
    mov eax, value1
    add eax,value2

     print str$(eax),13,10
    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start

I did that and the same problem... I think i start to make you angry... But i start to be too, sorry if i am fussy . I started to make more research and found something. I do assamble, link and then i try to start it. When i look in task manager there is a problem. The program test.exe(this is his name from last time) runns in background and has one instance for every time i start it.  Something strange I would say.... do you have any solution for this?

And tis problem is havin some friends too because i ascked them to try and does the same...

U have the latest edition from the site? Is any windows problem, or some settings that i have to do?