hi, i'm very new to asm, and tried to compile this code which i found in a tute with masm:



    DOSSEG
    .MODEL SMALL
    .STACK 200h
    .DATA

OurString  DB  "This is a string of characters.  "
            DB  "Do you lack imagination?  Put something interesting here!$"

    .CODE

START:
    MOV  AX, SEG OurString    ; Move the segment where OurString is located
    MOV  DS, AX                ; into AX, and now into DS

    MOV  DX, OFFSET OurString  ; Offset of OurString -> DX
    MOV  AH, 9h                ; Print string subfunction
    INT  21h                  ; Generate interrupt 21h

    MOV  AX, 4C00h            ; Exit to DOS sufunction
    INT  21h                  ; Generate interrupt 21h
END START



but it gave these errors:



End of file encountered on input file
Test.asm(21) : error 85: End of file, no END directive
Test.asm(1) : error 10: Syntax error
Test.asm(2) : error 10: Syntax error
Test.asm(3) : error 10: Syntax error
Test.asm(4) : error 10: Syntax error
Test.asm(6) : error 86: Data emitted with no segment
Test.asm(7) : error 86: Data emitted with no segment
Test.asm(9) : error 10: Syntax error
Test.asm(11) : error 62: No or unreachable CS
Test.asm(12) : error 43: Operand must have segment
Test.asm(13) : error 86: Data emitted with no segment
Test.asm(15) : error 86: Data emitted with no segment
Test.asm(16) : error 86: Data emitted with no segment
Test.asm(17) : error 86: Data emitted with no segment
Test.asm(19) : error 86: Data emitted with no segment
Test.asm(20) : error 86: Data emitted with no segment
End of file encountered on input file
Test.asm(21) : error 85: End of file, no END directive



:shock:

why is this happening?

thanx for any help.
Posted on 2005-11-22 23:31:15 by geek@02

you must use MASM to assemble this source. From the error numbers in your log I can tell that it isnt MASM what you are using (at least not MASM 5-7).
Posted on 2005-11-22 23:59:19 by japheth
i downloaded masm38 v8 and assembled the above program in it, but it gives these errors now:


Assembling: C:\MASM32\Test.asm
C:\MASM32\Test.asm(1) : warning A4015: directive ignored with /coff switch
C:\MASM32\Test.asm(12) : error A2004: symbol type conflict
C:\MASM32\Test.asm(21) : warning A4023: with /coff switch, leading underscore re
quired for start address : START
_
Assembly Error


:sad:

i'm really new 2 asm, please help!
Posted on 2005-11-23 13:23:22 by geek@02
That's 16-bit asm there - I strongly recommend you start up from 32-bit.
16-bit code will only make you give up ASM, since 16-bit has no fun in it, isn't well-supported on Win2k & WinXP, and generally has a million limitations.

The MASM32 package, that you downloaded, has enough examples and tutes on writing 32-bit asm code.
Start by studying the \masm32\EXAMPLE1\MINIMUM\minimum.asm
Posted on 2005-11-23 14:18:29 by Ultrano
> 16-bit code will only make you give up ASM, since 16-bit has no fun in it

I would suggest to ignore such remarks, geek@02. Whether 16-bit is fun or not depends on many things.

About your error: if your version of MASM is >= 7, try command line option -omf




Posted on 2005-11-24 02:01:03 by japheth