5.1.5 · D1 · Hardware › Instruction Set Architecture (ISA) › x86 architecture overview
Intuition Is poore topic ke peeche ek hi idea hai
Computer ka brain sirf on/off switches ke patterns samajhta hai — bits. x86 ek khaas language hai jo un bits ko commands mein badalta hai ("in do numbers ko add karo", "yeh wahan copy karo"), ek aisi language jo 40 saalon se bade ho rahi hai aur kabhi koi purana word nahi bhulaai. Parent page par sab kuch — registers, hex numbers, addresses, instruction bytes — bas in switches ke groups ko naam dene ka tarika hai, isliye parent page padhne se pehle hume har naam ka matlab aur uska picture samajhna hoga.
Is page mein assume kiya gaya hai ki tumhe kuch nahi aata siwaay ginaai ke. Hum har wo symbol build karenge jo parent x86 overview use karta hai, ek ek brick karke.
Ek bit ek switch hai jo ya to 0 (off) hai ya 1 (on). Yeh sabse chhoti amount of information hai jo ek computer hold kar sakta hai.
Socho ek light switch wall par. Uske exactly do states hain. Wahi ek bit hai. Is poore subject mein baaki sab kuch sirf in switches ki bahut saari lines hain ek row mein.
Intuition Yahan se kyun shuru karein?
Parent jo bhi baat karta hai — har register, har address, har instruction — woh sab literally inhi switches ki ek row hai. Agar tum switches picture kar sako, tum x86 ka poora picture kar sakte ho. Kuch bhi isse zyada fundamental nahi hai.
Jab hum kehte hain ek register "16-bit" ya "64-bit" hai, to matlab hai row kitni switches lambi hai . Wider = woh bade numbers aur zyada distinct patterns hold kar sakta hai.
Figure s01 dobara dekho: 8 switches side by side milke ek byte banate hain. Parent ka phrase "8086 was 16-bit" ka matlab sirf yeh hai ki uski main storage rows 16 switches lambi thi (2 bytes). "64-bit" matlab 64 switches lambi (8 bytes).
width n
patterns 2 n
sabse bada value
8 (byte)
256
255
16
65 536
65 535
20
1 048 576 (1 MB)
1 048 575
32
~4.3 billion
~4.3 billion − 1
64
~1.8 × 1 0 19
bahut bada
Intuition 20 bits kyun matter karenge
Notice karo 2 20 = 1 048 576 = 1 MB . Jab parent kehta hai 8086 "20-bit / 1 MB address space chahta tha", woh ek switch-row 20 lambi maang raha hai. Yeh row-length idea dhyan mein rakho; poori segmentation story is baare mein hai ki woh 16-lambi row mein fit nahi hoti.
Intuition Hum bits directly kyun nahi likhte
1122334455667788 ko 64 individual 0s aur 1s ki tarah likhna 64 characters ka eye-strain hai. Insaanon ko switches ke ek group ko naam dene ka chhota tarika chahiye. Woh shortcut hai hexadecimal .
Definition Hexadecimal (hex)
Numbers likhne ka ek tarika 16 digits use karke: 0 1 2 3 4 5 6 7 8 9 A B C D E F, jahan A=10, B=11, … F=15. Hum ise prefix 0x se flag karte hain. To 0x1F matlab "hex number 1F", na ki decimal 1 ke baad F.
0x1000 ko switches ki tarah padhna
0x1000 mein 4 hex digits hain = 4 × 4 = 16 bits. Digit 1 hai 0001, har 0 hai 0000:
0x1000 = 1 0001 0 0000 0 0000 0 0000
Plain decimal mein woh switch pattern 4096 ke barabar hai. Yeh ek hi number hai teen tareekon se naam diya gaya — hex, bits, decimal.
Intuition Hume "shift" ki zaroorat kyun hai
Parent ka headline formula ek segment ko "×16" multiply karta hai. Hume dekhna hai ki yeh real multiplication nahi hai — yeh switches ko slide karna hai. Yeh samajhna "×16 expensive hai" wali myth ko poori tarah hata deta hai.
≪ k
Notation x ≪ k ka matlab hai "switches ki row x lo aur har switch ko k jagahon left slide karo, khali hue right-hand slots mein 0s fill karo." Symbol ≪ literally dikhta hai jaise baayein point karte arrows.
0 x 1000 ≪ 4
0001 0000 0000 0000 ko 4 left slide karo aur ek zero digit se pad karo to milta hai 0x10000 (ek 20-bit row). Humne bas ek 16-bit number ko 20-bit number ke top mein badal diya — exactly wahi segmentation trick, pure sliding ke roop mein dekha gaya.
Ek register ek fixed switch-row hai jo CPU chip ke andar hi rehti hai, address ki jagah ek naam ke saath (jaise RAX). Kyunki yeh chip par hai, maths unit ise kisi bhi cheez se zyada fast read aur write karta hai.
Socho ek labelled box jo 64 switches hold karta hai. Parent ki poori table (RAX/EAX/AX/AL) ek aisi box describe kar rahi hai jise tum alag window-sizes se dekh sakte ho:
AL = sabse neeche wale 8 switches,
AX = sabse neeche wale 16 ,
EAX = sabse neeche wale 32 ,
RAX = sab 64 .
Intuition Nesting = fossil record
AL ki jagah RAX padhne par koi data move nahi hota — tum bas ussi row par ek chhoti window se dekh rahe ho. Har bada naam baad ki x86 generation mein box ko wide karke add kiya gaya, isliye woh nest karte hain. Yahi parent ka "ek register, chaar naam" wala picture hai. Zyada detail ke liye dekho Registers and the Register File .
Definition Memory address
Main memory numbered byte-boxes ki ek lambi line hai. Ek address bas ek box ka number hai — "box #4096 par jao".
Definition Segment aur Offset
Offset = tum chune hue region ke andar kitni door ho (8086 par ek 16-bit row).
Segment = tumne kaun sa region start kiya (woh bhi 16-bit).
8086 ne yeh do 16-bit rows combine ki taaki ek 20-bit address tak pahunch sake jo woh otherwise naam nahi de sakta tha — yeh topic hai Memory Addressing Modes aur parent ka segmentation section.
Ab parent ke key formula ka har symbol define ho gaya hai:
PhysAddr = ( Segment ≪ 4 ) + Offset
Ise padhо: segment-row ko 4 jagah left slide karo (×16), phir offset-row add karo. Dono pieces 16 switches hain; shift ek ko 20-switch address ke top mein fit karne ke liye uthata hai. Ab yahan kuch mysterious nahi hai.
Ek instruction CPU ke liye ek command hai, memory mein kuch bytes ki ek chhoti run ke roop mein stored.
Opcode woh byte(s) hain jo kehte hain kya karna hai — verb, jaise "ADD" ya "MOV" (move/copy). Baaki bytes (prefixes, operands, constants) kehte hain kise .
Intuition x86 instructions length mein kyun vary karte hain
Kyunki ek command apne constants ko khud ke andar include karta hai, ek bada constant instruction ko lamba banata hai. To instructions 1 se lekar 15 bytes tak hote hain. Variable length ki ek row fixed length ki row se kaatna mushkil hai — wahi difference poora RISC vs CISC argument hai, aur yeh Fetch-Decode-Execute Cycle aur Micro-operations (µops) ko feed karta hai jo parent mention karta hai. Ab tumhare paas woh sections padhne ke liye har zaruri word hai.
Left shift = times 2 to the k
Instruction and Opcode bytes
x86 architecture overview
Har foundation parent x86 overview mein flow karta hai; wahan koi bhi cheez aisa brick use nahi karti jo humne yahan nahi rakhi. Inhe master karne ke baad ARM Architecture se compare karo.
Right side cover karo aur khud ko test karo. Agar koi line surprise kare, to uska section dobara padho.
Bit kya hai? Ek switch jo ya to 0 (off) hai ya 1 (on).
Ek byte mein kitne bits hote hain? 8 bits.
n bits mein kitne distinct patterns fit hote hain?2 n .
Hardware ko 1 MB ke liye 20-bit address kyun chahiye? Kyunki 2 20 = 1 048 576 = 1 MB , isliye 20 switches har byte ko naam de sakte hain.
Ek hex digit kitne bits represent karta hai? 4 bits (ek nibble), kyunki 2 4 = 16 .
0 x 1000 ko decimal number mein likho.4096 .
x ≪ 4 kya karta hai, aur yeh kiske barabar hai?Switches ko 4 jagah left slide karta hai; x × 16 ke barabar hai.
Kya "Segment × 16" ek runtime multiply hai? Nahi — yeh 4 bits ka ek left shift hai, wiring se hota hai, essentially free.
Register kya hai? CPU ke andar ek named switch-row, sabse fast storage jo maths unit reach kar sakta hai.
RAX ke comparison mein AL kya hai?Usi 64-bit register par sabse neeche ke 8 bits (ek chhoti window).
Opcode kya hai? Woh byte(s) jo kehte hain ek instruction kya karta hai — uska verb.
x86 instructions 1 se 15 bytes tak kyun vary karte hain? Kyunki constants instruction ke andar stored hote hain, isliye bade constants ise lamba banate hain.