News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How run a Masm program on a 64-bit Windows 8? (newbie)

Started by Kenny_007, September 27, 2013, 05:47:57 AM

Previous topic - Next topic

Kenny_007

I'm totally new to Assembly programming and have no experience in the slightest, except for higher level languages. I've been able to download masm32 and it was all successful, however there are some problems: apparently I need a 16-bit linker to run my assembly code and whenever I try this my PC says it can't download this version.

Now, surely there must be a way to run an x86 assembly program using masm on a 64 bit windows 8. Also, I'm not too sure what I would type in at the command prompt to even compile and run the code. So can someone tell me how to run a masm program on a 64-bit os as well as any useful links. I wouldn't be asking this if I knew how to, so please no derogatory comments

Vortex

Hi Kenny,

Welcome to the forum.

Windows 8 64-bit cannot run 16-bit applications :

http://answers.microsoft.com/en-us/windows/forum/windows_8-windows_install/how-to-run-16-bit-software-in-windows-8-64-bit/1a4b1493-27ae-488b-911a-ab4f9689b015

The 16-bit linker comes with the Masm32 installation :

\masm32\bin\link16.exe

jj2007

Quote from: Kenny_007 on September 27, 2013, 05:47:57 AMapparently I need a 16-bit linker to run my assembly code

As Vortex already wrote, 16-bit code won't run on Win8. But 32-bit code will, and often it is very easy to port your source to 32-bit. Perhaps you should simply post it here (zip & attach), so that we see clearer what your options are.

FORTRANS

Hi,

   You can try DOSBox or Virtual PC to run 16-bit programs.
Search for those in the 16-bit sub-forum.

Regards,

Steve

Gunther

Hi Kenny_007,

first things first: Welcome to the forum.

Steve aka FORTRANS is right: your only chance to launch 16 bit software under a 64 bit OS is a virtual machine. VirtualBox is another alternative. You may wish to check this thread for more details. Good luck.

Gunther
You have to know the facts before you can distort them.

japheth


The M$ 16-bit linker is a Win32 program, so it should run in Win64.

Here's a http download URL that should work: http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe

The executable that the linker might create, however, will need a virtual environment, as it has already been mentioned above.

sinsi

Looks like lnk563.exe is a DOS SFX but the link.exe contained in it is a PE file.
🍺🍺🍺

Kenny_007

Alright I've successfully downloaded Dosbox and Virtualbox so how do I run a masm program? I took a simple x86 assembly code from a book i'm reading and I want it to execute it. Is it the same as C where you use gcc example.c -o example.exe or do I do something different? I would show the assembly code but it's quite lengthy although if you gys dont mind i'll happily post it.

dedndave

you can attach a ZIP file to the reply
under the Reply window is a "link", Attachments and other options - just click on that

however, it isn't necessary - just use a simple example program until you get going
        .MODEL  Small
        .STACK  2048
        .DOSSEG
        .386
        OPTION  CaseMap:None

;####################################################################################

        .DATA

s$Msg   db 'Hello World !',0Dh,0Ah,24h

;************************************************************************************

        .DATA?

;####################################################################################

        .CODE

;************************************************************************************

_main   PROC    FAR

        mov     ax,@data
        mov     ds,ax

        mov     dx,offset s$Msg
        mov     ah,9
        int     21h

        mov     ax,4C00h
        int     21h

_main   ENDP

;####################################################################################

        END     _main

Kenny_007

thanks guys, but i still don't know how to actually 'run the program' and by run i mean to compile and then execute

jj2007

1. Copy & paste to MyCode.asm:
include \masm32\include\masm32rt.inc

.code
AppName   db "Masm32:", 0

start:   MsgBox 0, "Hello World", addr AppName, MB_OK
   exit

end start

2. Open a console in the path of MyCode.asm and use these commands:
\masm32\bin\ml.exe /c /coff mycode.asm
\masm32\bin\link.exe /subsystem:console mycode.obj


And before complaining again that "it doesn't work",
- zip your code and attach it here
- provide us with
  a) what you have done,
  b) detailed error messages,
  c) info on your setup

dedndave

i think he's trying to run 16-bit code

but - the hard part is probably "how do i open a console window" - lol
i can't help you, there, as i don't have much experience with virtual systems under 64-bit

i can help you with the command lines, though

\masm32\bin\ml /c MyFile.asm
\masm32\bin\Link16 MyFile.obj;

Gunther

Hi Kenny,

another attempt. Attached is the file hello.zip. It contains a simple hello world for testing your virtual machine with a DOS program. It works under DOSBox, VirtualBox and VirtualPC (tested).

Please have a look into b_hello.bat, which builds the running EXE.

A final word: Don't waste your time with 16 bit code. Check out the examples and tutorials inside the MASM32 package. 32 bit and 64 bit is the way to go. Good luck.

Gunther
You have to know the facts before you can distort them.

Kenny_007

I think you have me mistaken i'm not trying to write any 16 bit code, but when I wanted to compile an x86 asembly program using masm a website said a 16 bit linker was required. I've attached a simple program I got from a book I'm reading on assembly. So I'm not interested in 16 bit code at all, it's just that I've heard from places that you need a 16 bit linker to write an assembly program and the thing is, is that when I try to compile my program using the following command:

ml /c hello.asm
hello.asm(1) : fatal error A1000: cannot open file : Irvine32.inc


I'm pretty sure the code is x86 and i'm definitely using masm32. I guess i should've mentioned this at the start, my bad

Kenny_007

by the way i saved it as an asm file, i just had to convert it to zip to post it here