简体   繁体   中英

Is PUSH instruction in assembly language a zero address instruction or one address instruction?

I read that ADD and MUL instructions when implemented in Stack are zero address instructions but there is no discussion anywhere as to PUSH and POP instruction are one address instruction or zero address instructions. Here is an excerpt from Computer Architecture by Morris Mano: 在此处输入图片说明

It was asked in our exams and answered as zero address instruction but I am pretty sure it must be a one address instruction. Please someone help.

PUSH/POP are clearly 1 explicit address because they have one explicit operand. The other (implicit) operands being the stack pointer and stack contents.

The text you quote from your textbook even says PUSH and POP need one address field in their machine code.

Clearly a grading error on your exam, mixing PUSH/POP up with ADD/MUL instructions in that stack machine. Even in other ISAs like x86, PUSH/POP are 1-address instructions .

PUSH could only be 0-address if there was some fixed register whose contents were pushed, and you had to get data into that register first to push it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM