You are on page 1of 4

1- Write an assembly code to transfer data from an accumulator register to base

register.

MOV BX, AX

2- Write an assembly code to transfer a 44H to a HIGHER part of counter register.


Also, transfer a 1997H to base register.

MOV CH, 44H


MOV BX, 1997H

3- Write an assembly code to transfer the memory content Of address 3200H to the
accumulator.
Also, transfer the memory content of ADDRESS 3500H to base register.

MOV AX, [3200H]


MOV BX, [3500H]

4- Find the Physical address (P.A) of the memory location and its contents after
execution
of the following, assuming DS=1512H.
MOV AL, 3E h
MOV [4185H], AL

Answer:
P.A = { BASE * 10 } + OFFSET // Offset = Effective
P.A = { 1512 * 10 } + 4185 = 15120 + 4185 = 19305 H

Its Content: 19305 = 3Eh

5- Find the Physical address of the memory location after execution of the
following,
assuming that DS= 1000H, and BX=1234H
MOV AX, [BX]

Answer:
P.A = { BASE * 10 } + OFFSET
P.A = { 1000h * 10h } + 1234 h = 10000h + 1234h = 11234 h

6- Assume that DS=1120H, SI=2498H, And AX=17EFH show the contents of memory
locations(Physical Address)
after execution the following:
MOV [SI], AX

Answer:
P.A = { BASE * 10 } + OFFSET
P.A = { 1120 * 10 } + 2498h = 11200 + 2498 = 13698 H

CONTENT: 13698 => EF H


13699 => 17 H

7- Calculate the physical address for the following assembly code, assume that:
DS= 4500H, SS=2000H, BX=2100H, SI=1486H, DI=8500H,
BP= 7814H, and AX= 2512H:
MOV [BX+20], AX
MOV [SI+10], AX
MOV [DI+4], AX
MOV [BP+12], AX

Answer: (first instruction only)


P.A = { BASE * 10 } + OFFSET
= { 4500 * 10 } + (2100 + 20) = 45000 + 2120 = 47120 H

CONTENT: 47120 => 12 H


47121 => 25 H

String Addressing:

Q- write an assembly code to move the string("AHMED").

Answer:
DAT DB 'A', 'H' , 'M' , 'E' , 'D'

LEA SI, DAT ; Load Effictive Address


MOV DI, 110H

MOVSB
MOVSB
MOVSW
MOVSB

HLT

# Data Transfer:

8- Write an assembly code to find a way for assigning a binary immediate


data(10001000b)
to segment register DS, then to the low part of AX.

Also, Assign(16H) to memory location (4317H), then to the high part of BX,
after this, copy BH to AH.
Answer:
mov cl, 10001000b
mov DS, cx
Mov Ax, DS

mov [4317] , 16h


mov BH, [4317]
mov AH, BH

9- Write assembly code to exchange the content of registers DX and AX.


Also,exchange the content of BL and CH.

Answer:

XCHG AX, DX
XCHG BL, CH

10- Write assembly code to assign the register BX with 4014H,


and register DX with 4038H. Move the content of BX to DX and verse.
Then copy the now value of low content for BX and DX to memory Locations [2131 H],
and [2139 H].

Answer:
MOV BX, 4014H
MOV DX, 4038H
XCHG BX, DX

MOV [2131H], BL
MOV [2139H], DL

11- write an assembly code to store these data on stack memory


6026 H, 12 h, and 1235H through AX register , [2141 h] and directly?

Answer:
mov AX, 6026
push AX
mov [2141], 12
push [2141]
push 1235 h

12- To retrieve data from stack to [3236],


the low part of CX and DX.
Answer:
pop [3236]
pop CX
pop DX

You might also like