SPARC汇编语言 [英] SPARC Assembly Language
问题描述
我试图运行样品SPARC汇编语言,但我也不知道从哪里开始。我试图 VIM宏
或 M4 example.m
,但我不知道在哪里以及如何进行编译。我在网上搜索,阅读文章,但没有提到如何开始编码。
I am trying to run a sample Sparc assembly language , but I am not even sure where to start. I tried vim macro
or m4 example.m
but I dont know where and how to compile it. I searched the internet, read articles, but none of them mentioned how to start coding.
例如,我想键入此汇编语言:
for example, I would like to type this assembly language :
.global main
main: save %sp, -96, %sp
mov PROMPT, %o0
call writeChar
nop
call readInt
什么表彰,我应该用它来编译和运行? (使用Linux)
what commend should I use to compile and run ? (using Linux)
推荐答案
您不编译组装code,你组装吧!这就是说,你的编译器驱动程序可能可以做到这一点。一个常见的文件扩展名的汇编源$ C $ c是 .S
,也许是这样的:
You don't "compile" assembly code, you "assemble" it! That said, your compiler driver can probably do it. A common filename extension for assembly source code is .s
, so maybe something like:
cc -o example example.s
然后,如果它的工作,你就会有一个名为例如
的可执行文件运行,测试和调试。
Then, if it worked, you'll have an executable named example
to run, test, and debug.
这篇关于SPARC汇编语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!