libaml: implement Alias and Debug instructions
This commit is contained in:
parent
a71b3dff06
commit
6aa1ca35c3
1 changed files with 15 additions and 4 deletions
|
@ -155,9 +155,9 @@ static Frame stack[32];
|
||||||
static Heap *hp;
|
static Heap *hp;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
Obad, Onop,
|
Obad, Onop, Odebug,
|
||||||
Ostr, Obyte, Oword, Odword, Oqword, Oconst,
|
Ostr, Obyte, Oword, Odword, Oqword, Oconst,
|
||||||
Onamec, Oname, Oscope,
|
Onamec, Oname, Oscope, Oalias,
|
||||||
Oreg, Ofld, Oxfld, Opkg, Ovpkg, Oenv, Obuf, Omet,
|
Oreg, Ofld, Oxfld, Opkg, Ovpkg, Oenv, Obuf, Omet,
|
||||||
Odev, Ocpu, Othz, Oprc,
|
Odev, Ocpu, Othz, Oprc,
|
||||||
Oadd, Osub, Omod, Omul, Odiv, Oshl, Oshr, Oand, Onand, Oor,
|
Oadd, Osub, Omod, Omul, Odiv, Oshl, Oshr, Oand, Onand, Oor,
|
||||||
|
@ -1067,6 +1067,15 @@ evalscope(void){
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void*
|
||||||
|
evalalias(void){
|
||||||
|
Name *n;
|
||||||
|
|
||||||
|
if(n = FP->arg[1])
|
||||||
|
n->v = FP->arg[0];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
evalmet(void){
|
evalmet(void){
|
||||||
Name *n;
|
Name *n;
|
||||||
|
@ -1527,6 +1536,7 @@ evalarith(void){
|
||||||
static Op optab[] = {
|
static Op optab[] = {
|
||||||
[Obad] "", "", evalbad,
|
[Obad] "", "", evalbad,
|
||||||
[Onop] "Noop", "", evalnop,
|
[Onop] "Noop", "", evalnop,
|
||||||
|
[Odebug] "Debug", "", evalnop,
|
||||||
|
|
||||||
[Ostr] ".str", "s", evaliarg0,
|
[Ostr] ".str", "s", evaliarg0,
|
||||||
[Obyte] ".byte", "1", evaliarg0,
|
[Obyte] ".byte", "1", evaliarg0,
|
||||||
|
@ -1539,6 +1549,7 @@ static Op optab[] = {
|
||||||
|
|
||||||
[Oname] "Name", "N*", evalname,
|
[Oname] "Name", "N*", evalname,
|
||||||
[Oscope] "Scope", "{n}", evalscope,
|
[Oscope] "Scope", "{n}", evalscope,
|
||||||
|
[Oalias] "Alias", "nN", evalalias,
|
||||||
|
|
||||||
[Odev] "Device", "{N}", evalscope,
|
[Odev] "Device", "{N}", evalscope,
|
||||||
[Ocpu] "Processor", "{N141}", evalscope,
|
[Ocpu] "Processor", "{N141}", evalscope,
|
||||||
|
@ -1608,7 +1619,7 @@ static Op optab[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static uchar octab1[] = {
|
static uchar octab1[] = {
|
||||||
/* 00 */ Oconst, Oconst, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 00 */ Oconst, Oconst, Obad, Obad, Obad, Obad, Oalias, Obad,
|
||||||
/* 08 */ Oname, Obad, Obyte, Oword, Odword, Ostr, Oqword, Obad,
|
/* 08 */ Oname, Obad, Obyte, Oword, Odword, Ostr, Oqword, Obad,
|
||||||
/* 10 */ Oscope, Obuf, Opkg, Ovpkg, Omet, Obad, Obad, Obad,
|
/* 10 */ Oscope, Obuf, Opkg, Ovpkg, Omet, Obad, Obad, Obad,
|
||||||
/* 18 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 18 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
|
@ -1649,7 +1660,7 @@ static uchar octab2[] = {
|
||||||
/* 18 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 18 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
/* 20 */ Obad, Obad, Obad, Oacq, Obad, Obad, Obad, Orel,
|
/* 20 */ Obad, Obad, Obad, Oacq, Obad, Obad, Obad, Orel,
|
||||||
/* 28 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 28 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
/* 30 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 30 */ Obad, Odebug, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
/* 38 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 38 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
/* 40 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 40 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
/* 48 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
/* 48 */ Obad, Obad, Obad, Obad, Obad, Obad, Obad, Obad,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue