I put this together to demonstrate how you can do this. Since you did not give a full example, I can't guarantee that it will fit right into what you are doing.
I used newfloat to create a new float type listing, as you seem to have. minipages are used to set the listings themselves into the sub-floats. Depending on what you have already, this may be enough to fix your issues.
I also augmented the example to show referencing and a list of listings. Within this bigger example, two problems still present themselves:
The counter on subrefs is not set correctly; I have added a \refstepcounter to temporarily add 1 to the count to correct this.
The \listoflistings puts the two sublisting captions above the main caption. I'm not sure yet why this is happening of if it can be corrected. The fix/hack would be to put the main caption at the top of the float, but that would move it in the final typesetting to the top as well, which may not be desired.
Even with these irregularities, a very nice result is obtained:

The MWE code:
\documentclass{article}
\usepackage{listings}
\usepackage{newfloat,caption}
\usepackage{subcaption}
\usepackage[demo]{graphicx}
\DeclareFloatingEnvironment[fileext=frm,placement={!ht},name=Listing,within=section]{listing}
\begin{document}
\tableofcontents
\listoflistings
\section{One}
\section{Two}
\begin{listing}
\refstepcounter{listing}
\noindent\begin{minipage}[b]{.45\textwidth}
\begin{lstlisting}
add x1, x1, 5
stp fp, lr, [sp, #-16]!
add x5, x6, x7
\end{lstlisting}
\captionof{sublisting}{Some caption.}
\label{lst:codeblockA}
\end{minipage}%
\hfill
\begin{minipage}[b]{.45\textwidth}
\begin{lstlisting}
ldr x5, [x5]
\end{lstlisting}
\captionof{sublisting}{Some other caption.}
\label{lst:codeblockB}
\end{minipage}
\addtocounter{listing}{-1}
\caption{Some text. The quick brown fox\ldots}
\label{lst:codeblocks}
\end{listing}
Figure~\ref{lst:codeblocks} includes block \ref{lst:codeblockA} and \ref{lst:codeblockB}
\end{document}