Ok, I see.
So
x1 = bx % 320
y1 = bx / 320
x2 = cx % 320
y2 = cx / 320

So you have a line, you need to rasterize it. I'm sure you can find a good rasterizing algorithm on the internet. If it is C (it probably is) just feed it to an optimizing C compiler and convert the resulting assembly to 16-bit code. It should be easier than translating the code yourself.

Then you just put values at the appropriate memory addresses.