Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,582 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,926 people online right now. Registration is fast and FREE... Join Now!




My assembly program - how will I add any number on my first inputted n

 
Reply to this topicStart new topic

My assembly program - how will I add any number on my first inputted n, Add number to first input

marckiestar
27 Sep, 2008 - 02:30 AM
Post #1

New D.I.C Head
*

Joined: 21 Aug, 2007
Posts: 21



Thanked: 1 times
My Contributions
Hi Guys! Thanks for the info on my other topic on this link http://www.dreamincode.net/forums/showtopic65152.htm , but I figured it out by myself.

And now, I'm trying to add a number on my first input.

Here's the code I've made :

CODE


DOSSEG
       .MODEL SMALL
       .STACK 200H
       .DATA

hello    db    "Input Number: $"
input    db    6 dup("$")
newline    db    13,10,"$"
msg     db      "You Have Inputted: $"

.code

clrscr    proc
    push ax
    mov al, 03h
    mov ah, 00h
    int 10h
    pop ax
    ret
clrscr    endp

readstr    proc
    push ax
    mov ah, 0ah
    int 21h
    pop ax
    ret
readstr    endp

printstr proc
    push ax
    mov ah, 09h
    int 21h
    pop ax
    ret
printstr endp


begin: mov ax, @data
       mov ds, ax
       mov es, ax
    
    call clrscr

lbl1:    lea dx,[hello]
    mov ah,09h
    int 21h
    

    mov  input, 41
    lea dx, input
    call readstr

    
;lea si, input    im not sure about this part, i just enclosed it here as a comment
;mov al, [si]+1
;add dx,0001h ------ > im trying to add 1 on the input but it doesn't work
    

    lea dx, newline
    call printstr
    
    lea dx, msg
    call printstr
    
    lea dx, input[0002]
    call printstr
    
mov ah, 4ch
int 21h

end begin

    



Guys, can you modify my code?
Please add a comment,
I wanted to have an example on adding 1 on it and any number.
Please have your modifications on my code above, so that I will be able to where the proper placements for your code.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:36AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month