MikeOS string_to_int

Help and discussion about non-Linux operating systems

Moderators: ChrisThornett, LXF moderators

MikeOS string_to_int

Postby matiome1 » Fri Aug 22, 2008 10:04 am

Is there a way, in MikeOS to change a string to a number?
matiome1
 
Posts: 4
Joined: Fri Aug 22, 2008 10:01 am

RE: MikeOS string_to_int

Postby M-Saunders » Fri Aug 22, 2008 10:14 am

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
User avatar
M-Saunders
LXF regular
 
Posts: 2893
Joined: Mon Apr 11, 2005 12:14 pm

RE: MikeOS string_to_int

Postby matiome1 » Fri Aug 22, 2008 10:16 am

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...
matiome1
 
Posts: 4
Joined: Fri Aug 22, 2008 10:01 am

RE: MikeOS string_to_int

Postby matiome1 » Fri Aug 22, 2008 10:23 am

Can you "print" a number to the screen in MikeOS (sorry about double post)?
matiome1
 
Posts: 4
Joined: Fri Aug 22, 2008 10:01 am

RE: MikeOS string_to_int

Postby M-Saunders » Fri Aug 22, 2008 10:37 am

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
User avatar
M-Saunders
LXF regular
 
Posts: 2893
Joined: Mon Apr 11, 2005 12:14 pm

RE: MikeOS string_to_int

Postby matiome1 » Fri Aug 22, 2008 10:42 am

Thanks for the tips, the Handbook is very good!
matiome1
 
Posts: 4
Joined: Fri Aug 22, 2008 10:01 am


Return to Other OS

Who is online

Users browsing this forum: No registered users and 0 guests