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

Lecture3 Assembly

The document discusses the topics of 8086 assembly language, programming environments for assembly language, and the instruction format of 8086. It provides examples of using assembly language to display text on screen using BIOS and MS-DOS interrupts. Programming environments discussed include MASM assembler with DOSBox, EMU8086 emulator/assembler, and using MASM/TASM extensions in Visual Studio Code. General templates shown for 8086 assembly language programs include directives for code and data segments as well as using interrupts for program exit.

Uploaded by

ecevitmert1453
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Lecture3 Assembly

The document discusses the topics of 8086 assembly language, programming environments for assembly language, and the instruction format of 8086. It provides examples of using assembly language to display text on screen using BIOS and MS-DOS interrupts. Programming environments discussed include MASM assembler with DOSBox, EMU8086 emulator/assembler, and using MASM/TASM extensions in Visual Studio Code. General templates shown for 8086 assembly language programs include directives for code and data segments as well as using interrupts for program exit.

Uploaded by

ecevitmert1453
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Lecture 3

8086 Assembly Language,


Programming Evironments,
Instruction Format

Topics
 8086 Assembly Language

 Programming Evironments
 Option1 : MASM Assembler and DOSBox Emulator
 Option2 : EMU8086 Emulator/Assembler
 Option3 : Visual Studio Code and MASM/TASM Extension

 Instruction Format

2
Instruction Set Architecture (ISA) Categories
 Depending on the CPU architecture, an Assembly language instruction set is
defined as followings.

 CISC (Complex Instruction Set Computer)


 Contains large number of instructions
 More complex on hardware
 Mostly used in Von Neumann architecture processors
 Examples: Intel x86-64, AMD-64, Motorola

 RISC (Reduced Instruction Set Computer)


 Contains fewer but effective instructions
 More complex on software
 Mostly used in Harvard architecture processors
 Examples: ARM Cortex, Atm

Machine Language
 Every microprocessor and microcontroller has its own set of Machine language,
and corresponding Assembly language instruction set.

 Machine language contains low level instructions in binary form.


 In machine language, every instruction is described by
binary digits (bits).
 Example :
Suppose that an Assembler program (compiler) generated the following binary
machine code for an 16-bit instruction : 1011000000000101
The equivalent hexadecimal digits are = B005

 CPU fetches the binary machine code instruction from memory,


decodes it, then executes the operation.
 When CPU decodes the sequence of binary code digits,
it determines that the machine code given above
corresponds to MOV AL, 5 as Assembly instruction.

4
Assembly Language
 Assembly Language is a symbolic language to represent
the low level binary machine codes.
 In Assembly language, mnemonics (short instruction names) are used to
represent the instructions.
 Example Assembly language instruction : MOV AL, 5

Mnemonic Operand1 Operand2

Move (copy) immediate data 5 to accumulator AL register.


 An Assembler program (compiler) must be used to translate the Assembly
language instructions to the binary machine codes.

 A machine language and its associated assembly language are


completely dependent on a specific microprocessor.
 For example, the instruction above works only for the Intel x86 microprocessors,
it does not work on any other microprocessors.

Usage Areas of Assembly Language


 Assembly instructions give direct control over the hardware components
such as CPU, memory, Input/Output device, disk, etc.
 Comparing to high-level languages (C, C++, etc.), programs written in
assembly languages require less memory, and run faster.

 Assembly language is preferred in following cases:


 Short to moderate-sized programs.
 Applications where memory cost and speed are the most important factors.
 Real-time control applications.
 Applications involving more input/output from/to devices, or more peripheral
hardware control.

 Example usage areas for Assembly languages:


 System programming (device drivers)
 Compilers
 Real-time systems
 Embedded systems

6
Assembler and Debugger

Assembly language programs are assembled (similar to compiling) by Assembler program,


into microprocessor-specific executable machine codes.

Assembly language Assembler Machine language


Source code & Linker Executable code

A Debugger program can be used as Disassembler program, which takes any


executable machine code, then generates the Assembly source codes.

Machine language Assembly language


Executable code Debugger Instructions
(Disassembly)

General Program Template


for 8086 Assembly Language

The following program template uses simplified segment directives.

Statements that have a dot prefix (.) are Assembler directives, not 8086 instructions.

For assembler, using lowercase, uppercase, and spaces does not matter.

.8086 ;Optional. Declaring CPU type (Default is 8086)

.model small ;REQUIRED. Declaring program size

.stack ;Optional. Declaring stack size (default is 1 KB)

.data ;Optional. Beginning of data segment (Used for defining variables)

.code ;REQUIRED. Beginning of code segment of program

Basla PROC ;Optional. Name of main procedure

.STARTUP ;Optional. Startup of program (Required only if Data Segment is used)

; WRITE YOUR CODES HERE

.EXIT ;REQUIRED. Exit to Operating System (Quit the program)

Basla ENDP ;Optional. End of Procedure

END Basla ;REQUIRED. Marks the End of file


8
Alternative Template1
.model small
.stack
.data

.code

Basla PROC

;Equivalents of the .STARTUP directive


MOV AX, @DATA ;@ symbol gets address of DATA segment
MOV DS, AX ;DS register assigned with DATA segment address

; WRITE YOUR CODES HERE

;Equivalents of the .EXIT directive


MOV AH, 4Ch ;4Ch is code for exit operation
INT 21h ;21h is code for DOS service interrupt

Basla ENDP

END Basla
9

Alternative Template2
;CS (Code Segment) register uses logical segment named komutlar.
;DS (Data Segment) register uses logical segment named veriler.
assume ds : veriler , cs : komutlar

veriler segment

veriler ends

komutlar segment

Basla :

mov ax, veriler


mov ds, ax

; WRITE YOUR CODES HERE

mov ah, 4ch


int 21h

komutlar ends

end Basla
10
Example1 : Displaying Text on Screen
(Using BIOS interrupt service 10h)

Program below calls BIOS interrupt service, for displaying characters on screen.

10h is a software interrupt for video services of BIOS.

0Eh is function code for screen displaying.

Function parameter is AL register, containing the ASCII code of one character.

.model small
.code

Basla PROC

MOV AH, 0Eh ; Select displaying service function of BIOS


hello1.asm MOV AL, 'H' ; Copy an ASCII character to AL register
File INT 10h ; BIOS function to display a character in AL
MOV AL, 'e'
INT 10h
MOV AL, 'l'
INT 10h
MOV AL, 'l'
INT 10h
MOV AL, 'o'
INT 10h

.EXIT
Basla ENDP
END Basla
11

Example2 : Displaying Text on Screen


(Using MS-DOS interrupt service 21h)

The following program defines a text string on memory.

It calls MS-DOS interrupt 21h service, for displaying a string.

09h is the display function code of the interrupt 21h service.

Function parameter is DX register, containing the string address.

.MODEL SMALL

.DATA
Cumle DB 'Hello world', 13, 10, '$'
;ASCII codes: 13 is Carriage Return
;10 is Line Feed, $ is string end symbol
hello2.asm
File .CODE

Basla PROC
.STARTUP

MOV DX, OFFSET Cumle ;Move address of Cumle variable to DX register


MOV AH, 09h ;Function code for displaying string
INT 21h ;MS-DOS function call

.EXIT
Basla ENDP

END Basla
12
ASCII Codes Table
(Decimal)
Null Space

NewLine

Return

13

Examples: Using ASCII Codes



The followings are valid equivalent definitions of the same ASCII string.

In all cases, the Assembler program generates only the binary machine codes.

Using quote marks:

Cumle DB 'Hello world', 13, 10, '$'


Using decimal numbers for each character:

Cumle DB 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 13, 10, 36


Using hexadecimal numbers:

Cumle DB 48h, 65h, 6Ch, 6Ch, 6Fh, 20h, 77h, 6Fh, 72h, 6Ch, 64h, 0Dh, 0Ah, 24h


Using binary numbers:

Cumle DB 01001000b, 01100101b, 01101100b, . . . . .


14
Topics
 8086 Assembly Language

 Programming Evironments
 Option1 : MASM Assembler and DOSBox Emulator
 Option2 : EMU8086 Emulator/Assembler
 Option3 : Visual Studio Code and MASM/TASM Extension

 Instruction Format

15

MASM Assembler/Linker

File Editor : A source program consisting of assembly language
statements is created using any text editor (such as Notepad,
Notepad++, or Visual Studio Code editor, etc.)

MASM assembler has its own editor program called PWB.EXE (16-bit)
(Programmer’s Work Bench) which is a program with DOS GUI.
Usage of PWB is optional.

Assembler : The MASM assembler program reads the source file and
produces an object file, which is a machine-language translation
(binary code) of the source program.

Linker : The object file may contain calls to routines (such as operating
system service functions) in an external link library.

The linker then copies the needed routines from the link library into the
object file, creates a special header record at the beginning of the
program, and produces an executable program (binary).

16
Phases of Editing, Assembling, Linking

Optional listing file


LST (Contains generated
file hexadecimal
machine codes.)

ASM
Editor file Assembler

Assembly program OBJ Intermediate object file


source file file

LIB Linker
files
Other Object and
Library Files
(If any) EXE
file
Executable file
(Contains binary
machine codes)
17

Loading, Executing, and Debugging


an Executable Program

Loader : When the program is run by entering its name on the DOS
command line, the DOS loader program decodes the header record of the
executable program file, then loads it into memory.

Executing : The CPU begins executing (running) the program.

Debugger : MASM has a debugger program called CV.EXE (16-bit)
(Code View) that can be optionally used for step-by-step execution of
Assembly instructions.

18
Assemblers for
Intel x86 Processors

An assembler is a program (similar to compiler) for translating assembly
language source code program into binary object code.

There are many assemblers for Intel x86 architecture such as followings.

Supported
Assembler Programs
Operating Systems
Short
Long Name DOS Windows Linux
Name
Microsoft Macro
MASM √ √ -
Assembler

Borland Turbo
TASM √ √ -
Assembler

FASM Flat Assembler √ √ -

Netwide
NASM - - √
Assembler

GAS GNU Assembler - - √


19

Microsoft Macro Assembler (MASM)



MASM was originally developed by Microsoft for MSDOS operating system.

It supports a wide variety of macro facilities and structured programming.

The latest version of MASM is called ML64 (MASM command-line driver),
which is a part of Microsoft Visual Studio 2022.

It is not available as a separate program.

MASM 6.11 version is available as a separate program.

It can run on legacy DOS operating system (16-bit, 32-bit), and
also on Windows operating system (32-bit, 64-bit).

In the lecture examples, MASM 6.11 version is used.

Supported Intel CPU’s


MASM
Assembler Version 16-bit 32-bit 64-bit

MASM 6.11 √ √ -

ML64 - √ √

20
DOSBox Emulator Program

The lecture covers Intel 8086 CPU (16-bit microprocessor).

MASM 6.11 assembler is used for programming examples in the lecture.

The 64-bit Windows operating system does not support 16-bit applications.

Therefore, it is necessary to use an emulator (simulator) program, which allows
compiling and linking 16-bit 8086 assembly programs.

The DOSBox Emulator Program can be used for this purpose.

All of the following component programs of MASM 6.11 can be
executed in the DOSBox emulator window.
ML.EXE MASM assembler and linker
PWB.EXE Programmer’s Work Bench editor (usage is optional)
CV.EXE Code View debugger (usage is optional)

21

Installing DOSBox Emulator


and MASM Assembler
Step 1) Unzip the DOSBox.zip file into a temporary location in computer.

Step 2) Run the DOSBox0.74-3-win32-installer.exe file to start installation.


Enter C:\ root directory for target location.

Step 3) Unzip the MASM.zip file into C:\ root directory.

Step 4) By using Windows File Explorer, create an empty new folder named “codes”
in C:\ root directory, that can be used to store Assembly source program files for
testing. You may choose any other folder name.

C:\

├─── DOSBox

├─── MASM

└─── codes

22
Configuration of DOSBox
Step 1) Run DOSBox.exe program. When executed first time, DOSBox creates a
default configuration file, in the following location:
C:\Users\Username\AppData\Local\DOSBox\dosbox-0.74-3.conf

Step 2) Open the configuration file dosbox-0.74-3.conf with Notepad editor.

Step 3) Add the following new commands to the end of configuration file.

mount C C:\MASM
set PATH=C:\BIN;C:\BINR;C:\INCLUDE;C:\LIB
mount D C:\codes
D:


The first mount command maps physical directory “C:\MASM“,
onto a temporary virtual drive as “C:\”.

Set PATH command tells DOSBox searching paths of MASM binary files.

The second mount command maps physical directory “C:\codes“,
onto a temporary virtual drive as “D:\”.

Step 4) Restart the DOSBox program, so that changes take effect.


Configuration file is executed automatically by DOSBox, every time it is started.

23

Compiling and Linking


an Assembly Program with MASM
1) Write an Assembly program with a text editor such as Notepad,
then save it to the “C:\codes” physical directory.

2) Open the DOSBox emulator window.


By using the configuration file, DOSBox program goes to virtual D:\ drive.

D:\> DOSBox console prompt

3) In the DOSBox emulator window, enter the commands below


to assemble (compile) and link the Assembly source file.

ML hello.asm /link

4) If there are no syntax errors, an executable file is generated. (Warnings are skipped)
Run the hello.exe program, by entering executable file name in DOSBox window.

hello.exe

24
Using MASM Assembler Program (ML.EXE)
DOSBox Emulator window

Compiling
& Linking

Executing

25

Command-line Options of
MASM Assembler

Simple form of assembling and linking:

ML hello.asm /link

The ML.EXE program first calls the MASM.EXE program,


then calls the LINK.EXE program, if there are no syntax errors.
It generates the following two files:
hello.obj : Object program
hello.exe : Executable program

● Using /Fl option to generate a listing file:

ML /Fl hello.asm /link

It generates also the following file:


hello.lst : Listing file
Contains hexadecimal machine codes and Assembly instructions.

26
Listing File (Generated by Assembler)
hello.lst File
Microsoft (R) Macro Assembler Version 6.11 01/01/23 09:00:00
hello.asm Page 1 – 1
.MODEL SMALL
0000 .DATA
0000 48 65 6C 6C 6F 20 Cumle DB 'Hello world', 13, 10, '$'
77 6F 72 6C 64 0D
0A 24
0000 .CODE
0000 Basla PROC
0000 B8 ---- R mov ax, @data
0003 8E D8 mov ds, ax
0005 BA 0000 R mov dx, OFFSET Cumle
0008 B4 09 mov ah, 09h
000A CD 21 int 21h
000C B4 4C mov ah, 4Ch
000E CD 21 int 21h
0010 Basla ENDP
END Basla

Data Bytes and


Addresses (offsets) Instruction Machine Codes
of Instructions (Hexadecimal)
27

Using CodeView Debugger Program (Step-by-step execution)


CV.EXE window in DOSBox Emulator

Addresses (segment Instruction Machine


and offsets) of Codes (Hexadecimal) Registers and
Instructions Status Flags 28
Topics
 8086 Assembly Language

 Programming Evironments
 Option1 : MASM Assembler and DOSBox Emulator
 Option2 : EMU8086 Emulator/Assembler
 Option3 : Visual Studio Code and MASM/TASM Extension

 Instruction Format

29

Installing EMU8086 Emulator



Emu8086 is an assembler and microprocessor emulator (simulator) program,
designed specificly for the 8086 CPU.

Can be used execute instructions step-by-step, as in a debugger.

It displays contents of registers, memory, stack, variables and
status flag bits after each Assembly instruction is executed.

It is a complete IDE (Integrated Development Environment) containing
the following integrated components:
▪ Source code editor
▪ Flat Assembler (FASM) and Linker
▪ Debugger
▪ Emulator program

Emu8086 does not use the MASM assembler, it uses the integrated FASM assembler.

FASM syntax is same as MASM syntax, with some additional features.

INSTALLATION
C:\
Step 1) Unzip the zipped file into a temporary folder. │
Step 2) Run the setup.exe program in the temporary folder. │
Emu8086 is installed in the C:\emu8086\ folder. └─── emu8086

After installation, double-click the emu8086.exe program to run it.

30
Using Editor of EMU8086 (emu8086.exe)

Create a new file and write an Assembly program in the EMU8086 integrated editor.

Or, open an existing source file (hello.asm).

Click the Compile button for assembling only, without running.
If there are no syntax errors, click the Run button which is shown in a new window.

Also, clicking the Emulate button will start the Emulator, and
instructions can be executed step-by-step (debug mode).

Emu8086 Editor window


Emu8086
Emulator screen
(Console output)

31

Using Emulator and Debug windows (Step-by-step execution)


Emu8086 Emulator window (Machine codes of hello.asm Program)

Registers

Machine Codes
(ASCII equivalents)

Machine Codes
(Decimal)

32
Addresses of Instructions (physical) Machine Codes (Hexadecimal)
Emu8086 Debug window
(Source codes)

33

Emu8086 RAM memory window


(Data Bytes)

SPA: Space

Addresses of Data bytes


(segment and offsets) Data bytes Data bytes (ASCII equivalents)
Data bytes (Hexadecimal) (Decimal) “Hello world”

34
Emu8086 Variables window
(in Data Segment)

Emu8086
Flags window

35

Topics
 8086 Assembly Language

 Programming Evironments
 Option1 : MASM Assembler and DOSBox Emulator
 Option2 : EMU8086 Emulator/Assembler
 Option3 : Visual Studio Code and MASM/TASM Extension

 Instruction Format

36
Installing Microsoft Visual Studio Code Editor,
and MASM/TASM Extension for VSCode

Step1) Download and install Microsoft Visual Studio Code editor from internet.

Step2) Open the VSCode program, then click the Extensions button on left.
In the Search box at top, type “MASM/TASM”.

Step3) Visual Studio Code makes an online search in the Visual Studio
marketplace. It may display more than one extensions to choose.

Step4) Select the extension named MASM/TASM and install it.



The MASM/TASM extension for VSCode contains the following components.
 DOSBox emulator

 MASM assembler

 TASM assembler


All of them run in the Visual Studio Code window.

37

Editing, Compiling, and Running


8086 Assembly Program in
Microsoft Visual Studio Code

Write an 8086 Assembly program in VSCode editor.

Right-click the Assembly source code, then click “Run ASM Code”.

The compilation and execution results will be shown on the right console window.

Visual Studio Code MASM/TASM Extension 38


editor window console window (DOSBox)
Debugging Assembly Program
in Microsoft Visual Studio Code

Right-click the Assembly source code, then click “Debug ASM Code”.

By default, MASM/TASM extension opens the TASM (Turbo Assembler) debugger
program in the Visual Studio Code window.

39

Topics
 8086 Assembly Language

 Programming Evironments
 Option1 : MASM Assembler and DOSBox Emulator
 Option2 : EMU8086 Emulator/Assembler
 Option3 : Visual Studio Code and MASM/TASM Extension

 Instruction Format

40
8086 Assembly Language
Instruction Format
General Statement Format (Assembly Instruction Syntax):

Operation
(Mnemonic of Operand(s) ; Comment
Opcode)


Operation : Defines the action of the statement.
This field contains either an instruction mnemonic or an assembler directive.

Mnemonic : Short instruction name.


Operands : Lists one or more items on which the instruction or directive operates.


Comment : Provides a comment for the programmer.
Comments are for documentation only. They are ignored by the assembler.

41

Examples

Format Example : General format of Move instruction


MOV Destination , Source
; Cop es value n source operand to dest nat on operand.
; The mnemon c MOV s the short for Move nstruct on.

Usage Examples :
MOV AL, 50 ;Move mmed ate data 50 to AL reg ster

MOV BL, AL ;Move AL reg ster to BL reg ster

MOV AL, Dizi[7] ;Move 7th element of D z array var able to AL

MOV SI, 7 ;Move 7 to SI reg ster


MOV AL, Dizi[SI] ;Move the data value n the address D z [SI] to AL

42
8086 Machine Language
Instruction Format

For every Assembly language instruction written by programmer in source file,
the Assembler Program generates the Binary Machine Codes.

Instruction Format of Binary Machine Code is from 1 byte to 6 bytes,
depending upon the addressing modes used for instructions.

The following is the 8086 Machine Instruction Format, for maximum of 6-byte
instructions.

Operands (source
Operation
and destination) Address Displacement
Immediate Data
of an Operand
(optional)
OpCode D W MOD REG R/M (optional)

6 1 1 2 3 3 Lower Higher Lower Higher


bits bit bit bits bits bits Byte Byte Byte Byte
1 Byte 1 Byte 1 Byte 1 Byte 1 Byte 1 Byte

43

Byte1 : Operation

Opcode stands for Operation Code.
Every Instruction has a unique 6-bit opcode.
For example, opcode for MOV is 100010.

D stands for direction.
If D=0, then direction is from register.
If D=1, then direction is to register.

W stands for width.
If W=0, then only a byte is transferred (8 bits).
If W=1, then a whole word is transferred (16 bits).

Operation
OpCode D W

6 bits 1 bit 1 bit

1 Byte

44
Byte2 : Operands

Second byte of a machine code instruction indicates whether one of the operands is in
memory or both are in registers.

This byte contains three fields: MOD, REG, and R / M

Operands
(source and destination)
MOD REG R/M
2 bits 3 bits 3 bits
1 Byte

Abbreviation Field
Mode of Memory
MOD
Addressing
Register selected
REG
(Second Operand)
Register / Memory
R/M
(First Operand)

45

MOD field
in Byte2

MOD field is 2-bits.

It encodes the Memory Addressing Mode of the instruction.

Bits of MOD
Memory Addressing Mode
field

00 Memory addressing without displacement

01 Memory addressing with 8-bit displacement

10 Memory addressing with 16-bit displacement

Register addressing with


11 W = 0 for 8-bit data , and W = 1 for 16-bit data

46
R / M and
MOD fields in Byte2

MOD and R / M fields together is calculated by Assembler, based upon the addressing
mode and register being used in it. They define the second operand.

If MOD = 11, then addressing is a register to register mode.

If MOD = 00, 01, 10 , then addressing is a memory mode.

Table below shows how effective address of memory operand gets selected
for different R / M and MOD values.

(Memory Mode with (Memory Mode with (Memory Mode with (Register
no displacement) 8-bit displacement) 16-bit displacement) Mode)

47

REG field
in Byte2

REG field is 3-bits and indicates the register selection for the first operand ,
which can be source / destination operand, depending on the Direction bit (D = 0 / 1 ).

Table below shows how REG field along with the status of Width bit (W = 0 / 1)
selects the different registers.

48
Examples : Instruction Formats

1-BYTE

1-BYTE

2-BYTE

2-BYTE

3-BYTE

4-BYTE

3-BYTE

4-BYTE

6-BYTE 49

Example: Generating Machine Code


for MOV BL,AL Instruction
Example : Assembler (compiler) will generate binary machine language codes
for the following 8086 Assembly language instruction. MOV BL, AL


Ocode (Operation Code) for MOV instruction is = 100010

AL is source operand, therefore Direction bit D = 0

Operands (source and destination) are 8-bit, therefore Width bit W=0

Addressing mode is Register Mode, therefore MOD = 11

Code for AL register (source operand) is , REG = 000

Operation is from register to register, and BL is destination operand.
Therefore Register/Memory bits are , R/M = 011

FIRST BYTE (8 bits) SECOND BYTE (8 bits)


D W MOD REG R/M
Opcode (6 bits)
bit bit (2 bits) (3 bits) (3 bits)
1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 1

The generated machine code for MOV BL, AL instruction is below.


= 10001000 11000011 (Binary)
= 88 C3 (Hexadecimal)
50
Examples: Machine Code Byte Lengths
for Different Instructions

Some number operands are treated as memory address displacement values, some
numbers are treated as immediate data values by the Assembler, depending on the
syntactic location in the instruction..

Instruction mnemonics used: CLC (Clear Carry flag), MOV (Move)

Number of
Machine Code Bytes
Machine Code
Assembly Instruction Bytes for
Generated by the Assembler
(Hexadecimal)
Instruction

CLC 1 F8
MOV BL, 12h 2 B3 12
MOV BX, 1234h 3 BB 34 12
MOV [BX], 1234h 4 C7 07 34 12
MOV [BX]+1234h, 56h 5 C6 87 34 12 56
MOV [BX]+[DI]+[1234h], 5678h 6 C7 81 34 12 78 56

51

Assembly Program Source Code

;Program for examples of byte lengths


;for different instructions.

.model small

.code
CLC ;1 byte instruction
MOV BL, 12h ;2 bytes instruction
MOV BX, 1234h ;3 bytes instruction
MOV [BX], 1234h ;4 bytes instruction
MOV [BX]+1234h, 56h ;5 bytes instruction
MOV [BX]+[DI]+1234h, 5678h ;6 bytes instruction

.EXIT
END

52

You might also like