Via the Wikipedia:
'A pirate code was a code of conduct invented for governing pirates, and first introduced by the Portuguese buccaneer Bartolomeu Português. Generally each pirate crew had its own code or articles, which provided rules for discipline, division of stolen goods, and compensation for injured pirates.
Buccaneers began operating under a set of rules variously called the Chasse-Partie, Charter Party, Custom of the Coast, or Jamaica Discipline. These eventually became known as Articles of Agreement, or the pirate's code. Pirate articles varied from one captain to another, and sometimes even from one voyage to another, but they were generally alike in including provisions for discipline, specifications for each crewmate's share of treasure, and compensation for the injured.
Each crew member was asked to sign or make his mark on the articles, then swear an oath of allegiance or honor. The oath was sometimes taken on a Bible, but John Phillips' men, lacking a Bible, swore on an axe. Legend suggests that other pirates swore on crossed pistols, swords, or on a human skull, or astride a cannon. This act formally inducted the signer into the pirate crew, generally entitling him to vote for officers and on other "affairs of moment," to bear arms, and to his share of the plunder. The articles having been signed, they were then posted in a prominent place, often the door of the grand cabin.
After a piratical cruise began, new recruits from captured ships would sometimes sign the articles, in some cases voluntarily, in other cases under threat of torture or death. Valuable sea artisans, such as carpenters and navigators, were especially likely to be forced to sign articles under duress, and would rarely be released regardless of their decision to sign or not. In some cases, even willing recruits would ask the pirates to pretend to force them to sign, so that they could plead they were forced should they ever be captured by the law. Generally, men who had not signed the articles had a much better chance of acquittal at trial if captured by the law.
Pirate articles are closely related to, and in some cases derived from, privateering articles, which similarly provided for discipline and regulated distribution of booty (though usually far less equally than with pirate articles). By the 19th century, ordinary merchant ships also had articles specifying wages and rules, which crewmen had to sign upon shipping aboard. Merchant articles and privateering articles can be traced back to Europe in the Middle Ages when there was a system of 'joint hands' agreements between merchants, owners and seamen to share profits. Four complete or nearly complete sets of piratical articles have survived, chiefly from Charles Johnson's A General History of the Pyrates, first published in 1724. A partial code from Henry Morgan is preserved in Alexandre Exquemelin's 1678 book The Buccaneers of America. Many other pirates are known to have had articles. Few pirate articles have survived, because pirates on the verge of capture or surrender usually burned their articles or threw them overboard, to prevent the papers being used against them at trial." (http://en.wikipedia.org/wiki/Pirate_code_of_the_Brethren)