Monday, 5 May 2014

CS401 Vu current Assignment No 1 Solution May 2014

Suppose we have the following register values:

AX = 0200h
BX = 4336h
CX = 1234h
SI = 0100h
CS = 0FE0h   and
DS = E000h
You are required to calculate the physical address generated by each of the following instructions:
  1. MOV AX, [CS: BX + 100]
  2. MOV CX, [BX + SI + 0x0030]
Note: Every instruction is independent of others.

Question No. 2:

Assemble the given program using NASM. 

ORG 0100H
XOR AX, AX
MOV BX, 55H
MOV AX, 42
ADD AX, BX
SUB BX, 02H
ADD AX, BX
SUB AX, EA12H
MOV BX, 22H
MOV AX, 0X4C00
INT 0X21

  1. After that load the Debugger by typing AFD in command prompt as in Fig

Solution :


Second question coreect code
org 0x0100
xor ax, bx
mov bx, 0x55
mov ax, 42
add ax, bx
sub bx, 0x02
add ax, bx
sub ax, 0xEA12
mov bx, 0x22
mov ax, 0x4c00
int 0x21