Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MikeOS string_to_int

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Other OS
View previous topic :: View next topic  
Author Message
matiome1



Joined: Fri Aug 22, 2008 11:01 am
Posts: 4

PostPosted: Fri Aug 22, 2008 11:04 am    Post subject: MikeOS string_to_int Reply with quote

Is there a way, in MikeOS to change a string to a number?
Back to top
View user's profile Send private message
M-Saunders
LXF regular


Joined: Mon Apr 11, 2005 1:14 pm
Posts: 2893

PostPosted: Fri Aug 22, 2008 11:14 am    Post subject: RE: MikeOS string_to_int Reply with quote

Lo,

Nope, there isn't a system call for that yet -- only the inverse, os_int_to_string.

But adding such a call would be a good project! The Hanbook shows how to create your own system calls (it's really easy), so if you fancy it, join the mailing list on the MikeOS website and keep us informed!

M
Back to top
View user's profile Send private message Visit poster's website
matiome1



Joined: Fri Aug 22, 2008 11:01 am
Posts: 4

PostPosted: Fri Aug 22, 2008 11:16 am    Post subject: RE: MikeOS string_to_int Reply with quote

The problem is I'm a newbie to assembly so I have no idea how to go about doing this.
If I find out how to do it I'll have a go...
Back to top
View user's profile Send private message
matiome1



Joined: Fri Aug 22, 2008 11:01 am
Posts: 4

PostPosted: Fri Aug 22, 2008 11:23 am    Post subject: RE: MikeOS string_to_int Reply with quote

Can you "print" a number to the screen in MikeOS (sorry about double post)?
Back to top
View user's profile Send private message
M-Saunders
LXF regular


Joined: Mon Apr 11, 2005 1:14 pm
Posts: 2893

PostPosted: Fri Aug 22, 2008 11:37 am    Post subject: RE: MikeOS string_to_int Reply with quote

Yes, you can use os_print_2hex to display the contents of AL (in hexadecimal), and os_print_4hex to display AX (hex). Or you can use os_print_digit to print the contents of AX in decimal.

Have you read the assembly language primer in the Handbook? That should give you a basic grounding!

M
Back to top
View user's profile Send private message Visit poster's website
matiome1



Joined: Fri Aug 22, 2008 11:01 am
Posts: 4

PostPosted: Fri Aug 22, 2008 11:42 am    Post subject: RE: MikeOS string_to_int Reply with quote

Thanks for the tips, the Handbook is very good!
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Other OS All times are GMT
Page 1 of 1

 
Jump to:  
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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast