Sie sind auf Seite 1von 3

TASM 5 Intel 8086 Turbo Assembler

A current version of TASM (Turbo Assembler) is rather hard to come by on the Web. Below is a .zip file you can download that is ready-to-go with TASM 5. I promise it worked for me for a whole semester, and I never had complaints about it. It is very simple to use: 1. Dont be deterred by the number of files in the zip you only need two (yes, 2!) 2. Give it your code: Look in the BIN directory, okay now put your .asm file in there 3. Compile your code: Run tasm /l /zi your_file.asm, but replace your_file with the name of your .asm file 4. Link your code: Run tlink /v your_file.obj io.obj, and replace your_file with the same name you used in step 3 5. Run your code: Run your_file.exe, and again replace your_file with the same nam e So to summarize, here is a sample use of TASM:

tasm /l /zi hello_world.asm tlink /v hello_world.obj io.obj hello_world.exe

It is best if you run TASM close to the root of your hard drive, so dont put it in your My Documents folder, since it has spaces and is very long. In fact, after you download and unzip the file below, you can just drop the TASM folder straight into your C drive and it will work well. Thats in XP or earlier. Okay, so how about running this in Vista or Windows 7? How about on a Mac? The key with Vista is that nobody, not even administrators, has direct access to the command line. The result is that no one I know has had success running TASM in Vista. You will need to install XP or earlier in a virtual machine and run it in there. Windows 7 may be simpler in that some variants contain a Windows XP VM already, so you might be able to run TASM in XP Mode. I really cant say since I havent tried. As for a Mac, I can say there is a very nice solution that doesnt require wasting tons o f system resources on a virtual machine. A dab of Google solves everything In this case, there is a nice bit of freeware called Boxer, which is a simple DOS emulator that most people use to play their favourite old games. Read the documentation and you should be up and running in no time. Boxer runs well under Mac OS X Leopard (10.5) and Snow Leopard (10.6). Good luck! Let me know how it worked for you in the comments.

Update (Dec 2012)


Today I wanted to get a Hello World example running just to make sure that this copy of TASM still works on Windows 7. My PC is a quad-core machine running Windows 7 Professional SP1 with 6GB of RAM, so lets say just a bit more than the typical computer that used an 8086 processor

For DOSBox I visited the DOSBox download page, and got a copy of the latest version for Windows (when I looked it was 0.74). Then I installed it to the default location suggested by the installer (C:\Program Files (x86)\DOSBox-0.74). Next I downloaded tasm.zip from the link at the bottom of this post, unzipped it, and placed it at the root of my drive (C: \tasm). At this point, who knows what will happen all Ive done is a bit of set-up. Okay, now I ran DOSBox using the shortcut it created in my Start menu, and used its built-in advice on how to mount a directory as a drive letter.

Z:\>intro Z:\>intro mount

It seems that I will want to mount C:\tasm as my drive letter C so that DOSBox will see tasm.exe at C:\bin\tasm.exe, and we can move on.

Z:\>mount c c:\tasm\

DOSBox should confirm the action by responding Drive C is mounted as local directory c:\tasm\. Good! I found a Hello World program online at Programmers Heaven. Dont forget to follow the instructions given by atcl on that pageyou need to edit the code by adding a .startup line just after the existing .CODE line. The file should be named hello.asm and should now look like this:

.MODEL small .STACK 100h .DATA HelloMessage DB Hello, world,13,10,$ .CODE .startup mov ax,@data mov ds,ax mov ah,9 mov dx,OFFSET HelloMessage int 21h mov ah,4ch int 21h END

The next step is to compile the code, link it, then execute it. Note: the first command uses a /l that is a lowercase L, not the number 1! Another note: my website automatically uses smart quotes that will notcompile correctly, so you will have to manually edit the line

containing Hello, world to use normal straight quotes in all four cases. Thanks to codex in the comments for noticing that!

Z:\>c: C:\>cd bin C:\BIN>tasm /l /zi hello.asm

The compiler should tell you that is finished with zero error messages and zero warning messages.

C:\BIN>tlink /v hello.obj io.obj

There should be no bad things printed out here either. Alright, now we have an executable program file and we can run it!

C:\BIN>hello.exe

You should now see the fruit of our work: the line Hello, world should appear. All done!

Das könnte Ihnen auch gefallen