; Example of R16 × R16 multiply ; YASEP16 : 13 instructions, 44 bytes .name Mul16x16 .profile YASEP16 ; R1 x R2 => R3-R4 (R5=scratch) ; R2 left modified (rotated) after execution ; the 2 middle bytes are computed together MUL8H R1 R2 R3 MUL8H R2 R1 R4 ; Notice the exchange of operands ADD R4 R3 ; carry reused later SHR 8 R3 R4 ; adjust between R3 and R4, SHL 8 R3 MOV 100h R5 ; speculative carry OR R4 R5 R4 carry ; and put the carry back into R4 ; lower byte MUL8L R2 R1 R5 ADD R5 R3 ADD 1 R4 R4 carry ; higher byte ROL 8 R2 MUL8H R2 R1 R5 ADD R5 R4 ; eventually : ROR 8 R2