SP <- 1;
N(the number of actual arguments) <- 0;
Repeat{ //macro call
S(SP) <- -1;
S(SP+1) <- MDT index from MDT;
insert actual argument to S(SP+2, ..., S(SP+N+1);
S(SP+1) <- S(SP+1)+1;
repeat{ //macro call in macro
read S(SP) from MDT;
match actual arguments using S(SP+2),...,S(SP+N+1);
complete the instruction;
S(SP+1) <- S(SP+1)+1;
if(ENDM) SP <- S(SP); //go to sp before macro call
if(macro call){
S(SP+n+2) <- SP;
SP <- SP+N+2;
S(SP+1) <-MNT의 MDT index;
insert actual arguments to S(SP+2),...,S(SP+N+1);
S(SP+1) <- S(SP+1)+1;
}
else{ print the expanded instruction; }
}
until(S(SP)!=-1)
}
else{ print read instruction;}
}
until (NOT END instruction)
END expanded macro procedure;
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I am taking a system programming class, and in the class I learned intel 8086 processor. I'm studying recursive macro call algorithm. But I wonder why first s(sp) becomes -1 when stack pointer(==sp) is 1. I know little about intel 8086 processor.
here's pseudo code
Enlace copiado
0 Respuestas
Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla