Download presentation
Presentation is loading. Please wait.
Published byJohn Hardy Modified over 9 years ago
1
University of Sargodha, Lahore Campus Prepared by Ali Saeed
2
MASM stands for Microsoft Macro Assembler The Microsoft Macro Assembler is an x86 assembler that uses the Intel syntax for MS- DOS and Microsoft Windows
3
First Set the Environment Variable
5
Edit Command is use to enter in Assembly Editor MASM prog1.asm to Compile Link prog1 Prog1; to run
6
8086 was introduced in 1978 It had 16 bit processor 8088 was introduced in 1979 8088 has 8 bit data bus 8086 has faster clock rate, thus batter performance 8088 is less expensive
7
80186 and 80188 are enhanced versions of 8086 and 8088 respectively These has new instruction set called extended instruction set But, these did not had significant advantages over 8086 and 8088 Soon it was replaced by 80286
8
It was introduced in 1982 It was also 16 bit processor It was faster then 8086 (12.5 MHz Vs 10MHz) It has two number of operation modes ◦ Real Addressing Mode ◦ Protected virtual Addressing Mode
9
In Real Addressing mode this will behaves like 8086 Program for 8086 can be executed in this mode without modifications In protected mode 80286 support multitasking, ability to execute several tasks at a time Memory protection in protected mode memory use by one program can’t be use by others
10
It was 32 bit microprocessor 80386 or 386 was introduced in 1985 It was much faster than 80286 having 3.3 MHz Processor It has three modes ◦ Real Addressing Mode ◦ Protected virtual Addressing Mode ◦ Virtual 8086 mode (run multiple 8086 application under memory protection mode) 386XS has same internal structure as 386, but has 16 bit bus
11
Registers are small memory area inside the CPU. Registers have fastest speed then other memory devices i.e. RAM, Hard Disk etc… Registers are available of different size ◦ 8 bit ◦ 16 bit ◦ 32 bit
14
AX - the accumulator register (divided into AH / AL). BX - the base address register (divided into BH / BL). CX - the count register (divided into CH / CL). DX - the data register (divided into DH / DL). SI - source index register. DI - destination index register. BP - base pointer. SP - stack pointer.
15
CS - points at the segment containing the current program. DS - generally points at segment where variables are defined. ES - extra segment register, it's up to a coder to define its usage. SS - points at the segment containing the stack.
16
Although it is possible to store any data in the segment registers This is never a good idea. The segment registers have a very special purpose - pointing at accessible blocks of memory. Segment registers work together with general purpose register to access any memory value.
17
For example if we would like to access memory at the physical address 12345h (hexadecimal), we should set the DS = 1230h and SI = 0045h. This is good, since this way we can access much more memory than with a single register that is limited to 16 bit values.
18
CPU makes a calculation of physical address by multiplying the segment register by 10h and adding general purpose register to it (1230h * 10h + 45h = 12345h):
19
The address formed with 2 registers is called an effective address. By default BX, SI and DI registers work with DS segment register; BP and SP work with SS segment register. Other general purpose registers cannot form an effective address! Also, although BX can form an effective address, BH and BL cannot!
20
SP – Stack Pointer, it is use to conjunction with SS to access the stack segment BP – Base Pointer, it is used primarily to access data on stack, but unlike SP we can use BP to access data in other segment SI – Source Index, it is used to point memory location in data segment address by DS. By adding SI we can easily access consecutive memory locations DI – Destination Index, it work like SI, It work with string operations, and access memory with ES
21
All register come above is for data register. To access instructions 8086 use registers CS and IP. CS contain the segment number of next instruction IP contain offset of next instruction IP is updated every time as each instruction is executed IP can not be manipulated by an instruction An instruction may not contain IP as operand
22
Thanks
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.