Hello, and welcome.
Firstly, since the HCS12 is a 16-bit MCU, you have actually posted this in the incorrect forum, especially for an assembly language question. I suspect one of the moderators will eventually transfer this to a more appropriate forum.
Now I would assume that the code you have presented is a course exercise that you are expected to complete, to demonstrate that you have an understanding of the subject in question. If I were to immediately provide the answers you requested, without you first making your own attempt to understand what is happening, I don't think that you would have learnt very much. Please correct me if this is not the situation.
To understand a sub-routine written in assembly code, it is necessary to understand what each instruction does, and what it is meant to do in the context of the sub-routine structure. This means that comments need to be added for most lines of code, about what you think is happening. I think you should attempt to do this, and is probably what your course tutor is expecting.
You also need to be aware of (or surmise) the entry and exit conditions for the sub-routine, and also document these as comments. For the present example, it would appear that the entry values for AccB and X registers are significant to the sub-routine - what might each value represent? On exit, the AccA value would appear significant.
Looking at the basic structure, you obviously have a code loop, so that the same instructions may execute multiple times. Therefore, the loop exit arrangement needs to be understood. Finally, what might the value 79 decimal represent?
What I have just described are the actions and considerations that most assembly programmers would need to observe - there are few shortcuts. So I suggest that you have a go yourself, and post your commented code if you think you still have some problems. I assume that you already have full documentation for the various assembly instructions.
Regards,
Mac