Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

--------> IN ASSEMBLY x86 What is wrong with my code? Code will be provided below the picture. I will give you what the program is

--------> IN ASSEMBLY x86

What is wrong with my code? Code will be provided below the picture. I will give you what the program is suppose to do. Please show the output.

image text in transcribed

Here is my code:

#include

using namespace std;

int main ()

{

unsigned long i1;

unsigned long i2;

unsigned long i3;

unsigned long i4;

__asm

{

;;FUNCTION: Sets and returns switch char-

;; acter and device availability.

;;

;;

;;CALL:

;;

;; ret= _charop(al,dl)

;; int ret; DL return value,

;; int al; charoper function

;; int dl; charoper data

;;

;;RETURN:

;; See the DOS docs for details.

;;_charop(0,0) returns the ASCII switch char,

;;_charop(1,'-') sets the switch to -,

;;_charop(2,0) returns device availability,

;;_charop(3,i) sets device availability.

;;

;;

;;DESCRIPTION:

;;

;;EXAMPLE:

;;

;;

;;CAUTIONS:

;;

;;

;;ASSUMPTIONS:

;;

;;LONG 32 bits (4 bytes)

;;INT 16 bits (2 bytes)

;;CHAR 8 bits (1 byte)

;;

page

pgroup group prog

prog segment byte public 'prog'

assume cs:pgroup,ds:pgroup

public _charop

_charop proc near

push bp

mov bp,sp

mov al,[bp+4]

mov dl,[bp+6]

mov ah,55

int 33

mov al,dl

mov ah,0

pop bp

ret

_charop endp

prog ends

end

}

cout

endl;}

Problem: Starting with the following C++ program # include using namespace std; void main 0 unsigned long il; unsigned long i2; unsigned long i3; unsigned long i4 asm cout using namespace std; void main 0 unsigned long il; unsigned long i2; unsigned long i3; unsigned long i4 asm cout

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: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

5. Discuss the key components of behavior modeling training.

Answered: 1 week ago