Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an 8086-family assembly language procedure (code fragment) that would fill

ID: 1980088 • Letter: W

Question

Write an 8086-family assembly language procedure (code fragment) that would fill the first pan o a complete segment of memory (assume the segment is the data segment) with zeros (up to a certain offset within the segment), and the rest of the segment with ones. The code will fill The locations within the segment, up to the offset given in BX, with all Os. Once the offset reaches the value in BX (inclusive), fill the rest of the locations form BX (inclusive) to OxFFFF with l's. Assume the segment and offset address values are passed as arguments to the procedure in AX and BX registers, respectively.

Explanation / Answer

Ans: AX is called the accumulator register, and it is used mostly for arithmetic, logic, and the general transfer of data. Many of the assembly language instructions for higher level mathematical operations such as multiply and divide don't even let the programmer specify a register other than AX to be used.

BX is called the base register, and it is used as a base address or pointer to things like data arrays. We will find out later that there are a number of other registers that are used as pointers, but those are special purpose pointers. BX tends to be more of a general purpose pointer.

Most 8086 instructions can operate on the 8086’s general purpose register set. By specifying the name of the register as an operand to the instruction, you may access the contents of that register. Consider the 8086 mov (move) instruction:

mov destination, source

This instruction copies the data from the source operand to the destination operand. The eight and 16 bit registers are certainly valid operands for this instruction. The only restriction is that both operands must be the same size. Now let’s look at some actual 8086 mov instructions:

mov ax, bx ;Copies the value from BX into AX

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote