News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_VintageAdvantage

Discussion on semantics, but without Umberto Eco

Started by VintageAdvantage, 18:27, 31 December 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VintageAdvantage

Quote from: nicf82 on 13:17, 31 December 20Interesting! I presume that is also why we only use OUT (C) instead of OUT (BC)

No, the reason is that OUT (C), reg ALWAYS acts like OUT (BC),reg. C is on the address bus from A0 to A7, and B is on the address bus from A8 bis A15. So OUT (BC),reg does not exists, or, it IS actually the same as OUT (C), reg.

So, there is NO OUT (BC), reg op-code in Z80. That's OUT (C), reg, and it actually does OUT (BC), reg. :-) Clear now?

Pelrun's last "Bingo" is wrong.

The bigger question really is - why did the Zilog engineers not call the the mnemonic OUT (BC), reg but used OUT (C), reg instead? Does anybody know? 8080 legacy or something like that?

From the given mnemonics, it surely seems that they intended the Z80 to be used as an 8bit IO address machine; however, it is clearly documented (and intended) that the BC full register is put on the address bus. Calling this an "undocumented quirk" is wrong and misleading.

pelrun

#1
@VintageAdvantage , if you're going to claim we're wrong, you would want to say something that actually refutes our points rather than just restates them.
The Z80 was *designed* to only use C here, to be backwards compatible with the 8080 (as distinct from how it was actually *implemented*). That's why the instruction is "OUT (C),C". But it actually takes a lot more logic to mask off the B in the BC pair, and there is absolutely no benefit to doing it, so Zilog didn't bother. Instead, the restriction is in the *documentation only*.

VintageAdvantage

#2
What is wrong is this:

Quote from: nicf82 on 13:17, 31 December 20Interesting! I presume that is also why we only use OUT (C) instead of OUT (BC)

No, the reason why we are not using OUT (BC), reg is that this op-code / mnemonic does not exist. We would be using it if it existed, because this is what's actually going on.


Quote from: pelrun on 13:28, 31 December 20Bingo! I almost mentioned that but didn't quite get around to it :D

Nope. If you are confirming something that's wrong, then this is also wrong  :-*

pelrun

What exactly are you trying to accomplish here? Wait, don't answer that, I don't have any interest in engaging you further.

VintageAdvantage

Quote from: pelrun on 03:57, 01 January 21The Z80 was *designed* to only use C here, to be backwards compatible with the 8080 (as distinct from how it was actually *implemented*). That's why the instruction is "OUT (C),C". But it actually takes a lot more logic to mask off the B in the BC pair, and there is absolutely no benefit to doing it, so Zilog didn't bother. Instead, the restriction is in the *documentation only*.

Are you just going to quote what I wrote already above?

VintageAdvantage

What is wrong is this:

Quote from: nicf82 on Yesterday at 14:17
Interesting! I presume that is also why we only use OUT (C) instead of OUT (BC)

No, the reason why we are not using OUT (BC), reg is that this op-code / mnemonic does not exist. We would be using it if it existed, because this is what's actually going on.


Quote from: pelrun on Yesterday at 14:28
Bingo! I almost mentioned that but didn't quite get around to it
:D
Nope. If you are confirming something that's wrong, then this is also wrong 

:-* :P

pelrun

"We don't use OUT (BC),C because that opcode/mnemonic doesn't exist"
The opcode exists, it's just *called* "OUT (C),C" by convention.  :picard: :picard2: :doh: Can you please stop twisting yourself into semantic knots to win a stupid argument on the internet?

VintageAdvantage

#7
But I am not... see, the 8080 backward compatibility issue was raised by me, as a question, and it was actually meant as a suggestive question ;-) So yes, the OUT (C), reg is inherited from the 8080 mnemonics and the op code is identical indeed. However, for the Z80, the semantics is really the one of an OUT (BC), reg, as we all agree. If they had renamed the mnemonics, they would have used that one. So the real reason for not using OUT (BC), reg is that they haven't renamed it, and wanted to keep the mnemonics backward compatible.

pelrun

Congratulations, that's what we originally said.

rpalmer

#9
For my 2 cents worth:
The best way to think of the Z80 is an enhanced 8080.The opcodes from 8080 work on a Z80, there would be subtle differences from internals specifics (to avoid Zilog being litigated by Intel when the Z80 was originally released).

The discussion seems to be on how the assembler determines HOW to handle statements like OUT (C) or OUT (BC).
An assembler may indeed have an "OUT (BC),xx" but the generated code is the same as the common convention "OUT (C),xx". It is all in the making of the text code easier for us humans to understand when considering what actually the instruction does.Most assemblers (if not all) use "OUT (C),xx" by convention to map the same functions as that originally designed by Intel for the same opcode.

nicf82

Yes Vintage that amounts to the same thing I think doesn't it? All I was saying is that calling OUT (C) results in the chip effectively doing an OUT (BC). I was never aware until pelrun mentioned it that this is because Zilog never advertised the IO address bus as being 16 bit. Also was not aware that it had its roots in the 8080.

Happy new year everyone  ;D

VintageAdvantage

#11
Quote from: pelrun on 11:16, 01 January 21
Congratulations, that's what we originally said.
You are a bad argument looser... Is your ego so brittle that you cannot admit that I was the one who brought up the 8080 backward compatibility reason? You only mentioned the 8080 after I suggested that explanation. There is no mention of the 8080 in any of your BS explanations before I brought it up...


VintageAdvantage

Quote from: rpalmer on 12:52, 01 January 21An assembler may indeed have an "OUT (BC),xx"

It may.  Which one please? None that I am using has it.

VintageAdvantage

#13
Quote from: nicf82 on 12:56, 01 January 21All I was saying is that calling OUT (C) results in the chip effectively doing an OUT (BC).

No you weren't. You were saying that we don't have OUT (BC) because of some conspiracy
theory being presented with one-hot encoding and how the CPC was addressing its chips with chip select...which in principle would suffice to use one 8bit register only for, but has nothing to do why we don't have OUT (BC). 

Nobody ever disputed the facts, which were correctly presented in the first place. What I was disputing is the BS explanation for the facts.

Quote from: nicf82 on 12:56, 01 January 21is because Zilog never advertised the IO address bus as being 16 bit

I don't think that is the case...  this is well documented in any Z80 book / reference manual.

VintageAdvantage

#14
Quote from: rpalmer on 12:52, 01 January 21The discussion seems to be on how the assembler determines HOW to handle statements like OUT (C) or OUT (BC).

Correct. This is the difference between MNEMONICS (OUT (BC)) and op-code (binary reprsentation, 0hED49)  for an instruction that achieves a certain effect (has a special semantics, e.g., "output register pair BC to the IO address bus"). Of course we could name this instruction "foobar" but then legacy 8080 assembler would not have worked well for the Z80.

Powered by SMFPacks Menu Editor Mod