|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I need to make a program that ask two numbers, multiply it and then show the result.
This is what I have done until now. My problem is when the program must show the result. If anyone can help me I would thank you. ![]() Code:
.model small
.stack 2000h
.data
m1 db 0dh,0ah,"Enter multiplicant (0-9): $"
m2 db 0dh,0ah,"Enter multiplier (0-9): $"
m3 db 0dh,0ah,"The product is: $"
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
mov dx,offset m2
int 21h
mov ah,1
int 21h
mov cl,al
mov ah,9
mov dx,offset m1
int 21h
mov ah,1
int 21h
sub cl,30
sub al,30
mul cl
aam
add al,30
add ah,30
mov bx,ax
mov ah,9
mov dx,offset m3
int 21h
mov dx,'bx'
mov ah,2
int 21h
mov ax,4c00h
int 21h
main endp
end main
Last edited by v0id; 03-03-2008 at 12:24 AM. Reason: Remember the code-tags! |
| Sponsored Links |
|
|
|
|||
|
To me, it looks like you're not pointing DS to the segment of the string.
Try: Code:
.model small
.stack 2000h
.data
m1 db 0dh,0ah,"Enter multiplicant (0-9): $"
m2 db 0dh,0ah,"Enter multiplier (0-9): $"
m3 db 0dh,0ah,"The product is: $"
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
mov dx,offset m2
int 21h
mov ah,1
int 21h
mov cl,al
mov ah,9
mov dx,offset m1
int 21h
mov ah,1
int 21h
sub cl,30
sub al,30
mul cl
aam
add al,30
add ah,30
mov bx,ax
mov ax,seg m3
mov ds,ax
mov dx,offset m3
mov ah,9
int 21h
mov dx,'bx'
mov ah,2
int 21h
mov ax,4c00h
int 21h
main endp
end main
Tell me if it works, will you?
__________________
________________________________________________ "I'm not young enough to know everything." - Oscar Wilde |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Free Assembly Tutorials | Jordan | General Programming | 39 | 10-05-2008 05:40 PM |
| C++ to assembly conversion | Kaishain | C and C++ | 4 | 12-10-2007 05:07 AM |
| Assembly Applications | skilletsteve | General Programming | 8 | 08-25-2006 07:32 PM |
| Companies That Hire Assembly Programmers | encoder | General Programming | 14 | 08-01-2006 05:28 PM |
| Assembly tutorials | Kaabi | General Programming | 1 | 07-05-2006 12:18 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%