Question

In: Computer Science

Q17. Fill in the blanks: Consider the operands to be signed words (16 bit) a) mov...

Q17. Fill in the blanks:

Consider the operands to be signed words (16 bit)

a) mov ax, - 48 cwd mov bx , 5 idiv bx ; ax = _______ , dx = _____ (provide answers in decimal) Consider the operands to be signed words (16 bit)

b) mov ax , -1 mov bx , -1 imul bx ; ax = _________H, dx =__________H (provide answer in Hex) Consider the operands to be signed words

c) mov ax , -1 mov dx , 2 imul dx ; ax = _______H ,dx = ________H(provide answer in Hex) Consider the operands to be signed byte (8 bit)

d) mov al, -48 cbw mov bl, 5 idiv bl ; al = _____, ah = _______ (provide answers in decimal) 5

Q18. Fill in the values as the following code fragment is executed:

a) count DB 9A H ; count is Byte variable initialized to 9A H num DB BC H ; num is a Byte variable initialized to BCH mov ah, count mov al, num ; ax = _______________H

b) mov ax, 1234H mov ax, ‘A’ ; ax = ________________H (Hint: ASCII code of ‘A’ = 65 in decimal)

c ) mov dx , 0087H mov ax, 6000H mov bx, 100H div bx ; ax = ________________H

d) mov ax, 1237H sub al, 38H ; ax = ________________H

Solutions

Expert Solution

a) mov ax, - 48

cwd

mov bx , 5

idiv bx ; ax = -9 , dx = -3  

Ans. IDIV performs signed integer division

b) mov ax , -1

mov bx , -1

imul bx ;    ax =00000001 H, dx =00000000H

Ans. IMUL performs multiplication if 8,16,32 bit data with either AL, AX or EAX. Preserves sign of product by sign extending it into upper half of destination register.

c) mov ax , -1

mov dx , 2

imul dx ; ax = FFFFFFFE H ,dx = 00000000H

Ans. IMUL performs multiplication if 8,16,32 bit data with either AL, AX or EAX. Preserves sign of product by sign extending it into upper half of destination register.

d) mov al, -48

cbw

mov bl, 5

idiv bl ; al = -9 , ah = -3

Ans. IDIV performs signed integer division

Q18. Fill in the values as the following code fragment is executed:

a) count DB 9A H ; count is Byte variable initialized to 9A H

num DB BC H ; num is a Byte variable initialized to BCH

mov ah, count

mov al, num ; ax = 9ABC H

Ans. Here data of count variable is stored in higher byte of Accumulator (ah) and data of num variable is stored at lowwer byte of Accumulator (al). Hence 2 datas are stored in one register.

b) mov ax, 1234H

mov ax, ‘A’ ; ax = 1241 H (Hint: ASCII code of ‘A’ = 65 in decimal)

c ) mov dx , 0087H

mov ax, 6000H

mov bx, 100H

div bx ; ax = 8760 H

d) mov ax, 1237H

sub al, 38H ; ax = 12FF H


Related Solutions

Fill in the blanks: Consider the following equilibrium and fill in the blanks with either increase...
Fill in the blanks: Consider the following equilibrium and fill in the blanks with either increase or decrease. I2(s) + 5F2(g) ⇌ 2IF5(g) A decrease in volume results in a Blank 1 in pressure which will Blank 2 the amount of IF5.
Fill in the blanks with the following numbers, not the words, for this and all the...
Fill in the blanks with the following numbers, not the words, for this and all the questions that follow. Jot them down so you won't have to keep scrolling up to the top to see what they are: Demand = 1 Supply = 2 Right = 3 Left = 4 Up = 5 Down = 6 QUESTION 6 Suppose the dollar were to strengthen in international currency markets. That is, the price of the dollar, in terms of other national...
Fill in the blanks with the following numbers, not the words, for this and all the...
Fill in the blanks with the following numbers, not the words, for this and all the questions that follow. Jot them down so you won't have to keep scrolling up to the top to see what they are: Demand = 1 Supply = 2 Right = 3 Left = 4 Up = 5 Down = 6 QUESTION 4 Consider the case where an important technological innovation (e.g., the personal computer, iPhone, Internet, etc.) made labor more productive. This would cause...
This question contains multiple fill in the blanks. Please choose from the following words to fill...
This question contains multiple fill in the blanks. Please choose from the following words to fill in the appropriate blanks: mitosis, identical, synapsis, separation, different, meiosis. Words may be used more than once or not at all. NOTE: Enter your answers in all lower case letters exactly as they are shown above. During (a)____, chromosome number is reduced to haploid complements. This is achieved by (b)_____ of homologous chromosomes and their subsequent (c)_____. It would seem to be more mechanically...
Fill in the blanks with the given words. In the last 40 years, the concentration of...
Fill in the blanks with the given words. In the last 40 years, the concentration of carbon dioxide in the air has increased by more than 20%. IR spectroscopy shows that carbon dioxide absorbs IR radiation. If carbon dioxide molecules absorb IR radiation, where does that energy go? How does the increase in the concentration of carbon dioxide affect the air temperature? If carbon dioxide molecules absorb IR radiation, the energy goes into( ___). Vibrating carbon dioxide molecules make other...
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000...
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000 0001 0001 0001 1111 1111 1000 0000
Consider the following structure definitions and fill in the blanks for the enqueue function:
Consider the following structure definitions and fill in the blanks for the enqueue function:    typedef struct queue queue_t;     typedef struct node node_t;    struct node {         node_t *next;          void *val; };    struct queue {         node_t *head;         node_t *tail;};/* add val at the tail of the queue q */void enqueue (queue_t *q, void *val) {     if (q->head == NULL) {        _______________ = _______________ = malloc(sizeof(_______________));        _______________ = NULL;     } else {        _______________ = _______________ = malloc(sizeof(_______________));        _______________ = NULL;     }    q->tail->val = val; }
7.What is the hexadecimal equivalent of the 16-bit signed integer -32,760 ? *Note: answer in two's...
7.What is the hexadecimal equivalent of the 16-bit signed integer -32,760 ? *Note: answer in two's complement*
Fill in the blanks with words that would best complete the passage. carrier reimburses receiver catalog...
Fill in the blanks with words that would best complete the passage. carrier reimburses receiver catalog of goods    buyer    settles    bill of lading seller    issuer When an international transaction will be completed with a letter of credit, the buyer will contact the ______ bank, outlining the bank's obligations to pay on the letter of credit and the buyer's obligation to pay the bank. The letter of credit is sent to the _____, stating that once the...
Use the following words to fill in the blanks, some may be used more than once...
Use the following words to fill in the blanks, some may be used more than once or not at all: Increase; Decrease; Greater Than; Less Than; Equal; System; Effusion; Enthalpy; Diffusion; Entropy; Mass; Volume; Density; Heat; Temperature; State; Calorimeter; Specific Heat; Gas; Extensive; Intensive, surrounding A. Calorimetry is possible because all the energy which leaves the _________ is absorbed by the _________, and vice versa B. When volume is held constant, the term for work goes to zero, which allows...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT