Re: Need Help.
- From: "MQ" <spamtrap@xxxxxxxxxx>
- Date: 10 Jul 2006 22:53:29 -0700
spamtrap@xxxxxxxxxx wrote:
Am wondering if anyone can help me. I am new to Turbo Assembly and
don't have a clue on what to do on this one... Since I am trying to
grasp on how to make a simple program which add and subtract - I came
up with this...
-----------------------------
.model tiny
.code
org 0100h
main: jmp start
first db 'Enter first number:','$'
second db 'Enter second number:','$'
answer db 'The answer is:','$'
ch1 db ?
ch2 db ?
sagot db ?
start:
mov ax,03h
int 10h
mov bh,0
mov dh,1
mov dl,2
mov ah,02h
int 10h
mov dh,1
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset first
int 21h
mov ah,1
int 21h
sub al,30h
mov ch1,al
mov dh,2
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset second
int 21h
mov ah,1
int 21h
sub al,30h
mov ch2,al
add al,ch1
add al,30h
mov sagot,al
mov dh,3
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset answer
int 21h
mov ah,02h
mov dl,sagot
int 21h
mov ah,4ch
int 21h
int 20h
end main
end
-----------------------------
For my addition and this for my subtraction...
-----------------------------
.model tiny
.code
org 0100h
main: jmp start
first db 'Enter first number:','$'
second db 'Enter second number:','$'
answer db 'The answer is:','$'
ch1 db ?
ch2 db ?
sagot db ?
start:
mov ax,03h
int 10h
mov bh,0
mov dh,1
mov dl,2
mov ah,02h
int 10h
mov dh,1
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset first
int 21h
mov ah,1
int 21h
sub al,30h
mov ch1,al
mov dh,2
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset second
int 21h
mov ah,1
int 21h
sub al,30h
mov ch2,al
sub al,ch1
add al,30h
mov sagot,al
mov dh,3
mov dl,2
mov ah,02h
int 10h
mov ah,09h
mov dx,offset answer
int 21h
mov ah,02h
mov dl,sagot
int 21h
mov ah,4ch
int 21h
int 20h
end main
end
--------------------------
Am wondering if any can help me on making up a simple multiplication
program - or teach me how to... -scratches head- Thanks. Really.
What exactly is your question here? No-one is going to write a program
for you. You will get much better responses if you actually try it out
yourself, and then ask for *specific* help, such as "Why does my
program do <x> when I expect it to do <y>". Otherwise, people (like
myself) are going to suspect that you are trying to get them to do your
homework...
If you really do not know how to multiply in assembly, then google it.
Please put in an effort before posting to a newsgroup...
.
- References:
- Need Help.
- From: spamtrap
- Need Help.
- Prev by Date: Re: why my code not compil masm8
- Next by Date: Re: How much does it take to execute MMX instruction?
- Previous by thread: Need Help.
- Next by thread: Re: Need Help.
- Index(es):
Relevant Pages
|
|