| View previous topic :: View next topic |
| Author |
Message |
matiome1
Joined: Fri Aug 22, 2008 11:01 am Posts: 4
|
Posted: Fri Aug 22, 2008 11:04 am Post subject: MikeOS string_to_int |
|
|
| Is there a way, in MikeOS to change a string to a number? |
|
| Back to top |
|
 |
M-Saunders Moderator

Joined: Mon Apr 11, 2005 1:14 pm Posts: 2881
|
Posted: Fri Aug 22, 2008 11:14 am Post subject: RE: MikeOS string_to_int |
|
|
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 |
|
 |
matiome1
Joined: Fri Aug 22, 2008 11:01 am Posts: 4
|
Posted: Fri Aug 22, 2008 11:16 am Post subject: RE: MikeOS string_to_int |
|
|
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 |
|
 |
matiome1
Joined: Fri Aug 22, 2008 11:01 am Posts: 4
|
Posted: Fri Aug 22, 2008 11:23 am Post subject: RE: MikeOS string_to_int |
|
|
| Can you "print" a number to the screen in MikeOS (sorry about double post)? |
|
| Back to top |
|
 |
M-Saunders Moderator

Joined: Mon Apr 11, 2005 1:14 pm Posts: 2881
|
Posted: Fri Aug 22, 2008 11:37 am Post subject: RE: MikeOS string_to_int |
|
|
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 |
|
 |
matiome1
Joined: Fri Aug 22, 2008 11:01 am Posts: 4
|
Posted: Fri Aug 22, 2008 11:42 am Post subject: RE: MikeOS string_to_int |
|
|
| Thanks for the tips, the Handbook is very good! |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|