我一直在阅读“从头开始编程”一书来学习 Linux 中的汇编编程。我在解决第 3 章末尾的一个练习时遇到了麻烦。练习说修改以下程序以使用数据集末尾的地址来终止循环。这只是一个简单的程序,用于查找一组数据中的最大数字,目前它只是使用数字零来标记数据的结尾。
#PURPOSE: This program finds the maximum number of a
# set of data items.
#
#VARIABLES: The registers have the following uses:
#
# %edi -- Holds the index of the data item being examined
# %ebx -- Largest data item found
# %eax -- Current data item
#
# The following memory locations are used:
#
# data_items -- Contains the item data. A 0 is used
# to terminate the data.
#
.section …Run Code Online (Sandbox Code Playgroud)