Can you please write an assembly program in 68k that allows the user to enter tw
ID: 665912 • Letter: C
Question
Can you please write an assembly program in 68k that allows the user to enter two integer numbers (X and Y) and calculate X^Y and outputs the answer to the screen. Thank you.
And not this because it doesn’t work
.MODEL SMALL
.DATA
BASE DB ?
POW DB ?
NL1 DB 0AH,0DH,'ENTER BASE:','$'
NL2 DB 0AH,0DH,'ENTER POWER:','$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
ENTER_BASE:
LEA DX,NL1
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV BL,AL
MOV BASE,AL
ENTER_POWER:
LEA DX,NL2
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV CL,AL
DEC CL
MOV AX,00
MOV AL,BASE
LBL1:
MUL BL
LOOP LBL1
MOV CL,10
DIV CL
ADD AX,3030H
MOV DX,AX
MOV AH,02H
INT 21H
MOV DL,DH
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Explanation / Answer
Assmbly code
ASSMBLY LINUXCODE
ADDING SumCode
.model small
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.