0% found this document useful (0 votes)
60 views

Microprocessor and Microcontroller Lab

This document provides instructions for running assembly language programs using MASM/TASM assemblers on a PC: 1. Copy the assembler and linker files to a directory. 2. Open the command prompt and navigate to the directory. 3. Write the assembly program in Notepad and save it with a .asm extension. 4. Assemble the program using the assembler and linker. 5. The executable can be run from the command prompt and debugged using TD.EXE.

Uploaded by

Tony Rajan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Microprocessor and Microcontroller Lab

This document provides instructions for running assembly language programs using MASM/TASM assemblers on a PC: 1. Copy the assembler and linker files to a directory. 2. Open the command prompt and navigate to the directory. 3. Write the assembly program in Notepad and save it with a .asm extension. 4. Assemble the program using the assembler and linker. 5. The executable can be run from the command prompt and debugged using TD.EXE.

Uploaded by

Tony Rajan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Microprocessor and microcontroller lab

Procedure for doing experiments in PC using MASM/TASM 1. Copy the files (MASM.EXE and LINK.EXE) or (TASM.EXE and TLINK.EXE) to a convenient directory in your PC 2. Open the command prompt ( run-> cmd or start->programs>accessories->command prompt) 3. In the command prompt type cd <path to directory> to change to the directory containing copied files 4. Open notepad and start typing the program in notepad 5. Once program is complete choose save dialog box, select file type as all files and save the program as program1.asm (or any other name with .asm as extension) in the directory mentioned above 6. In the command prompt type tasm program1.asm (or masm program1.asm) to assemble the program. This will list the details of program and make an object file, if there is no error. 7. Once assembling is complete, type tlink program1.obj (or link program1.obj) to link and generate the executable. 8. Once linking is over you can see the executable file with .exe extension. To run this file, just type the name of the file in command prompt program1 9. To debug the executable program use TD.EXE which has a simple graphical interface to view the instructions, registers, segments and flags 10.Explore the facilities of td.exe

Structure of an assembly language program with data segment and code segment only

MYDATA A MSG MYDATA

SEGMENT DB DB ENDS 0 ;VARIABLE A $

HELLO

MYCODE

SEGMENT CS:MYCODE, DS:MYDATA

ASSUME START:

MOV AX,MYDATA MOV DS,AX

;TO DISPLAY A CHARACTER MOV AH,02 MOV DL,41H INT 21H ; TO DISPLAY A STRING MOV AH,09 LEA DX,MSG INT 21H ;TO TERMINATE PROGRAM AND RETURN TO OS MOV AX,4C00H INT 21H

MYCODE

ENDS END START

You might also like