







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Objectives: Introduction of assembler. Some concepts and assembler setting snapshot:
An assembly language is a low-level programming language for computers, microprocessors, Microcontrollers, and other integrated circuits. It implements a symbolic representation of the binary machine codes and other constants needed to program a given CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on mnemonics that symbolize processing steps (instructions), processor registers, memory locations, and other language features. An assembly language is thus specific to certain physical (or virtual) computer architecture.
Machine language is a pattern of bits that represent the OPCODE and operands, directly executable by the CPU. The following is a short machine language program or the IBM PC. Assembly Language Machine Language Operations MOV AX,A 10100001 00000000 00000000 Fetch the contents of memory word 0 and put it in register AX. ADD AX,4 00000101 0000100 00000000 Add 4 to AX MOV A,AX 10100011 0000000 00000000 Store the contents of AX in memory word 0.
It is a system program which converts the assembly language program instructions into machine executable instructions. For example: Microsoft Macro Assembler (MASM), Borland Turbo Assembler (TASM), Open Source Netwide Assembler (NASM) etc.
The Microsoft Macro Assembler (MASM) is an x86 assembler for MS-DOS and Microsoft Windows. It supports a wide variety of macro facilities and structured programming idioms, Including high-level functions for looping and procedures. Later versions added the capability of producing programs for Windows.
Turbo Assembler (TASM) is an x86 assembler package developed by Borland. It is used with Borland's high-level language compilers, such as Turbo Pascal, Turbo Basic and Turbo C. The Turbo Assembler package is bundled with the linker, Turbo Linker, and is interoperable with the Turbo Debugger.
debugging.
Creating an Assembly Language Program An assembly language program should be entered with any text editor and have the extension filename.asm.
Once you have entered this program you need to assemble it. This is done using the following TASM command line syntax. TASM Filename.asm The .asm extension is assumed for the file. The files generated by this command will be; Filename.asm the source file Filename.obj generated by TASM Filename.lst the list file
As a final step you need to run the Turbo linker (TLINK) to create an EXE (executable) file by the name of filename.exe. This is done by entering the following command. TLINK Filename.obj The .obj extension is assumed for the file. The files generated by this command will be; Filename.exe the Executable file
TD, the Turbo Debugger, is run with the following command. TD Filename.exe
The execution of program is done by entering the following command. Filename.exe
The following program displays the string "this is my first program in 8086 assembly" on screen. .model small data_Seg segment 'data' ; Add your Data here st1 db "this is my first program in 8086 assembly",13,10,'$' data_Seg ends Code_Seg segment 'code' assume cs:code_Seg, ds:data_Seg, ss:stack_seg main proc far ; Set Segment Registers mov ax,data_Seg mov ds,ax ; Add Your Code Here mov ah, mov dx,offset st1 ;string display INT 21h ;exit to operating system MOV AH,4CH INT 21h MAIN endp code_seg ends ; set entry point and stop the assembler stack_Seg segment stack db 100h dup (?) stack_Seg ends end main YouTube tutorial: https://www.youtube.com/watch?v=m1e8RfmsCNI Required Files Link: TASM https://drive.google.com/file/d/0BxFfQqBvZCltMHdNbFFCZVJkUlE/view DOSBox https://www.dosbox.com/download.php?main= Basic Steps to install and run DosBox, TASM and Compile x86 Assembly Program in Windows 7 64 bit Version
Lab Task Task # 1: Copy the above code in notepad and save the file in c:\temp folder or c:\turbo assembler folder with extension .asm i.e. First_program.asm
Observe the output