简体   繁体   中英

how to send an array from Assembler to C ++

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
}

Codes are not working. This is just an examplede here.

extern long arr[3];

Then use it like normal in C or C++.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM