microprocessor - 1D

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
2,214
\(\displaystyle \bold{1.}\) The first byte of an instruction is the ____________, unless it contains one of the override prefixes.
\(\displaystyle \bold{2.}\) Describe the purpose of the \(\displaystyle \text{D}\)- and \(\displaystyle \text{W}\)-bits found in some machine language instructions.
\(\displaystyle \bold{3.}\) In a machine language instruction, what information is specified by the \(\displaystyle \text{MOD}\) field?
\(\displaystyle \bold{4.}\) If the register field \(\displaystyle (\text{REG})\) of an instruction contains \(\displaystyle 010\) and \(\displaystyle \text{W} = 0\), what register is selected, assuming that the instruction is a \(\displaystyle 16\)-bit mode instruction?
\(\displaystyle \bold{5.}\) How are the \(\displaystyle 32\)-bit registers selected for the Pentium \(\displaystyle 4\) microprocessor?
\(\displaystyle \bold{6.}\) What memory-addressing mode is specified by \(\displaystyle \text{R/M} = 001\) with \(\displaystyle \text{MOD} = 00\) for a \(\displaystyle 16\)-bit instruction?
\(\displaystyle \bold{7.}\) Identify the default segment registers assigned to the following:
\(\displaystyle \bold{(a)}\) \(\displaystyle \text{SP}\)
\(\displaystyle \bold{(b)}\) \(\displaystyle \text{EBX}\)
\(\displaystyle \bold{(c)}\) \(\displaystyle \text{DI}\)
\(\displaystyle \bold{(d)}\) \(\displaystyle \text{EBP}\)
\(\displaystyle \bold{(e)}\) \(\displaystyle \text{SI}\)
\(\displaystyle \bold{8.}\) Convert an \(\displaystyle \text{8B07H}\) \(\displaystyle \text{f}\)rom machine language to assembly language.
\(\displaystyle \bold{9.}\) Convert an \(\displaystyle \text{8B9E004CH}\) \(\displaystyle \text{f}\)rom machine language to assembly language.
\(\displaystyle \bold{10.}\) If a \(\displaystyle \text{MOV SI,[BX+2]}\) instruction appears in a program, what is its machine language equivalent?
 
\(\displaystyle \bold{1.}\) The first byte of an instruction is the \(\displaystyle \textcolor{blue}{\text{opcode}}\), unless it contains one of the override prefixes.
 
\(\displaystyle \bold{2.}\) Describe the purpose of the \(\displaystyle \text{D}\)- and \(\displaystyle \text{W}\)-bits found in some machine language instructions.

The \(\displaystyle \textcolor{blue}{\text{D}}\)-bit specifies the direction of data transfer (either from REG to R/M or from R/M to REG), while the \(\displaystyle \textcolor{blue}{\text{W}}\)-bit determines the size of the data being transferred (either a byte or a word/doubleword).
 
\(\displaystyle \bold{3.}\) In a machine language instruction, what information is specified by the \(\displaystyle \text{MOD}\) field?

The \(\displaystyle \text{MOD}\) field indicates \(\displaystyle \textcolor{blue}{\text{the type of addressing}}\) used for the \(\displaystyle \text{R/M}\) field and determines \(\displaystyle \textcolor{blue}{\text{the displacement size}}\).
 
\(\displaystyle \bold{4.}\) If the register field \(\displaystyle (\text{REG})\) of an instruction contains \(\displaystyle 010\) and \(\displaystyle \text{W} = 0\), what register is selected, assuming that the instruction is a \(\displaystyle 16\)-bit mode instruction?

\(\displaystyle \textcolor{blue}{\text{DL}}\)
 
\(\displaystyle \bold{5.}\) How are the \(\displaystyle 32\)-bit registers selected for the Pentium \(\displaystyle 4\) microprocessor?

On the Pentium \(\displaystyle 4\), if you're running in \(\displaystyle 16\)-bit mode, and you want to use a \(\displaystyle 32\)-bit register, \(\displaystyle \textcolor{blue}{\text{you need to use a prefix}}\) to tell the CPU. Or more precisely, \(\displaystyle \textcolor{blue}{\text{a register-size and/or address-size prefix is used}}\) to specify a \(\displaystyle 32\)-bit register.
 
\(\displaystyle \bold{6.}\) What memory-addressing mode is specified by \(\displaystyle \text{R/M} = 001\) with \(\displaystyle \text{MOD} = 00\) for a \(\displaystyle 16\)-bit instruction?

\(\displaystyle \textcolor{blue}{\text{DS:[BX+DI]}}\)
 
\(\displaystyle \bold{7.}\) Identify the default segment registers assigned to the following:

\(\displaystyle \bold{(a)}\) \(\displaystyle \text{SP} \longrightarrow \textcolor{blue}{\text{SS}}\)
\(\displaystyle \bold{(b)}\) \(\displaystyle \text{EBX} \longrightarrow \textcolor{red}{\text{DS}}\)
\(\displaystyle \bold{(c)}\) \(\displaystyle \text{DI} \longrightarrow \textcolor{green}{\text{DS}}\)
\(\displaystyle \bold{(d)}\) \(\displaystyle \text{EBP} \longrightarrow \textcolor{purple}{\text{SS}}\)
\(\displaystyle \bold{(e)}\) \(\displaystyle \text{SI} \longrightarrow \textcolor{orange}{\text{DS}}\)
 
Top