【发布时间】:2011-03-08 23:07:13
【问题描述】:
我希望将数组的一些元素复制到 Assembly 中的另一个元素。两个数组都通过存储在寄存器中的指针访问。因此, edx 将指向一个数组,而 eax 将指向另一个数组。基本上, edx 指向从文本文件中读取的字符数组,我希望 eax 只包含 32 个字符。这是我正在尝试做的事情:
使用 NASM 进行 I386 组装
add edx, 8 ; the first 8 characters of the string are not wanted
mov cl, 32
ip_address:
; move the character currently pointed to by edx to eax (mov [eax], [edx])
inc edx
inc eax
loop ip_address
再次,我希望将前八个字符之后的 32 个字符放在第二个数组中。问题是我对如何做到这一点感到困惑。非常感谢任何帮助。
【问题讨论】:
标签: arrays assembly cpu-registers