SlideShare a Scribd company logo
IBM PC Assembly Language and Programming by Peter AbelChapter 1: Basic Feature of PC hardwareMohammed Nazimuddin(나짐) Email:nazim@eslab.inha.ac.kr1210 Hi-tech centre.
Hardware FeaturesInternal HardwareProcessorMemoryRegisterExternal hardwareKeyboardMonitorDiskCD-ROM
Bits and BytesBits The fundamental building block of computer storage is Bit.A bit may beOff  0On  1
BytesA group of nine related bitsThe eight data bits provide the basis for binary arithmetic and characters256(28) – (00000000 ~ 11111111)One Bit parity.Rules of ParityMust be odd in each byte00001010  00001010(1)Represents a storage Location
Related BytesWord2-Byte(16-bit)Double Word4-Byte(32-bit)Quadword8-Byte(64-bit)Paragraph16-byte(128)Kilobyte(KB)Megabyte(MB)
Number systemBinaryBase 2 (0,1)Binary to Decimal01000001Bits are numbered from the right to left.b8b7b6b5b4b3b2b1b0Subscripts represent the place value, e.g. b6 has place value 26Conversion to decimal is done by evaluating the polynomialb8*28+ b7*27  + b6*26 + b5*25 +b4*24 +b3*23 +b2*22 +b1*21 + b0*20
In this case, 0+64+0+0+0+0+0+1 = 65DecimalBase 10( 0 to 9)Decimal to BinaryDivided by 2 Stop when 0Concatenate the Remainder is reverse orderExample65           100000165 / 2 = 32 r 132 / 2 = 16 r 016 / 2 = 8 r 08 / 2 = 4 r 04 / 2 = 2 r 02 / 2 = 1 r 01 / 2 = 0 r 1
HEXADECIMALBase 16(0 to 9, A..F)Hex to Binary
Expand each hex digit to the equivalent 4-bit binary form
You may omit leading zeros of leftmost digit
37h = 0011 0111b
(or 110111b)
Binary to Hex
Group bits by fours (starting with least significant bits)
Add leading zeros as necessary to complete the last group
Convert each group to the equivalent hex digit
0100 1110b = 4EhCharacter DataAmerican Standard Code for Information Interchange (ASCII)A 7-bit binary code for a set of 128 charactersUsually occupy a byte of storageLeading bit may be ignored or used differently by various programsA sequence of bytes containing ASCII codes is referred to as an ASCII string
Numeric DataBinary storagetwo’s complement, one’s complement, sign and magnitude, or biased representationsASCII storagesequence of ASCII bytes representing the digits of the number expressed in some radixBinary Coded Decimalsequence of nybbles representing digits 0-9 of the number
Binary StorageA pre-arranged storage size is usedtypically byte, word, doubleword, or quadwordRepresent a number in base two and encode the bits197d is 11000101bat least 8 bits will be required to store this number (leading zeros are added if necessary to fill additional bits for larger storage sizes)
Signed vs Unsigned CodesSigned Byte
two’s complement code is most common
only 7 bits are used for the magnitude
Minimum -128 is coded as 10000000b
Maximum +127 is coded as 01111111b
Zero is 00000000b
Unsigned Byte
all 8 bits used to represent the magnitude of the number

More Related Content

PPT
Data Representation
PPTX
Data representation
PPTX
Data representation in computers
PPT
Chapter 2 Part2 A
PPTX
Data representation
PDF
Computer data representation (integers, floating-point numbers, text, images,...
PPT
[1] Data Representation
PPTX
Data representation
Data Representation
Data representation
Data representation in computers
Chapter 2 Part2 A
Data representation
Computer data representation (integers, floating-point numbers, text, images,...
[1] Data Representation
Data representation

What's hot (20)

PPTX
Data representation
PPT
Computer organiztion2
PPTX
How computers represent data
PDF
Data representation
PDF
Chapter 03 number system
PDF
Vhdl introduction
PPT
Meghna ppt.
PPT
Computer Systems Data Representation
PPT
Topic 1 Data Representation
PPT
C:\Fakepath\Chapter 2 Part2 B
PPTX
Data representation
PPT
Data representation
PDF
Data representation
PPTX
Introduction to Software Engineering: Lecture 1 introduction i
PPT
Logic design and switching theory
DOC
Digital Comprator
PPT
Lecture 01
PDF
Data representation in computers
PPTX
Number system
PPT
Data representation moris mano ch 03
Data representation
Computer organiztion2
How computers represent data
Data representation
Chapter 03 number system
Vhdl introduction
Meghna ppt.
Computer Systems Data Representation
Topic 1 Data Representation
C:\Fakepath\Chapter 2 Part2 B
Data representation
Data representation
Data representation
Introduction to Software Engineering: Lecture 1 introduction i
Logic design and switching theory
Digital Comprator
Lecture 01
Data representation in computers
Number system
Data representation moris mano ch 03
Ad

Viewers also liked (8)

PPS
Logo dizajn za salon Alhemija by totaldizajn
PPT
Typek flying local flag
KEY
J.C. Jones quotes
PPT
Инфо настани за новиот Закон за здруженија и фондации
PDF
dobry dizajn
PDF
Salesguru.Pl na Bootstrapie
PPT
Bosc Intro 20090627
KEY
MiMo09
Logo dizajn za salon Alhemija by totaldizajn
Typek flying local flag
J.C. Jones quotes
Инфо настани за новиот Закон за здруженија и фондации
dobry dizajn
Salesguru.Pl na Bootstrapie
Bosc Intro 20090627
MiMo09
Ad

Similar to Class2 (20)

PDF
Introduction to Microprocessor lecture 01
PPTX
6_2018_11_23!09_24_56_PM (1).pptx
PPTX
Intro to assembly language
PPTX
Assembly programming 8085/8086 microprocessors
PPSX
Coa presentation1
PPTX
Introduction to debugging linux applications
PDF
COMPUTER ORGANIZATION NOTES Unit 2
PPT
Material com Conceitos de Assembler Mainframe
PPT
10 instruction sets characteristics
DOCX
Chapter 1SyllabusCatalog Description Computer structu
PPTX
Introduction to Computer System. 8085/8086 architecture
PPTX
Introduction to computer hardware
PPT
microprocessor
PPT
microprocessors
DOCX
Bits and bytes
PDF
8051 Architecture, blocks and salient features
PPTX
Chapter # 1 Intro to 80868088 uProcessor.pptx
PPT
Instruction set of 8086
PDF
Basic arithmetic, instruction execution and program
PPTX
Unit-1-Introduction.pptx computer organization and architecture
Introduction to Microprocessor lecture 01
6_2018_11_23!09_24_56_PM (1).pptx
Intro to assembly language
Assembly programming 8085/8086 microprocessors
Coa presentation1
Introduction to debugging linux applications
COMPUTER ORGANIZATION NOTES Unit 2
Material com Conceitos de Assembler Mainframe
10 instruction sets characteristics
Chapter 1SyllabusCatalog Description Computer structu
Introduction to Computer System. 8085/8086 architecture
Introduction to computer hardware
microprocessor
microprocessors
Bits and bytes
8051 Architecture, blocks and salient features
Chapter # 1 Intro to 80868088 uProcessor.pptx
Instruction set of 8086
Basic arithmetic, instruction execution and program
Unit-1-Introduction.pptx computer organization and architecture

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Approach and Philosophy of On baking technology

Class2

  • 1. IBM PC Assembly Language and Programming by Peter AbelChapter 1: Basic Feature of PC hardwareMohammed Nazimuddin(나짐) Email:nazim@eslab.inha.ac.kr1210 Hi-tech centre.
  • 3. Bits and BytesBits The fundamental building block of computer storage is Bit.A bit may beOff  0On  1
  • 4. BytesA group of nine related bitsThe eight data bits provide the basis for binary arithmetic and characters256(28) – (00000000 ~ 11111111)One Bit parity.Rules of ParityMust be odd in each byte00001010  00001010(1)Represents a storage Location
  • 6. Number systemBinaryBase 2 (0,1)Binary to Decimal01000001Bits are numbered from the right to left.b8b7b6b5b4b3b2b1b0Subscripts represent the place value, e.g. b6 has place value 26Conversion to decimal is done by evaluating the polynomialb8*28+ b7*27 + b6*26 + b5*25 +b4*24 +b3*23 +b2*22 +b1*21 + b0*20
  • 7. In this case, 0+64+0+0+0+0+0+1 = 65DecimalBase 10( 0 to 9)Decimal to BinaryDivided by 2 Stop when 0Concatenate the Remainder is reverse orderExample65 100000165 / 2 = 32 r 132 / 2 = 16 r 016 / 2 = 8 r 08 / 2 = 4 r 04 / 2 = 2 r 02 / 2 = 1 r 01 / 2 = 0 r 1
  • 8. HEXADECIMALBase 16(0 to 9, A..F)Hex to Binary
  • 9. Expand each hex digit to the equivalent 4-bit binary form
  • 10. You may omit leading zeros of leftmost digit
  • 11. 37h = 0011 0111b
  • 14. Group bits by fours (starting with least significant bits)
  • 15. Add leading zeros as necessary to complete the last group
  • 16. Convert each group to the equivalent hex digit
  • 17. 0100 1110b = 4EhCharacter DataAmerican Standard Code for Information Interchange (ASCII)A 7-bit binary code for a set of 128 charactersUsually occupy a byte of storageLeading bit may be ignored or used differently by various programsA sequence of bytes containing ASCII codes is referred to as an ASCII string
  • 18. Numeric DataBinary storagetwo’s complement, one’s complement, sign and magnitude, or biased representationsASCII storagesequence of ASCII bytes representing the digits of the number expressed in some radixBinary Coded Decimalsequence of nybbles representing digits 0-9 of the number
  • 19. Binary StorageA pre-arranged storage size is usedtypically byte, word, doubleword, or quadwordRepresent a number in base two and encode the bits197d is 11000101bat least 8 bits will be required to store this number (leading zeros are added if necessary to fill additional bits for larger storage sizes)
  • 20. Signed vs Unsigned CodesSigned Byte
  • 21. two’s complement code is most common
  • 22. only 7 bits are used for the magnitude
  • 23. Minimum -128 is coded as 10000000b
  • 24. Maximum +127 is coded as 01111111b
  • 27. all 8 bits used to represent the magnitude of the number
  • 28. Minimum 0 (zero) is coded as 00000000b
  • 29. Maximum 255 is coded as 11111111bStorage Sizes and RangesUnsigned IntegerByte
  • 31. Word
  • 36. 0 to 18,446,744,073,709,551,615Signed (2’s Complement Code)Byte
  • 38. Word
  • 43. -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807Binary ArithmeticAdditionNumbers can be added in any number base
  • 44. Use the same algorithm you practiced in second grade!
  • 45. Binary Example: c ccc 10101+ 11111001000+0 = 00+1 = 11+0 = 11+1 = 101+1+1 = 11
  • 46. Negative Binary NumberA negative binary value is expressed in Two’s complement notation. Two’s complementReverse the bitAdd 1Example: +65 Reverse bits Add 1 Number -65 0100000110111110 110111111
  • 47. Subtraction How to Subtract 42 from 65 ? 65 : +(-43) : = 22
  • 48. PC ComponentsSystem BoardProcessor, main memory, connectors, hard disk, etc… BusA bus with wires attached to the system board connects the components.Processor8088,8086,80286….PentiumExecution and Bus control unit
  • 49. Execution and Bus control UnitEU: Execution UnitBIU: Bus interface UnitProgram controlInstruction Queue..
  • 50. Intel 8086 OrganizationRegisters - storage locations found inside the processor for temporary storage of dataData Registers (16-bit)AX, BX, CX, DXAddress Registers (16-bit)Segment registers: CS, SS, DS, ESPointer registers: SP, BP, IPIndex registers: SI, DIStatus (Flags) register (16-bit)
  • 51. Data RegistersThe data registers may be used for general purposes, however each has special usesAX : AccumulatorBX : BaseCX : CountDX : DataEach byte of the 4 data registers can be accessed independentlyAH, AL, BH, etc.These are referred to as 8-bit registers, but remember they are part of an existing register
  • 52. Memory8086 - 1 megabyte of memory (220 bytes)Each byte is accessed by specifying an address (00000h through FFFFFh)20-bit addresses must be formed from 16-bits of information
  • 53. Interrupt VectorsBIOS and DOS DataDOSApplication Program AreaVideoReservedBIOS
  • 54. Segment Registers20-bit addresses are obtained by combining two 16-bit registers, segment:offsetAddress = segment*16(10h)+offsetExample CS: 010C IP: 14D2Address = 010C*10+14D2 = 010C0+14D2 Address = 02592Each segment is 64K, segments can start at any paragraph boundary
  • 55. Program SegmentsDuring program execution, the segment registers are only changed if memory not currently accessible in an active segment must be accessedProgram bytes are arranged into distinct segments for convenienceCS -> segment containing machine instructionsSS -> segment containing storage for the stackDS -> segment containing data values and storageES -> segment for additional data or special memory operationsProgrammers must be aware of this organization
  • 56. Instruction and Stack PointersIP contains the address of the next instruction to be executedIP specifies an offset into the CS segmentIP is not the operand of any instructionSP points to the top item on the stackSP is an offset into the SS segmentSP can be used as an operand in some instructions
  • 57. BP and Index RegistersBP is a Base PointerSpecifies an offset into any segment, but most commonly the Stack segmentSI and DI are called Index registersThey normally specify an offset into the Data segment, although they can be used as offsets into any segmentSometimes they hold a number to be added to the address of an array (index)
  • 58. FlagsIndividual bits are used to store the status of the microprocessorBits are set or cleared as the result of many operationsBits may be affected indirectly (by the execution of an instruction) or directly by an instruction designed to access the status word.