Home > other >  Consult, cx register Shared a nested loop.
Consult, cx register Shared a nested loop.

Time:05-07

Assembly is not like a high-level language, nested loop only CX is available,
Said in the book can be used to stack storage, so the whole stack can only serve CX, because the stack out after the first, you can't put anything else in the stack,

CodePudding user response:

Cx of cycle doesn't have to use, also can be other conditions; Use the stack to save cycle cx, usually can be, because the stack inner loop should be balanced, so push cx - & gt; Inner loop - & gt; Cx is not a contradiction, pop, of course, also can use memory or other general purpose registers to save cx,

CodePudding user response:

reference 1/f, zara's reply:
cycle with cx, not necessarily can also be other conditions; Use the stack to save cycle cx, usually can be, because the stack inner loop should be balanced, so push cx - & gt; Inner loop - & gt; Cx is not a contradiction, pop, of course, also can use the memory cx, even other general-purpose registers to save

That if there are many layers of nested loop, that to find where to store so many cx?

CodePudding user response:

The stack is simple