Re: ESP (stack) question (using HLA)???



A correction above, HLA *can* push 16 bit values. Sorry.

Just adjust the above code for word size.

program minstack;

#include ("stdlib.hhf")

static
Wdeg: uns16 := 0;
rstack: uns16[2];
tesp: dword;
endstatic;

begin minstack;

mov (esp, tesp);
lea (esp, rstack [2*2]);

mov (10, ax);
push (ax);
pop (Wdeg);

mov (tesp, esp);
stdout.put ("Wdeg = ", Wdeg,nl);
stdout.put ("contents of stack = :",
rstack[0*2], " ",
rstack[1*2],nl);


end minstack;

.