SPARC Assembly Language

大兔子大兔子 提交于 2019-12-11 16:49:30

问题


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

what commend should I use to compile and run ? (using Linux)


回答1:


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.



来源:https://stackoverflow.com/questions/14651855/sparc-assembly-language

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!