EN
vcsPhp3(3V)vcsLib manualvcsPhp3(3V)
Name

vcsPhp3

Serves PHP, so the 6507 pushes its flags onto the stack.

Synopsis
#include "vcsLib.h"

void vcsPhp3(void);
Description

It’s the old trick for missiles and the ball. With the stack pointing at ENAM0, ENAM1 or ENABL, the Z flag left by a comparison turns the object on or off without any branches.

With vcsLib the ARM already knows the result of the comparison, but the trick is still useful for writing three registers in a row at 3 cycles each without bus stuffing.

On the bus

It serves 08 and takes 3 cycles of the 6507. This is how it looks on the bus right after a vcsJmp3:

φ2A12–A0D7–D0R/W$100008$1001··$001FP
1 php2 dummy read3 flags into ENABL

served by the cartridgewritten by the 6507dummy read

Example
vcsLdx2(ENABL); vcsTxs2();
vcsPhp3();
Compatibility

● complete ◐ works with differences ○ exists but does nothing – missing ? no data

ImplementationBy versionNotes
Stella● 7.0● master
Gopher2600● 2022-2023● 2025-04● v0.51.0● v0.53.0● master
Test7800● 2025● v0.8.0 – v0.9.0
PlusCart and UnoCart● 2.3.15 – 2.3.28● git 2025-11● 2.3.32
Chameleon Cart– 2025-10-23
Chameleon Cart, alternative firmware– 2026-11-28
Newbroo Wild Cart and Decker? 2026
VCSIDE ACE adapter– 2026-11
See also

vcsPlp4(3V), vcsTxs2(3V)

vcsLib · December 2026StackvcsPhp3(3V)