9 int stoi(
const char* str) {
10 char pows[] = {1, 10, 100};
13 for(; str[size] != 0; size++) {}
16 for(
size_t i = 0; str[i] != 0; i++)
17 num += pows[size - i] * (str[i] -
'0');
24 for(
int i = 0; * (
char*)(0x80 + i) != 0; i++) {
25 if(*(
char*)(0x80 + i) ==
' ') {
26 *(
char*)(0x80 + i) = 0;
28 if(*(
char*)(0x81 + i) != 0)
36 int track =
stoi(param1);
37 int sector =
stoi(param2);
40 asm(
"int 0x13\n"::
"a"(0x0201),
"b"(disk),
"c"(track<<8 | sector),
"d"(0));
41 for(
int i = 0; i < 512; i++)
42 asm(
"int 0x20"::
"a"(disk[i]));
44 asm(
"int 0x20"::
"a"(
'\n'));
int stoi(const char *str)
Convert string to int.
useful macros, definitions, enums etc.
#define NULL
pointer to NULL
#define __start
Must be before main function of program to put this function as first in binary file.