command: ASSUME CS:CODESG error: A2008:syntax error:CS

Started by cgr9102, December 22, 2011, 09:52:09 PM

Previous topic - Next topic

cgr9102

ml64 give error in this command: ASSUME CS:CODESG

error message: A2008:syntax error:CS

why does give error this command
ASSUME CS:CODESG
what is wrong?

dedndave


cgr9102

yes i am sure
codes:

      PAGE 60,80
      TITLE 16 BITLIK IKI SAYININ TOPLANMASI
STACKSG   SEGMENT PARA 'STACK'
      DW 10 DUP(?)
STACKSG   ENDS
DATASG   SEGMENT PARA 'DATA'
ASAYISI DW 1234H
BSAYISI DW 0ABCDH
TOPLAM    DD 0H
DATASG   ENDS
CODESG   SEGMENT PARA 'CODE'
      ASSUME CS:CODESG
      ASSUME DS:DATASG
      ASSUME SS:STACKSG
ANA      PROC FAR
      PUSH DS
      SUB AX, AX
      PUSH AX
      MOV AX, DATASG
      MOV DS, AX
      LEA SI, TOPLAM
      MOV AX, ASAYISI
      MOV BX, BSAYISI
      ADD AX, BX
      MOV [SI], AX
      ADC WORD PTR [SI+2], 0
      RET
ANA      ENDP
CODESG   ENDS
      END ANA

errors: 12.,13.,14.,15.,16. and 28/ lines

donkey

Segment registers were retired in LONG MODE (x64) so you can't use them. FS and GS can however be used as pointers to fixed data (in long mode the GS register points to the TIB).
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

cgr9102

I guess 32 bit and 64 bit working systems are different. how can I learn 64 bit assembly? can you tell me source?

donkey

Have a look at GoAsm or JWasm both good x64 assemblers, and both with example code available. ML64 is a bit stripped down so beginners should avoid it as even setting up a call to a procedure can be a chore in it.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

making the transition from 16-bit to 64-bit without passing through 32-bit may be a bit much, also
but, if you must - JwAsm is a good place to start

welcome to the forum, by the way   :U