In general, Semantics always refers to some kind of meaning (of something that is written) and is thus usually opposed to syntax, which refers to the formal way in which something is written.
1. Semantics is a subfield of linguistics that is traditionally defined as the study of meaning. One area of study is the meaning of compounds, another is the study of relations between different linguistic expressions (homonymy, synonymy, antonymy, polysemy, hypernymy, hyponymy). Semantics includes the study of thematic roles. Semantics deals with sense and reference, truth conditions and discourse analysis. Pragmatics is often considered a part of semantics.
3. Semantics is also a branch of formal logic, alongside Grammar, Proof Theory, and Applications. Semantics provides "interpretations" of formal languages, in the strict sense that an interpretation is a mapping of the atomic elements of a language (the simple sentences; or the simple terms, predicates, and operators) into a "domain of interpretation" (truth values, or objects, or numbers) so as way as to provide enough information to evaluate all the sentences in the language, or at least in the theory under question; and semantics provides the method for deriving these valuations of whole sentences, theories, etc., from the interpretations of their parts.