Programming Question

A place general forum talk, not related to ingame discussions.
Post Reply
darkness5723
Forum Regular
Posts: 730
Joined: Thu Dec 22, 2005 3:12 pm
Alliance: Ascended Generations
Race: The Faceless
ID: 5741
Location: Wherever

Programming Question

Ooooookayyy so this is a bit of a strange topic. I'm in an assembly language class.

I have much experience in programming but that was mostly in high-level stuff (Java, C++, C#...etcetcetcetc)
Also have low-level experience in C, and a very slight amount of FORTRAN.

But.. assembly makes absolutely 0 sense to me. In theory it makes perfect sense, but whenever I tell it to do a simple MOV instruction, it keeps **Filtered** about something or another.

Heres the assignment:

Simply display 4 strings in sequence (can get this to work just fine)
mov 3 numbers to the registers ax,bx,cx and display them using codeview.

Code:

Code: Select all

title Project1

.model small
.386
.stack 100h

.DATA

message BYTE "Name: Bryan Winstead", 0Ah,0Dh, '$'
num1 SBYTE -118
num2 WORD 256
num3 WORD 40000

.CODE
main PROC
  mov ax, @DATA
  mov ds, ax

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

  mov ax, offset num1
  mov bx, offset num2
  mov cx, offset num3
main ENDP
END main


Now whenever I try to assemble/link it it gives me the following errors

undefined symbol: DGROUP (it references the line mov ax, @DATA)
then it says with /coff switch, leading underscore required for start address : main

Now.. usually it spits out an undefined symbol when you reference an identifier that hasnt been declared in the .DATA segment. But this is referencing the data segment itself, like the DATA segment doesn't exist.. and it very clearly does.

And err. the /coff switch.. I'm not using any switches at all to assemble/link it, so why would it be giving me an error about a switch.

Also.. if you notice any problems with the actual code could you point them out? Being a first assignment, I'm not allowed to use any libraries or include files. Also I know I need to assemble it with the /Zi switch to use codeview.. BUT I can't even get it to assemble without ANY switches.

SO err.. can anyone help?

btw: using MASM 8.00.50727.104
cpu is an AMDX2 6000+ but it's IA32 compliant, and I'm not even using the IA32 instruction set, doing it in 16-bit real mode for now.
Come_Forth
Forum Expert
Posts: 1307
Joined: Sat May 07, 2005 1:30 pm
ID: 0
Location: The Galapagos Islands

Re: Programming Question

I don't know anything about programming, but I hope that these links help:
http://www.eggheadcafe.com/aspnet_answe ... 368320.asp
http://objectmix.com/asm-x86-asm-370/68 ... a2006.html
http://www.gamedev.net/community/forums ... _id=184531
I know now why this crap didn't work. This is the command to assemble the hello.asm:

Code: Select all

ml /omf /Bllink16 /Zm hello.asm

For the 16-Bit crap to work you have to disable the /coff that ML implicit uses.

Again thanks for your great help to get me started.
"Conservatives are not necessarily stupid, but most stupid people are conservatives."
John Stuart Mill
darkness5723
Forum Regular
Posts: 730
Joined: Thu Dec 22, 2005 3:12 pm
Alliance: Ascended Generations
Race: The Faceless
ID: 5741
Location: Wherever

Re: Programming Question

You have no idea how much that helps me lol.

At school we use MASM 6.15 and with the advent of 8.0 it defaults to /coff switch. This won't be a problem when we move to 32-bit but for the 16-bit its going to be a **Filtered**. Oh well.

Thanks alot come_forth you saved me a world of trouble. I tried researching assembly online but there's very little help available lol.
Come_Forth
Forum Expert
Posts: 1307
Joined: Sat May 07, 2005 1:30 pm
ID: 0
Location: The Galapagos Islands

Re: Programming Question

Glad to be of help
"Conservatives are not necessarily stupid, but most stupid people are conservatives."
John Stuart Mill
Post Reply

Return to “This, That, Those, and Them”