Parshat Chukat - So how many Mitzvot are there?
The Lord spoke to Moses, saying: "Take the staff and assemble the congregation, you and your brother Aaron, and speak to the rock in their presence so that it will give forth its water. You shall bring forth water for them from the rock and give the congregation and their livestock to drink."
The Gemara in Masechet Baba Metzia  discusses at length the prohibition of "Tza'ar ba'alei chayim" (cruelty towards animals). There is a makhloket Tana'im as to whether this prohibition is mi'deoraita (Torah based) or only an issur dera'banan (Rabbinic decree). This makhloket continues between the Amoraim, Rishonim and even Acharonim.
The majority of the Poskim agree that Tza'ar ba'alei chayim is indeed Deoraita.
What remains to be clarified is: which one of the 613 Mizvot, or more particularly, which one of 365 negative Mitzvot, is the issur of Tza'ar ba'alei chayim? Going through the list of the negative Mitzvot, we cannot find one that is classified Tza'ar ba'alei chayim.
The Shita Mekubetzet says that Tza'ar ba'alei chayim is learnt from another issur - "You shall not muzzle an ox when it is threshing [the grain]." Since the reason for this prohibition is to prevent anguish from the animal we apply this as a general prohibition to all cruelty towards animals.
Similar styles of deduction could be used based on the Rambam and Sefer Hachinuch regarding the Mitzvot of Shiluach Haken (the sending away of the mother bird) and Oto ve'et Beno (the prohibition of slaughtering an animal and it's offspring on the same day). Since the reason behind both of these Mitzvot is to avoid cruelty to animals we can deduce that all cruelty to animals is prohibited.
The Ibn Ezra similarly states that the reason for the Torah's prohibition - "You shall not plow with an ox and a donkey together" - is because the ox is stronger than the donkey and causes the donkey pain when plowing with the ox. Or, as the Be'er Heteiv explains, since the ox chews its cud, the donkey thinks it is eating more than him and is anguished by this.
All these Issurim imply that Tza'ar ba'alei chayim is Deoraita.
The question is though, if one hits their dog in a cruel way have they violated these abovementioned issurim? There is no ox, no muzzle, no threshing floor, no bird or chicks or eggs, no offspring, no donkey and no plough.
Rashi say's that Tza'ar ba'alei chayim - Deoraita, is learned from the positive Mitzvah of - "If you see your enemy's donkey lying under its burden would you refrain from helping him? You shall surely help along with him."
There are, however, a group of both Rishonim and Acharonim who learnt this De'oraita law from very different sources.
- The Rambam  writes that the prohibition of Tza'ar ba'alei chayim is learnt from what the Malach Hashem say's to Bilam: "Why have you beaten your she-donkey these three times?"
- The Sefer Charedim writes that it is learnt from the general Mitzvah to "Walk in the Ways of Hashem - just like He is merciful so should you be merciful, etc."
- The She'eilat Ya'avetz writes that it is learnt from what Chazal learn from the verse in Kriat shema: "And I will give grass in your field for your livestock, and you will eat and be sated", that one should first feed one's animals before one eats.
- Lastly, from the verse quoted above from this week's Parsha: "Take the staff and assemble the congregation, you and your brother Aaron, and speak to the rock in their presence so that it will give forth its water. You shall bring forth water for them from the rock and give the congregation and their livestock to drink." the author of Yom Teruah learns out that Tza'ar ba'alei chayim is Deoraita.
According to this approach the prohibition of Tza'ar ba'alei chayim is learnt from pesukim that do not relate to Mitzvot at all, rather from general, story line verses. It is from these verses that chazal deduced Issurim De'oraita! These Issurim/Mitzvot are not included in the regular count of 613 Mitzvot, but they are also - De'oraita.
It is well known that the obligation of Chinuch is Derabanan, however on the verse: " For I have known him because he commands his sons and his household after him, that they should keep the way of the Lord to perform righteousness and justice, in order that the Lord bring upon Abraham that which He spoke concerning him" the Meshech Chochmah comments that it is this verse that forms the basis of the obligation of Chinuch.
Traces of this idea can actually be found in quite a lot of other Issurim and Mitzvot in Shas.
There are two ways that the Torah instructs us how to behave. The first is the one we are all familiar with - Mitzvot. There are 613 of them and they have been listed by the Rishonim.
There is however another way that Hashem has conveyed "His will" to us and that is by being sensitive to all the ideas expressed in his Torah even though they are not one of those 613. 
Shabbat Shalom, Rav Avigdor
Comments and questions welcome firstname.lastname@example.org