Subversion Repositories Kolibri OS

Rev

Rev 7563 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7563 Rev 7564
Line -... Line 1...
-
 
1
dword std_print(dword count, args)
-
 
2
{
1
:dword std_print(dword count, args)
3
	consoleInit();
2
{
4
	count = 1;
3
	consoleInit();
5
	WHILE(count)
-
 
6
	{
4
	WHILE(count)
7
		con_printf stdcall (DSDWORD[args]);
5
	{
8
		args+=4;
6
		con_printf stdcall (DSDWORD[args]);
9
		count--;
7
		args+=4;
10
	}
8
		count--;
11
}
9
	}
12
 
10
}
13
:dword std_set(dword count, args)
Line -... Line 14...
-
 
14
{
-
 
15
	dword name = 0;
-
 
16
	dword value = 0;
-
 
17
	WHILE(count>0)
-
 
18
	{
-
 
19
		name = DSDWORD[args];
-
 
20
		args += 4;
-
 
21
		value = DSDWORD[args];
-
 
22
		args += 4;
-
 
23
		variables.set(name, value);
-
 
24
		count-=2;
-
 
25
	}
-
 
26
}
-
 
27
 
-
 
28
:dword std_get(dword count, args)
-
 
29
{
-
 
30
	RETURN variables.get(DSDWORD[args]);
-
 
31
}
-
 
32
 
-
 
33
:dword std_str(dword count, args)
11
 
34
{
12
:dword std_str(dword count, args)
35
	dword tmp = 0;
13
{
36
	tmp = malloc(15);
14
	dword tmp = 0;
37
	itoa_(tmp,DSDWORD[args]);
15
	tmp = malloc(15);
38
	RETURN tmp;
Line 50... Line 73...
50
void Init()
73
	functions.init(100);
51
{
74
	
52
	functions.init(100);
75
	/* Console functions */
Line 53... Line 76...
53
	
76
	
54
	/* Console functions */
-
 
-
 
77
	
Line 55... Line 78...
55
	functions.set("print", #std_print);
78
	/* String functions */
56
	
79
	functions.set("str", #std_str);
Line 57... Line 80...
57
	/* String functions */
80
	
Line 62... Line 85...
62
	
85
	functions.set("+", #std_add);
63
	/* Math functions */
86
	functions.set("-", #std_sub);
64
	functions.set("+", #std_add);
87
	
Line -... Line 88...
-
 
88
	/* Lisp functions */
-
 
89
	functions.set("set", #std_set);
-
 
90
	functions.set("get", #std_get);
-
 
91
	
65
	functions.set("-", #std_sub);
92
	variables.init(100);
66
	
93
}
Line 67... Line 94...
67
	variables.init(100);
94
 
68
}
95
dword StdCall(dword count, name, args)
69
 
96
{
-
 
97
	dword tmp = 0;
70
dword StdCall(dword count, name, args)
98
	
71
{
99
	functions.get(name);
-
 
100
	IF(EAX) RETURN EAX(count, args);
-
 
101
	IF(!strcmp(name, "print"))
-
 
102
	{
-
 
103
		consoleInit();
-
 
104
		count = 1;
-
 
105
		WHILE(count)
-
 
106
		{
-
 
107
			con_printf stdcall (DSDWORD[args]);
-
 
108
			args += 4;
-
 
109
			count--;
-
 
110
		}
72
	dword tmp = 0;
111
	}
73
	functions.get(name);
112
	RETURN 0;
74
	IF(EAX)RETURN EAX(count, args);
113
}
-
 
114