Showing posts with label 8086 Assembler. Show all posts
Showing posts with label 8086 Assembler. Show all posts

Friday, 28 October 2016

Evolution of Microprocessor

Evolution of Microprocessor:

Microprocessor has turned into the brain of millions of gadgets, since year 1971 i.e. devoid of microprocessors these wonderful innovations of millions of gadgets would have not been possible. Now come have a look at the gadgets in which the microprocessors are playing an imperative role from more than 40 long years.


  • Business Calculator: A business calculator was invented in the year 1971. The Unicom 141P business calculator was out of the foremost gadgets that feature a microprocessor.
  • Commodore PET: The PET was invented in the year 1971 and is broadly recognized as the primary all-in-one home computer.
  • Washing Machine: The foremost microchip controlled washing machines were launched in the year 1977 and gave a bang to the market, showcasing the varied usages of innovative technology.
  • Arcade Mania in the year 1980: Namco pioneered Pac-Man in the walkways of the Unite States and ignited a new trend.
  • Osborne 1 Laptop: With five screen and 10.7kgs of weight, Osborne 1 Laptop was invented in the year 1981. It actually was the great grand-father of most modern laptops.
  • Nintendo NES: Consoles revitalized the gaming industry in the year 1986 such as Nintendo Entertainment System.
  • Computing Democratized: Personal & business computing blasted with a broad variety of laptops, desktops & even early tabs. These inventions came up in the year 1991.
  • MP3 Player: The modern way to enjoy to music forever altered in the last 1990s with the foremost MP3 player, which was invented in the year 1997.
  • BlackBerry: The Smartphone insurgence boosted with the launch of RIM’s Blackberry 850. The 1st BB was accessible in the year 1999.
  • Apple iPod: Apple launched its 1st iPod in the year 2001; its release gave the future of MP3 music format a new selection of set tunes.
  • Microsoft Windows Tablet: Approximately a decade prior to the shopper’s fascination with tab, Microsoft Windows Tablet was launched in the year 2002, business were employing these tabs for more useful jobs.
  • Netbook: Netbooks were launched in the year 2008, as small and light-weighted gadget for carrying out uncomplicated jobs and enjoying media & internet content on the move.
  • Apple iPod: Tabs strike the customers main-stream with the release of iPod in the year 2010.
  • Digital Signage in the year 2011: Digital Signage was 1st of the vast new usages for the microprocessor. Intellectual, internet allied gadgets are more and more found in the daily life from business and retail to farming and automobiles.
  • Ultrabook in the year 2011: The advancement of the Personal Computer takes an additional gigantic step as trendy Ultrabook gadgets push ahead high performance computing experience.

Thursday, 27 October 2016

Memory Access(8086 Assembler Tutorial for Beginners)

Memory Access
To access memory we can use these four registers: BX, SI, DI, BP. Combining these registers inside [ ] symbols, we can get different memory locations. These combinations are supported (addressing modes)

d8 - stays for 8 bit displacement.

d16 - stays for 16 bit displacement.


Displacement can be a immediate value or offset of a variable, or even both. It's up to compiler to calculate a single immediate value.
Displacement can be inside or outside of [ ] symbols, compiler generates the same machine code for both ways.
Displacement is a signed value, so it can be both positive or negative.
Memory access



Generally the compiler takes care about difference between d8 and
d16, and generates the required machine code. For example, let's assume that DS = 100, BX = 30, SI = 70. The following addressing mode: [BX + SI] + 25 is calculated by processor to this physical address: 100 * 16 + 30 + 70
+ 25 = 1725. By default DS segment register is used for all modes except those with BP register, for these SS segment register is used. There is an easy way to remember all those possible combinations using this chart:


You can form all valid combinations by taking only one item from each column or skipping the column by not taking anything from it. As you see BX and BP never go together. SI and DI also don't go together. Here is an example of a valid addressing mode: [BX+5].

      
                                                                     
You can form all valid combinations by taking only one item from each column or skipping the column by not taking anything from it. As you see BX and BP never go together. SI and DI also don't go together. Here is an example of a valid addressing mode: [BX+5].

In order to say the compiler about data type, these prefixes should be used:
BYTE PTR - for byte.
WORD PTR - for word (two bytes). For example:
BYTE PTR [BX] ; byte access.
or
WORD PTR [BX] ; word access.
MicroAsm supports shorter prefixes as well:
b. - for BYTE PTR
w. - for WORD PTR Sometimes compiler can calculate the data type automatically, but you may not and should not rely on that when one of the operands is an immediate value.


MOV instruction
· Copies the second operand (source) to the first operand (destination).
· The source operand can be an immediate value, general-purpose register or memory location.
· The destination register can be a general-purpose register, or memory location.
· Both operands must be the same size, which can be a byte or a word.





These types of operands are supported:
MOV REG, memory 
MOV memory, REG
MOV REG, REG 
MOV memory, immediate 
MOV REG, immediate
REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP.
memory: [BX], [BX+SI+7], variable, etc...
immediate: 5, -24, 3Fh, 10001101b, etc...






For segment registers only these types of MOV are supported:
MOV SREG, memory 
MOV memory, SREG 
MOV REG, SREG 
MOV SREG, REG
SREG: DS, ES, SS, and only as second operand: CS.
REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP.
memory: [BX], [BX+SI+7], variable, etc...



The MOV instruction cannot be used to set the value of the CS and  IP registers
.

Monday, 24 October 2016

8086 Assembler Tutorial for Beginners

8086 Assembler Tutorial for Beginners(PART-1)


 This tutorial is intended for those who are not familiar with assembler at all, or have a very distant idea about it. Of course if you have knowledge of some other programming language (Basic, C/C++, Pascal...) that may help you a lot. But even if you are familiar with assembler, it is still a good idea to look through this document in order to study emu8086 syntax. It is assumed that you have some knowledge about number representation (HEX/BIN), if not it is highly recommended to study
Numbering Systems Tutorial before you proceed.


What is an assembly language?

Assembly language is a low level programming language. You need to get some knowledge about computer structure in order to understand anything. The simple computer model as I see it: 

The system bus (shown in yellow) connects the various components of a computer. 

The CPU is the heart of the computer, most of computations occur inside the CPU.


RAM is a place to where the programs are loaded in order to be executed.

GENERAL PURPOSE REGISTERS 8086 CPU has 8 general purpose registers, each register has its own name:
· 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. Despite the name of a register, it's the programmer who determines the usage for each general purpose register. The main purpose of a register is to keep a number (variable). The size of the above registers is 16 bit, it's something like: 0011000000111001b (in binary form), or
12345 in decimal (human) form. 4 general purpose registers (AX, BX, CX, DX) are made of two separate 8 bit registers, for example if AX= 0011000000111001b, then AH=00110000b and AL=00111001b. Therefore, when you modify any of the 8 bit registers 16 bit register is also updated, and vice-versa. The same is for other 3 registers, "H" is for high and "L" is for low part. Because registers are located inside the CPU, they are much faster than memory. Accessing a memory location requires the use of a system bus, so it takes much longer. Accessing data in a register usually takes no time. Therefore, you should try to keep variables in the registers. Register sets are very small and most registers have special purposes which limit their use as variables, but they are still an excellent place to store temporary data of calculations.

Powered by Blogger.