The premisses of Barbara,

All M is P,
All S is M,

exclude certain compartments as shewn in the following diagram:

This yields at once the conclusion All S is P.

346 Similarly for Camestres we have the following:

For Datisi we have

Bocardo yields