VSBM documentation
John Strawn
9/1/87
The goal is to get (A-B)*C. A "brute-force" implementation would
be something like
move x:(r1),a ; A
move x:(r5),x0 ; B
sub x0,a ; B-A
tfr a,y0 ; NB allows parallel move
move x:(r2),y1 ; C
mpyr y1,y0
move a,x:(r6)
This is wasteful, because the tfr, mpyr, and sub will require at least
3 operations in even the tightest inner loop. Therefore, we implement
this as A*C-B*C, for which the outline is:
move x:(r1),x0 ; A
move x:(r5),y0 ; B
move x:(r2),y1 ; C
mpy x0,y1,a
macr -y0,y1,a
move a,x:(r6)