RetroCoders Community

Help => Beginners => Topic started by: honeydatax on Aug 04, 2022, 06:01 PM

Title: risc-v assembly
Post by: honeydatax on Aug 04, 2022, 06:01 PM

.section .rodata
prompt: .asciz "Value of t0 = %ld and value of t1 = %ld\n"
.section .text
myfunc:
    addi    sp, sp, -8
    sd      ra, 0(sp)
    la      a0, prompt
    mv      a1, t0
    mv      a2, t1
    call    printf
    ld      ra, 0(sp)
    addi    sp, sp, 8
    ret



im tring to print f my msg wat is worng on my risc v? thanks
Title: Re: risc-v assembly
Post by: ron77 on Aug 07, 2022, 08:36 AM
hello honeydatax

i don't have risc v cpu but perhaps his might be helpful??

https://stackoverflow.com/questions/57228650/how-to-print-to-console-in-linux-from-risc-v-assembly (https://stackoverflow.com/questions/57228650/how-to-print-to-console-in-linux-from-risc-v-assembly)
Title: Re: risc-v assembly
Post by: honeydatax on Aug 08, 2022, 07:47 AM
thanks is wat im need :)