0
name lab2

data segment
podatak1 dw 1
rezultat dw 0
data ends

code segment
assume cs:code, ds:data

start: 

    mov ax, data
    mov ds, ax
    mov ax, podatak1
    add ax, cx
    mov rezultat, ax


    code ends
end start
end

i get syntax error, all the time? Does anyone know the solution? thanks! btw, i use masm 6.5

johnfound
  • 6,857
  • 4
  • 31
  • 60

1 Answers1

0

Change this:

mov ax, data

to

mov ax, @data

Apart from that, it would be helpfull to post the exact errors you get.

Devolus
  • 21,661
  • 13
  • 66
  • 113
  • lab2.asm(1) : error 10: Syntax error lab2.asm(17) : error 9: Symbol not defined @DATA this is what i get when i add @ – user3036183 Nov 26 '13 at 12:04
  • Remove the `@` I was confusing it with some other problem. where did you get masm 6.5 from? I'm using the MASM32 download and this include MASM 6.14, and this assembles fine. I can't find a reference to a 6.5 version either. – Devolus Nov 26 '13 at 13:09
  • i got it from my teacher, idk. :) it goes with CodeView too. i downloaded it from my faculty site. – user3036183 Nov 26 '13 at 13:12
  • Codeview is an old 16 bit debugger. When I look for this, it references either the masm32 download (which I use and is 6.14) or even older masm's, but no 6.5 version. Are you sure about that, or can you provide the download link? – Devolus Nov 26 '13 at 13:25
  • The download link is at my faculty department's locked VIP access only site. – user3036183 Nov 26 '13 at 13:29
  • You could remove (or put a ';' in front) at the first line, as the sytnax error seems to be from there (name lab2). I just don't see why it works here. – Devolus Nov 26 '13 at 13:39
  • Still have syntax error even when i put commentary commas ; ... idk what is wrong with this. :/ – user3036183 Nov 26 '13 at 13:41
  • Maybe you have some hidden characters in your sourcefile? What you could try is to create a backup, then copy the text from the above posting and paste it into a brand new textfile and assemble it. I copied your code into a file here and it definitely assembles without errors. – Devolus Nov 26 '13 at 13:44
  • Damn, it is working now. Do you have some documentary about those hidden characters in sourcefiles and can you tell me something more about that? – user3036183 Nov 26 '13 at 14:03
  • I asumme that you maybe introduced some invisible characters like CTRL+something or such. When yopu posted it here, these characters were removed, so it worked for me. You can look at the textfile with a hex editor and try to find out where it is, if you want. Some editors may show them, but it seems yours is simply hiding it. I would expect the offending char in the first line already. – Devolus Nov 26 '13 at 14:05
  • Well, mostly i use EDIT from CMD but know (for a change) i used Notepad++, it has good color highlight thingy for every program language. Guess he is one evil text editor. thanks again. – user3036183 Nov 26 '13 at 14:08
  • NP++ ias a good editor, I use it also for many purposes (just not for coding :p) About the hidden characters you can look here: http://stackoverflow.com/questions/767545/does-notepad-show-all-hidden-characters – Devolus Nov 26 '13 at 14:10