Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an assembly language program that corresponds to the following C++ program

ID: 3546965 • Letter: W

Question

  1. Write an assembly language program that corresponds to the following C++ program:

    #include <iostream>
    using namespace std;

    int num;

    int main () {
    cin >> num;
    num = num / 16;
    cout << "num = " << num << endl;
    return 0; }
Write an assembly language program that corresponds to the following C++ program:

#include <iostream>
using namespace std;

int num;

int main () {
cin >> num;
num = num / 16;
cout << "num = " << num << endl;
return 0; } Write an assembly language program that corresponds to the following C++ program:

#include <iostream>
using namespace std;

int num;

int main () {
cin >> num;
num = num / 16;
cout << "num = " << num << endl;
return 0; } Write an assembly language program that corresponds to the following C++ program:

#include <iostream>
using namespace std;

int num;

int main () {
cin >> num;
num = num / 16;
cout << "num = " << num << endl;
return 0; } cin >> num;
num = num / 16;
cout << "num = " << num << endl;
return 0;

Explanation / Answer

The following Assembly Language Program :

assume cs:code,ds:data

data segment
org 2000h
num1 dw 8345h
num2 dw 2346h
rem dw 2d dup(0h)
quo dw 2d dup(0h)
data ends
code segment

loop:

mov ax,data
mov ds,ax
mov ax,num1
idiv 16
mov quo,ax
mov rem,dx
mov ah,4ch
int 21h
code ends
end loop

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote