Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
291
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
14
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Intel ProcessorsIntel Processors Information and images of the processors taken fromInformation 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/
  • 2. 1971: 4004 Microprocessor1971: 4004 Microprocessor
  • 3. 1971: 4004 Microprocessor1971: 4004 Microprocessor http://www.computerhistory.org/exhibits/highlights/busicom.shtml
  • 4. 1971: 4004 Microprocessor1971: 4004 Microprocessor  The 4004 was Intel's first microprocessor. ThisThe 4004 was Intel's first microprocessor. This breakthrough invention powered the Busicombreakthrough invention powered the Busicom calculator and paved the way for embeddingcalculator and paved the way for embedding intelligence in inanimate objects as well as theintelligence in inanimate objects as well as the personal computer.personal computer.
  • 5. 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
  • 6. 1972: 8008 Microprocessor1972: 8008 Microprocessor
  • 7. 1972: 8008 Microprocessor1972: 8008 Microprocessor www.ciphersbyritter.com/ MARK8/MAGCOV5.JPG
  • 8. 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 toA 1974 article in Radio Electronics referred to a device called the Mark-8 which used thea device called the Mark-8 which used the 8008. The Mark-8 is known as one of the first8008. The Mark-8 is known as one of the first computers for the home --one that by today'scomputers for the home --one that by today's standards was difficult to build, maintain andstandards was difficult to build, maintain and operate.operate.
  • 9. 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
  • 10. 1974: 8080 Microprocessor1974: 8080 Microprocessor
  • 11. 1974: 8080 Microprocessor1974: 8080 Microprocessor http://www.obsoletecomputermuseum.org/altair/altair3.jpg
  • 12. 1974: 8080 Microprocessor1974: 8080 Microprocessor  The 8080 became the brains of the firstThe 8080 became the brains of the first personal computer--the Altair, allegedlypersonal computer--the Altair, allegedly named for a destination of the Starshipnamed 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 forComputer hobbyists could purchase a kit for the Altair for $395. Within months, it sold tensthe Altair for $395. Within months, it sold tens of thousands, creating the first PC back ordersof thousands, creating the first PC back orders in history.in history.
  • 13. 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
  • 14. 1978: 8086-8088 Microprocessor1978: 8086-8088 Microprocessor
  • 15. 1978: 8086-8088 Microprocessor1978: 8086-8088 Microprocessor http://accad.osu.edu/~waynec/history/images/small/ibm_pc_xt.jpg
  • 16. 1978: 8086-8088 Microprocessor1978: 8086-8088 Microprocessor  A pivotal sale to IBM's new personal computerA pivotal sale to IBM's new personal computer division made the 8088 the brains of IBM'sdivision made the 8088 the brains of IBM's new hit product--the IBM PC. The 8088'snew hit product--the IBM PC. The 8088's success propelled Intel into the ranks of thesuccess propelled Intel into the ranks of the Fortune 500, and Fortune magazine named theFortune 500, and Fortune magazine named the company one of the "Business Triumphs of thecompany one of the "Business Triumphs of the Seventies."Seventies."
  • 17. 1982: 286 Microprocessor1982: 286 Microprocessor
  • 18. 1982: 286 Microprocessor1982: 286 Microprocessor
  • 19. 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 allwas the first Intel processor that could run all the software written for its predecessor. Thisthe software written for its predecessor. This software compatibility remains a hallmark ofsoftware compatibility remains a hallmark of Intel's family of microprocessors. Within 6Intel's family of microprocessors. Within 6 years of its release, an estimated 15 millionyears of its release, an estimated 15 million 286-based personal computers were installed286-based personal computers were installed around the world.around the world.
  • 20. 1985: Intel386™ Microprocessor1985: Intel386™ Microprocessor
  • 21. 1985: Intel386™ Microprocessor1985: Intel386™ Microprocessor http://skola.amoskadan.cz/images/pp/uvod/pc386.gif
  • 22. 1985: Intel386™ Microprocessor1985: Intel386™ Microprocessor  The Intel386™ microprocessor featuredThe Intel386™ microprocessor featured 275,000 transistors--more than 100times as275,000 transistors--more than 100times as many as the original 4004. It was a 32-bit chipmany as the original 4004. It was a 32-bit chip and was "multi tasking," meaning it could runand was "multi tasking," meaning it could run multiple programs at the same time.multiple programs at the same time.
  • 23. 1989: Intel486™ DX CPU1989: Intel486™ DX CPU MicroprocessorMicroprocessor
  • 24. 1989: Intel486™ DX CPU1989: Intel486™ DX CPU MicroprocessorMicroprocessor http://www.100megspopup.com/redawa/Graphics/Icon486.jpg
  • 25. 1989: Intel486™ DX CPU1989: Intel486™ DX CPU MicroprocessorMicroprocessor  The Intel486™ processor generation really meant youThe 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 forclick computing. "I could have a color computer for the first time and do desktop publishing at athe first time and do desktop publishing at a significant speed," recalls technology historian Davidsignificant speed," recalls technology historian David K. Allison of the Smithsonian's National Museum ofK. Allison of the Smithsonian's National Museum of American History. The Intel486™ processor was theAmerican History. The Intel486™ processor was the first to offer a built-in math coprocessor, whichfirst to offer a built-in math coprocessor, which speeds up computing because it offloads complexspeeds up computing because it offloads complex math functions from the central processor.math functions from the central processor.
  • 26. 1993: Intel® Pentium® Processor1993: Intel® Pentium® Processor
  • 27. 1993: Intel® Pentium® Processor1993: Intel® Pentium® Processor  The Intel Pentium® processor allowedThe Intel Pentium® processor allowed computers to more easily incorporate "realcomputers to more easily incorporate "real world" data such as speech, sound,world" data such as speech, sound, handwriting and photographic images. Thehandwriting and photographic images. The Intel Pentium brand, mentioned in the comicsIntel Pentium brand, mentioned in the comics and on television talk shows, became aand on television talk shows, became a household word soon after introduction.household word soon after introduction.
  • 28. 1995: Intel® Pentium® Pro Processor1995: Intel® Pentium® Pro Processor
  • 29. 1995: Intel® Pentium® Pro1995: 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 fuelPentium® 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 scientificmechanical engineering and scientific computation. Each Intel® Pentium Procomputation. Each Intel® Pentium Pro processor is packaged together with a secondprocessor is packaged together with a second speed-enhancing cache memory chip. Thespeed-enhancing cache memory chip. The powerful Pentium® Pro processor boasts 5.5powerful Pentium® Pro processor boasts 5.5 million transistors.million transistors.
  • 30. 1997: Intel® Pentium® II Processor1997: Intel® Pentium® II Processor
  • 31. 1997: Intel® Pentium® II Processor1997: Intel® Pentium® II Processor  The 7.5 million-transistor Intel® Pentium II processorThe 7.5 million-transistor Intel® Pentium II processor incorporates Intel® MMX™ technology, which isincorporates Intel® MMX™ technology, which is designed specifically to process video, audio anddesigned specifically to process video, audio and graphics data efficiently. It was introduced ingraphics data efficiently. It was introduced in innovative Single Edge Contact (S.E.C) Cartridgeinnovative Single Edge Contact (S.E.C) Cartridge that also incorporated a high-speed cache memorythat also incorporated a high-speed cache memory chip. With this chip, PC users can capture, edit andchip. With this chip, PC users can capture, edit and share digital photos with friends and family via theshare digital photos with friends and family via the Internet; edit and add text, music or between-sceneInternet; 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.
  • 32. 1998: Intel® Pentium II Xeon1998: Intel® Pentium II Xeon ProcessorProcessor
  • 33. 1998: Intel® Pentium II Xeon1998: Intel® Pentium II Xeon ProcessorProcessor  The Intel® Pentium II Xeon processors are designedThe Intel® Pentium II Xeon processors are designed to meet the performance requirements of mid-rangeto meet the performance requirements of mid-range and higher servers and workstations. Consistent withand higher servers and workstations. Consistent with Intel's strategy to deliver unique processor productsIntel'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 technicalPentium II Xeon processors feature technical innovations specifically designed for workstationsinnovations specifically designed for workstations and servers that utilize demanding businessand servers that utilize demanding business applications such as Internet services, corporate dataapplications such as Internet services, corporate data warehousing, digital content creation, and electronicwarehousing, digital content creation, and electronic and mechanical design automation. Systems based onand mechanical design automation. Systems based on the processor can be configured to scale to four orthe processor can be configured to scale to four or eight processors and beyond.eight processors and beyond.
  • 34. 1999: Intel® Celeron® Processor1999: Intel® Celeron® Processor
  • 35. 1999: Intel® Celeron® Processor1999: Intel® Celeron® Processor  Continuing Intel's strategy of developingContinuing Intel's strategy of developing processors for specific market segments, theprocessors for specific market segments, the Intel® Celeron® processor is designed for theIntel® Celeron® processor is designed for the value PC market segment. It providesvalue PC market segment. It provides consumers great performance at an exceptionalconsumers great performance at an exceptional price, and it delivers excellent performance forprice, and it delivers excellent performance for uses such as gaming and educational software.uses such as gaming and educational software.
  • 36. 1999: Intel® Pentium® III Processor1999: Intel® Pentium® III Processor  The Intel® Pentium® III processor features 70 newThe Intel® Pentium® III processor features 70 new instructions--Internet Streaming SIMD extensions--instructions--Internet Streaming SIMD extensions-- that dramatically enhance the performance ofthat dramatically enhance the performance of advanced imaging, 3-D, streaming audio, video andadvanced imaging, 3-D, streaming audio, video and speech recognition applications. It was designed tospeech recognition applications. It was designed to significantly enhance Internet experiences, allowingsignificantly enhance Internet experiences, allowing users to do such things as browse through realisticusers 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 millionquality video. The processor incorporates 9.5 million transistors, and was introduced using 0.25-microntransistors, and was introduced using 0.25-micron technology.technology.
  • 37. 1999: Intel® Pentium® III Xeon™1999: Intel® Pentium® III Xeon™ ProcessorProcessor  The Intel® Pentium III Xeon™ processor extendsThe Intel® Pentium III Xeon™ processor extends Intel's offerings to the workstation and server marketIntel's offerings to the workstation and server market segments, providing additional performance for e-segments, providing additional performance for e- Commerce applications and advanced businessCommerce applications and advanced business computing. The processors incorporate the Intel®computing. The processors incorporate the Intel® Pentium III processor's 70 SIMD instructions, whichPentium III processor's 70 SIMD instructions, which enhance multimedia and streaming videoenhance multimedia and streaming video applications. The Intel® Pentium III Xeon processor'sapplications. The Intel® Pentium III Xeon processor's advance cache technology speeds information fromadvance cache technology speeds information from the system bus to the processor, significantlythe system bus to the processor, significantly boosting performance. It is designed for systems withboosting performance. It is designed for systems with multiprocessor configurations.multiprocessor configurations.
  • 38. 2000: Intel® Pentium® 4 Processor2000: Intel® Pentium® 4 Processor  Users of Intel® Pentium® 4 processor-based PCs can createUsers of Intel® Pentium® 4 processor-based PCs can create professional-quality movies; deliver TV-like video via theprofessional-quality movies; deliver TV-like video via the Internet; communicate with real-time video and voice; renderInternet; communicate with real-time video and voice; render 3D graphics in real time; quickly encode music for MP33D graphics in real time; quickly encode music for MP3 players; and simultaneously run several multimediaplayers; and simultaneously run several multimedia applications while connected to the Internet. The processorapplications while connected to the Internet. The processor debuted with 42 million transistors and circuit lines of 0.18debuted with 42 million transistors and circuit lines of 0.18 microns. Intel's first microprocessor, the 4004, ran at 108microns. Intel's first microprocessor, the 4004, ran at 108 kilohertz (108,000 hertz), compared to the Intel® Pentium® 4kilohertz (108,000 hertz), compared to the Intel® Pentium® 4 processor's initial speed of 1.5 gigahertz (1.5 billion hertz). Ifprocessor's initial speed of 1.5 gigahertz (1.5 billion hertz). If automobile speed had increased similarly over the sameautomobile speed had increased similarly over the same period, you could now drive from San Francisco to New Yorkperiod, you could now drive from San Francisco to New York in about 13 seconds.in about 13 seconds.
  • 39. 2001: Intel® Xeon™ Processor2001: Intel® Xeon™ Processor  The Intel® Xeon™ processor is targeted for high-performanceThe 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. Theprocessor server configurations coming in the future. The platform offers customers a choice of operating systems andplatform 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 toIntel Xeon processor-based workstations are expected to achieve performance increases between 30 and 90 percentachieve 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. Theprocessors depending on applications and configurations. The processor is based on the Intel NetBurst™ architecture, whichprocessor is based on the Intel NetBurst™ architecture, which is designed to deliver the processing power needed for videois designed to deliver the processing power needed for video and audio applications, advanced Internet technologies, andand audio applications, advanced Internet technologies, and complex 3-D graphics.complex 3-D graphics.
  • 40. 2001: Intel® Itanium™ Processor2001: 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, theenterprise-class servers and workstations, the processor was built from the ground up with anprocessor was built from the ground up with an entirely new architecture based on Intel's Explicitlyentirely new architecture based on Intel's Explicitly Parallel Instruction Computing (EPIC) designParallel Instruction Computing (EPIC) design technology. The processor delivers world-classtechnology. The processor delivers world-class performance for the most demanding enterprise andperformance for the most demanding enterprise and high-performance computing applications, includinghigh-performance computing applications, including e-Commerce security transactions, large databases,e-Commerce security transactions, large databases, mechanical computer-aided engineering, andmechanical computer-aided engineering, and sophisticated scientific and engineering computing.sophisticated scientific and engineering computing.
  • 41. 2002: Intel® Itanium™ 2 Processor2002: Intel® Itanium™ 2 Processor  The Itanium™ 2 processor is the secondThe Itanium™ 2 processor is the second member of the Itanium processor family, a linemember of the Itanium processor family, a line of enterprise-class processors. The familyof enterprise-class processors. The family brings outstanding performance and thebrings outstanding performance and the volume economics of the Intel® Architecturevolume economics of the Intel® Architecture to the most data-intensive, business-criticalto the most data-intensive, business-critical and technical computing applications. Itand technical computing applications. It provides leading performance for databases,provides leading performance for databases, computer-aided engineering, secure onlinecomputer-aided engineering, secure online transactions, and more.transactions, and more.
  • 42. 2003: Intel® Pentium® M Processor2003: 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 arePRO/Wireless 2100 network connection are the three components of Intel® Centrino™the three components of Intel® Centrino™ mobile technology. Intel Centrino mobilemobile technology. Intel Centrino mobile technology is designed specifically fortechnology is designed specifically for portable computing, with built-in wirelessportable computing, with built-in wireless LAN capability and breakthrough mobileLAN capability and breakthrough mobile performance. It enables extended battery lifeperformance. It enables extended battery life and thinner, lighter mobile computers.and thinner, lighter mobile computers.
  • 43. Assembly Language forAssembly Language for the Intel 8086the Intel 8086 Information taken fromInformation taken from http://www.emu8086.com/Help/asm_http://www.emu8086.com/Help/asm_ tutorial_01.htmltutorial_01.html
  • 44. RegistersRegisters General purpose Segment
  • 45. GENERAL PURPOSE REGISTERSGENERAL PURPOSE REGISTERS 8086 CPU has 8 general purpose registers, each register has its8086 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.
  • 46. 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- extra segment register, it's up to a coder to define its usage.to define its usage.  SSSS - points at the segment containing the- points at the segment containing the stack.stack.
  • 47. 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 withregister always works together with CSCS segment registersegment register and it points to currently executing instruction.and it points to currently executing instruction. Flags RegisterFlags Register is modified automatically by CPU afteris modified automatically by CPU after mathematical operations, this allows to determine the type ofmathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control tothe result, and to determine conditions to transfer control to other parts of the program.other parts of the program. Generally you cannot access these registers directly.Generally you cannot access these registers directly.
  • 48. As you may see there are 16 bits in this register, each bit is called aAs you may see there are 16 bits in this register, each bit is called a flagflag andand can take a value ofcan take a value of 11 oror 00..  Carry Flag (CF)Carry Flag (CF) - this flag is set to- this flag is set to 11 when there is anwhen there is an unsigned overflowunsigned overflow.. For example when you add bytesFor example when you add bytes 255 + 1255 + 1 (result is not in range 0...255).(result is not in range 0...255). When there is no overflow this flag is set toWhen there is no overflow this flag is set to 00..  Zero Flag (ZF)Zero Flag (ZF) - set to- set to 11 when result iswhen result is zerozero. For none zero result this flag. For none zero result this flag is set tois set to 00..  Sign Flag (SF)Sign Flag (SF) - set to- set to 11 when result iswhen result is negativenegative. When result is. When result is positivepositive itit is set tois 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 awhen there is a signed overflowsigned overflow. For. For example, when you add bytesexample, when you 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 onewhen there is even number of one bits in result, and tobits in result, and to 00 when there is odd number of one bits. Even if resultwhen there is odd number of one bits. Even if result is a word only 8 low bits are analyzed!is a word only 8 low bits are analyzed!  Auxiliary Flag (AF)Auxiliary Flag (AF) - set to- set to 11 when there is anwhen there is an unsigned overflowunsigned overflow for lowfor low nibble (4 bits).nibble (4 bits).  Interrupt enable Flag (IF)Interrupt enable Flag (IF) - when this flag is set to- when this flag is set to 11 CPU reacts toCPU reacts to interrupts from external devices.interrupts from external devices.  Direction Flag (DF)Direction Flag (DF) - this flag is used by some instructions to process data- this flag is used by some instructions to process data chains, when this flag is set tochains, when this flag is set to 00 - the processing is done forward, when- the processing is done forward, when this flag is set tothis flag is set to 11 the processing is done backward.the processing is done backward.
  • 49. 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
  • 50. #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.
  • 51. ORG 100hORG 100h MOV AX, 5MOV AX, 5 ; set AX to 5.; set AX to 5. MOV BX, 2MOV BX, 2 ; set BX to 2.; set BX to 2. JMP calcJMP calc ; go to 'calc'.; go to 'calc'. back: JMP stopback: JMP stop ; go to 'stop'.; go to 'stop'. calc:calc: ADD AX, BXADD AX, BX ; add BX to AX.; add BX to AX. JMP backJMP back ; go 'back'.; go 'back'. stop:stop: RETRET ; return to operating system.; return to operating system. ENDEND ; directive to stop the compiler.; directive to stop the compiler.
  • 52. include emu8086.incinclude emu8086.inc ORG 100hORG 100h MOV AL, 25MOV AL, 25 ; set AL to 25.; set AL to 25. MOV BL, 10MOV BL, 10 ; set BL to 10.; set BL to 10. CMP AL, BLCMP AL, BL ; compare AL - BL.; compare AL - BL. JE equalJE 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 stopJMP 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: RETRET ; gets here no matter what.; gets here no matter what. ENDEND
  • 53. include emu8086.incinclude emu8086.inc ORG 100hORG 100h MOV AL, 25MOV AL, 25 ; set AL to 25.; set AL to 25. MOV BL, 10MOV BL, 10 ; set BL to 10.; set BL to 10. CMP AL, BLCMP AL, BL ; compare AL - BL.; compare AL - BL. JNE not_equalJNE not_equal ; jump if AL <> BL (ZF = 0).; jump if AL <> BL (ZF = 0). JMP equalJMP 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 stopJMP 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: RETRET ; gets here no matter what. END; gets here no matter what. END
  • 54. ORG 100hORG 100h CALL m1CALL m1 MOV AX, 2MOV AX, 2 RETRET ; return to operating system.; return to operating system. m1 PROCm1 PROC MOV BX, 5MOV BX, 5 RETRET ; return to caller.; return to caller. m1 ENDPm1 ENDP ENDEND
  • 55. ORG 100hORG 100h MOV AL, 1MOV AL, 1 MOV BL, 2MOV BL, 2 CALL m2CALL m2 CALL m2CALL m2 CALL m2CALL m2 CALL m2CALL m2 RETRET ; return to operating system.; return to operating system. m2 PROCm2 PROC MUL BLMUL BL ; AX = AL * BL.; AX = AL * BL. RETRET ; return to caller.; return to caller. m2 ENDPm2 ENDP ENDEND
  • 56. ORG 100hORG 100h LEA SI, msg ; load address of msg to SI.LEA SI, msg ; load address of msg to SI. CALL print_meCALL print_me RETRET ; 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 PROCprint_me PROC next_char:next_char: CMP b.[SI], 0CMP b.[SI], 0 ; check for zero to stop; check for zero to stop JE stopJE stop ;; MOV AL, [SI]MOV AL, [SI] ; next get ASCII char.; next get ASCII char. MOV AH, 0EhMOV AH, 0Eh ; teletype function number.; teletype function number. INT 10hINT 10h ; using interrupt to print a char in AL.; using interrupt to print a char in AL. ADD SI, 1ADD SI, 1 ; advance index of string array.; advance index of string array. JMP next_charJMP next_char ; go back, and type another char.; go back, and type another char. stop:stop: RETRET ; return to caller.; return to caller. print_me ENDPprint_me ENDP ; ==========================================================; ========================================================== msg DB 'Hello World!', 0msg DB 'Hello World!', 0 ; null terminated string.; null terminated string. ENDEND