News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Why won't this code compile?

Started by jackinthebox, February 20, 2006, 10:15:22 PM

Previous topic - Next topic

jackinthebox

I am trying to compile my first assembly program using MASM and the Easy Code IDE. However I can't even get "Hello World" to compile. I am following this tutorial.

; This is a simple program which displays "Hello World!"
; on the screen.

.model small
.stack
.data

Message db "Hello World!$"    ; message to be display

.code

mov dx,OFFSET Message    ; offset of Message is in DX
mov ax,SEG Message    ; segment of Message is in AX
mov ds,ax       ; DS:DX points to string

mov ah,9       ; function 9 - display string
int 21h       ; call dos service
mov ax,4c00h       ; return to dos DOS
int 21h

END start       ;end here


Here is the debugger output:

============== Project1 - Debug ==============

Assembling: Module1
Module1.asm(4) : warning A4011: multiple .MODEL directives found : .MODEL ignored
Module1.asm(12) : error A2022: instruction operands must be the same size
Module1.asm(21) : error A2006: undefined symbol : start
Module1.asm(13) : error A2004: symbol type conflict
Module1.asm(21) : error A2148: invalid symbol type in expression : start

Errors ocurred.


I appreciate any help anyone has to offer. Thanks!

hutch--

The errors are telling you most of it. You are trying to build a small memory model DOS 16 bit file in a 32 bit package..

If you need to build 16 bit code, get a 16 bit OMF linker and set up your own editor etc ... to build the old stuff.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

skywalker

Quote from: jackinthebox on February 20, 2006, 10:15:22 PM
I am trying to compile my first assembly program using MASM and the Easy Code IDE. However I can't even get "Hello World" to compile. I am following this tutorial.

; This is a simple program which displays "Hello World!"
; on the screen.

.model small
.stack
.data

Message db "Hello World!$"    ; message to be display

.code

mov dx,OFFSET Message    ; offset of Message is in DX
mov ax,SEG Message    ; segment of Message is in AX
mov ds,ax       ; DS:DX points to string

mov ah,9       ; function 9 - display string
int 21h       ; call dos service
mov ax,4c00h       ; return to dos DOS
int 21h

END start       ;end here


Here is the debugger output:

============== Project1 - Debug ==============

Assembling: Module1
Module1.asm(4) : warning A4011: multiple .MODEL directives found : .MODEL ignored
Module1.asm(12) : error A2022: instruction operands must be the same size
Module1.asm(21) : error A2006: undefined symbol : start
Module1.asm(13) : error A2004: symbol type conflict
Module1.asm(21) : error A2148: invalid symbol type in expression : start

Errors ocurred.


I appreciate any help anyone has to offer. Thanks!

I pulled this out of  some code. This'll help you fix it.

Good luck.

prompt    db       13,10,13,10,'File not present.',13,10,'$'

mov          dx, offset prompt
             mov          ah,9
             int          21h
you'll also need this right after .code .

:start

move ax,@data
move dx,ax

jackinthebox

#3
Quote from: hutch-- on February 20, 2006, 10:24:50 PM
The errors are telling you most of it. You are trying to build a small memory model DOS 16 bit file in a 32 bit package..

If you need to build 16 bit code, get a 16 bit OMF linker and set up your own editor etc ... to build the old stuff.

< Expletives deleted, P1 >

On a side note, I greatly appreciate your help skywalker.

zooba

I didn't think you'd last too long here.  :naughty:

hutch--

Bye Bye Jack.  :bg

If you are that stupid that you cannot take some normal technical advice, you should go back to kindergarten where you belong.

Now for anyone interested in trying to build DOS 16 bit code, Easycode is a 32 bit project that uses the 32 bit COFF linker from Microsoft and whether our kiddies friend likes it or not, it will not build 16 bit OMF format files.

16 bit code should be posted in the 16 bit forum and as it appears that our kiddie friend cannot read either, post 16 bit code there and you have some chance of an answer.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ic2

Shame on YOU
you can't and never will never bring this down.

THAT IS EXACTLY WHAT YOU ARE AFTER CREEP

So you declare war on the background pro's

We can smell you.  I for one smell sh*T trying to trick your way in>


BUCK YOUUUUUUUBitch type

sluggy

jackinthebox,
your grammar sucks, and you could have done with some commas and periods in your little rant. It is good to know that you could spell all the variations of "fuck", although you could have used a spell checker to pick up "SUPPOSSED". A few more years in school and you might have it nailed.  :clap: :snooty:

Are you the jackinthebox that is also known as "Brady"?


hutch--

Never mind,

I have no doubt that next time "mummy" changes his diaper, she will give him a paddling for trying to say all of those naughty words at the same time.  :cheekygreen:
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

zooba

I don't see what the fuss is about. Once it's been translated it's really quite a polite message :U :toothy

Quote from: jackinthecribMr. Hutch,

I would have preferred assisstance with my task rather than your response. I am not yet fluent in assembler errors and was not aware of the differences between 16-bit and 32-bit linking processes. Your response was not helpful to me and I would have preferred a link to a tutorial, sir.

asmGhost

Wow,
That was hardly worth staying up for  :lol. I was always curious what I was missing when I was sleeping. Mystery solved. :U
Hope the door hits him on the a** on the way out.

PBrennick

The man(?) needs help before he hurts someone.  The Whole thing is shocking.  I hope we never hear from him again.
Paul
The GeneSys Project is available from:
The Repository or My crappy website

hutch--

> I hope we never hear from him again

There's a real good chance of that.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php