Bit one of the Intel 8080's Flags registerLCD Displays with the Intel 8080How did the Z80 instruction set differ from the 8080?Why did Pokémon Red have so many overflow bugs?Intel 8080 - Behaviour of the carry bit when comparing a value with 0The start of x86: Intel 8080 vs Intel 8086?Intel 8080-based home computersIs the Game Boy Sharp LR35902 object-compatible with the 8080/Z-80?The behavior of the auxiliary carry flag in subtraction on Intel 8080
Do companies have non compete agreements between each other?
Does Airplane Mode allow GPS location to pass through?
How do I negotiate salary when returning to a position I just left?
Balancing empathy and deferring to the syllabus in teaching responsibilities
Is there a word/phrase that can describe playing a musical instrument in a casual way?
How can medieval knights protects themselves against guns?
Game company goes bankrupt, another company wants to make a sequel how?
I noticed an error in a graded exam during office hours. Should I give the student the lower grade?
CEO says not to expect pay increases unless you do something really exceptional. Is this counter-productive?
Starting a sentence instantly with a noun
Ground->ship Wi-Fi bandwidth in my fast moving spaceship
Why dont electrical receptacles have more than one ground?
How did Boris Johnson manage to be elected Mayor of London for two terms when London is usually staunchly Labour?
Make me speak L33T
Why is it so important who the whistleblower in the Trump-Zelensky phone call is?
What else would an hot red wire be for in a split-tab outlet?
SQL - Leveraging an index on another column with the same ordering guarantee
Triangular domino tiling of an almost regular hexagon
A bob hanging in an accelerating train moves backward. What is the force moving it backward?
Is there a difference between “When you are reduced to 0 hit points” and “when you would be reduced to 0 hit points”?
Can span be constexpr?
Two people from small group of friends want to have a "meeting" with me. The circumstances are strange and give me a bad feeling
Could dinosaurs breathe modern air?
Adjoints for radical and socle functors
Bit one of the Intel 8080's Flags register
LCD Displays with the Intel 8080How did the Z80 instruction set differ from the 8080?Why did Pokémon Red have so many overflow bugs?Intel 8080 - Behaviour of the carry bit when comparing a value with 0The start of x86: Intel 8080 vs Intel 8086?Intel 8080-based home computersIs the Game Boy Sharp LR35902 object-compatible with the 8080/Z-80?The behavior of the auxiliary carry flag in subtraction on Intel 8080
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup? If so what was the reason for this, and was this inherited from the 8008 Flags register?
8080
add a comment
|
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup? If so what was the reason for this, and was this inherited from the 8008 Flags register?
8080
add a comment
|
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup? If so what was the reason for this, and was this inherited from the 8008 Flags register?
8080
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup? If so what was the reason for this, and was this inherited from the 8008 Flags register?
8080
8080
edited Sep 12 at 16:31
Single Malt
asked Sep 12 at 16:25
Single MaltSingle Malt
3035 bronze badges
3035 bronze badges
add a comment
|
add a comment
|
3 Answers
3
active
oldest
votes
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup?
TL;DR:
No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW
is executed.
Long Read:
The 8080 does not have a flag register, but like its predecessor the 8008, separate flags. Which are, like other answers correctly describe, in random states after power-up/reset.
The 8080 flags have no access in register form for the programmer. Only testing in conditioned instructions is possible. Setting could only be done via instructions with implied result stored in any of them. The only access as byte data was when pushed onto the stack.
When storing the flags to the stack (PUSH PSW
) the second byte is synthesized from the flag bits and completed by 'filler' values for positions 1, 3, 5 (1, 0, 0). This guarantees that in memory bit 1 always will be 1.
(From "8080 Assembly Language Programming Manual", "Rev B", p.22/23)
During store (PUSH PSW
)
If register pair PSW is specified, the first byte of information
saved holds the contents of the A register; the
second byte holds the settings of the five condition bits,
i.e., Carry, Zero, Sign, Parity, and Auxiliary Carry. The format
of this byte is:
| | | |A| | | | |
|S|Z|0|C|0|P|1|C|
S State of Sign bit
Z State of Zero bit
0 always 0
AC State of auxiliary Carry bit
0 always 0
P State of Parity bit
1 always 1
C State of Carry bit
For retrieval (POP PSW
):
[...] If register pair
PSW is specified, the byte of data indicated by the contents
of the stack pointer plus one is used to restore the values of
the five condition bits (Carry, Zero, Sign, Parity, and Auxiliary
Carry) using the format described in the last section.
If so what was the reason for this, and was this inherited from the 8008 Flags register?
In part, as they were separate single-bit entities. Except the 8008 did not allow any access to the flags beside testing them in conditional instructions. There was no instruction to store or retrieve them at all.
Tidbits on x80-Family Flags:
The grand daddy of all things 80, the Datapoint 2200 laid the ground here by defining them as separate flip-flops, only accessible using conditional instructions. They are not presented as a register-like structure in any way.
The 8008, being a single chip implementation of the 2200, followed that, while the 8080 did introduce a register-like view for its programming model, but not in hardware.
Only the follow up 8085 did introduce a real flag register (*1), still not in the register file, but kept separate, like the A register (*2). Now bit 1 was used as V flag. That's one of the incompatibilities with 8080 code - and one way to detect a 8085: by pushing a cleared HL, popping PSW, pushing PSW again and then checking L. If bit 1 is still cleared, it's an 8085.
The Z80, in contrast, added a flag register (or more accurately two, as there's one in the alternate register set too) as part of its huge register file, but workings were still based on separate flip-flops located near the ALU. At the beginning of every instruction the content of the flag register in use got copied into the flag flip-flops, and copied back at the end. This process is a must when handling two separate register sets and also keeping the flags close to the ALU.
The Datapoint 2200 Version 2 also had two register sets: no flag register, but two sets of flag flip-flops multiplexed toward the ALU (like the registers).
*1 - Well, almost, as only 7 storage bits are implemented. Bit 3 was replaced by a circuit to always drive 0 when read.
*2 - On the 8008 and 8080, the A register was also not a member of the register file.
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
|
show 4 more comments
According to the manual, the only thing that is explicitly set after RESET in the 8080 is the program counter. Everything else is indeterminate:
Note, however,that the RESET has no effect on status flags, or on any of the processor's working registers (accumulator, registers, or stackpointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
If they don't initialize anything at all, it is very unlikely they'd initialize something that isn't even used.
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
add a comment
|
According to the Intel 8080 microcomputer systems user’s manual, the contents of registers are indeterminate on startup:
The contents of its
program counter, stack pointer, and the other working registers are naturally subject to random factors and cannot be
specified.
And further on:
Note, however, that
theRESET
has no effect on status flags, or on any of the
processor's working registers (accumulator, registers, or
stack pointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12300%2fbit-one-of-the-intel-8080s-flags-register%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup?
TL;DR:
No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW
is executed.
Long Read:
The 8080 does not have a flag register, but like its predecessor the 8008, separate flags. Which are, like other answers correctly describe, in random states after power-up/reset.
The 8080 flags have no access in register form for the programmer. Only testing in conditioned instructions is possible. Setting could only be done via instructions with implied result stored in any of them. The only access as byte data was when pushed onto the stack.
When storing the flags to the stack (PUSH PSW
) the second byte is synthesized from the flag bits and completed by 'filler' values for positions 1, 3, 5 (1, 0, 0). This guarantees that in memory bit 1 always will be 1.
(From "8080 Assembly Language Programming Manual", "Rev B", p.22/23)
During store (PUSH PSW
)
If register pair PSW is specified, the first byte of information
saved holds the contents of the A register; the
second byte holds the settings of the five condition bits,
i.e., Carry, Zero, Sign, Parity, and Auxiliary Carry. The format
of this byte is:
| | | |A| | | | |
|S|Z|0|C|0|P|1|C|
S State of Sign bit
Z State of Zero bit
0 always 0
AC State of auxiliary Carry bit
0 always 0
P State of Parity bit
1 always 1
C State of Carry bit
For retrieval (POP PSW
):
[...] If register pair
PSW is specified, the byte of data indicated by the contents
of the stack pointer plus one is used to restore the values of
the five condition bits (Carry, Zero, Sign, Parity, and Auxiliary
Carry) using the format described in the last section.
If so what was the reason for this, and was this inherited from the 8008 Flags register?
In part, as they were separate single-bit entities. Except the 8008 did not allow any access to the flags beside testing them in conditional instructions. There was no instruction to store or retrieve them at all.
Tidbits on x80-Family Flags:
The grand daddy of all things 80, the Datapoint 2200 laid the ground here by defining them as separate flip-flops, only accessible using conditional instructions. They are not presented as a register-like structure in any way.
The 8008, being a single chip implementation of the 2200, followed that, while the 8080 did introduce a register-like view for its programming model, but not in hardware.
Only the follow up 8085 did introduce a real flag register (*1), still not in the register file, but kept separate, like the A register (*2). Now bit 1 was used as V flag. That's one of the incompatibilities with 8080 code - and one way to detect a 8085: by pushing a cleared HL, popping PSW, pushing PSW again and then checking L. If bit 1 is still cleared, it's an 8085.
The Z80, in contrast, added a flag register (or more accurately two, as there's one in the alternate register set too) as part of its huge register file, but workings were still based on separate flip-flops located near the ALU. At the beginning of every instruction the content of the flag register in use got copied into the flag flip-flops, and copied back at the end. This process is a must when handling two separate register sets and also keeping the flags close to the ALU.
The Datapoint 2200 Version 2 also had two register sets: no flag register, but two sets of flag flip-flops multiplexed toward the ALU (like the registers).
*1 - Well, almost, as only 7 storage bits are implemented. Bit 3 was replaced by a circuit to always drive 0 when read.
*2 - On the 8008 and 8080, the A register was also not a member of the register file.
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
|
show 4 more comments
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup?
TL;DR:
No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW
is executed.
Long Read:
The 8080 does not have a flag register, but like its predecessor the 8008, separate flags. Which are, like other answers correctly describe, in random states after power-up/reset.
The 8080 flags have no access in register form for the programmer. Only testing in conditioned instructions is possible. Setting could only be done via instructions with implied result stored in any of them. The only access as byte data was when pushed onto the stack.
When storing the flags to the stack (PUSH PSW
) the second byte is synthesized from the flag bits and completed by 'filler' values for positions 1, 3, 5 (1, 0, 0). This guarantees that in memory bit 1 always will be 1.
(From "8080 Assembly Language Programming Manual", "Rev B", p.22/23)
During store (PUSH PSW
)
If register pair PSW is specified, the first byte of information
saved holds the contents of the A register; the
second byte holds the settings of the five condition bits,
i.e., Carry, Zero, Sign, Parity, and Auxiliary Carry. The format
of this byte is:
| | | |A| | | | |
|S|Z|0|C|0|P|1|C|
S State of Sign bit
Z State of Zero bit
0 always 0
AC State of auxiliary Carry bit
0 always 0
P State of Parity bit
1 always 1
C State of Carry bit
For retrieval (POP PSW
):
[...] If register pair
PSW is specified, the byte of data indicated by the contents
of the stack pointer plus one is used to restore the values of
the five condition bits (Carry, Zero, Sign, Parity, and Auxiliary
Carry) using the format described in the last section.
If so what was the reason for this, and was this inherited from the 8008 Flags register?
In part, as they were separate single-bit entities. Except the 8008 did not allow any access to the flags beside testing them in conditional instructions. There was no instruction to store or retrieve them at all.
Tidbits on x80-Family Flags:
The grand daddy of all things 80, the Datapoint 2200 laid the ground here by defining them as separate flip-flops, only accessible using conditional instructions. They are not presented as a register-like structure in any way.
The 8008, being a single chip implementation of the 2200, followed that, while the 8080 did introduce a register-like view for its programming model, but not in hardware.
Only the follow up 8085 did introduce a real flag register (*1), still not in the register file, but kept separate, like the A register (*2). Now bit 1 was used as V flag. That's one of the incompatibilities with 8080 code - and one way to detect a 8085: by pushing a cleared HL, popping PSW, pushing PSW again and then checking L. If bit 1 is still cleared, it's an 8085.
The Z80, in contrast, added a flag register (or more accurately two, as there's one in the alternate register set too) as part of its huge register file, but workings were still based on separate flip-flops located near the ALU. At the beginning of every instruction the content of the flag register in use got copied into the flag flip-flops, and copied back at the end. This process is a must when handling two separate register sets and also keeping the flags close to the ALU.
The Datapoint 2200 Version 2 also had two register sets: no flag register, but two sets of flag flip-flops multiplexed toward the ALU (like the registers).
*1 - Well, almost, as only 7 storage bits are implemented. Bit 3 was replaced by a circuit to always drive 0 when read.
*2 - On the 8008 and 8080, the A register was also not a member of the register file.
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
|
show 4 more comments
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup?
TL;DR:
No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW
is executed.
Long Read:
The 8080 does not have a flag register, but like its predecessor the 8008, separate flags. Which are, like other answers correctly describe, in random states after power-up/reset.
The 8080 flags have no access in register form for the programmer. Only testing in conditioned instructions is possible. Setting could only be done via instructions with implied result stored in any of them. The only access as byte data was when pushed onto the stack.
When storing the flags to the stack (PUSH PSW
) the second byte is synthesized from the flag bits and completed by 'filler' values for positions 1, 3, 5 (1, 0, 0). This guarantees that in memory bit 1 always will be 1.
(From "8080 Assembly Language Programming Manual", "Rev B", p.22/23)
During store (PUSH PSW
)
If register pair PSW is specified, the first byte of information
saved holds the contents of the A register; the
second byte holds the settings of the five condition bits,
i.e., Carry, Zero, Sign, Parity, and Auxiliary Carry. The format
of this byte is:
| | | |A| | | | |
|S|Z|0|C|0|P|1|C|
S State of Sign bit
Z State of Zero bit
0 always 0
AC State of auxiliary Carry bit
0 always 0
P State of Parity bit
1 always 1
C State of Carry bit
For retrieval (POP PSW
):
[...] If register pair
PSW is specified, the byte of data indicated by the contents
of the stack pointer plus one is used to restore the values of
the five condition bits (Carry, Zero, Sign, Parity, and Auxiliary
Carry) using the format described in the last section.
If so what was the reason for this, and was this inherited from the 8008 Flags register?
In part, as they were separate single-bit entities. Except the 8008 did not allow any access to the flags beside testing them in conditional instructions. There was no instruction to store or retrieve them at all.
Tidbits on x80-Family Flags:
The grand daddy of all things 80, the Datapoint 2200 laid the ground here by defining them as separate flip-flops, only accessible using conditional instructions. They are not presented as a register-like structure in any way.
The 8008, being a single chip implementation of the 2200, followed that, while the 8080 did introduce a register-like view for its programming model, but not in hardware.
Only the follow up 8085 did introduce a real flag register (*1), still not in the register file, but kept separate, like the A register (*2). Now bit 1 was used as V flag. That's one of the incompatibilities with 8080 code - and one way to detect a 8085: by pushing a cleared HL, popping PSW, pushing PSW again and then checking L. If bit 1 is still cleared, it's an 8085.
The Z80, in contrast, added a flag register (or more accurately two, as there's one in the alternate register set too) as part of its huge register file, but workings were still based on separate flip-flops located near the ALU. At the beginning of every instruction the content of the flag register in use got copied into the flag flip-flops, and copied back at the end. This process is a must when handling two separate register sets and also keeping the flags close to the ALU.
The Datapoint 2200 Version 2 also had two register sets: no flag register, but two sets of flag flip-flops multiplexed toward the ALU (like the registers).
*1 - Well, almost, as only 7 storage bits are implemented. Bit 3 was replaced by a circuit to always drive 0 when read.
*2 - On the 8008 and 8080, the A register was also not a member of the register file.
Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup?
TL;DR:
No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW
is executed.
Long Read:
The 8080 does not have a flag register, but like its predecessor the 8008, separate flags. Which are, like other answers correctly describe, in random states after power-up/reset.
The 8080 flags have no access in register form for the programmer. Only testing in conditioned instructions is possible. Setting could only be done via instructions with implied result stored in any of them. The only access as byte data was when pushed onto the stack.
When storing the flags to the stack (PUSH PSW
) the second byte is synthesized from the flag bits and completed by 'filler' values for positions 1, 3, 5 (1, 0, 0). This guarantees that in memory bit 1 always will be 1.
(From "8080 Assembly Language Programming Manual", "Rev B", p.22/23)
During store (PUSH PSW
)
If register pair PSW is specified, the first byte of information
saved holds the contents of the A register; the
second byte holds the settings of the five condition bits,
i.e., Carry, Zero, Sign, Parity, and Auxiliary Carry. The format
of this byte is:
| | | |A| | | | |
|S|Z|0|C|0|P|1|C|
S State of Sign bit
Z State of Zero bit
0 always 0
AC State of auxiliary Carry bit
0 always 0
P State of Parity bit
1 always 1
C State of Carry bit
For retrieval (POP PSW
):
[...] If register pair
PSW is specified, the byte of data indicated by the contents
of the stack pointer plus one is used to restore the values of
the five condition bits (Carry, Zero, Sign, Parity, and Auxiliary
Carry) using the format described in the last section.
If so what was the reason for this, and was this inherited from the 8008 Flags register?
In part, as they were separate single-bit entities. Except the 8008 did not allow any access to the flags beside testing them in conditional instructions. There was no instruction to store or retrieve them at all.
Tidbits on x80-Family Flags:
The grand daddy of all things 80, the Datapoint 2200 laid the ground here by defining them as separate flip-flops, only accessible using conditional instructions. They are not presented as a register-like structure in any way.
The 8008, being a single chip implementation of the 2200, followed that, while the 8080 did introduce a register-like view for its programming model, but not in hardware.
Only the follow up 8085 did introduce a real flag register (*1), still not in the register file, but kept separate, like the A register (*2). Now bit 1 was used as V flag. That's one of the incompatibilities with 8080 code - and one way to detect a 8085: by pushing a cleared HL, popping PSW, pushing PSW again and then checking L. If bit 1 is still cleared, it's an 8085.
The Z80, in contrast, added a flag register (or more accurately two, as there's one in the alternate register set too) as part of its huge register file, but workings were still based on separate flip-flops located near the ALU. At the beginning of every instruction the content of the flag register in use got copied into the flag flip-flops, and copied back at the end. This process is a must when handling two separate register sets and also keeping the flags close to the ALU.
The Datapoint 2200 Version 2 also had two register sets: no flag register, but two sets of flag flip-flops multiplexed toward the ALU (like the registers).
*1 - Well, almost, as only 7 storage bits are implemented. Bit 3 was replaced by a circuit to always drive 0 when read.
*2 - On the 8008 and 8080, the A register was also not a member of the register file.
edited Sep 17 at 10:31
answered Sep 12 at 17:38
RaffzahnRaffzahn
75.9k9 gold badges191 silver badges316 bronze badges
75.9k9 gold badges191 silver badges316 bronze badges
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
|
show 4 more comments
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
2
2
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
I voted +1 as this all sounds correct; who voted -1? "It's not set at startup because it doesn't exist" sounds like a good contribution to me.
– Tommy
Sep 12 at 17:43
1
1
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
@SingleMalt Well, for a definitive Answer one may have to go thru the circuitry. It may as well be due the way the data lines are layouted. Ken Shirriff might be a good source to ask here. The 8086 flag register was on purpose made to work similar to the 8080 to ease automatic program conversion.
– Raffzahn
Sep 12 at 20:23
1
1
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
@Raffzahn definitely seems plausible to do with the circuitry. Appreciate the additional information that 8085 was the first of these to introduce a real register flag, and the link about its V flag.
– Single Malt
Sep 12 at 20:49
1
1
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
So, this seems to be a Heisenberg thing: Once you start looking at it (PUSH PSW), it suddenly is different ;)
– tofro
Sep 12 at 22:23
2
2
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
@TripeHound I guess it could have been made. But then again, there was no particular need for a specific sequence or assignment - the 8008 had no way to access them. Looking at the die shot - the flag FF are at the lower edge of what's marked as ALU - it may be simply related to routing - rather tight in that area :)
– Raffzahn
Sep 13 at 10:28
|
show 4 more comments
According to the manual, the only thing that is explicitly set after RESET in the 8080 is the program counter. Everything else is indeterminate:
Note, however,that the RESET has no effect on status flags, or on any of the processor's working registers (accumulator, registers, or stackpointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
If they don't initialize anything at all, it is very unlikely they'd initialize something that isn't even used.
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
add a comment
|
According to the manual, the only thing that is explicitly set after RESET in the 8080 is the program counter. Everything else is indeterminate:
Note, however,that the RESET has no effect on status flags, or on any of the processor's working registers (accumulator, registers, or stackpointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
If they don't initialize anything at all, it is very unlikely they'd initialize something that isn't even used.
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
add a comment
|
According to the manual, the only thing that is explicitly set after RESET in the 8080 is the program counter. Everything else is indeterminate:
Note, however,that the RESET has no effect on status flags, or on any of the processor's working registers (accumulator, registers, or stackpointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
If they don't initialize anything at all, it is very unlikely they'd initialize something that isn't even used.
According to the manual, the only thing that is explicitly set after RESET in the 8080 is the program counter. Everything else is indeterminate:
Note, however,that the RESET has no effect on status flags, or on any of the processor's working registers (accumulator, registers, or stackpointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
If they don't initialize anything at all, it is very unlikely they'd initialize something that isn't even used.
edited Sep 13 at 0:51
Cody Gray
1,2816 silver badges21 bronze badges
1,2816 silver badges21 bronze badges
answered Sep 12 at 17:05
tofrotofro
18.9k3 gold badges38 silver badges101 bronze badges
18.9k3 gold badges38 silver badges101 bronze badges
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
add a comment
|
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
2
2
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
I like the 'unlikely' part :)) Except, for all ever visible to programmers, they will look like initialized. Cool, isn't it?
– Raffzahn
Sep 12 at 18:14
add a comment
|
According to the Intel 8080 microcomputer systems user’s manual, the contents of registers are indeterminate on startup:
The contents of its
program counter, stack pointer, and the other working registers are naturally subject to random factors and cannot be
specified.
And further on:
Note, however, that
theRESET
has no effect on status flags, or on any of the
processor's working registers (accumulator, registers, or
stack pointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
add a comment
|
According to the Intel 8080 microcomputer systems user’s manual, the contents of registers are indeterminate on startup:
The contents of its
program counter, stack pointer, and the other working registers are naturally subject to random factors and cannot be
specified.
And further on:
Note, however, that
theRESET
has no effect on status flags, or on any of the
processor's working registers (accumulator, registers, or
stack pointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
add a comment
|
According to the Intel 8080 microcomputer systems user’s manual, the contents of registers are indeterminate on startup:
The contents of its
program counter, stack pointer, and the other working registers are naturally subject to random factors and cannot be
specified.
And further on:
Note, however, that
theRESET
has no effect on status flags, or on any of the
processor's working registers (accumulator, registers, or
stack pointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
According to the Intel 8080 microcomputer systems user’s manual, the contents of registers are indeterminate on startup:
The contents of its
program counter, stack pointer, and the other working registers are naturally subject to random factors and cannot be
specified.
And further on:
Note, however, that
theRESET
has no effect on status flags, or on any of the
processor's working registers (accumulator, registers, or
stack pointer). The contents of these registers remain indeterminate, until initialized explicitly by the program.
edited Sep 17 at 10:48
Toby Speight
6565 silver badges16 bronze badges
6565 silver badges16 bronze badges
answered Sep 12 at 16:57
Stephen KittStephen Kitt
52.8k9 gold badges216 silver badges223 bronze badges
52.8k9 gold badges216 silver badges223 bronze badges
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
add a comment
|
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
2
2
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
beat me to it, and you cite the same manual ;)
– tofro
Sep 12 at 17:10
add a comment
|
Thanks for contributing an answer to Retrocomputing Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f12300%2fbit-one-of-the-intel-8080s-flags-register%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown