Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Assembly FAQ


How do I write my first program in DOS mode ? by straiph
Posted: 14 Jun 02 (Edited 14 Jun 02)

This tutorial uses TASM. Others may vary slightly.
A DOS compatible shell or mode is required.

1, Create a text file called TEST.ASM in the directory where TASM.EXE & TLINK.EXE are located.

2, Copy the following text into TEST.ASM

.model tiny
m1 db "Hello$"
main proc
 mov ax,0B800h
 mov ds,ax ;data segment base=0B8000h
 mov bx,09Eh ;top right corner
 mov al,02Ah ;an asterisk
 mov ah,01Fh ;white foreground, blue background
 mov [bx],ax ;put word into screen memory
 push seg m1
 pop ds
 mov ah, 09
 lea dx, m1
 int 21h
 mov ax, 4c00h
 int 21h
main endp
end main

3, Open a DOS prompt and goto the previously stated directory.

4, type 'TASM TEST.ASM' and press return, it should create a TEST.OBJ file with no errors.

5, type 'TLINK TEST.OBJ' and press return, it should create a TEST.EXE file with no errors.

6, type TEST and press return, results should be a clear screen with Hello at top left and a white asterisk with a blue background located at top right.

7, Pat yourself on the back with a big smile while feelings last or until nausea.

Back to Assembly FAQ Index
Back to Assembly Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close