gpt4 book ai didi

c - 如何将数组从汇编程序发送到 C++

转载 作者:行者123 更新时间:2023-11-30 16:10:31 26 4
gpt4 key购买 nike

cofile.s:

.section .data
arr:
.long 333
.long 111
.long 666

.section .text
.global main
main:
inc 1(arr)
int $0x80
mov $1, %rax
int $0x80

fl.cpp:

#include <iostream>

int main() {
//here you need to get an array from assembler
}

代码不起作用。这只是一个示例。

最佳答案

extern long arr[3];

然后像在 C 或 C++ 中一样使用它。

关于c - 如何将数组从汇编程序发送到 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58870352/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com