0% found this document useful (0 votes)
57 views

Intel MP Architecture & Assembly Programming

Here are the solutions to the assignment problems: 1. If we had 20,00010 memory address lines, the last address line needed to describe an item in hex 2 bytes wide would be FFFF16. With 20,00010 address lines, the maximum addressable memory locations would be 1,048,576 (220). Since each memory location is 2 bytes wide, the highest address would be FFFF16. 2. Referring to the figure shown, if we POP data item #2 (two bytes) from the stack, the stack pointer (SP) will increment. The hex value that will appear in the SP is 0012. When data is popped (removed) from the stack, the stack pointer increments to

Uploaded by

Daisuke SS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Intel MP Architecture & Assembly Programming

Here are the solutions to the assignment problems: 1. If we had 20,00010 memory address lines, the last address line needed to describe an item in hex 2 bytes wide would be FFFF16. With 20,00010 address lines, the maximum addressable memory locations would be 1,048,576 (220). Since each memory location is 2 bytes wide, the highest address would be FFFF16. 2. Referring to the figure shown, if we POP data item #2 (two bytes) from the stack, the stack pointer (SP) will increment. The hex value that will appear in the SP is 0012. When data is popped (removed) from the stack, the stack pointer increments to

Uploaded by

Daisuke SS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Microprocessor/Microcontroller Systems

Introduction Intel MP Architecture &


Module 4
Assembly Language

At the end of this module, you are expected to:

1. Describe the internal registers and flags of an x86 MPU.


2. Draw the programming model of the Intel 80x86 MPU.
3. Categorize some assembly codes.

Intel MP Architecture

Shown above is the simplified block diagram of any microprocessor, including the Intel 80x68
family of processors. You noticed that memory (random accessed memory or RAM) is needed so
that there would be a place for data and instructions to be stored. Data and programs which can
be lost after power is removed are stored in RAM. Data and instructions (or specifically, program
or in general software) which must never be lost, even after the power is turned off, are stored in
ROM (read only memory). Remember that ROM is a type of memory which cannot have its
contents changed once the ROM chip is manufactured. PROM (programmable ROM) and
EPROM (erasable-programmable ROM) are used in much the same way as ROM but can be
reprogrammed after manufactured but require special equipment to program them.

Microprocessor Programming

Microprocessors work with an instruction set that allows it to function. Although the instruction
set within the processor is binary, programmers work with English-like commands, which are
divided into seven groups. These are:

College of Engineering – URS Morong Campus 1/16


Microprocessor/Microcontroller Systems

MP Basic Operations

Microprocessors execute programs by repeatedly cycling through three basic steps:

Fetch

Decode

Execute

 Program (instructions) and Data are stored in Memory


 Each instruction is read (fetched) from memory, interpreted (decoded), and executed
o Arithmetic Logic Unit (ALU) performs operations on data
o Data is transferred (register, memory, I/O)
 Program Counter (PC) indicates current location of program in Memory and is automatically
incremented after each instruction
 Each instruction can take several clock cycles

College of Engineering – URS Morong Campus 2/16


Microprocessor/Microcontroller Systems

Addressing

• Since there are many memory locations (or, addresses), it is necessary to have a means of
referring to specific locations.
• This is done through addressing. Typically, RAM addresses are numbered 0000H (in hex)
to the highest addressable memory.
• For example, using 12 binary digits, how many unique memory locations would be possible?

212 = 4096 unique addresses from


0000 0000 0000 up to 1111 1111 1111 or
0 0 0 hex F F F

College of Engineering – URS Morong Campus 3/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 4/16


Microprocessor/Microcontroller Systems

• Accumulator: one of the most often used parts of a μP is the accumulator – a register which
often has its contents altered in some way.
• For example, we can add the contents of the accumulator to the contents of a RAM address.
Usually, the result of an operation is also placed in the accumulator.
• Width of Registers: maximum size of bits is generally, 8, 16, 32, or 64
• General-Purpose Registers: are similar to the accumulator, and are temporary storage
locations. They differ from accumulator in that operations involving two pieces of data are
usually not performed in them with the result going back into the register itself, as the case of
the accumulator.
• Program Counter (PC) or Instruction Pointer (IP): considering the fact that there can be
millions of RAM locations, it’s obvious that the μP must keep track of the location from which
it will be getting its next instruction. This is the job of the PC or IP.
• Status Register: sometimes called condition code register, or flag register, is a special register
which keeps track of certain facts about the outcome of arithmetic, logical, & other operations.
This register makes it possible for the μP to be able to test for certain conditions, & then to
perform alternate functions based on those conditions. This is done through the use of flags.
• Stack Pointer: the structure of a stack is a first-in-last-out (FILO), where unlike main memory,
where you can access data item in any order. The stack is designed so that you can only
access (through stack pointer) the top of the stock. We can push an item (save operation)
onto the stack so that we can later pop them (retrieve operation)

College of Engineering – URS Morong Campus 5/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 6/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 7/16


Microprocessor/Microcontroller Systems

Categories of Some Assembly Codes

College of Engineering – URS Morong Campus 8/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 9/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 10/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 11/16


Microprocessor/Microcontroller Systems

College of Engineering – URS Morong Campus 12/16


Microprocessor/Microcontroller Systems

SELF-ASSESSMENT QUESTIONNAIRE (SAQ) #4

A. Multiple Choice. DIRECTIONS: Write the letter(s) of your best answer.

1. An example of software that resides in ROM (firmware) is


a. assembly language
b. application software
c. the BIOS
d. all of the above
2. Information given to an assembler such as where to begin executing instructions is provided
by
a. the BIOS
b. system programs
c. executable instructions
d. assembler directives
3. The part of a microprocessor that fetches the next instruction from memory is called the
a. ALU
b. BIU
c. EU
d. bus controller
4. The part of a microprocessor that translates the programming instruction into an address where
microcode resides is the
a. ALU
b. instruction decoder
c. register array
d. control unit
5. The figure illustrates the segment/offset method of addressing used in Intel processors. The
advantage of this method is
a. code can be easily relocated
b. a smaller address bus can be used
c. addresses can be “pipelined”
d. the clock speed can be increased

6. In a computer, the address bus is a


a. one-way bus from the CPU
b. one-way bus to the CPU
c. two-way bus between the CPU and memory
d. two-way bus between the CPU and ports

College of Engineering – URS Morong Campus 13/16


Microprocessor/Microcontroller Systems

7. An advantage to assembly language is that it is


a. fast and efficient
b. easier to write programs
c. can be used on any processor
d. all of the above
8. The IEEE 488 bus standard
a. is a serial bus with 2 types of devices
b. is a parallel bus with 2 types of devices
c. is a serial bus with 3 types of devices
d. is a parallel bus with 3 types of devices
9. The CPU is not involved in
a. arithmetic instructions
b. loop instructions
c. software interrupts
d. direct memory access
10. For the circuit shown, the output will be
a. LOW
b. HIGH
c. high impedance
d. not enough information to tell

B. Identification. DIRECTIONS: Draw the following with complete labels

1. Describe how the 8088/8086 accumulator is labeled.


2. How many 8-bit general-purpose registers does 8088 have?
3. In the 8088 what has the same function as the program counter in 8-bit μPs?
4. In simplest terms, what are general-purpose registers?
5. A register which helps μPs to work with tables of data?
6. When a flag register is . . . . . . this indicates that the condition which the flag tests has not
come true.
7. When a flag register is . . . . . . this indicates that the condition which the flag tests has come
true.

College of Engineering – URS Morong Campus 14/16


Microprocessor/Microcontroller Systems

ASSIGNMENT 4

INSTRUCTIONS: Answer the following problem and submit in the complete solution.

1. If we had 20,00010 memory address lines, what would be the last address line needed to
describe an item in hex 2 bytes wide?
2. Refer to Figure shown. If we POP data item #2 (two-bytes) from the stack, will the stack
pointer (SP) increment or decrement? What hex value will appear in the SP?
3. Refer to the same Figure, if we PUSH three data items onto the stack 1-byte each, will the
SP increment or decrement? What hex value will appear in the SP?

ANSWERS TO SAQ #4

A. Multiple Choice
1. C 6. A
2. D 7. A
3. B 8. D
4. B 9. D
5. A 10. C

B. Identification

1. It is named EAX as a 32-bit wide extended accumulator, or named AX & is 16 bits wide with
an 8-bit upper half (called AH) and an 8-bit lower-half (called AL).
2. There are eight 8-bit general-purpose registers: AH, AL, BH, BL, CH, CL, DH, & DL
3. The IP (Instruction Pointer)
4. Temporary locations which can store a byte or a word of data similar to RAM but which are
inside the μP.
5. Index register
6. 0 (LOW) or CLEAR/Disabled
7. 1 (HIGH) or SET/Enabled

College of Engineering – URS Morong Campus 15/16


Microprocessor/Microcontroller Systems

REFERENCES

PDF:

Fernando, F.M., Unpublished Lesson Materials on Microprocessor, 2012.

Books:

Brey, Barrey B.,Intel Microprocessors, 8/E, Prentice Hall, 2009.

Malvino, Albert P., Brown Jerald A., Digital Computer Electronics (3rd Ed.). Prentice Hall Int’l. Inc.

Ramesh S. Gaonkar, Fundamentals of Microcontrollers and Applications in Embedded Systems,


McGraw Hill, 2010.

College of Engineering – URS Morong Campus 16/16

You might also like