57
Intel Processors Intel Processors Information and images of the processors taken from Information and images of the processors taken from http://www.intel.com/museum/online/hist_micro/hof/ http://www.intel.com/museum/online/hist_micro/hof/

Intel processors

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Intel processors

Intel ProcessorsIntel Processors

Information and images of the processors taken from Information and images of the processors taken from http://www.intel.com/museum/online/hist_micro/hof/http://www.intel.com/museum/online/hist_micro/hof/

Page 2: Intel processors

1971: 4004 Microprocessor1971: 4004 Microprocessor

Page 3: Intel processors

1971: 4004 Microprocessor1971: 4004 Microprocessor

http://www.computerhistory.org/exhibits/highlights/busicom.shtml

Page 4: Intel processors

1971: 4004 Microprocessor1971: 4004 Microprocessor

The 4004 was Intel's first microprocessor. This The 4004 was Intel's first microprocessor. This breakthrough invention powered the Busicom breakthrough invention powered the Busicom calculator and paved the way for embedding calculator and paved the way for embedding intelligence in inanimate objects as well as the intelligence in inanimate objects as well as the personal computer. personal computer.

Page 5: Intel processors

1971: 4004 Microprocessor1971: 4004 Microprocessor

Data Word: 4-bitData Word: 4-bit Clock: 740KHzClock: 740KHz Address Space: 4 KBAddress Space: 4 KB Instruction Set: 46Instruction Set: 46 Registers: 16Registers: 16

Page 6: Intel processors

1972: 8008 Microprocessor 1972: 8008 Microprocessor

Page 7: Intel processors

1972: 8008 Microprocessor1972: 8008 Microprocessor

www.ciphersbyritter.com/ MARK8/MAGCOV5.JPG

Page 8: Intel processors

1972: 8008 Microprocessor1972: 8008 Microprocessor

The 8008 was twice as powerful as the 4004. The 8008 was twice as powerful as the 4004. A 1974 article in Radio Electronics referred to A 1974 article in Radio Electronics referred to a device called the Mark-8 which used the a device called the Mark-8 which used the 8008. The Mark-8 is known as one of the first 8008. The Mark-8 is known as one of the first computers for the home --one that by today's computers for the home --one that by today's standards was difficult to build, maintain and standards was difficult to build, maintain and operate. operate.

Page 9: Intel processors

1972: 8008 Microprocessor1972: 8008 Microprocessor

Data Word: 8-bitData Word: 8-bit Clock: 800KHzClock: 800KHz Address Space: 16 KBAddress Space: 16 KB Instructions: 48Instructions: 48 Registers: 15Registers: 15 Addressing modesAddressing modes

RegisterRegister Register directRegister direct ImmediateImmediate

Page 10: Intel processors

1974: 8080 Microprocessor 1974: 8080 Microprocessor

Page 11: Intel processors

1974: 8080 Microprocessor1974: 8080 Microprocessor

http://www.obsoletecomputermuseum.org/altair/altair3.jpg

Page 12: Intel processors

1974: 8080 Microprocessor 1974: 8080 Microprocessor

The 8080 became the brains of the first The 8080 became the brains of the first personal computer--the Altair, allegedly personal computer--the Altair, allegedly named for a destination of the Starship named for a destination of the Starship Enterprise from the Star Trek television show. Enterprise from the Star Trek television show. Computer hobbyists could purchase a kit for Computer hobbyists could purchase a kit for the Altair for $395. Within months, it sold tens the Altair for $395. Within months, it sold tens of thousands, creating the first PC back orders of thousands, creating the first PC back orders in history. in history.

Page 13: Intel processors

1974: 8080 Microprocessor1974: 8080 Microprocessor

Data Word: 8-bitData Word: 8-bit Clock: ~2MHzClock: ~2MHz Address Space: 64 KBAddress Space: 64 KB Instructions: 48Instructions: 48 Addressing modesAddressing modes

RegisterRegister Register directRegister direct ImmediateImmediate

Page 14: Intel processors

1978: 8086-8088 Microprocessor 1978: 8086-8088 Microprocessor

Page 15: Intel processors

1978: 8086-8088 Microprocessor1978: 8086-8088 Microprocessor

http://accad.osu.edu/~waynec/history/images/small/ibm_pc_xt.jpg

Page 16: Intel processors

1978: 8086-8088 Microprocessor1978: 8086-8088 Microprocessor

A pivotal sale to IBM's new personal computer A pivotal sale to IBM's new personal computer division made the 8088 the brains of IBM's division made the 8088 the brains of IBM's new hit product--the IBM PC. The 8088's new hit product--the IBM PC. The 8088's success propelled Intel into the ranks of the success propelled Intel into the ranks of the Fortune 500, and Fortune magazine named the Fortune 500, and Fortune magazine named the company one of the "Business Triumphs of the company one of the "Business Triumphs of the Seventies." Seventies."

Page 17: Intel processors

1982: 286 Microprocessor 1982: 286 Microprocessor

Page 18: Intel processors

1982: 286 Microprocessor1982: 286 Microprocessor

Page 19: Intel processors

1982: 286 Microprocessor1982: 286 Microprocessor

The Intel 286, originally known as the 80286, The Intel 286, originally known as the 80286, was the first Intel processor that could run all was the first Intel processor that could run all the software written for its predecessor. This the software written for its predecessor. This software compatibility remains a hallmark of software compatibility remains a hallmark of Intel's family of microprocessors. Within 6 Intel's family of microprocessors. Within 6 years of its release, an estimated 15 million years of its release, an estimated 15 million 286-based personal computers were installed 286-based personal computers were installed around the world. around the world.

Page 20: Intel processors

1985: Intel386™ Microprocessor 1985: Intel386™ Microprocessor

Page 21: Intel processors

1985: Intel386™ Microprocessor1985: Intel386™ Microprocessor

http://skola.amoskadan.cz/images/pp/uvod/pc386.gif

Page 22: Intel processors

1985: Intel386™ Microprocessor1985: Intel386™ Microprocessor

The Intel386™ microprocessor featured The Intel386™ microprocessor featured 275,000 transistors--more than 100times as 275,000 transistors--more than 100times as many as the original 4004. It was a 32-bit chip many as the original 4004. It was a 32-bit chip and was "multi tasking," meaning it could run and was "multi tasking," meaning it could run multiple programs at the same time. multiple programs at the same time.

Page 23: Intel processors

1989: Intel486™ DX CPU 1989: Intel486™ DX CPU MicroprocessorMicroprocessor

Page 24: Intel processors

1989: Intel486™ DX CPU 1989: Intel486™ DX CPU MicroprocessorMicroprocessor

http://www.100megspopup.com/redawa/Graphics/Icon486.jpg

Page 25: Intel processors

1989: Intel486™ DX CPU 1989: Intel486™ DX CPU MicroprocessorMicroprocessor

The Intel486™ processor generation really meant you The Intel486™ processor generation really meant you go from a command-level computer into point-and-go from a command-level computer into point-and-click computing. "I could have a color computer for click computing. "I could have a color computer for the first time and do desktop publishing at a the first time and do desktop publishing at a significant speed," recalls technology historian David significant speed," recalls technology historian David K. Allison of the Smithsonian's National Museum of K. Allison of the Smithsonian's National Museum of American History. The Intel486™ processor was the American History. The Intel486™ processor was the first to offer a built-in math coprocessor, which first to offer a built-in math coprocessor, which speeds up computing because it offloads complex speeds up computing because it offloads complex math functions from the central processor. math functions from the central processor.

Page 26: Intel processors

1993: Intel® Pentium® Processor1993: Intel® Pentium® Processor

Page 27: Intel processors

1993: Intel® Pentium® Processor1993: Intel® Pentium® Processor

The Intel Pentium® processor allowed The Intel Pentium® processor allowed computers to more easily incorporate "real computers to more easily incorporate "real world" data such as speech, sound, world" data such as speech, sound, handwriting and photographic images. The handwriting and photographic images. The Intel Pentium brand, mentioned in the comics Intel Pentium brand, mentioned in the comics and on television talk shows, became a and on television talk shows, became a household word soon after introduction. household word soon after introduction.

Page 28: Intel processors

1995: Intel® Pentium® Pro Processor 1995: Intel® Pentium® Pro Processor

Page 29: Intel processors

1995: Intel® Pentium® Pro 1995: Intel® Pentium® Pro ProcessorProcessor

Released in the fall of 1995 the Intel® Released in the fall of 1995 the Intel® Pentium® Pro processor is designed to fuel Pentium® Pro processor is designed to fuel 32-bit server and workstation applications, 32-bit server and workstation applications, enabling fast computer-aided design, enabling fast computer-aided design, mechanical engineering and scientific mechanical engineering and scientific computation. Each Intel® Pentium Pro computation. Each Intel® Pentium Pro processor is packaged together with a second processor is packaged together with a second speed-enhancing cache memory chip. The speed-enhancing cache memory chip. The powerful Pentium® Pro processor boasts 5.5 powerful Pentium® Pro processor boasts 5.5 million transistors. million transistors.

Page 30: Intel processors

1997: Intel® Pentium® II Processor 1997: Intel® Pentium® II Processor

Page 31: Intel processors

1997: Intel® Pentium® II Processor 1997: Intel® Pentium® II Processor

The 7.5 million-transistor Intel® Pentium II The 7.5 million-transistor Intel® Pentium II processor incorporates Intel® MMX™ technology, processor incorporates Intel® MMX™ technology, which is designed specifically to process video, audio which is designed specifically to process video, audio and graphics data efficiently. It was introduced in and graphics data efficiently. It was introduced in innovative Single Edge Contact (S.E.C) Cartridge innovative Single Edge Contact (S.E.C) Cartridge that also incorporated a high-speed cache memory that also incorporated a high-speed cache memory chip. With this chip, PC users can capture, edit and chip. With this chip, PC users can capture, edit and share digital photos with friends and family via the share digital photos with friends and family via the Internet; edit and add text, music or between-scene Internet; edit and add text, music or between-scene transitions to home movies; and, with a video phone, transitions to home movies; and, with a video phone, send video over standard phone lines and the Internet. send video over standard phone lines and the Internet.

Page 32: Intel processors

1998: Intel® Pentium II Xeon 1998: Intel® Pentium II Xeon Processor Processor

Page 33: Intel processors

1998: Intel® Pentium II Xeon 1998: Intel® Pentium II Xeon ProcessorProcessor

The Intel® Pentium II Xeon processors are designed The Intel® Pentium II Xeon processors are designed to meet the performance requirements of mid-range to meet the performance requirements of mid-range and higher servers and workstations. Consistent with and higher servers and workstations. Consistent with Intel's strategy to deliver unique processor products Intel's strategy to deliver unique processor products targeted for specific markets segments, the Intel® targeted for specific markets segments, the Intel® Pentium II Xeon processors feature technical Pentium II Xeon processors feature technical innovations specifically designed for workstations innovations specifically designed for workstations and servers that utilize demanding business and servers that utilize demanding business applications such as Internet services, corporate data applications such as Internet services, corporate data warehousing, digital content creation, and electronic warehousing, digital content creation, and electronic and mechanical design automation. Systems based on and mechanical design automation. Systems based on the processor can be configured to scale to four or the processor can be configured to scale to four or eight processors and beyond. eight processors and beyond.

Page 34: Intel processors

1999: Intel® Celeron® Processor 1999: Intel® Celeron® Processor

Page 35: Intel processors

1999: Intel® Celeron® Processor1999: Intel® Celeron® Processor

Continuing Intel's strategy of developing Continuing Intel's strategy of developing processors for specific market segments, the processors for specific market segments, the Intel® Celeron® processor is designed for the Intel® Celeron® processor is designed for the value PC market segment. It provides value PC market segment. It provides consumers great performance at an exceptional consumers great performance at an exceptional price, and it delivers excellent performance for price, and it delivers excellent performance for uses such as gaming and educational software. uses such as gaming and educational software.

Page 36: Intel processors

1999: Intel® Pentium® III Processor 1999: Intel® Pentium® III Processor

The Intel® Pentium® III processor features 70 new The Intel® Pentium® III processor features 70 new instructions--Internet Streaming SIMD extensions-- instructions--Internet Streaming SIMD extensions-- that dramatically enhance the performance of that dramatically enhance the performance of advanced imaging, 3-D, streaming audio, video and advanced imaging, 3-D, streaming audio, video and speech recognition applications. It was designed to speech recognition applications. It was designed to significantly enhance Internet experiences, allowing significantly enhance Internet experiences, allowing users to do such things as browse through realistic users to do such things as browse through realistic online museums and stores and download high-online museums and stores and download high-quality video. The processor incorporates 9.5 million quality video. The processor incorporates 9.5 million transistors, and was introduced using 0.25-micron transistors, and was introduced using 0.25-micron technology. technology.

Page 37: Intel processors

1999: Intel® Pentium® III Xeon™ 1999: Intel® Pentium® III Xeon™ Processor Processor

The Intel® Pentium III Xeon™ processor extends The Intel® Pentium III Xeon™ processor extends Intel's offerings to the workstation and server market Intel's offerings to the workstation and server market segments, providing additional performance for e-segments, providing additional performance for e-Commerce applications and advanced business Commerce applications and advanced business computing. The processors incorporate the Intel® computing. The processors incorporate the Intel® Pentium III processor's 70 SIMD instructions, which Pentium III processor's 70 SIMD instructions, which enhance multimedia and streaming video enhance multimedia and streaming video applications. The Intel® Pentium III Xeon processor's applications. The Intel® Pentium III Xeon processor's advance cache technology speeds information from advance cache technology speeds information from the system bus to the processor, significantly the system bus to the processor, significantly boosting performance. It is designed for systems with boosting performance. It is designed for systems with multiprocessor configurations. multiprocessor configurations.

Page 38: Intel processors

2000: Intel® Pentium® 4 Processor 2000: Intel® Pentium® 4 Processor

Users of Intel® Pentium® 4 processor-based PCs can create Users of Intel® Pentium® 4 processor-based PCs can create professional-quality movies; deliver TV-like video via the professional-quality movies; deliver TV-like video via the Internet; communicate with real-time video and voice; render Internet; communicate with real-time video and voice; render 3D graphics in real time; quickly encode music for MP3 3D graphics in real time; quickly encode music for MP3 players; and simultaneously run several multimedia players; and simultaneously run several multimedia applications while connected to the Internet. The processor applications while connected to the Internet. The processor debuted with 42 million transistors and circuit lines of 0.18 debuted with 42 million transistors and circuit lines of 0.18 microns. Intel's first microprocessor, the 4004, ran at 108 microns. Intel's first microprocessor, the 4004, ran at 108 kilohertz (108,000 hertz), compared to the Intel® Pentium® 4 kilohertz (108,000 hertz), compared to the Intel® Pentium® 4 processor's initial speed of 1.5 gigahertz (1.5 billion hertz). If processor's initial speed of 1.5 gigahertz (1.5 billion hertz). If automobile speed had increased similarly over the same automobile speed had increased similarly over the same period, you could now drive from San Francisco to New York period, you could now drive from San Francisco to New York in about 13 seconds. in about 13 seconds.

Page 39: Intel processors

2001: Intel® Xeon™ Processor 2001: Intel® Xeon™ Processor The Intel® Xeon™ processor is targeted for high-performance The Intel® Xeon™ processor is targeted for high-performance

and mid-range, dual-processor workstations, dual and multi-and mid-range, dual-processor workstations, dual and multi-processor server configurations coming in the future. The processor server configurations coming in the future. The platform offers customers a choice of operating systems and platform offers customers a choice of operating systems and applications, along with high performance at affordable prices. applications, along with high performance at affordable prices. Intel Xeon processor-based workstations are expected to Intel Xeon processor-based workstations are expected to achieve performance increases between 30 and 90 percent achieve performance increases between 30 and 90 percent over systems featuring Intel® Pentium® III Xeon™ over systems featuring Intel® Pentium® III Xeon™ processors depending on applications and configurations. The processors depending on applications and configurations. The processor is based on the Intel NetBurst™ architecture, which processor is based on the Intel NetBurst™ architecture, which is designed to deliver the processing power needed for video is designed to deliver the processing power needed for video and audio applications, advanced Internet technologies, and and audio applications, advanced Internet technologies, and complex 3-D graphics. complex 3-D graphics.

Page 40: Intel processors

2001: Intel® Itanium™ Processor 2001: Intel® Itanium™ Processor

The Itanium™ processor is the first in a family of 64-The Itanium™ processor is the first in a family of 64-bit products from Intel. Designed for high-end, bit products from Intel. Designed for high-end, enterprise-class servers and workstations, the enterprise-class servers and workstations, the processor was built from the ground up with an processor was built from the ground up with an entirely new architecture based on Intel's Explicitly entirely new architecture based on Intel's Explicitly Parallel Instruction Computing (EPIC) design Parallel Instruction Computing (EPIC) design technology. The processor delivers world-class technology. The processor delivers world-class performance for the most demanding enterprise and performance for the most demanding enterprise and high-performance computing applications, including high-performance computing applications, including e-Commerce security transactions, large databases, e-Commerce security transactions, large databases, mechanical computer-aided engineering, and mechanical computer-aided engineering, and sophisticated scientific and engineering computing. sophisticated scientific and engineering computing.

Page 41: Intel processors

2002: Intel® Itanium™ 2 Processor2002: Intel® Itanium™ 2 Processor

The Itanium™ 2 processor is the second The Itanium™ 2 processor is the second member of the Itanium processor family, a line member of the Itanium processor family, a line of enterprise-class processors. The family of enterprise-class processors. The family brings outstanding performance and the brings outstanding performance and the volume economics of the Intel® Architecture volume economics of the Intel® Architecture to the most data-intensive, business-critical to the most data-intensive, business-critical and technical computing applications. It and technical computing applications. It provides leading performance for databases, provides leading performance for databases, computer-aided engineering, secure online computer-aided engineering, secure online transactions, and more. transactions, and more.

Page 42: Intel processors

2003: Intel® Pentium® M Processor 2003: Intel® Pentium® M Processor

The Intel® Pentium® M processor, the Intel® The Intel® Pentium® M processor, the Intel® 855 chipset family, and the Intel® 855 chipset family, and the Intel® PRO/Wireless 2100 network connection are PRO/Wireless 2100 network connection are the three components of Intel® Centrino™ the three components of Intel® Centrino™ mobile technology. Intel Centrino mobile mobile technology. Intel Centrino mobile technology is designed specifically for technology is designed specifically for portable computing, with built-in wireless portable computing, with built-in wireless LAN capability and breakthrough mobile LAN capability and breakthrough mobile performance. It enables extended battery life performance. It enables extended battery life and thinner, lighter mobile computers. and thinner, lighter mobile computers.

Page 43: Intel processors

Assembly Language for Assembly Language for the Intel 8086the Intel 8086

Information taken from Information taken from http://www.emu8086.com/Help/asm_http://www.emu8086.com/Help/asm_

tutorial_01.htmltutorial_01.html

Page 44: Intel processors

RegistersRegisters

General purpose Segment

Page 45: Intel processors

GENERAL PURPOSE REGISTERSGENERAL PURPOSE REGISTERS

8086 CPU has 8 general purpose registers, each register has its 8086 CPU has 8 general purpose registers, each register has its own name: own name:

AXAX - the accumulator register (divided into - the accumulator register (divided into AH / ALAH / AL). ). BXBX - the base address register (divided into - the base address register (divided into BH / BLBH / BL). ). CXCX - the count register (divided into - the count register (divided into CH / CLCH / CL). ). DXDX - the data register (divided into - the data register (divided into DH / DLDH / DL). ). SISI - source index register. - source index register. DIDI - destination index register. - destination index register. BPBP - base pointer. - base pointer. SPSP - stack pointer. - stack pointer.

Page 46: Intel processors

SEGMENT REGISTERSSEGMENT REGISTERS CSCS - points at the segment containing the - points at the segment containing the

current program. current program. DSDS - generally points at segment where - generally points at segment where

variables are defined. variables are defined. ESES - extra segment register, it's up to a coder to - extra segment register, it's up to a coder to

define its usage. define its usage. SSSS - points at the segment containing the stack. - points at the segment containing the stack.

Page 47: Intel processors

SPECIAL PURPOSE REGISTERSSPECIAL PURPOSE REGISTERS

IPIP - the instruction pointer. - the instruction pointer. Flags RegisterFlags Register - determines the current state of the processor. - determines the current state of the processor.

IPIP register always works together with register always works together with CSCS segment register and segment register and it points to currently executing instruction.it points to currently executing instruction.

Flags RegisterFlags Register is modified automatically by CPU after is modified automatically by CPU after mathematical operations, this allows to determine the type of the mathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control to other result, and to determine conditions to transfer control to other parts of the program.parts of the program.Generally you cannot access these registers directly. Generally you cannot access these registers directly.

Page 48: Intel processors

As you may see there are 16 bits in this register, each bit is called a As you may see there are 16 bits in this register, each bit is called a flagflag and can take a value and can take a value of of 11 or or 00..

Carry Flag (CF)Carry Flag (CF) - this flag is set to - this flag is set to 11 when there is an when there is an unsigned overflowunsigned overflow. For example . For example when you add bytes when you add bytes 255 + 1255 + 1 (result is not in range 0...255). When there is no overflow (result is not in range 0...255). When there is no overflow this flag is set to this flag is set to 00. .

Zero Flag (ZF)Zero Flag (ZF) - set to - set to 11 when result is when result is zerozero. For none zero result this flag is set to . For none zero result this flag is set to 00.. Sign Flag (SF)Sign Flag (SF) - set to - set to 11 when result is when result is negativenegative. When result is . When result is positivepositive it is set to it is set to 00. .

Actually this flag take the value of the most significant bit.Actually this flag take the value of the most significant bit. Overflow Flag (OF)Overflow Flag (OF) - set to - set to 11 when there is a when there is a signed overflowsigned overflow. For example, when you . For example, when you

add bytes add bytes 100 + 50100 + 50 (result is not in range -128...127). (result is not in range -128...127). Parity Flag (PF)Parity Flag (PF) - this flag is set to - this flag is set to 11 when there is even number of one bits in result, when there is even number of one bits in result,

and to and to 00 when there is odd number of one bits. Even if result is a word only 8 low bits are when there is odd number of one bits. Even if result is a word only 8 low bits are analyzed!analyzed!

Auxiliary Flag (AF)Auxiliary Flag (AF) - set to - set to 11 when there is an when there is an unsigned overflowunsigned overflow for low nibble (4 for low nibble (4 bits).bits).

Interrupt enable Flag (IF)Interrupt enable Flag (IF) - when this flag is set to - when this flag is set to 11 CPU reacts to interrupts from CPU reacts to interrupts from external devices.external devices.

Direction Flag (DF)Direction Flag (DF) - this flag is used by some instructions to process data chains, when - this flag is used by some instructions to process data chains, when this flag is set to this flag is set to 00 - the processing is done forward, when this flag is set to - the processing is done forward, when this flag is set to 11 the the processing is done backward.processing is done backward.

Page 49: Intel processors

There are 3 groups of instructions. There are 3 groups of instructions.

First group: First group: ADDADD, , SUBSUB,,CMPCMP, , ANDAND, , TESTTEST, , OROR, , XORXOR

Second group: Second group: MULMUL, , IMULIMUL, , DIVDIV, , IDIVIDIV Third group: Third group: INCINC, , DECDEC, , NOTNOT, , NEGNEG

Page 50: Intel processors

#MAKE_COM# ; instruct compiler to make COM file. ORG 100h ; The sub-function that we are using ; does not modify the AH register on ; return, so we may set it only once. MOV AH, 0Eh ; select sub-function. ; INT 10h / 0Eh sub-function ; receives an ASCII code of the ; character that will be printed ; in AL register. MOV AL, 'H‘ ; ASCII code: 72 INT 10h ; print it! MOV AL, 'e' ; ASCII code: 101 INT 10h ; print it! MOV AL, 'l' ; ASCII code: 108 INT 10h ; print it! MOV AL, 'l' ; ASCII code: 108 INT 10h ; print it! MOV AL, 'o' ; ASCII code: 111 INT 10h ; print it! MOV AL, '!' ; ASCII code: 33 INT 10h ; print it! RET ; returns to operating system.

Page 51: Intel processors
Page 52: Intel processors

ORG 100h ORG 100h MOV AX, 5 MOV AX, 5 ; set AX to 5. ; set AX to 5. MOV BX, 2 MOV BX, 2 ; set BX to 2. ; set BX to 2. JMP calc JMP calc ; go to 'calc'. ; go to 'calc'. back: JMP stop back: JMP stop ; go to 'stop'. ; go to 'stop'. calc: calc: ADD AX, BX ADD AX, BX ; add BX to AX. ; add BX to AX. JMP back JMP back ; go 'back'. ; go 'back'. stop: stop: RET RET ; return to operating system.; return to operating system. END END ; directive to stop the compiler. ; directive to stop the compiler.

Page 53: Intel processors

include emu8086.inc include emu8086.inc ORG 100h ORG 100h MOV AL, 25 MOV AL, 25 ; set AL to 25. ; set AL to 25. MOV BL, 10 MOV BL, 10 ; set BL to 10. ; set BL to 10. CMP AL, BL CMP AL, BL ; compare AL - BL. ; compare AL - BL. JE equal JE equal ; jump if AL = BL (ZF = 1). ; jump if AL = BL (ZF = 1). PUTC 'N' PUTC 'N' ; if it gets here, then AL <> BL, ; if it gets here, then AL <> BL, JMP stop JMP stop ; so print 'N', and jump to stop. ; so print 'N', and jump to stop. equal: equal: ; if gets here, ; if gets here, PUTC 'Y' PUTC 'Y' ; then AL = BL, so print 'Y'. ; then AL = BL, so print 'Y'. stop: stop: RET RET ; gets here no matter what. ; gets here no matter what. END END

Page 54: Intel processors

include emu8086.inc include emu8086.inc ORG 100h ORG 100h MOV AL, 25 MOV AL, 25 ; set AL to 25. ; set AL to 25. MOV BL, 10 MOV BL, 10 ; set BL to 10. ; set BL to 10. CMP AL, BL CMP AL, BL ; compare AL - BL. ; compare AL - BL. JNE not_equal JNE not_equal ; jump if AL <> BL (ZF = 0). ; jump if AL <> BL (ZF = 0). JMP equal JMP equal not_equal: not_equal:

; let's assume that here we ; let's assume that here we ; have a code that is assembled ; have a code that is assembled ; to more than 127 bytes... ; to more than 127 bytes...

PUTC 'N' PUTC 'N' ; if it gets here, then AL <> BL, ; if it gets here, then AL <> BL, JMP stop JMP stop

; so print 'N', and jump to stop. ; so print 'N', and jump to stop. equal: equal: ; if gets here, ; if gets here, PUTC 'Y' PUTC 'Y' ; then AL = BL, so print 'Y'. ; then AL = BL, so print 'Y'. stop: stop: RET RET ; gets here no matter what. END ; gets here no matter what. END

Page 55: Intel processors

ORG 100h ORG 100h CALL m1 CALL m1 MOV AX, 2 MOV AX, 2 RET RET ; return to operating system. ; return to operating system. m1 PROC m1 PROC MOV BX, 5 MOV BX, 5 RET RET ; return to caller. ; return to caller. m1 ENDP m1 ENDP END END

Page 56: Intel processors

ORG 100h ORG 100h MOV AL, 1 MOV AL, 1 MOV BL, 2 MOV BL, 2 CALL m2 CALL m2 CALL m2 CALL m2 CALL m2 CALL m2 CALL m2 CALL m2 RET RET ; return to operating system. ; return to operating system. m2 PROC m2 PROC MUL BL MUL BL ; AX = AL * BL. ; AX = AL * BL. RET RET ; return to caller. ; return to caller. m2 ENDP m2 ENDP END END

Page 57: Intel processors

ORG 100h ORG 100h LEA SI, msg ; load address of msg to SI. LEA SI, msg ; load address of msg to SI. CALL print_me CALL print_me RET RET ; return to operating system. ; return to operating system. ; =====================================================; =====================================================; this procedure prints a string, the string should be null ; this procedure prints a string, the string should be null ; terminated (have zero in the end), ; terminated (have zero in the end), ; the string address should be in SI register: ; the string address should be in SI register: print_me PROC print_me PROC next_char: next_char:

CMP b.[SI], 0 CMP b.[SI], 0 ; check for zero to stop ; check for zero to stop JE stop JE stop ; ;

MOV AL, [SI] MOV AL, [SI] ; next get ASCII char. ; next get ASCII char. MOV AH, 0Eh MOV AH, 0Eh ; teletype function number. ; teletype function number. INT 10h INT 10h ; using interrupt to print a char in AL. ; using interrupt to print a char in AL. ADD SI, 1 ADD SI, 1 ; advance index of string array. ; advance index of string array. JMP next_char JMP next_char ; go back, and type another char. ; go back, and type another char.

stop: stop: RET RET ; return to caller. ; return to caller. print_me ENDP print_me ENDP ; ========================================================== ; ========================================================== msg DB 'Hello World!', 0 msg DB 'Hello World!', 0 ; null terminated string. ; null terminated string. END END