How can I compile C code to get a bare-metal skeleton of a minimal RISC-V assembly program?

前端 未结 3 450
野趣味
野趣味 2020-12-24 09:09

I have the following simple C code:

   void main(){
    int A = 333;
    int B=244;
    int sum;
    sum = A + B;  
}

When I compile this w

3条回答
  •  庸人自扰
    2020-12-24 09:19

    I'm surprised no one mentioned gcc -S which skips assembly and linking altogether and outputs assembly code, albeit with a bunch of boilerplate, but it may be convenient just to poke around.

提交回复
热议问题