flat assembler
Message board for the users of flat assembler.

Index > DOS > program to add

Author
Thread Post new topic Reply to topic
charunanda



Joined: 09 Nov 2011
Posts: 2
Location: india
charunanda
org 100h
use16
mov al,01h
mov bl,01h
add al,bl
mov ah, 09
mov dl,al
int 21h
mov ah,01
int 21h
mov ah, 4ch
int 21h

i wrote this to add 2 numbers. but when i compile it shows 1pass etc. when i run its not working, instead computer beeps ans shows some error. what could be wrong with this program. pl help me to rectify that.

_________________
Thanking you in advance

CHARU
Post 09 Nov 2011, 17:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
Moving to DOS
Post 09 Nov 2011, 17:20
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Try This:
Code:
org 100h

        mov al,01h
  mov bl,01h
  add al,bl
   mov ah, 02
  mov dl,al
   add dl,30h
  int 21h

 ret    

_________________
Nil Volentibus Arduum Razz
Post 09 Nov 2011, 19:42
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 759
Location: Massachusetts, USA
bitshifter
add dl,'0' is easier to read for me...
Post 10 Nov 2011, 07:18
View user's profile Send private message Reply with quote
charunanda



Joined: 09 Nov 2011
Posts: 2
Location: india
charunanda
I copied and run code given by DJ Mauretto. But i cant see the otput. the outpmt screen come and then vanishes. what could be the reason?
Post 10 Nov 2011, 14:18
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Quote:
I copied and run code given by DJ Mauretto. But i cant see the otput. the outpmt screen come and then vanishes. what could be the reason?

The reason is that you must run this program under dos shell..
anyway now i added a wait for a key
Code:

org 100h

        mov al,01h
        mov bl,01h
        add al,bl
        mov ah, 02
        mov dl,al
        add dl,30h
        int 21h

        xor ax,ax
        int 16h
        ret    
Wink

_________________
Nil Volentibus Arduum Razz
Post 10 Nov 2011, 15:14
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.