Author Topic: How to run this?  (Read 4664 times)

PSPFrK29

  • Guest
How to run this?
« on: December 10, 2012, 08:22:42 AM »
Hey guys, Ive been trying to find a way to run this code but somewhoe the compiler that my professor preferred us to download doesnt work for me so I download Masm32, but still cant figure to run this, when I did i got this error.

Code:
INCLUDE Irvine32.inc
.data
str1 BYTE "Random Messages",0
.code
main PROC
   mov  eax, blue + (white * 16)   
   mov  ecx,4      

L1:   call SetTextColor
   mov  edx,OFFSET str1
   call WriteString
   call Crlf
   add  eax,2      
   loop L1
   exit
main ENDP
END main

When I go to project and compile resource files I got this error in CMD.



Please help me out guys Im new to this program and this whole assembly language stuff. Thanks

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: How to run this?
« Reply #1 on: December 10, 2012, 08:51:29 AM »
It looks like you are opening the file in QEditor and selecting Compile Resource File from the Project menu. Since that command is hard coded to compile a resource definition file named rsrc.rc, and there is no such file in your working directory, you get an error. You probably should be selecting Console Assemble & Link.
Well Microsoft, here’s another nice mess you’ve gotten us into.

PSPFrK29

  • Guest
Re: How to run this?
« Reply #2 on: December 10, 2012, 08:57:33 AM »
Okay I did that now I get error,

C:\mams3\lab5.asm(1) : fatal error A1000: cannot open file : Irvine32.inc
Assembly error
Press any key to continue

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: How to run this?
« Reply #3 on: December 10, 2012, 10:12:31 AM »
You need to have your source file and all of the Irvine components in your working directory.
Well Microsoft, here’s another nice mess you’ve gotten us into.

PSPFrK29

  • Guest
Re: How to run this?
« Reply #4 on: December 10, 2012, 11:50:17 AM »
But when I went to msam32 folder and go to Include folder I dont see Irvine as a file there, can that be the reason why? and it is there I saved it inside msam32 folder

Magnum

  • Member
  • *****
  • Posts: 2309
Re: How to run this?
« Reply #5 on: December 10, 2012, 04:20:17 PM »
Irvine32.inc won't be in there since it isn't a part of the masm package.

I did a search for the file, but only found references to it.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

  • Member
  • *****
  • Posts: 10098
  • Assembler is fun ;-)
    • MasmBasic
Re: How to run this?
« Reply #6 on: December 10, 2012, 05:38:55 PM »
Making the Irvine library run with Masm32 is unfortunately not trivial. Attached is a short demo showing how the 32-bit examples can be used in parallel with Masm32 and/or MasmBasic.
« Last Edit: December 10, 2012, 08:03:11 PM by jj2007 »

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: How to run this?
« Reply #7 on: December 10, 2012, 07:55:59 PM »
If I place this source:
Code: [Select]
INCLUDE Irvine32.inc
INCLUDELIB Irvine32.lib
INCLUDELIB \masm32\lib\kernel32.lib
.data
str1 BYTE "Random Messages",0
.code
main PROC
   mov  eax, blue + (white * 16)
   mov  ecx,4
L1:
   call SetTextColor
   mov  edx,OFFSET str1
   call WriteString
   call Crlf
   add  eax,2
   loop L1
   call ReadChar ; pause before closing
   exit
main ENDP
END main

In a working directory off the MASM32 directory (IOW in a subdirectory of the MASM32 directory) , along with these files:

Irvine32.inc
SmallWin.inc
Irvine32.lib

Then I can open the source in Qeditor, select Console Assemble & Link from the Project menu, and assemble and link the source into a working EXE.

Note that Qeditor will use ML and Link from the masm32\bin directory (this is automatic), kernel32.lib from the masm32\lib directory (as specified), and Irvine32.inc, SmallWin.inc, and Irvine32.lib from the working directory (which the system sees as the current directory, and the first place to look for a file when the file path is not specified).

For a source that uses any of the Irvine32 macros you will also need to include Macros.inc, and I think there may be several other include files needed, depending on what your source uses.

Edit:

Making the working directory a subdirectory of the MASM32 directory will make it somewhat easier to access from Qeditor, but actually the only requirement is that it be on the same drive as the MASM32 directory.

« Last Edit: December 11, 2012, 10:55:50 AM by MichaelW »
Well Microsoft, here’s another nice mess you’ve gotten us into.