MOVing between two memory addresses

后端 未结 6 1079
感情败类
感情败类 2020-11-29 07:50

I\'m trying to learn assembly (so bear with me) and I\'m getting a compile error on this line:

mov byte [t_last], [t_cur]

The error is

6条回答
  •  长情又很酷
    2020-11-29 08:01

    It's really simple in 16 bit, just do the following:

         push     di
         push     si
         push     cx
         mov      cx,(number of bytes to move)
         lea      di,(destination address)
         lea      si,(source address)
         rep      movsb
         pop      cx
         pop      si
         pop      di
    

    Note: the pushes & pops are neceessary if you need to save the contents of the registers.

提交回复
热议问题