15,916,215 members
See more:
I have a project that I need to create a program in assembly language that will perform addition, subtraction, multiplication and division of base 7 to base 9. I have no idea on this as I'm a beginner in assembly language. My main problem on this is that I don't know how to perform basic calculator operations by coding in assembly language. Hope you can help me with this. At least an idea on how to perform calculation will help.

What I have tried:

.MODEL SMALL
.STACK 1000h
.DATA
au db 0dh,0ah, 'Augend(00-99): \$'
sum db 0dh,0ah,'The sum is : \$'
.CODE
start:
mov ax,@data
mov ds,ax
mov dx,offset abase7
mov ah,09
int 21h

mn:
mov ah,09
int 21h
mov ah,01
int 21h

mov cl,al
sub cl,30h

mov dx,offset au
mov ah,09
int 21h
mov ah,01
int 21h

xor ah,ah
aaa

mov cx,ax

mov dx,offset sum
mov ah,09
int 21h

mov ah,2
mov dl,ch
int 21h

mov dl,cl
int 21h

mov ah,4ch
int 21h

end start
Posted
Updated 11-May-21 2:01am

## Solution 1

Vee Jay Recana 11-May-21 10:51am
Can someone help me if how should I extract quotient and remainder and display together?
For example, I have a quotient of 1 and a remainder of 6, it should output 16. How should I do that?
Richard MacCutchan 11-May-21 12:10pm
The same way you output any data. Set up a message in your DATA section and store the two values in the appropriate positions before printing. Something like:
```qr        db       0dh,0ah, 'Quotient: '
quot      db       0  ; store the quotient here
db       ' Remainder: '
rem       db       0, ' \$'  ; and the remainder here; and then print the message beginning at qr
```