Lost Password?

Go Back   CodeCall Programming Forum > Software Development > General Programming

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-2008, 02:19 PM
SCR SCR is offline
Newbie
 
Join Date: Mar 2008
Posts: 1
Credits: 0
Rep Power: 0
SCR is on a distinguished road
Default Help with 8086 Assembly

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-12-2008, 10:09 AM
Walle Walle is offline
Newbie
 
Join Date: Mar 2008
Posts: 27
Credits: 0
Rep Power: 3
Walle is on a distinguished road
Default Re: Help with 8086 Assembly

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
As you notice, I added "mov ax,seg m3" and "mov ds,ax", since we can't do "mov ds,seg m3".

Tell me if it works, will you?
__________________
________________________________________________
"I'm not young enough to know everything." - Oscar Wilde
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -5. The time now is 04:59 AM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 79%

Ads