The listing environment is provided and is similar to figure and table, although it is not a floating environment. Include support for \caption, \label, \ref, and introduces \listoflistings, \listingname, \listlistingname. It produces a .lol. It does not change \@makecaption (unless the option "bigcaptions" is used), so packages that change the layout of \caption still work. See also
listings