When i run this with gcc filename.s -o filename. It is giving fatal error: Unknown opcode at define registers.
Anyhelp will be appreciated
.section ".data"
prompt: .asciz "\nThis program prints the Fibonacci sequence"
prompt2: .asciz "\nEnter a limit on the largest number to be displayed:"
prompt5: .asciz "\nDo you want to print a different sequence (Y/N):"
input: .word 0
yesNo: .byte 0
nl: .asciz "\n"
format1: .asciz "%d%c"
format2: .asciz "%c%c"
.align 8
.global main
.section ".text"
define(f_1, l0)
define(f_2, l1)
define(count, l2)
main:
save %sp, -96, %sp
repeat:
!!!!Welcome and initial prompt!!!
set prompt, %o0 !set welcome message
call printf !print it
nop
set prompt2, %o0 !ask fo a number
call printf
nop
set format1, %o0 !input needs to be an interger
set input, %o1 !address where input is stored
set nl, %o2 !dump
call scanf
nop
ld [%o1], %o0
mov %o0, %count
mov 1, %f_1
mov 1, %f_2
mov 1, %o0
call printf
nop
mov 1, %o0
call printf
nop
loop:
add %f_1, %f_2, %o0
call printf
mov %f_1, %f_2
mov %o0, %f_1
cmp %f_1, %count
ble loop
!!!Continue?!!!
set prompt5, %o0
call printf
nop
set format2, %o0 !getting a character and a newline
set yesNo, %o1
set nl, %o2
call scanf
nop
set yesNo, %l0
ldub [%l0], %o0 !get the ys/no from memory
cmp %o0, 'y'
be repeat
nop !yes then try again
ret !get out
restore