Subversion Repositories Kolibri OS

Rev

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

Rev 7744 Rev 7745
Line 1... Line 1...
1
/* Lisp functions */
1
/* Lisp functions */
-
 
2
 
2
:dword std_exit()
3
:dword std_sleep(dword count, args)
3
{
4
{
-
 
5
	dword ret = 0;
-
 
6
	dword arg = 0;
-
 
7
	dword val = 0;
-
 
8
	WHILE(count)
-
 
9
	{
-
 
10
		arg = DSDWORD[args];
-
 
11
		REPEAT1:
-
 
12
		IF (DSDWORD[arg+4] == TSym) 
-
 
13
		{
4
	con_exit stdcall (1);
14
			arg = std_get(1, args);
5
	ExitProcess();
15
			goto REPEAT1;
-
 
16
		}
-
 
17
		IF (DSDWORD[arg+4] == TInt)
-
 
18
		{
-
 
19
			EAX = 5;
-
 
20
			EBX = DSDWORD[arg];
-
 
21
			$int 0x40
-
 
22
		}
-
 
23
		args+=4;
-
 
24
		count--;
-
 
25
	}
-
 
26
	RETURN ret;
6
}
27
}
Line 7... Line 28...
7
 
28
 
8
:dword std_set(dword count, args)
29
:dword std_set(dword count, args)
9
{
30
{
Line 60... Line 81...
60
	}
81
	}
61
	RETURN ret;
82
	RETURN ret;
62
}
83
}
63
 
84
 
Line -... Line 85...
-
 
85
:dword std_exit(dword count, args)
-
 
86
{
-
 
87
	IF(initConsole) con_exit stdcall (1);
-
 
88
	ExitProcess();
-
 
89
}
-
 
90
 
64
:dword std_sub(dword count, args)
91
:dword std_sub(dword count, args)
65
{
92
{
66
	dword ret = 0;
93
	dword ret = 0;
67
	IF(count)
94
	IF(count)
68
	{ 
95
	{ 
Line 78... Line 105...
78
	}
105
	}
79
	RETURN ret;
106
	RETURN ret;
80
}
107
}
81
 
108
 
Line -... Line 109...
-
 
109
:dword std_type(dword count, args)
-
 
110
{
-
 
111
	dword ret = 0;
-
 
112
	dword arg = 0;
-
 
113
	dword val = 0;
-
 
114
	ret = malloc(TLen);
-
 
115
	DSDWORD[ret] = "nil";
-
 
116
	DSDWORD[ret+4] = TStr;
-
 
117
	WHILE(count)
-
 
118
	{
-
 
119
		arg = DSDWORD[args];
-
 
120
		REPEAT1:
-
 
121
		IF (DSDWORD[arg+4] == TSym) 
-
 
122
		{
-
 
123
			arg = std_get(1, args);
-
 
124
			goto REPEAT1;
-
 
125
		}
-
 
126
		switch (DSDWORD[arg+4])
-
 
127
		{
-
 
128
			case TStr:
-
 
129
				DSDWORD[ret] = "string";
-
 
130
			break;
-
 
131
			case TInt:
-
 
132
				DSDWORD[ret] = "integer";
-
 
133
			break;
-
 
134
		}
-
 
135
		args+=4;
-
 
136
		count--;
-
 
137
	}
-
 
138
	RETURN ret;
-
 
139
}
-
 
140
 
82
/* Console functions */
141
/* Console functions */
83
:dword std_print(dword count, args)
142
:dword std_print(dword count, args)
84
{
143
{
85
	dword ret = 0;
144
	dword ret = 0;
86
	dword arg = 0;
145
	dword arg = 0;
Line 216... Line 275...
216
	
275
	
Line 217... Line 276...
217
	/* Lisp functions */
276
	/* Lisp functions */
218
	functions.set("set", #std_set);
277
	functions.set("set", #std_set);
219
	functions.set("get", #std_get);
278
	functions.set("get", #std_get);
-
 
279
	functions.set("type", #std_type);
-
 
280
	functions.set("sleep", #std_sleep);
-
 
281
 
Line 220... Line 282...
220
	
282
	
221
	variables.init(100);
283
	variables.init(100);
Line 222... Line 284...
222
}
284
}