Forum Topic: Masm 6.11 help!

(171 views • 6 replies)

This topic is 1 page long.

<< < > >>
None

CaptinChu

Reply To Post Reply & Quote

Posted at: 11/8/09 03:52 PM

CaptinChu DARK LEVEL 15

Sign-Up: 09/11/05

Posts: 3,219

I've recently acquired the book Assembly Language for Intel-Based Computers by Kip R. Irvine. It includes instructions on how to code in assembly, as well as the MASM 6.11 assembler.

Here's the problem: I don't know how to use it!!! I'm used to just sending my C++ code into a compiler and the compiler spits out an .exe. Apparently, Assembly is this whole song and dance.

Can anyone here help me set up and IDE for MASM Assembly? (It has to be MASM, not any other compiler; that's what the book is based on.) If not, could you please instruct me step by step to turn .asm into .exe? And please don't say "Google;" I've already done that.

This "Hello World" code should be able to work using the set up:

title Hello World Program      (hello.asm)

; This program displays "Hello, world!"
.model small
.stack 100h
.data
message db "Hello, world!",0dh,0ah,'$'

.code
main proc
 mov ax,@data
 mov ds,ax

 mov ah,9
 mov dx, offset message
 int 21h

 mov ax,4C00h
 int 21h
main endp
end main

All programming problems can be solved with Arrays!

BBS Signature

None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 11/8/09 04:08 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,385

Assembly uses compilers too. Download MASM and compile your code with it.
There's no IDE. Maybe syntax highlighting in a few editors. There's really nothing else to the language.

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


None

kiwi-kiwi

Reply To Post Reply & Quote

Posted at: 11/8/09 04:58 PM

kiwi-kiwi LIGHT LEVEL 08

Sign-Up: 03/06/09

Posts: 650

Quick google revealed this ASM IDE
Also MASM 6.11 is a pretty old version, I would get the newest masm if I were you, but the book might still be good for learning purposes.
And I'd also suggest reading AOA


None

CaptinChu

Reply To Post Reply & Quote

Posted at: 11/8/09 09:21 PM

CaptinChu DARK LEVEL 15

Sign-Up: 09/11/05

Posts: 3,219

Good stuff! I got something to work! However, it's giving me a .obj file, not a .exe file... Can you help me out a little bit more? Is there some special command or some "linking" thing that I keep hearing about?

All programming problems can be solved with Arrays!

BBS Signature

None

authorblues

Reply To Post Reply & Quote

Posted at: 11/10/09 08:51 PM

authorblues FAB LEVEL 12

Sign-Up: 06/21/05

Posts: 6,360

At 11/8/09 09:21 PM, CaptinChu wrote: Good stuff! I got something to work! However, it's giving me a .obj file, not a .exe file... Can you help me out a little bit more? Is there some special command or some "linking" thing that I keep hearing about?

object files have to be linked to an executable. a compiler generally handles that step for you, using a linker. i dont know what you can use for windows, but if you have a gcc-type toolkit available, "ld" should do the trick.

GENERATION 1-i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

BBS Signature

None

CaptinChu

Reply To Post Reply & Quote

Posted at: 11/11/09 01:59 AM

CaptinChu DARK LEVEL 15

Sign-Up: 09/11/05

Posts: 3,219

Thank you for all your help! I've found my way through assembly and I'm going to be having a lovely wonderful time learning it now! Thanks!

All programming problems can be solved with Arrays!

BBS Signature

None

alio-big-mac

Reply To Post Reply & Quote

Posted at: 11/16/09 06:51 AM

alio-big-mac EVIL LEVEL 11

Sign-Up: 08/18/05

Posts: 48

Considering you appear to be using 16bit Assembly, nasm is probably your easiest solution.

Code (Changed some stuff):

[bits 16]
[org 100h]

push hello_txt
call print_str
add sp,2
ret

hello_txt db "Hello World!",0

print_str:
mov si,[sp+2]
mov ah,0eh
.print_str_loop:
lodsb ; basically mov al,byte[si] inc si
test al,al ; a smaller version of cmp al,0
je .print_str_end
int 10h
jmp .print_str_loop
.print_str_end:
ret


All times are Eastern Standard Time (GMT -5) | Current Time: 07:33 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!