BOSS
BOSS

Reputation: 1898

Assembling an ASM file into an EXE

I just started learning the assembly language programming few days ago. Now I have a problem assembling the asm file into an exe. I use NASM as my assembler. This is the command I use to assemble it:

nasm file.asm -o file.com or exe

Here is my code:

.model small
.data
.code
start:
mov ax,@data
mov ds,ax

mov ax,00h
mov bx,33h

mov ah,4ch
int 21h
end start

...but I get these errors:

boss.asm:1: error: attempt to define a local label before any non-local labels
boss.asm:1: error: parser: instruction expected
boss.asm:2: error: attempt to define a local label before any non-local labels
boss.asm:3: error: attempt to define a local label before any non-local labels
boss.asm:13: error: parser: instruction expected

I don't understand what these errors mean. How do I fix these errors?

Upvotes: 0

Views: 4146

Answers (1)

Loren Pechtel
Loren Pechtel

Reputation: 9093

It's been a long time but I think this can be caused by a lack of proper segment definitions.

Upvotes: 1

Related Questions