News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

undefined symbol?

Started by realcr, July 23, 2006, 08:09:30 PM

Previous topic - Next topic

realcr

Hi there.
I tried using tasm for dos mode [you can't program for windows all the time lol...] , however some things aren't working as expected.

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 si,600h
    mov di,[si]
    mov [si+5],di


    mov ax,12h
    call WriteInt

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



  WriteInt:
  ; Prints the content of the AX register onto the screen
  MOV     CX , 0Ah
  @@GetNextChar:
    XOR     DX , DX
    DIV     CX
    PUSH    DX
    OR      AX , AX
    JZ      @@PrintIt
    CALL    @@GetNextChar
  @@PrintIt:
    POP     DX
    ADD     DL , 30h
    MOV     AH , 02h
    INT     21h
  RET


END START



C:\>c:\tasm\bin\tasm.exe aaa.asm
Turbo Assembler  Version 4.1  Copyright (c) 1988, 1996 Borland International

Assembling file:   aaa.asm
**Error** aaa.asm(17) Undefined symbol: WRITEINT
Error messages:    1
Warning messages:  None
Passes:            1
Remaining memory:  415k

I have no idea what's wrong , I thought I writeint was defined.
thanks,
bar.

skywalker

I'ts been a long while, but you need to do something like this.


WriteInt Proc

....

WriteInt endp

MichaelW

Using TASM 3.1 I cannot duplicate the problem. The source as posted assembles OK:

Turbo Assembler  Version 3.1  Copyright (c) 1988, 1992 Borland International

Assembling file:   test.asm
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  459k


And the object module links OK, and the EXE runs OK, displaying "18" before it exits.

And the same results with MASM.

eschew obfuscation

realcr

thanks MichaelW and skywalker.
skywalker , I tried at first to use the proc notation but it still didn't work , so I guess indeed something is wrong with my tasm.
Anyways, if u already mentioned that , where can I find the masm version which allows me to write assembly programs for dos? Because I remember hutch saying that the masm version that can be downloaded from the masm website can't do that...
I prefer masm over tasm so I will be more than happy to know I can use masm for dos programming.

bar.

MichaelW

The ML 6.14 from the MASM32 package will work just fine for 16-bit DOS applications, but you must replace the linker. The one that I use is available here (version 5.63):

http://spiff.tripnet.se/~iczelion/download.html

eschew obfuscation

realcr

Tnx Michael! Finally masm to get things work.

bar.