X86 processor based assembly language-Basic Concepts

Source: Internet
Author: User
1.1 welcome to Assembly Language

1. How do schedulers and linkers work together? How does the assembler and linker always work?

An aggreger convert source-code programs from assembly language into machine language. A Linker combines individual files created by an aggreger into a single executable program.

Assembler transfers Assembly LanguageSource codeConvert to machine language. The linker combines the independent files generated by the assembler into an executable file.Program.

2. How Will studying Assembly Language enhance your understanding of operating systems? How does one enhance the understanding of the operating system by learning the assembly language?

Assembly Language is a good tool for learning how application programs communicate with the computer's opeating system via interrupt handlers, system cals, and common memory areas. assembly Language Programming also helps when learning how the operating system loads and executes application programs.

Assembly Language is a good tool that can be used to learn how applications interact with the operating system through interrupt processing programs, system calls, and memory public areas. The assembly language is also helpful when learning how the operating system loads and executes applications.

3. What is meant by a one-to-Define relationship when comparing a high-level language to machine language? What is the one-to-many relationship between advanced languages and machine languages?

In a one-to-Define relationship, a single statement expands into multiple assembly language or machine instructions.

In a one-to-multiple relationship, a single statement can be used as multiple assembly or machine commands.

4. Explain the concept of portability as it applies to programming languages. SolutionProgramming LanguagePortability.

A language whose source programs can compiled and run on wide variety of computer systems is said to be portable.

Source of a languageCodeThis language can be compiled and run on multiple computer systems.

5 is the assembly language for x86 processors the same as those for computer systems such as the VAX or Motorola 68x00? Is x86 assembly language the same as VAX or Motorola 68x00 assembly language?

No. Each assembly language is based on either a processor family or a specific computer.

Different. Each assembly language is based on a series of processors or specific machines.

6. Give an example of an embedded system application. An example of an embedded system application is provided.

Some examples of embedded systems applications are automobile fuel and ignition system, air-conditioning control systems, security systems, flight control system, hand-held computers, modems, printers, and other intelligent computer peripherals.

Such as automotive fuel and ignition systems, air conditioning control systems, security systems, flight control systems, handheld computers, modems, printers, and other smart computer peripherals.

7. What is a device driver? What is a device driver?

Device drives are programs that translate general operating system commands into specific references to hardware details that only the manufacture knows.

A device driver is a program that translates operating system commands into a specific reference of hardware details that only the manufacturer knows.

8. Do you suppose type checking on Pointer variables is stronger (stricter) in assembly language or in C and C ++? Do you think pointer variable check is stricter in assembly languages or in C and C ++?

C ++ does not allow a pointer of one type to be assigned to a pointer of another type. assembly language has no such restriction regarding pointers.

C ++ does not allow one type of pointer to another type. Assembly languages do not have this restriction.

9. Name two types of applications that wocould be better suited to assembly language than a higth-level language. Two relatively advanced languages are provided for applications that are more suitable for assembly language development.

Applications suited to assembly language: Hardware Device Driver and embedded systems and computer games requiring direct hardware access.

Hardware Device Drivers, embedded systems, and computer games requiring direct hardware access.

10. Why wocould a high-level language not be an ideal tool for writing a program that directly accesses a particle brand of printer? Why advanced language is not an ideal tool for directly accessing printer programs of a certain brand.

A high-level language may not provide for direct hardware access. Even if it does, awkward coding techniques must often be used, resulting in possible maintenance problems.

Advanced languages generally do not provide direct hardware access. Even if it is provided, it is necessary to often use some flexible encoding technology, resulting in maintenance problems.

11. Why is assembly language not usually used when writing large applications programs? Why do not I usually write large applications in assembly languages?

Assmbly language has minimal formal structure, so structure must be imposed by programmers who have varying levels of experience. This leads to difficulties maintaining existing code.

Assembly languages have the least formal structure, so these structures need to be implemented by programmers with different experiences. This makes the code difficult to maintain.

12 Translate the following C ++ expression to assembly language, using the example presented earlier int this chapter as guide: x = (y * 4) + 3.

MoV eax, ymov EBX, 4 imul ebxadd eax, 3mov X, eax
 
 
1.2 Virtual Machine Concept

1. In your own words, describe the virtual machine concept. What is a virtual machine?

Computers are constructed in layers, so that each layer represents a Translation Layer from higher-level instruction set to a lower-level instruction set.

The computer is layered, and each layer translates the previous instruction set into the next instruction set.

2. Why don't programmers write application programs in machine language? Why not use machine language to write programs?

It is enormously detailed and consists purely of numbers. Hard for humans to understand.

Machine language is too sensitive to details and consists of only numbers. It is hard to understand.

3. (true/false): When an interpreted program written in language L1 runs, each of its instructions is decoded and executed by a program written in language l0.

True. True.

4. Explain the technique of translation when dealing with different ages at different virtual machine levels. Explain the conversion technology for processing different levels of virtual machine languages.

An entire L1 program is converted into an l0 program by an l0 program specifically designed for this purpose. Then the resulting l0 program is executed directly on the computer hardware.

An L1 program is converted from an l0 program specially designed as a conversion program to an l0 program. The converted program is directly executed by computer hardware.

5. at which level does assembly language appear in the Virtual Machine example shown in this section? In the virtual machine example demonstrated in this section, the Assembly Language is the level.

At level 3. Level 3.

6. What software permits compiled Java programs to run on almost any computer? What software enables Java to run on almost any computer?

Java Virtual Machine (JVM ). Java virtual machine.

7. Name the four Virtual Machine levels named in this section, from lowest to hightest. The four levels of virtual machines in this section are described from low to high.

Digital Logic, instruction set architecture, assembly language, high-level language. Digital Logic, instruction set architecture, assembly language, and advanced language.

8. Machine language is used at which level of the virtual machine show in Figure 1-1? What level does the machine language belong?

Instruction Set architecture. Instruction Set architecture.

9. Statements at the assembly language level of a virtual machine are translated into statements at which other level? Which of the following statements can be translated into assembly language statements?

Instruction Set architecture. Instruction Set architecture.

1.3 Data Representation

1. Explain the term least significant bit (LSB ).

The bit on the left. The leftmost bit.

2. Explain the term most significant bit (LSB ).

The bit on the right. The rightmost bit, the highest bit.

3. What is the decimal representation of each of the following Unsigned binary integers?
A. 11111000 248
B. 11001010 202
C. 11110000 240

4. What is the decimal representation of each of the following Unsigned binary ingegers?
A. 00110101 53
B. 10010110 150
C. 11001100 204

5. What is the sum of each pair of binary integers?
A.m. 00001111 + 00000010 00010001
B. 11010101 + 01101011 101000000
C. 00001111 + 00001111 00011110

6. What is the sum of each pair of binary integers?
A.m. 10101111 + 11011011 110001010
B. 10010111 + 11111111 110010110
C. 01110101 + 10101100 10010001

7. How many bytes are contained in each of the following data types?
A. Word 2
B. doubleword 4
C. quadword 8

8. How many bits are contained in each of the following data types?
A. Word 16
B. doubleword 32
C. quadword 64

9. What is the minimum number of binary bits needed to represent each of the following unsigned decimal integers?
A. 65 7
B. 256 9
C. 32768 16

10. What is the minimum number of binary bits needed to represent each of the following unsigned decimal integers?
A. 4095 12
B. 65534 16
C. 2134657 22

11. What is the hexadecimal representation of each of the following binary numbers?
A. 1100 1111 0101 0111 cf57
B. 0101 1100 1010 1101 5cad
C. 1001 0011 1110 1011 93eb

12. What is the hexadecimal representation of each of the following binary numbers?
A. 0011 0101 1101 1010 35da
B. 1100 1110 1010 0011 cea3
C. 1111 1110 1101 fedb

13. What is the binary representation of the following hexadecimal numbers?
A. e5b6aed7
B. b697c7a1
C. 234b6d92

14. What is the binary representation of the following hexadecimal numbers?
A. 0126f9d4
B. 6acdfa95
C. f69bdc2a

15. What is the unsigned decimal representation of each hexadecimal integer?
A. 3A 58
B. 1bf 447
C. 4096 16534
16. What is the unsigned decimal representation of each hexadecimal integer?
A. 62 98
B. 1c9 457
C. 6a5b 27227

17. What is the 16-bit hexadecimal representation of each signed decimal integer?
A.-26 ffe6
B.-452 Fe3C
18. What is the 16-bit hexadecimal representation of each signed decimal integer?
A.-32 ffe0
B.-62 ffc2
19. The following 16-bit hexadecimal numbers represent signed integers. Convert to decimal.

A. 7cab 31915
B. c123-16093

20. The following 16-bit hexadecimal numbers represent signed integers. Convert to decimal.
A. 7f9b 32667
B. 8230-32208
21. What is the decimal representation of the following signed binary numbers?
A.m. 10110101-75
B. 00101010 42
C. 11110000-16

22. What is the decimal representation of the following signed binary numbers?
A.m. 10000000-128
B. 11001100-52
C. 10110111-73
23. What is the 8-bit binary (two's-complement) representation of each of the following signed decimal integers?
A.-5 11111011
B.-36 11011100
C.-16 11110000
24. What is the 8-bit binary (two's-complement) representation of each of the following signed decimal integers?
A.-72 10111000
B.-98 10011110.
C.-26 11100110
25. What are the hexadecimal and decimal representations of the ASCII character capital X?

58 h and 88D

26. What are the hexadecimal and decimal representations of the ASCII character Capital M?

4dh and 77D

27. Why was Unicode partitioned Ted?

To handle international character sets that require more than 256 codes.

To process more than 256 encoded international character sets.

28. What is the largest value you can represent using a 256-bit unsigned integer?

2256-1

29. What is the largest positive value you can represent using a 256-bit signed integer?

2255-1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.