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

pps

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.

BlackVortex

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

MichaelW

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.

eschew obfuscation

pps

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?

clive

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
It could be a random act of randomness. Those happen a lot as well.

dedndave

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

BlackVortex

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/

pps

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

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

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

aj4luna

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!

pps

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.

jj2007

Change line 37 as follows:
     print str$(eax),13,10

... and make sure you do CONSOLE assemble & link.

pps

it still does the same. i still have that problem. It can be a problem with windows 7? or what??  what should i do?

japheth

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.