Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is a simple NASM 64bit linux assembly program:

_exit:
    mov rax, 60
    mov rdi, 0
    syscall

My computer is AMD ( x86_64 64bit ) and i know this assembly program will working in INTEL 64bit processor too.

but I have these following problems !

  • Will this program work on ( linux ) computer with MIPS 64bit and ARM 64bit architecture?
  • Do only system calls change when an assembly code with the different operating systems?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
824 views
Welcome To Ask or Share your Answers For Others

1 Answer

Will this program work on ( linux ) computer with MIPS 64bit and ARM 64bit architecture?

No. MIPS and ARM have entirely different instruction sets. It would be comparable to trying to run JVM Bytecode with the .NET VM. It is just not compatible.

Do only system calls change when an assembly code with the different operating systems?

No. The calling conventions differ, for example. For example windows uses RCX, RDX, R8, and R9 for passing int arguments, SystemV (E.g. Linux) uses RDI, RSI, RDX, RCX, R8, R9 for this. Source


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...