Using the windows32 or windows64 framework, write and complete 80x86 assembly la
ID: 3801897 • Letter: U
Question
Using the windows32 or windows64 framework, write and complete 80x86 assembly language program will use a dialog box to prompt for an integer n, compute the sum of the integers from 1 to n and use a message box to display the sum. By the way this is the third time..(3rd time is the charm lol)
I need code like this: (Assembly) INCLUDE io.h
.DATA
grade1 DWORD ?
grade2 DWORD ?
grade3 DWORD ?
grade4 DWORD ?
final DWORD ?
prompt1 BYTE "Grade 1?", 0
prompt2 BYTE "Grade 2?", 0
prompt3 BYTE "Grade 3?", 0
prompt4 BYTE "Grade 4?", 0
promptF BYTE "Final?", 0
Not like this: (Java I guess)
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
public class SortingAlgorithm {
private static final String CREATE_DB = "CREATE DATABASE sorting";
private static final String DROP_DB = "DROP DATABASE sorting";
private static final String CREATE_TABLE = "CREATE TABLE sorting.sorting ( num double not null )";
Please do not answer if you dont know! This is my fourth time and it's been either wrong or filled with errors!! Thanks if you can help me!!
Explanation / Answer
DATA SEGMENT
prompt db 13, 10, 'Enter integer number:','A'
SUM DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA BX,A
MOV CL,10
MOV AX,0000
L1:ADD AL,BYTE PTR[BX]
INC BX
DEC CL
CMP CL,00
JNZ L1
MOV SUM,AL
MOV BH,10
DIV BH
MOV AH,4CH
INT 21H
CODE ENDS
END START
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.