← Back to Home

Practical 1

To install and configure DOSBox, MASM, and Debug tool, and simulate x86 architecture for executing 8086 Assembly Language Programs.

Theory

  1. What is the purpose of using DOSBox for 8086 assembly programming?
  2. Explain the role of MASM and Debug tools in the development of assembly language programs.
  3. What are the Data registers in x86 architecture and their functions?
  4. What is the role of assembler, linker, and debugger in the execution of an assembly program?

Installation Steps (DOSBox & MASM)

  1. Download and install DOSBox.
  2. Complete the installation process of DOSBox by clicking the Next button.
  3. Download the 8086.rar file. Click on the "Download MASM" button to download MASM to your system.
  4. Install MASM on your system, but make sure that the MASM folder is located in the D drive or any drive other than the C drive.
Download MASM

TASM Installation Process

  1. Download the TASM setup file from the provided link.
  2. Extract the downloaded TASM archive to a folder (recommended: D:\TASM).
  3. Ensure the TASM folder contains TASM.EXE, TLINK.EXE, and other required files.
  4. Mount the TASM folder in DOSBox using mount d d:\TASM and switch to the D: drive.
  5. You can now assemble and link assembly programs using TASM and TLINK inside DOSBox.
Download TASM

Mounting in DOSBox

Open DOSBox and type:

  mount d d:\8086 
  d:
    

Writing Your First Assembly Program

Create a file named hello.asm in Notepad and save it in D:\8086:

    .model 
    .stack 100h
    .data
     msg db 'Hello, World!$'
    .code
    main:
    mov ax, @data
    mov ds, ax
    mov ah, 09h
    lea dx, msg
    int 21h
    mov ah, 4ch
    int 21h
    end main
    

Compilation and Execution using MASM

Inside DOSBox, compile and run:

    masm hello.asm
    link hello.obj
    hello.exe
    

Using Debug Tool

Run Debug:

debug hello.exe

Useful Debug commands:

Output

You will see:

Hello, World!

Registers in x86