multiply two consecutive times in assembly language program

前端 未结 2 917
独厮守ぢ
独厮守ぢ 2021-01-29 14:37

I am using 8086 emulator and DOSBOX and MASM.

I know that when we multiply 8-bit with 8-bit, answer will be of 16-bit.

al*(8-bit)=ax

An

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-29 15:18

    I am pretty sure there is a duplicate of this somewhere already. Of course it's just elementary maths anyway:

    result_low = low(input_low * factor)
    result_high = high(input_low * factor) + low(input_high * factor)
    

    Pay attention to saving ax and dx as necessary.

提交回复
热议问题