很模糊.
如果你的意思是"没有加减"那么是的.
如果您的寄存器只包含1,而另一个只包含零,那么(intel)RCR将允许您将cary标志设置为1或0.
所以 - 如果你使用类似的(BH = FF BL = 0); 想要将DH添加到DL
rcr DL,1 ;DL0 to carry
jc DL1 ;it was a 1
rcr DH,1 ;DH0 to carry
;CY now has result DL0=0 + DH0=0=00; DL0=0 + DH0=1=01
rcr CL,1 ;CY to CL7
rcr BL,1 ;0 to CY, BL unchanged
rcl CL,1 ;CL0=0, CY=0 or 1
rcl CL,1 ;CL01=00 or 01
jmp done1 ;finished adding
DL1:
rcr DH,1 ;DH0 to carry. DL0 was 1, so result=10 if CY set, 01 if not
jc DHDL10 ;result is 10
rcl CL,1 ;CL0=0
rcr BH,1 ;1 to CY, BH unchanged
rcl CL,1 ;CL0=01
jmp done1 ;finished adding
DHDL10:
rcl CL,1 ;CL0=1
rcr BL,1 ;0 to CY, BL unchanged
rcl CL,1 ;CL01=10
done1:
Run Code Online (Sandbox Code Playgroud)
该例程应该添加DL和DH的最低位,给出CL的最低2位.
从那里,您可以将其称为一起添加2个寄存器 - 这只是重复移位和添加的问题.(我不是说这会很愉快,如果你有足够的决心就可以做到这一点)
由于你可以将2个数字加在一起,你可以将任意数量的数字加在一起,而乘法就是添加register1大量的register2.
因此,这是可能的.乏味,但可能.
经过一番思考......
再次给出(BH = FF BL = 0); 想要将DH添加到DL
rcr DL,1 ;DL0 to CY
jc DL1
DL0:
rcr DL,1
jc DL01
DL00:
...
DL01:
rcr DL,1
jc DL011
DL010:
...
DL01000000:
rcr DH,1
jc DL01000000H1
DL01000000H0:
rcr DH,1
jc DL01000000H01
...
DL00010000H00100000: ;8*4=32 - note bit-order reversed dur RCR, RCL = conventional
; all we need here is to use BH/BL and RCR to build result.
...
Run Code Online (Sandbox Code Playgroud)
所以 - 这是一个冗长,复杂,繁琐的方法,只需创建一个256*256的可能结果列表,机械地评估每对可能的输入值,但仅使用两条指令.可能需要一台电脑为你写它...