From: chitselb on
I came across this article: http://6502.org/tutorials/vflag.html
describing the overflow flag, and there's some discussion in there
about the SO pin on the 6502 (set overflow). It's interesting to note
that:

1) There's a CLV instruction but no corresponding SEV instruction
2) I've written some 6502 code but I haven't found a whole lot of use
for the V flag

It also raises in my mind some questions:

1) What was Chuck Peddle doing with that SO pin?
2) What does a PET/VIC/C64/C128 do with that pin?
3) Is there any hardware that utilises this feature?

Charlie
http://chitselb.com
From: Dombo on
chitselb schreef:
> I came across this article: http://6502.org/tutorials/vflag.html
> describing the overflow flag, and there's some discussion in there
> about the SO pin on the 6502 (set overflow). It's interesting to note
> that:
>
> 1) There's a CLV instruction but no corresponding SEV instruction
> 2) I've written some 6502 code but I haven't found a whole lot of use
> for the V flag
>
> It also raises in my mind some questions:
>
> 1) What was Chuck Peddle doing with that SO pin?

I don't know what Chuck Peddle did with that pin, but he probably
included it so the 6502 is able to very quickly respond to a hardware
signal.

> 2) What does a PET/VIC/C64/C128 do with that pin?

AFAIK they don't use this feature, but why don't you find out yourself:
http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/

> 3) Is there any hardware that utilises this feature?

IIRC the 1541 uses this feature to poll to see if there is data
available from the read/write circuitry.
From: Spiro Trikaliotis on
Hello,

chitselb wrote:

> 1) There's a CLV instruction but no corresponding SEV instruction
> 2) I've written some 6502 code but I haven't found a whole lot of use
> for the V flag

It is used for signed arithmetic to detect an overflow. Many people do
not use that.

> It also raises in my mind some questions:
>
> 1) What was Chuck Peddle doing with that SO pin?

Give an interface for hardware to allow to inform about a state.

> 2) What does a PET/VIC/C64/C128 do with that pin?

The C64/C128 cannot use it, because S.O. is not present on the 6510 (and
the later variants), only on the 650x.

If the VIC-1541 counts as VIC, too, ;) then the answer is simple: The
floppy uses it internally. When writing to the disk or reading from it,
there is some shift register which makes sure the data bits or
serialized (de-serialized).

This shift register has an output "BYTE READY" which is connected to
S.O. This way, the shift register can tell the CPU whenever it needs the
next byte (writing), or if the byte is ready to be taken from the shift
register (reading).

Using an input bit on the VIA 6522 and polling it might have resulted in
not being able to react in time, as it needs much more cycles than a

x: BVC x

(IIRC, we only have 26 cycles time in order to detect BYTE READ, and
writing the next byte/reading the next byte)

> 3) Is there any hardware that utilises this feature?

See above.

HTH,
Spiro.

--
Spiro R. Trikaliotis http://opencbm.sf.net/
http://www.trikaliotis.net/ http://www.viceteam.org/
From: Anssi Saari on
chitselb <chitselb(a)gmail.com> writes:

> 2) I've written some 6502 code but I haven't found a whole lot of use
> for the V flag

Well, I've seen it used to detect EOF. You run BIT $90 and if bit 6 in
that address is set, BIT sets the V flag. You can then branch
accordingly with BVS or BVC.