News:

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

): I am getting only errors!!

Started by new_comer, January 02, 2006, 08:48:14 PM

Previous topic - Next topic

new_comer

Hi!!

I wrote(copy and pasted) the following code (which have been written by administrator in one of the forum forum) in Qeditor and saved it as 'test.asm' then I compiled and ran it.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

;                 Build this with the "Project" menu using
;                       "Console Assemble and Link"

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    .486                                    ; create 32 bit code
    .model flat, stdcall                    ; 32 bit memory model
    option casemap :none                    ; case sensitive

    include \masm32\include\windows.inc     ; always first
    include \masm32\macros\macros.asm       ; MASM support macros

  ; -----------------------------------------------------------------
  ; include files that have MASM format prototypes for function calls
  ; -----------------------------------------------------------------
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc

  ; ------------------------------------------------
  ; Library files that have definitions for function
  ; exports and tested reliable prebuilt code.
  ; ------------------------------------------------
    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib

    .code                       ; Tell MASM where the code starts

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

start:                          ; The CODE entry point to the program

    print chr$("Hey, this actually works.",13,10)
    exit

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start                       ; Tell MASM where the program ends


But I got following out:

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823
Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.

Using codepage 1252 as default
Creating rsrc.RES
RC: RCPP -CP 1252 -f E:\masm32\RCa03716 -g E:\masm32\RDa03716 -DRC_INVOKED -D_WI
N32 -pc\:/ -E -I. -I .


RC : fatal error RC1110 : could not open rsrc.rc


Microsoft (R) Windows Resource To Object Converter Version 5.00.1736.1
Copyright (C) Microsoft Corp. 1992-1997. All rights reserved.

CVTRES : fatal error CVT1101: cannot open rsrc.res for reading
Press any key to continue . . .



Please help me out,otherwise this will jeopradise my assembly learning ethuaism

hutch--

hmmmm,

Its a piece of the MASM32 example code with additional comments. Do as the code says and build it as a console example.

The example is in \masm32\tutorial\console\demo1

Let us know how you go after you bother to read the comment at the top of the code,

Quote
;                 Build this with the "Project" menu using
;                       "Console Assemble and Link"
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

new_comer


Thank you sir....

But I am curious to know why it did not work last time. I mean I fallowed the correct procedure for executing any piece of code.

Do I have to do the same everytime I write any program. The one which are written on my college text book.


hutch--

Just know the difference between a console app and a normal gui app. With windows programs, if you need a graphics interface you build it in differently. These are options set in the linker between /subsystem:console versus windows.

The CVTRES error was trying to get it to build something that was not there. With a GUI app it has additional files for resources which are things like icons, bitmaps, menus and dialog box temp;lates and these are built with a resource compiler, converted to an object module by CVTRES then linked into the main exe that uses them.

Just potter through the simple stuff first so you get a feel for the basic style of code, then you can start doing more complex stuff later.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MichaelW

new_comer,

The only way I can duplicate your result is by selecting "Compile Resource File" on the Project menu. It fails because there is no resource file. I think the examples from your textbook should probably be built by whatever method is specified in the book or included with the examples.

eschew obfuscation