|
||||||
| 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-02-2008 at 11:24 PM. 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 04:40 PM |
| C++ to assembly conversion | Kaishain | C and C++ | 4 | 12-10-2007 04:07 AM |
| Assembly Applications | skilletsteve | General Programming | 8 | 08-25-2006 06:32 PM |
| Companies That Hire Assembly Programmers | encoder | General Programming | 14 | 08-01-2006 04:28 PM |
| Assembly tutorials | Kaabi | General Programming | 1 | 07-05-2006 11:18 AM |
| Xav | ........ | 1097.16 |
| MeTh0Dz|Reb0rn | ........ | 986.37 |
| morefood2001 | ........ | 850.04 |
| John | ........ | 841.93 |
| WingedPanther | ........ | 684.54 |
| marwex89 | ........ | 638.26 |
| Brandon W | ........ | 493.36 |
| chili5 | ........ | 292.12 |
| Steve.L | ........ | 188.37 |
| orjan | ........ | 187.41 |
Goal: 100,000 Posts
Complete: 79%