Assembly Language Chapter 6: Procedures and Functions
40 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the main criterion for dividing conditional jump instructions into groups?

  • The type of jump taken
  • The type of operand used
  • The type of comparison performed (correct)
  • The type of flag used
  • What is the purpose of the CMP instruction?

  • To perform arithmetic operations
  • Tobranch to a different location
  • To set flags based on a condition
  • To compare two operands (correct)
  • What is the notation used to refer to the left and right operands in a CMP instruction?

  • Operand 1 and Operand 2
  • Source and Destination
  • Src Op and Dest Op
  • Left Op and Right Op (correct)
  • What type of jumps are based on equality between operands or the value of (E)CX?

    <p>Jumps based on equality between operands or the value of (E)CX</p> Signup and view all the answers

    What instruction is used to jump if the value of CX/ECX register is zero?

    <p>JCXZ</p> Signup and view all the answers

    What is the purpose of the JNE instruction?

    <p>Jump if not equal</p> Signup and view all the answers

    What type of comparisons are shown in the Signed Comparisons table?

    <p>Signed comparisons</p> Signup and view all the answers

    How many groups can conditional jump instructions be divided into?

    <p>4</p> Signup and view all the answers

    What is the purpose of the RET instruction in a procedure?

    <p>To return control to the calling procedure</p> Signup and view all the answers

    What is the purpose of the CALL instruction in a procedure?

    <p>To call another procedure</p> Signup and view all the answers

    What is the syntax to define a procedure?

    <p>proc_name: ...</p> Signup and view all the answers

    What is the purpose of the PUSH instruction in stack operations?

    <p>To push data into the stack</p> Signup and view all the answers

    What is the purpose of the POP instruction in stack operations?

    <p>To pop data from the stack</p> Signup and view all the answers

    What is the data structure used in the memory to store and retrieve data?

    <p>Stack</p> Signup and view all the answers

    What is the order of data retrieval in a stack?

    <p>LIFO (Last In First Out)</p> Signup and view all the answers

    What registers are used for implementing the stack?

    <p>SS and ESP (or SP)</p> Signup and view all the answers

    What is the primary characteristic of ROM?

    <p>Non-Volatile</p> Signup and view all the answers

    What type of memory is flash memory also known as?

    <p>All of the above</p> Signup and view all the answers

    What happens to the data in SRAM when power is disconnected?

    <p>The data is lost</p> Signup and view all the answers

    Why does DRAM need to be refreshed?

    <p>Because the capacitors lose their charges</p> Signup and view all the answers

    What is the primary use of flash memory?

    <p>To store setup information for systems</p> Signup and view all the answers

    What is the main difference between SRAM and DRAM?

    <p>SRAM retains data without power, DRAM does not</p> Signup and view all the answers

    What type of memory is used when the size of the read/write memory is relatively small?

    <p>SRAM</p> Signup and view all the answers

    What is the common characteristic among ROM, PROM, EPROM, and EEPROM?

    <p>They are all non-volatile</p> Signup and view all the answers

    What is the primary function of the Numeric Execution Unit (NEU) in the 8087 coprocessor?

    <p>To execute coprocessor instructions</p> Signup and view all the answers

    How many registers are in the stack of the Numeric Execution Unit (NEU)?

    <p>8 registers that are 80-bits wide</p> Signup and view all the answers

    What is the purpose of the Status Register in the 8087 coprocessor?

    <p>To tell the overall status of the 8087 coprocessor</p> Signup and view all the answers

    How is the Status Register accessed in the 8087 coprocessor?

    <p>By executing the FSTSW instruction</p> Signup and view all the answers

    What is the purpose of the 'Busy' bit in the Status Register of the 8087 coprocessor?

    <p>To indicate that the coprocessor is busy executing the task</p> Signup and view all the answers

    What are the two ways to test the bits of the Status Register in the 8087 coprocessor?

    <p>Using the FSTSW instruction and the TEST instruction</p> Signup and view all the answers

    What is the size of the Status Register in the 8087 coprocessor?

    <p>16-bit register</p> Signup and view all the answers

    How is the Status Register copied into the microprocessor's AX register?

    <p>Using the FSTSW AX instruction</p> Signup and view all the answers

    What is the purpose of address inputs in a memory device?

    <p>To select a memory location within the device</p> Signup and view all the answers

    How many address pins are required to select any of the 1024 memory locations in a 1K memory device?

    <p>10 address pins</p> Signup and view all the answers

    What is the purpose of data connections in a memory device?

    <p>To input/output data</p> Signup and view all the answers

    How many data pins are required for an 8-bit wide memory device?

    <p>8 data pins</p> Signup and view all the answers

    What determines the number of address pins on a memory device?

    <p>The number of memory locations</p> Signup and view all the answers

    What is the purpose of control inputs in a memory device?

    <p>To select a read/write operation</p> Signup and view all the answers

    How many address connections are required for a 2K memory device?

    <p>11 address connections</p> Signup and view all the answers

    What is the purpose of selection inputs in a memory device?

    <p>To enable or disable the device</p> Signup and view all the answers

    Study Notes

    Architecture of 8087

    • The Numeric Execution Unit (NEU) executes coprocessor instructions and has an 8-register stack that holds operands and results.
    • The stack contains 8 registers that are 80-bits wide.
    • Numeric data is transferred inside the coprocessor in two parts: 64-bit mantissa bus and 16-bit exponent bus.
    • Other registers in the NEU include status, control, tag, and exception pointers.

    Status Register

    • The Status Register is a 16-bit register that tells the overall status of the 8087 coprocessor.
    • It is accessed by executing the FSTSW instruction, which stores the contents of the status register into a word of memory.
    • The FSTSW AX instruction copies the status register directly into the microprocessor's AX register.
    • The status register can be examined by testing the bit positions.

    Types of Conditional Jump Instructions

    • The x86 instruction set has a large number of conditional jump instructions that compare signed and unsigned integers and perform actions based on the values of individual CPU flags.
    • Conditional jump instructions can be divided into four groups:
      • Jumps based on specific flag values
      • Jumps based on equality between operands or the value of (E)CX
      • Jumps based on comparisons of unsigned operands
      • Jumps based on comparisons of signed operands

    Procedure and Functions

    • Procedures or subroutines are identified by a name and perform a well-defined job.
    • The procedure is called from another function by using the CALL instruction.
    • The called procedure returns control to the calling procedure by using the RET instruction.

    Stacks Data Structure

    • A stack is an array-like data structure in memory where data can be stored and removed from the top of the stack.
    • Data is pushed onto the stack and popped out of the stack.
    • Stacks are Last-In-First-Out (LIFO) data structures.
    • Assembly language provides two instructions for stack operations: PUSH and POP.

    Memory Devices

    • ROM (Read Only Memory) permanently stores programs and data that are resident to the system and does not change even when power supply is disconnected.
    • Flash memory is a type of Read-Mostly Memory (RMM) that is electrically erasable.
    • Static RAM (SRAM) devices retain data for as long as DC power is applied and are volatile.
    • Dynamic RAM (DRAM) is essentially the same as SRAM, except that it retains data for only 2 or 4 ms on an integrated capacitor and requires refreshing.

    Memory Pin Connections

    • Pin connections common to all memory devices include address inputs, data outputs (or input/outputs), some type of selection input, and at least one control input used to select a read/write operation.
    • Address inputs are labeled from A0 to AN, where 'N' can be any value (one less than the total number of address pins).
    • The number of address pins found on a memory device determines the number of memory locations found within it.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    This quiz tests your understanding of procedures and functions in assembly language, including their importance and identification.

    More Like This

    Use Quizgecko on...
    Browser
    Browser