The MASM Forum Archive 2004 to 2012

Project Support Forums => 64 Bit Assembler => Topic started by: cgr9102 on December 22, 2011, 09:52:09 PM

Title: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: cgr9102 on December 22, 2011, 09:52:09 PM
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?
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: dedndave on December 22, 2011, 10:57:21 PM
are you sure you have the segment name correct ?
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: cgr9102 on December 22, 2011, 11:59:00 PM
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
(http://img844.imageshack.us/img844/8817/ml64.jpg)
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: donkey on December 23, 2011, 12:31:28 AM
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).
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: cgr9102 on December 23, 2011, 01:34:26 AM
I guess 32 bit and 64 bit working systems are different. how can I learn 64 bit assembly? can you tell me source?
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: donkey on December 23, 2011, 02:18:10 AM
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.
Title: Re: command: ASSUME CS:CODESG error: A2008:syntax error:CS
Post by: dedndave on December 23, 2011, 02:53:16 AM
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