Posted by : Anonymous Monday 22 April 2013


Question No. 1:                                                                                  Marks [5+5]

Calculate physical address for the following segment-offset pairs:
  1. 5FD1: 111EQ  No 1 Solution:
    (a)
    Physical Address = Segment Address + Offset Address
    16 bit segment Address = 5FD1
    16 bit Offset Address = 111E
    To convert it into 20 bit address adds 0 at the right side of segment address and left  side of Offset Address.
    20 bit Segment Address = 5FD10
    20 bit Offset Address = 0111E
    Physical Address = 5FD10 + 0111E = 60E2E


  2. 91EF: F1F1

(b)
Physical Address = Segment Address + Offset Address
16 bit segment Address = 91EF
16 bit Offset Address = F1F1
To convert it into 20 bit address adds 0 at the right side of segment address and left side of Offset Address.
20 bit Segment Address = 91EF0
20 bit Offset Address = 0F1F1
Physical Address = 91EF0 + 0F1F1= A10E1
Briefly explain each step.



Question No. 2:                                                                                  Marks [10]

Write a complete assembly language code for the following program:

  1. Initialize AX with ‘4’
  2. Move ‘9’ to BX
  3. Move ‘6’ to CX
  4. Add AX with BX and store the result in AX
  5. Subtract CX from BX and store the result in BX
  6. Add AX with BX and the store the result in DX
  7. Invert the contents of AX register
  8. Perform AND operation on AX and DX registers; store the result in BX register.

[org 0x0100]
mov ax, 4
mov bx, 9
mov cx, 6
add bx, ax
mov ax, bx
sub bx, cx
mov bx,cx
add ax, bx
mov dx, ax
EAX
[ax,dx],bx
mov ax, 0x4c00
int 0x21

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © virtual university of pakistan - Skyblue - Powered by Blogger - Designed by Johanes Djogan -