Write an assembly language program that corresponds to the following C++ program
ID: 3546965 • Letter: W
Question
- 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; }
#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
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.