PDA

View Full Version : Some SPARC assembly help



Balain
2013-09-24, 07:20 PM
I have run into a problem in the first step of my assignment.

I am going to try and ask this and not break any codes of misconduct, so sorry if it is too vague.

I am currently trying to figure out the value of some function based on x. That is y=a*x+b

I get no errors or warnings when I compile. all the values in my registries seem to be correct, but when I run my program nothing is displayed. So I figure it has to be a problem with how I am using printf



out1: .asciz "x=%d y=%d"
.align 4

.global main
main: All my calculations for y



set out1, %o0 !out1 string
mov %l1, %o1 !value for x
mov %l2, %o2 !value for y
call printf
nop

mov 1, %g1
ta 0

Manga Shoggoth
2013-09-25, 08:24 AM
SPARC isn't really my thing, and it has been decades since I had to use assembly language, but... An (admittedly brief - I'm at work...) search for SPARC and printf suggests that you might want to increase your stack size.

Balain
2013-09-25, 11:42 PM
Thanks.

I tried that didn't seem to make a difference. I still am not sure what I missed. But code wasn't too long so started over and it seems to work fine now.