SlideShare a Scribd company logo
1 of 5
Answers to End of Chapter Reviews and Exercises
for Assembly Language for x86 Processors, 7th
Edition
by Kip R. Irvine
Chapters 1 and chapter 2 sample
Revision date: 1/18/2014
Chapter 1
1.7.1 Short Answer Questions
1. Most significant bit (the highest numbered bit).
2. (a) 53 (b) 150 (c) 204
3. (a) 110001010 (b) 110010110 (c) 100100001
4. 00000110
5. (a) 8 (b) 32 (c) 64 (d) 128
6. (a) 12 (b) 16 (c) 16
7. (a) 35DA (b) CEA3 (c) FEDB
8. (a) 0000 0001 0010 0110 1111 1001 1101 0100
(b) 0110 1010 1100 1101 1111 1010 1001 0101
(c) 1111 0110 1001 1011 1101 1100 0010 1010
9. (a) 58 (b) 447 (c) 16534
10. (a) 98 (b) 1203 (c) 671
11. (a) FFE8 (b) FEB5
12. (a) FFEB (b) FFD3
13. (a) 27641 (b) 16093
14. (a) 19666 (b) 32208
15. (a) −75 (b) +42 (c) −16
16. (a) −128 (b) −52 (c) −73
17.(a) 11111011 (b) 11010110 (c) 11110000
18. (a) 10111000 (b) 10011110 (c) 11100110
19. (a) AB2 (b) 1106
20. (a) B82 (b) 1316
21. 42h and 66d
22. 47h and 71d
23. 229
 1, or 6.8056473384187692692674921486353 X 1038
24. 286
 1, or 77371252455336267181195263
25. Truth table:
26. Truth table: (last column is the same as #25)
27. It requires 24
(16) rows.
28. 2 bits, producing the following values: 00, 01, 10, 11
1.7.2Algorithm Workbench
1. Code example (C++)
int toInt32(string s) {
int num = 0;
for(int i = 0; s[i] >= '0' && s[i] <= '1'; i++) {
num = num * 2 + s[i]-'0';
}
return num;
}
2. Code example (C++)
int hexStrToInt32(string s) {
int num = 0;
for(int i = 0; ; i++) {
if( s[i] >= '0' && s[i] <= '9' )
num = num * 16 + s[i]-'0';
else if( s[i] >= 'A' && s[i] <= 'F' )
num = num * 16 + (s[i]-'A'+10);
else
break;
}
return num;
}
3. Code example (C++)
string intToBinStr( int n ) {
vector<int> stack;
do {
int quotient = n / 2;
int remainder = n % 2;
stack.push_back(remainder);
n = quotient;
} while( n > 0 );
string s;
while( stack.size() > 0 ) {
s += (stack.back() + '0');
stack.pop_back();
}
return s;
}
4. Code example (C++)
string intToHexStr( int n ) {
vector<int> stack;
do {
int quotient = n / 16;
int remainder = n % 16;
stack.push_back(remainder);
n = quotient;
} while( n > 0 );
string s;
while( stack.size() > 0 ) {
int d = stack.back();
if( d >= 0 && d <= 9 )
s += (stack.back() + '0');
else // probably a hex digit
s += (stack.back() - 10 + 'A');
stack.pop_back();
}
return s;
}
5. Code example (C++)
string addDigitStrings( string s1, string s2, int base ) {
string sumStr;
int carry = 0;
for(int i = s1.size() - 1; i >= 0; i--) {
int dval = (s1[i] - '0') + (s2[i] - '0') + carry;
carry = 0;
if( dval > (base - 1) ) {
carry = 1;
dval = dval % base;
}
sumStr.insert(sumStr.begin(), (dval + '0'));
}
if( carry == 1 )
sumStr.insert( sumStr.begin(), 1 + '0');
return sumStr;
}
Chapter 2
2.8.1Short Answer Questions
1. EBP
2. Choose 4 from: Carry, Zero, Sign, Direction, Aux Carry,Overflow, Parity.
3. Carry flag
4. Overflow flag
5. True
6. Sign flag
7. Floating-point unit
8. 80 bits
9. True
10. False
11. True
12. False
13. True
14. False
14. False
15. False
16. True
17. False
18. True
19. False
20. False
21. True
22. True
23. False
24. False
25. Hardware,BIOS,and OS
26. It gives them more precise control of hardware,and execution is faster.

More Related Content

What's hot

Programming fundamentals using c++ question paper 2014 tutorialsduniya
Programming fundamentals using c++  question paper 2014   tutorialsduniyaProgramming fundamentals using c++  question paper 2014   tutorialsduniya
Programming fundamentals using c++ question paper 2014 tutorialsduniyaTutorialsDuniya.com
 
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...javan013
 
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1rohit kumar
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in CBUBT
 
Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiPriya Chauhan
 
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesOWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesFrans Rosén
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programmingRodolfo Finochietti
 
Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer OverflowsSumit Kumar
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentationSaad Symbian
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionrohit kumar
 

What's hot (20)

Programming fundamentals using c++ question paper 2014 tutorialsduniya
Programming fundamentals using c++  question paper 2014   tutorialsduniyaProgramming fundamentals using c++  question paper 2014   tutorialsduniya
Programming fundamentals using c++ question paper 2014 tutorialsduniya
 
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...
Concepts of Programming Languages 10th Edition Robert W. Sebesta Solutions Ma...
 
Flappy bird ppt
Flappy bird pptFlappy bird ppt
Flappy bird ppt
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in C
 
Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by Balaguruswami
 
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web TechnologiesOWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
 
C fundamental
C fundamentalC fundamental
C fundamental
 
Email Validation
Email ValidationEmail Validation
Email Validation
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programming
 
Tic Tac Toe
Tic Tac ToeTic Tac Toe
Tic Tac Toe
 
Writing Parsers and Compilers with PLY
Writing Parsers and Compilers with PLYWriting Parsers and Compilers with PLY
Writing Parsers and Compilers with PLY
 
Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer Overflows
 
Control statement in c
Control statement in cControl statement in c
Control statement in c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
User defined function in c
User defined function in cUser defined function in c
User defined function in c
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentation
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solution
 

Similar to Samples solution-manual-assembly-language-for-x86-processors-7th-edition-by-kip-r.-irvine-slp1044

Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 
Number system | Representation and conversion | low level programming
Number system | Representation and conversion | low level programmingNumber system | Representation and conversion | low level programming
Number system | Representation and conversion | low level programmingGajendra Singh
 
FEAL - CSAW CTF 2014 Quals Crypto300
FEAL - CSAW CTF 2014 Quals Crypto300FEAL - CSAW CTF 2014 Quals Crypto300
FEAL - CSAW CTF 2014 Quals Crypto300YOKARO-MON
 

Similar to Samples solution-manual-assembly-language-for-x86-processors-7th-edition-by-kip-r.-irvine-slp1044 (20)

6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
6th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
 
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
4th Semester M Tech: VLSI Design and Embedded System (June-2016) Question Papers
 
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
8th Semester (June; July-2015) Computer Science and Information Science Engin...
8th Semester (June; July-2015) Computer Science and Information Science Engin...8th Semester (June; July-2015) Computer Science and Information Science Engin...
8th Semester (June; July-2015) Computer Science and Information Science Engin...
 
1st Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
1st  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...1st  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
1st Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
 
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
5th Semester Electronic and Communication Engineering (June/July-2015) Questi...
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 
6th Semester (June; July-2015) Computer Science and Information Science Engin...
6th Semester (June; July-2015) Computer Science and Information Science Engin...6th Semester (June; July-2015) Computer Science and Information Science Engin...
6th Semester (June; July-2015) Computer Science and Information Science Engin...
 
6th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
6th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...6th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
6th Semeste Electronics and Communication Engineering (Dec-2015; Jan-2016) Qu...
 
Number system | Representation and conversion | low level programming
Number system | Representation and conversion | low level programmingNumber system | Representation and conversion | low level programming
Number system | Representation and conversion | low level programming
 
3rd Semester CS and IS (2013-June) Question Papers
3rd  Semester CS and IS  (2013-June) Question Papers 3rd  Semester CS and IS  (2013-June) Question Papers
3rd Semester CS and IS (2013-June) Question Papers
 
2013-June: 3rd Semester CSE / ISE Question Papers
2013-June: 3rd  Semester CSE / ISE Question Papers2013-June: 3rd  Semester CSE / ISE Question Papers
2013-June: 3rd Semester CSE / ISE Question Papers
 
6th Semester Electronic and Communication Engineering (2013-June) Question Pa...
6th Semester Electronic and Communication Engineering (2013-June) Question Pa...6th Semester Electronic and Communication Engineering (2013-June) Question Pa...
6th Semester Electronic and Communication Engineering (2013-June) Question Pa...
 
4th Semester (June; July-2014) Electronics and Communication Engineering Ques...
4th Semester (June; July-2014) Electronics and Communication Engineering Ques...4th Semester (June; July-2014) Electronics and Communication Engineering Ques...
4th Semester (June; July-2014) Electronics and Communication Engineering Ques...
 
Python From Scratch (1).pdf
Python From Scratch  (1).pdfPython From Scratch  (1).pdf
Python From Scratch (1).pdf
 
FEAL - CSAW CTF 2014 Quals Crypto300
FEAL - CSAW CTF 2014 Quals Crypto300FEAL - CSAW CTF 2014 Quals Crypto300
FEAL - CSAW CTF 2014 Quals Crypto300
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 
5th Semester (June-2016) Computer Science and Information Science Engineering...
5th Semester (June-2016) Computer Science and Information Science Engineering...5th Semester (June-2016) Computer Science and Information Science Engineering...
5th Semester (June-2016) Computer Science and Information Science Engineering...
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 

Samples solution-manual-assembly-language-for-x86-processors-7th-edition-by-kip-r.-irvine-slp1044

  • 1. Answers to End of Chapter Reviews and Exercises for Assembly Language for x86 Processors, 7th Edition by Kip R. Irvine Chapters 1 and chapter 2 sample Revision date: 1/18/2014 Chapter 1 1.7.1 Short Answer Questions 1. Most significant bit (the highest numbered bit). 2. (a) 53 (b) 150 (c) 204 3. (a) 110001010 (b) 110010110 (c) 100100001 4. 00000110 5. (a) 8 (b) 32 (c) 64 (d) 128 6. (a) 12 (b) 16 (c) 16 7. (a) 35DA (b) CEA3 (c) FEDB 8. (a) 0000 0001 0010 0110 1111 1001 1101 0100 (b) 0110 1010 1100 1101 1111 1010 1001 0101 (c) 1111 0110 1001 1011 1101 1100 0010 1010 9. (a) 58 (b) 447 (c) 16534 10. (a) 98 (b) 1203 (c) 671 11. (a) FFE8 (b) FEB5 12. (a) FFEB (b) FFD3 13. (a) 27641 (b) 16093 14. (a) 19666 (b) 32208 15. (a) −75 (b) +42 (c) −16 16. (a) −128 (b) −52 (c) −73 17.(a) 11111011 (b) 11010110 (c) 11110000 18. (a) 10111000 (b) 10011110 (c) 11100110 19. (a) AB2 (b) 1106 20. (a) B82 (b) 1316 21. 42h and 66d 22. 47h and 71d 23. 229  1, or 6.8056473384187692692674921486353 X 1038
  • 2. 24. 286  1, or 77371252455336267181195263
  • 3. 25. Truth table: 26. Truth table: (last column is the same as #25) 27. It requires 24 (16) rows. 28. 2 bits, producing the following values: 00, 01, 10, 11 1.7.2Algorithm Workbench 1. Code example (C++) int toInt32(string s) { int num = 0; for(int i = 0; s[i] >= '0' && s[i] <= '1'; i++) { num = num * 2 + s[i]-'0'; } return num; } 2. Code example (C++) int hexStrToInt32(string s) { int num = 0; for(int i = 0; ; i++) { if( s[i] >= '0' && s[i] <= '9' ) num = num * 16 + s[i]-'0'; else if( s[i] >= 'A' && s[i] <= 'F' ) num = num * 16 + (s[i]-'A'+10); else break; } return num; } 3. Code example (C++) string intToBinStr( int n ) { vector<int> stack; do { int quotient = n / 2;
  • 4. int remainder = n % 2; stack.push_back(remainder); n = quotient; } while( n > 0 ); string s; while( stack.size() > 0 ) { s += (stack.back() + '0'); stack.pop_back(); } return s; } 4. Code example (C++) string intToHexStr( int n ) { vector<int> stack; do { int quotient = n / 16; int remainder = n % 16; stack.push_back(remainder); n = quotient; } while( n > 0 ); string s; while( stack.size() > 0 ) { int d = stack.back(); if( d >= 0 && d <= 9 ) s += (stack.back() + '0'); else // probably a hex digit s += (stack.back() - 10 + 'A'); stack.pop_back(); } return s; } 5. Code example (C++) string addDigitStrings( string s1, string s2, int base ) { string sumStr; int carry = 0; for(int i = s1.size() - 1; i >= 0; i--) { int dval = (s1[i] - '0') + (s2[i] - '0') + carry; carry = 0; if( dval > (base - 1) ) { carry = 1; dval = dval % base; } sumStr.insert(sumStr.begin(), (dval + '0')); } if( carry == 1 ) sumStr.insert( sumStr.begin(), 1 + '0'); return sumStr; } Chapter 2 2.8.1Short Answer Questions 1. EBP
  • 5. 2. Choose 4 from: Carry, Zero, Sign, Direction, Aux Carry,Overflow, Parity. 3. Carry flag 4. Overflow flag 5. True 6. Sign flag 7. Floating-point unit 8. 80 bits 9. True 10. False 11. True 12. False 13. True 14. False 14. False 15. False 16. True 17. False 18. True 19. False 20. False 21. True 22. True 23. False 24. False 25. Hardware,BIOS,and OS 26. It gives them more precise control of hardware,and execution is faster.