Code
Middle English: via Old French from Latin codex, codic- (see codex). The term originally denoted a systematic collection of statutes made by Justinian or another of the later Roman emperors; compare with code (sense 3 of the noun) (mid 18th century), the earliest modern sense.
wiktionary
From Middle English code(“system of law”), from Old French code(“system of law”), from Latin cōdex, later form of caudex(“the stock or stem of a tree, a board or tablet of wood smeared over with wax, on which the ancients originally wrote; hence, a book, a writing.”). Doublet of codex
From code blue, a medical emergency
etymonline
code (n.)
c. 1300, "systematic compilation of laws," from Old French code "system of laws, law-book" (13c.), from Latin codex"systematic classification of statutory law," earlier caudex "book," literally "tree trunk," hence, book made up of wooden tablets covered with wax for writing. De Vaan traces this through Proto-Italic *kaud-ek- to PIE *kehu-d- "cleaved, separate," which he also sees as the root of cauda "tail" (see coda).
Meaning "cipher, system of signals and the rules which govern their use" (the sense in secret code) is from 1808. Code-name is from 1879 (in telegraphy). Meaning "system of expressing information and instructions in a form usable by a computer" is from 1946.
code (v.)
"to put into code," 1815, from code (n.). Specifically "to put into computer code" from 1947. Intransitive sense "write computer code" is by 1987. Related: Coded; coding.