Programming Question
Posted: Sat Feb 02, 2008 2:02 pm
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:
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.
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.