I am a young man who try to learn asm. Well, i was looking for a 32bit asembler and i found masm32.com. I think it is the greatest program i saw but i have a problem. I installed the aplication and i started it. When I tryied to compile i got the following error: RC: fatal error RC1110: could not open rsrc.rc . then CVTRES: fatal error CVT1101: cannot open rsrc.res for reading. This apear in a comand prompt window. I used till now just tasm, tlink and td, witch are old and on 16 bits. Please excuse me for my bad english, it is not my maternal language an I still make some mistakes.
Are you trying to do a build all ? It is looking for resources and it finds none. Try assembling and linking.
Or do the assembling and linking manually from the commandline. The assembler is ml.exe and the linker link.exe
pps,
The error messages:
RC : fatal error RC1110 : could not open rsrc.rc
CVTRES : fatal error CVT1101: cannot open rsrc.res for reading
Result when you select Compile Resource File on the Project menu but there is no rsrc.rc file in the working directory. Both of the Build All options will attempt to compile and convert a rsrc.rc file only if one is present. So if you are trying to build an existing project, you need only determine whether it is a console app or a gui app and use the appropriate Build All option.
so, i tryed to lunch from ml to asamble the file. Nothing.... I tried many things. What kind of project should i make for assembling a normal file. I mean a program like this:
.MODEL SMALL
.STACK
DATA SEGMENT
x db -33
y db 14o
z db 110101b
data ends
cod segment
assume cs:cod,ds:data,ss:data
start:
mov ax,data
mov ds,ax
mov al,y
cmp al,0
mov al,[si]
mov [bx],ax
add byte ptr [si],10
jge salt
salt:
mov bl,al
mov al,z
mul y
add al,bl
mov bl,x
add al,bl
mov x,al
mov ax,4c00h
int 21h
cod ends
END start
If i try to make a console aplication I get a problem with that generated code. Can i find a model of aplication, a tutorial of how to make an project?
Thought you wanted a 32-bit assembler, this is 16-bit code, and will require a 16-bit Linker
The 16-bit code assembles with MASM using the following command line
ML -c -Fl test.asm
The 16-bit Linker (See LINK 5.63 below), uses the following command line
LINK test,test;
It assembles and links fine, but isn't going to do much unless you have a debugger to step through it and see the values it saves to memory.
http://www.sce.carleton.ca/~mmacleod/masm.html
http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe
you can use a couple shortcuts for segments (i don't think you want to assume ss:data)
also, there are a couple uninitialized registers
as Clive mentioned, you will need a 16-bit linker for this code
.MODEL SMALL
.STACK 512
.DATA
x db -33
y db 14o
z db 110101b
.CODE
start: mov ax,@DATA
mov ds,ax
mov al,y
cmp al,0
mov al,[si] ;SI register not initialized
mov [bx],ax ;BX register not initialized
add byte ptr [si],10 ;SI register not initialized
jge salt ;will execute at "salt" either way
salt: mov bl,al
mov al,z
mul byte ptr y
add al,bl
mov bl,x
add al,bl
mov x,al
mov ax,4C00h
int 21h
END start
Quote from: pps on May 11, 2010, 04:14:52 PM
Well, i was looking for a 32bit asembler and i found masm32.com.
Then why try to assemble 16-bit code ? :eek
If you are reading an old assembly tutorial, just delete it and check iczelion's tuts. His coding style is very good.
http://win32assembly.online.fr/
I know that the code is 16bit but i have 2 who user eax, ebx and and dome double words that cannot be compiled with TASM . This was just an example of code. This code works with tasm, and is a didactic example that i had to write.
If i put here a 32bit code witch i couldn't test it might have errors and it would have been shame for me.
In Tasm i didn't had to initialize the registers, I tryied to pus xor si,si and work withought that, same eith bx or others. Only if in the program i wa using si like an contor and then i nedeed it "0" i made an initialize.
I saw that not having a debuger is realy bad, i will search those linksor maybe i will try the old turbo debuger because at a couple of problems i am not allowed to use a dos function ar to show a mesage. U have any better sugestions than TD?
Anyway, i will try with ML -c -Fl test.asm to see what is hapening
pps,
The code you posted is 16 bit DOS code and will not run as a win32 executable as int 21h is not available in win32. You could build it as 16 bit DOS code but that will only run in the 16 bit DOS subsystem, to write 32 bit code you need to rewrite it and use Windows API functions instead of int 21h, 10h and others. If you are writing mixed 16 / 32 bit code as for an operating system where the machine boots in real mode and sets up protected mode you tend to manually specify segments in MASM but the nod seems to be NASM or FASM for boot sector code when starting a machine at an OS level.
generally - we point the SI or BX register at an array of data before using them as you have :U
if you look at this link, there is an attachment that shows simple examples of both 16-bit and 32-bit programs
http://www.masm32.com/board/index.php?topic=12621.msg97236#msg97236
Quote from: hutch-- on May 14, 2010, 07:23:40 AM
pps,
The code you posted is 16 bit DOS code and will not run as a win32 executable as int 21h is not available in win32. You could build it as 16 bit DOS code but that will only run in the 16 bit DOS subsystem, to write 32 bit code you need to rewrite it and use Windows API functions instead of int 21h, 10h and others. If you are writing mixed 16 / 32 bit code as for an operating system where the machine boots in real mode and sets up protected mode you tend to manually specify segments in MASM but the nod seems to be NASM or FASM for boot sector code when starting a machine at an OS level.
wow!
it start again. I have a problem. a wrote this program and it doesn't work. i mean, i had a few time and i try to make masm work but id doesn't. here is the code:
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
comment * -----------------------------------------------------
Build this console app with
"MAKEIT.BAT" on the PROJECT menu.
----------------------------------------------------- *
.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 eax,13,10
ret
main endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end start
I assamble it, i link it, no problem, and i get the most wanted exe file but the exe file does nothing and masm 32 stop working when i try to run the file. what should i do? At the scool we learned only about tasm, tlink and the help from masm is poor.
Change line 37 as follows:
print str$(eax),13,10
... and make sure you do CONSOLE assemble & link.
it still does the same. i still have that problem. It can be a problem with windows 7? or what?? what should i do?
Quote from: pps on October 08, 2010, 07:07:42 AM
what should i do?
Analyze the problem!
That is: use your own brain and don't ask people what to do next! Since you want to learn assembly this is an inevitable step which you sooner or later have to take.
I'll give a small hint for a first step, though: Get yourself familiar with the command line and how to invoke Masm and the linker manually. Additionally, search for another source sample to begin with. Your current one isn't assembly, it's BASIC - which you surely don't want to learn.
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?
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...
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.
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_
Mysterious. Try opening the source in RichMasm (http://www.masm32.com/board/index.php?topic=12460) (part of the MB package), then assemble by pressing F6. Practically all Masm32 examples assemble just fine with the default settings.
Can you be clear that you are using Console Assemble & Link & not as you say Assemble & Link
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.
that could be a small external program, Jochen - good idea :P
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
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
I guess you are right, Dave. Also, W1 and W2 can be misleading, I think I should take them out.
Quote from: jj2007 on October 08, 2010, 02:52:33 PM
Mysterious. Try opening the source in RichMasm (http://www.masm32.com/board/index.php?topic=12460) (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.
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
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 (http://www.masm32.com/board/index.php?topic=12460) (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 (http://www.masm32.com/board/index.php?topic=12460).
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?
Quote from: pps on October 13, 2010, 12:25:41 PMI 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?
Most probably, your linker commandline contains SUBSYSTEM=WINDOWS. Since you have inkey in your code, it hangs there but will never show.
That is why RichMasm has an autodetect function that chooses SUBSYSTEM=CONSOLE if print, inkey and similar keywords are detected.
Hint: replace the inkey with an invoke MessageBox.
i have good news. I haven't tried with invoke but i found that after i make an console aplication project and then from project i select makeit.bat it works.
If we still are here, can u tell me what is makeit.bat? And why it is working. I will try in a few heures with invoke, for the moment i have to read about how that comand works, what arguments can take and what should i include.
i tested invoke and works when i use makeit. bat.
If i want to link it how should i call the linker in the console making that subsystem setting?
You should be a bit more explicit, i.e. post
- your complete code, from include ... to end start
- error messages, if there are errors
- describe what the prog does (e.g. does it show a MessageBox, or not?)
- post your makeit.bat
You can attach files by zipping them and clicking on "Additional Options".
you simply aren't assembling and linking it correctly
first, this is 32-bit code, so you will need to use a 32-bit linker - not the 16-bit
second, make sure you have the following files in the \masm32\bin folder:
ML.EXE
LINK.EXE
third, try these 2 commands from the command line:
masm32\bin\ml /c /coff test.asm
masm32\bin\link /SUBSYSTEM:CONSOLE /OPT:NOREF test.obj
just to clarify:
the ML.EXE assembler included with the masm32 package will assemble either 16-bit or 32-bit code
the LINK.EXE linker included with the masm32 package will only link 32-bit OBJ's
the LINK16.EXE linker included with the masm32 package will only link 16-bit OBJ's
examine your batch file(s) to verify you are using the appropriate linker and command lines for the type of ASM file you have written
sorry for the late response. I solved it. I opened the makeit file and found all what i need. Thank u again!