Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

computer architecture - using emu8086 Lab Exercise No. 1 - ALP to Exchange the two 8-bit numbers Lab Objective In this laboratory exercise you will

computer architecture - using emu8086
image text in transcribed
image text in transcribed
Lab Exercise No. 1 - ALP to Exchange the two 8-bit numbers Lab Objective In this laboratory exercise you will practice: Using Program to exchange the values Compiling and executing the programs using EMU8086-Simulator The follow up question and activity will give you practice modifying an existing program to perform a different task. Lab Exercise No - 1: Write an ALP Program to exchange two 8-bit number. DATA SEGMENT ; START DATA SEGMENT V1 DW 09 A 8 BIT VARIABLE DECLARE V2 DW 08 ; A 8 BIT VARIABLE DECLARE DATA ENDS END DATA SEGMENT CODE SEGMENT ; START CODE SEGMENT START: MOV AX, DATA ; INITILIZE DATA SEGMENT REGISTER MOV DS, AX MOV DX, V1 ; VALUE OF V1 IS MOVING INTO DX REG. MOV BX, V2 ; VALUE OF V2 IS MOVING INTO BX REG. XCHG DX, BX ; EXCHANGE OPERATION PERFORM MOV V1,DX ; MOVE VALUE OF BX IN V1 MOV V2.BX ; MOVE VALUE OF DX IN V2 CODE ENDS ; END CODE SEGMENT END START Lab Exercise No - 2: WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION Z=A*B+(C/D)-E. DATA SEGMENT DATA SEGMENT START A DB 2 DEFINE BYTE VARIABLE BDB 4 DEFINE BYTE VARIABLE C DB 6 DEFINE BYTE VARIABLE DDB 3 DEFINE BYTE VARIABLE E DB 1 DEFINE BYTE VARIABLE X DB 01 DUP(?) A WORD OF MEMORY RES DATA ENDS END DATA SEGMENT CODE SEGMENT START CODE SEGMENT START: MOV AX,DATA INITILIZE DATA SEGMENT REGISTER MOV DS, AX MOV AX,00 : SET 00 IN AX MOV AL.C ; MOVE VALUE OF C IN AL REGISTER DIVD DIV OF AL FROM D AND STORE RESULT IN AL REG MOV DL, AL ; MOVE VALUE OF AL IN DL REGISTERS MOV ALA MOVING OPERATION PERFORM FOR AL REGISTER MULB ;MUL BETWEEN AL AND B STORE RESULT IN AL REG ADD DL,AL ADDITION OF BL AND Z, RESULT STORE IN BL REG SUB DLE SUB OF DL FROM E, RESULT STORE IN DL REG. MOV X,DL RESULT STORE INX CODE ENDS END CODE SEGMENT END START Submission: 1. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS Note: Enter the values through key board and try use built in libraries like(call scan, call print etc). 2. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION ZEA-B+(C/D)+E. Lab Exercise No. 1 - ALP to Exchange the two 8-bit numbers Lab Objective In this laboratory exercise you will practice: Using Program to exchange the values Compiling and executing the programs using EMU8086-Simulator The follow up question and activity will give you practice modifying an existing program to perform a different task. Lab Exercise No - 1: Write an ALP Program to exchange two 8-bit number. DATA SEGMENT ; START DATA SEGMENT V1 DW 09 A 8 BIT VARIABLE DECLARE V2 DW 08 ; A 8 BIT VARIABLE DECLARE DATA ENDS END DATA SEGMENT CODE SEGMENT ; START CODE SEGMENT START: MOV AX, DATA ; INITILIZE DATA SEGMENT REGISTER MOV DS, AX MOV DX, V1 ; VALUE OF V1 IS MOVING INTO DX REG. MOV BX, V2 ; VALUE OF V2 IS MOVING INTO BX REG. XCHG DX, BX ; EXCHANGE OPERATION PERFORM MOV V1,DX ; MOVE VALUE OF BX IN V1 MOV V2.BX ; MOVE VALUE OF DX IN V2 CODE ENDS ; END CODE SEGMENT END START Lab Exercise No - 2: WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION Z=A*B+(C/D)-E. DATA SEGMENT DATA SEGMENT START A DB 2 DEFINE BYTE VARIABLE BDB 4 DEFINE BYTE VARIABLE C DB 6 DEFINE BYTE VARIABLE DDB 3 DEFINE BYTE VARIABLE E DB 1 DEFINE BYTE VARIABLE X DB 01 DUP(?) A WORD OF MEMORY RES DATA ENDS END DATA SEGMENT CODE SEGMENT START CODE SEGMENT START: MOV AX,DATA INITILIZE DATA SEGMENT REGISTER MOV DS, AX MOV AX,00 : SET 00 IN AX MOV AL.C ; MOVE VALUE OF C IN AL REGISTER DIVD DIV OF AL FROM D AND STORE RESULT IN AL REG MOV DL, AL ; MOVE VALUE OF AL IN DL REGISTERS MOV ALA MOVING OPERATION PERFORM FOR AL REGISTER MULB ;MUL BETWEEN AL AND B STORE RESULT IN AL REG ADD DL,AL ADDITION OF BL AND Z, RESULT STORE IN BL REG SUB DLE SUB OF DL FROM E, RESULT STORE IN DL REG. MOV X,DL RESULT STORE INX CODE ENDS END CODE SEGMENT END START Submission: 1. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS Note: Enter the values through key board and try use built in libraries like(call scan, call print etc). 2. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION ZEA-B+(C/D)+E

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions