No More Solutions

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.

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.
cd\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
e.g.
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
e.g.
tlink /t coba.obj

- To run the result (.COM file), use command:
<com_filename>
e.g.
coba

5. That's all, folks :)
Bookmark and Share

26 comments:

  1. Anonymous said...
     

    THANKS!! :)

  2. Steven Luck said...
     

    No problem :)

  3. parvathy said...
     

    very very thanksssssssssssssssssss

  4. Steven Luck said...
     

    No problem

  5. Anonymous said...
     

    not working in Windows7

  6. Steven Luck said...
     

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

  7. mary anne yap said...
     

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

  8. Steven Luck said...
     

    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
    endm

    To call the macro to print the words:
    Process:
    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.

  9. Anonymous said...
     

    thanks alot.........

  10. Steven Luck said...
     

    No problem :)

  11. Fidel Laurence Ricafranca said...
     

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

    How do I resolve this?

  12. Steven Luck said...
     

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

  13. Mohammad Dwekat said...
     

    thanks :)

  14. Steven Luck said...
     

    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 ^^

  15. Anonymous said...
     

    how do i debug after the tlink command??

  16. Steven Luck said...
     

    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 :)

  17. Anonymous said...
     

    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.

  18. Anonymous said...
     

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

  19. Steven Luck said...
     

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

  20. Anonymous said...
     

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

  21. Anonymous said...
     

    What is the purpose of /t in linking process?

  22. Anonymous said...
     

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

  23. Steven Luck said...
     

    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 :)

  24. Anonymous said...
     

    awesome

  25. Anonymous said...
     

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

  26. Steven Luck said...
     

    Glad it helps :)

Post a Comment