Hi,
Please help me to solve the problem:

suppose a computer, with 16-bit instructions
Address field is 6 bits
Instruction set includes 2- address and a single address and zero address commands
If the number of 1-address instructions is 120 commands
what is the maximum number of 2-address commands?
2-Address is like (Load Ri,M)
1-Address (Load Ri)
0-Address (Push M)

I would think that if you have 16 bits to use for instructions, and an address field takes up 6 bits, then you use 12 bits for a 2 address instruction. That leave you with 4 bits to use for various instructions to access to addresses.

So, 2^4 = 16 two address instructions at most.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.