User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 456,556 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,441 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Programming Forums
Views: 1828 | Replies: 13
Reply
Join Date: Oct 2007
Posts: 9
Reputation: tifka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tifka tifka is offline Offline
Newbie Poster

User input

  #1  
Oct 18th, 2007
Hey guys i just joined, I am sure this is a dumb question, but i been googling for the past week and cant seem to find a simple answer. I been trying to learn asm and I am trying to make a menu system. So like you type 1 and it jumps to that, you type 2 it jumps to that and so on. I cant seem to find out how to get user input though. Sorry if the answer is already on the forums I cant seem to find it.

Thanks for you help.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation: Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold Duoas is a splendid one to behold 
Rep Power: 13
Solved Threads: 193
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: User input

  #2  
Oct 18th, 2007
What OS are you using?

If it is x86 google "dos interrupt 21h".
If you are on a MIPS processor you'll need to google "mips syscall".

Hope this helps.
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: tifka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tifka tifka is offline Offline
Newbie Poster

Re: User input

  #3  
Oct 18th, 2007
Ok thank you, I usually boot from a cd when I do programming. So i use backtrack which is Linux.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: User input

  #4  
Oct 18th, 2007
Also what assembler because some assemblers have macros that do all (or most) of the grunt work of calling system functions.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: User input

  #5  
Oct 18th, 2007
Originally Posted by tifka View Post
Ok thank you, I usually boot from a cd when I do programming. So i use backtrack which is Linux.


You mean you actually boot linux from a CD You must be awfully patient to wait all that time for your computer to boot up.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: tifka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tifka tifka is offline Offline
Newbie Poster

Re: User input

  #6  
Oct 18th, 2007
Lol, well i have windows as my default and i only use my 1 hard drive which is 36gigs but its a raptor so its 10000 rpms which is nice. I have another one but something happened and its not working properly. So i cant grub boot. But i use NASM as my compiler.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: User input

  #7  
Oct 19th, 2007
>>But i use NASM as my compiler

Its not a compiler, but an assembler.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: tifka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tifka tifka is offline Offline
Newbie Poster

Re: User input

  #8  
Oct 19th, 2007
Well yea, So I try to do like

 
mov ah,01h
int 16h

Shouldn't that let the user in put whatever he/she wants?
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: User input

  #9  
Oct 19th, 2007
you need a good explaination of those interrupt functions. Here is just one of them you can find. Function 1, which you posted, only tests to see if a key has been pressed. You have to call other functions to actually get the value, such as function 10. But it too only returns the value of ONE key, so you have to create a loop and keep calling those two functions until function 1 says no-more-keys.

what you do with those keys is up to you -- normally you will want to put then into a buffer so that they can be easily used whenever you want.
Last edited by Ancient Dragon : Oct 19th, 2007 at 2:09 pm.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: tifka is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tifka tifka is offline Offline
Newbie Poster

Re: User input

  #10  
Oct 22nd, 2007
Ok thank you, just curious though with that they give you how to run the different things. Like for example....
INT 21,2B - Set Date
EXAMPLE
would i do

 section .data

global _start

_start:

AH = 2B
CX = 2007
DH = 10
DL = 22
int 21
Last edited by tifka : Oct 22nd, 2007 at 2:15 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Assembly Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Assembly Forum

All times are GMT -4. The time now is 5:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC