Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sparc程序集:使用printf打印\n字符_C_Assembly_Printf_Sparc - Fatal编程技术网

Sparc程序集:使用printf打印\n字符

Sparc程序集:使用printf打印\n字符,c,assembly,printf,sparc,C,Assembly,Printf,Sparc,好的,我有两个assembly.s文件 第一个功能原型是 void printCharacter( char c ) 在其中我调用printf来打印字符 ./global printCharacter .section ".data" format: .asciz "%c" .section ".text" printCharacter: save %sp, -96, %sp set format, %o0 mov %i0, %o1

好的,我有两个assembly.s文件

第一个功能原型是

void printCharacter( char c )
在其中我调用printf来打印字符

./global printCharacter

.section ".data"
format: .asciz "%c"

.section ".text"

printCharacter:
    save     %sp, -96, %sp

    set      format, %o0
    mov      %i0, %o1
    call     printf
    nop
问题是我正在从另一个文件调用此函数。 在另一个文件中,我在顶部声明了这个

    NewLine: .byte '\n'
我是这样用的

    set      NewLine, %o0
    call     printCharacter
    nop
在我的另一个函数“printCharacter”中,它使用

    mov      %i0, %o1 

           instead of

    set      %i0, %o1

    since I use printCharacter function for normal characters
    as well so I can't use set
如何将一个函数同时用于ASCII字符和\n需要的类似内容 “设置”命令而不是mov

我现在遇到的问题是,当我尝试打印一行新行时,它会打印出一行?在候机楼