Implement segalloc for minijort
This commit is contained in:
parent
e3d15b37cf
commit
8439de78e9
|
@ -791,6 +791,14 @@ void f_rand() {
|
||||||
PUSHI(rand());
|
PUSHI(rand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void f_segalloc() {
|
||||||
|
void far* ptr = farmalloc(0x10010UL);
|
||||||
|
unsigned long linearaddr = ((unsigned long)FP_SEG(ptr) << 4) +
|
||||||
|
((unsigned long)FP_OFF(ptr));
|
||||||
|
int segment = ((linearaddr & 0x000ffff0UL) >> 4);
|
||||||
|
PUSHI(segment);
|
||||||
|
}
|
||||||
|
|
||||||
void f_init() {
|
void f_init() {
|
||||||
CDEF("[", f_compileoff); f_immediate();
|
CDEF("[", f_compileoff); f_immediate();
|
||||||
CDEF("]", f_compileon);
|
CDEF("]", f_compileon);
|
||||||
|
@ -900,6 +908,7 @@ void f_init() {
|
||||||
CDEF("chdir", f_chdir);
|
CDEF("chdir", f_chdir);
|
||||||
CDEF("memmove", f_memmove);
|
CDEF("memmove", f_memmove);
|
||||||
CDEF("rand", f_rand);
|
CDEF("rand", f_rand);
|
||||||
|
CDEF("segalloc", f_segalloc);
|
||||||
PCONST("$DOCREATE", f_docreate);
|
PCONST("$DOCREATE", f_docreate);
|
||||||
PCONST("$DOVAR", f_dovar);
|
PCONST("$DOVAR", f_dovar);
|
||||||
PCONST("$DODEFERRED", f_dodeferred);
|
PCONST("$DODEFERRED", f_dodeferred);
|
||||||
|
|
BIN
minijort.exe
BIN
minijort.exe
Binary file not shown.
BIN
minijort.prj
BIN
minijort.prj
Binary file not shown.
Loading…
Reference in a new issue