Monday, April 11, 2011

Compiling Assembly using TASM in command prompt

Are you learning Assembly language, and confused about how to compile assembly file?
TASM20 is one of assembly compilers that works with Windows XP and Windows 2000 operating system. However, it does not work with Windows 7 64-bit operating system.
If you are using Windows XP or Windows 2000, you can try the following steps to compile and run assembly file.
To download TASM20, the compiler used for assembly file, click here.

Assumption: The Tasm.exe & Tlink.exe files used to compile assembly file are located at C:\tasm20\TASM.

1. Open command prompt by pressing Windows + R, or go to Start menu -> Run, then type "cmd" (without quotes).

2. Go to the folder where the Tasm.exe & Tlink.exe files used to compile assembly file are located, i.e. C:\tasm20\TASM.

3. For instance, we have made an assembly file named coba.asm used to print character 'A' as following:

4. Commands used:
- To compile the assembly file, use command:
tasm <asm_filename>.asm
tasm coba.asm

After executing the command above, an object file (coba.asm) will be created.

- To create .COM file, use command:
tlink /t <obj_filename>.obj
tlink /t coba.obj

- To run the result (.COM file), use command:

5. That's all, folks :)


  1. very very thanksssssssssssssssssss

  2. not working in Windows7

  3. Yeah, apparently it does not work on Windows 7, too bad.

    1. But you can have a virtual XP on your Windows 7. Hence, you can access tasm and tlink on your virtual XP.

  4. how can I make my name in an horizontal way? what is the proper code for it? Waiting for your response......

  5. Ok, Honestly, I don't remember anymore, since I don't use it anymore. After seeing my old files, I find out a macro to print words.

    print macro strWords
    push ax
    push dx
    mov ah, 09h
    lea dx, strWords
    int 21h
    pop dx
    pop ax

    To call the macro to print the words:
    str_Words db 'This is the sentence'
    print str_Words
    INT 20h

    PS: This code is not tested. You may want to test it out.

  6. thanks alot.........

  7. when i try to enter tlink calc it says. "Fatal: Unable to open file 'calc.obj'

    How do I resolve this?

  8. Are you running it on Windows XP? Or? Try reading Yahoo Answers

  9. Looks like I accidentally removed your comment ^^;
    Quoted: "Hello,

    Where can i download it (tasm and tlink)?"

    I think you can just google "download tasm and tlink" (without quote). It will directly shows on the first few entries ^^

  10. how do i debug after the tlink command??

  11. I have no idea how to debug this. Usually, we observe the error, and track back on the code. Please let me know if you get a way to debug it :)

  12. Its got something to do with 'td'. But I don't remember the exact syntax. You can check the working of the registers using that command. But I can't recollect the exact thing.

  13. what is tasm2msg? Is it something same as tasm.exe for compiling .asm files???

  14. Hi, I'm not sure about this. From what I searched about tasm2msg, it is related to assembler output filter.

  15. someone know the coordinates of plotting cx and dx on graphics?

  16. What is the purpose of /t in linking process?

  17. Hi Anonymous #1, I'm not sure anymore, haven't touched assembly for years.

    Anonymous #2, if you can use the tlink command, then you can actually find out the meaning of the parameter by typing "tlink /?" (without quote).

    Anonymous #3, that could be a way, but it's takes quite a bit of resource. Thanks for the sharing :)

  18. thanks for a lot of answer that you give us.... more live for you



Related Posts

Dual Axis not Working in Tableau

Problem : When creating chart with Dual Axis, Synchronize Axis is disabled and cannot be clicked. Cause : Tableau identified this as ...

About Me

My photo
Is an ordinary unNoticed man, with a little knowledge to share and high dreams to achieve. I'd be glad if I can help others, 'coz the only thing for the triumph of evil is for a good man to do nothing. I like English and Chinese language, and know a little about them. Hence, for me, most things can best be expressed in Chinese, some in English, and the rest in others ^^

About Blog

You can find a lot of debugging and deploying problems while developing applications in .NET and Visual Basic here. There are also some querying tips in SQL and typical source codes which might be useful shared here.

Popular Posts



Follow by Email