Sign in to follow this  
Sean_Seanston

x86 Assembler for Vista 64-bit?

Recommended Posts

Sean_Seanston    880
Ok, so I'm doing a Computer Science degree and we're learning assembly. I had TASM running on my XP 32-bit laptop but recently I got a new computer with Vista 64-bit and trying to run TASM results in an error message saying I need a version that works with 64-bit since, obviously with TASM being so old, it must be a 16-bit application. (Like Dungeon Keeper unfortunately as I discovered -_- but that's another issue). I looked at NASM and FASM but they both give me errors when I put in code like this which TASM never had a problem with:
.model small
.stack
.data
message   db "Hello world", "$"

.code

main   proc
   mov   ax,seg message
   mov   ds,ax

   mov   ah,09
   lea   dx,message
   int   21h

   mov   ax,4c00h
   int   21h
main   endp
end main
I don't know much about x86 Assembly but I've seen something about Intel syntax and AT&T syntax, though NASM and FASM are supposed to work with Intel syntax so I dunno. Maybe I need to configure them somehow? I also see Visual Studio 2008 Express includes MASM 9. How do I use that exactly? When I go to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin with the Cmd prompt and type "ml test.asm" I get some errors about "symbol type conflict" and something else. ml /? doesn't really help either... Any ideas as to how I can successfully assemble and run the code above? I could just use TASM on my laptop but being able to do it on my main PC would be easier. Thanks.

Share this post


Link to post
Share on other sites
Sean_Seanston    880
I type this:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>ml test.asm


Then this comes out:

Microsoft (R) Macro Assembler Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

Assembling: test.asm
test.asm(9) : error A2004:symbol type conflict
test.asm(19) : warning A4023:with /coff switch, leading underscore required for
start address : main

Share this post


Link to post
Share on other sites
Adam_42    3629
Unfortunately once you've got it to assemble you'll run into another problem - that assembly code is 16-bit so I think the result won't run!

You're probably best off dual booting with an older O/S, or using an emulator like DosBox.

Share this post


Link to post
Share on other sites
Extrarius    1412
Just a bit of trivia:
Quote:
Original post by Sean_Seanston
[...]TASM[...]

Quote:
Original post by Sean_Seanston
[...]Microsoft (R) Macro Assembler Version 9.00.30729.01[...]
TASM doesn't stand for "Microsoft (R) Macro Assembler". The appropriate acronym in this case is MASM. TASM stands for Turbo Assembler, which was (is?) a Borland product.

Share this post


Link to post
Share on other sites
Noplace    144
Hi, during college i used a program for some courses, cant remember the name but it allowed you to program assembly and simulate/emulate all the functionalites ( IO and interrupts etc ) it had its own output window and all, if you dont need to make exes then you can search for something like that

Share this post


Link to post
Share on other sites
popsoftheyear    2194
@extarius - I believe he tried to use TASM, discovered it didn't work on a 64 bit OS, and now is trying MASM and wonders why it won't compile his TASM-compatible code.

@Sean_Seanston - The main problem you're having is that, like Adam_42 said, you are trying to compile 16 bit code in a very-not-16-bit assembler!! ".model small"? Memory models don't work like that now in windows. That's why MASM is complaining. The line "mov ax, seg message" I believe will error because you don't have segments to address memory any more either. It's all flat (in fact it's not even real memory addresses any more, but that's another issue that probaby won't concern you)

Also, as promit and the masm warning said, you need an underscore to main, so call it _main.

I think your best bet would definitely be to boot to a 32 bit OS (maybe even DOS???) or learn to use MASM for making windows programs, of which there are tons and tons of tutorials on the internet if you just google for them.

[edit] Or do what NoPlace suggested... sounds like it's just what you need.

Good luck!

Cheers
-Scott

Share this post


Link to post
Share on other sites
Extrarius    1412
Quote:
Original post by popsoftheyear
@extarius - I believe he tried to use TASM, discovered it didn't work on a 64 bit OS, and now is trying MASM and wonders why it won't compile his TASM-compatible code.[...]
Indeed. I must be more tired than I thought =-/

Share this post


Link to post
Share on other sites
Sean_Seanston    880
Quote:
Original post by Extrarius
Just a bit of trivia:
Quote:
Original post by Sean_Seanston
[...]TASM[...]

Quote:
Original post by Sean_Seanston
[...]Microsoft (R) Macro Assembler Version 9.00.30729.01[...]
TASM doesn't stand for "Microsoft (R) Macro Assembler". The appropriate acronym in this case is MASM. TASM stands for Turbo Assembler, which was (is?) a Borland product.


Yes, I was talking about TASM in the early part of the post but later on I was discussing MASM and the errors I get with that...

Quote:
Original post by popsoftheyear
@extarius - I believe he tried to use TASM, discovered it didn't work on a 64 bit OS, and now is trying MASM and wonders why it won't compile his TASM-compatible code.


Yes indeed ^_^

Quote:
Original post by popsoftheyear
@Sean_Seanston - The main problem you're having is that, like Adam_42 said, you are trying to compile 16 bit code in a very-not-16-bit assembler!! ".model small"? Memory models don't work like that now in windows. That's why MASM is complaining. The line "mov ax, seg message" I believe will error because you don't have segments to address memory any more either. It's all flat (in fact it's not even real memory addresses any more, but that's another issue that probaby won't concern you)


I see... suppose I'll just use my laptop for assembly then.

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this