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

Class2