When i run this with gcc filename.s -o filename. It is giving fatal error: Unknown opcode at define registers.
Anyhelp will be appreciated
Code:
.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
hi,
I'm a beginner to UNIX and got some problem in this fibonacci.Please help me out.Here is the code:
fibo()
{
if
then
fibo=` expr {fibo ($1 - 2)} + {fibo ($1 - 1)}` | bc
echo $fibo
fi
}
echo "enter a number:"
read x
#echo "The fibonnacci series for value $x is:"
fibo $x
... (4 Replies)
I am facing problem with Shell script to generate Fibonacci series using recursion i.e. recursive function.
Here is my script:
#!/bin/sh
fibo()
{
no=$1
if ; then
return 0
elif ; then
return 1
else
a1=`expr $no - 1`
fibo $a1
... (10 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Shell script to find sum of first n numbers of Fibonacci series
2. Relevant commands, code, scripts,... (0 Replies)
So, Just for practice, I wrote a simple fibonacci sequence script in bash.
(03:08:02\$ cat fib
#!/usr/bin/bash
ret ()
{
echo -ne "\n"
sleep .5
}
a=1
b=2
echo -n $a #1 A
ret
echo -n $b #2 B
ret (8 Replies)
Hi eneryone,
Im trying to learn about assemply 8085 in order to make a project i have.
First of all which emulator to use? I work in linux and I currently istalled GNUSim8085.
Also, maybe somewhere I can find some simple examples?
The project is about making an array saved in specific... (8 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am having a hard time with this assignement i cant get the pfib value to print out the fib sequence.
... (1 Reply)
Hello, I am a beginner to shell programming. Coded the following for Fibonacci series.
#!/bin/bash
fib() {
i=0
j=1
arr=0
arr=1
echo "enter the limit:"
read n
while
do
fo= expr $j - 1
f1=$j
f2= expr $j + 1
arr= expr ${arr} + ${arr}
echo ${arr} (3 Replies)
Discussion started by: Rookie222
3 Replies
LEARN ABOUT PHP
wincache_ocache_meminfo
WINCACHE_OCACHE_MEMINFO(3) 1 WINCACHE_OCACHE_MEMINFO(3)wincache_ocache_meminfo - Retrieves information about opcode cache memory usageSYNOPSIS
array wincache_ocache_meminfo (void )
DESCRIPTION
Retrieves information about memory usage by opcode cache.
RETURN VALUES
Array of meta data about opcode cache memory usage or FALSE on failure
The array returned by this function contains the following elements:
o memory_total - amount of memory in bytes allocated for the opcode cache
o memory_free - amount of free memory in bytes available for the opcode cache
o num_used_blks - number of memory blocks used by the opcode cache
o num_free_blks - number of free memory blocks available for the opcode cache
o memory_overhead - amount of memory in bytes used for the opcode cache internal structures
EXAMPLES
Example #1
A wincache_ocache_meminfo(3) example
<pre>
<?php
print_r(wincache_ocache_meminfo());
?>
</pre>
The above example will output:
Array
(
[memory_total] => 134217728
[memory_free] => 112106972
[num_used_blks] => 15469
[num_free_blks] => 4
[memory_overhead] => 247600
)
SEE ALSO wincache_fcache_fileinfo(3), wincache_fcache_meminfo(3), wincache_ocache_fileinfo(3), wincache_rplist_fileinfo(3), wincache_rplist_mem-
info(3), wincache_refresh_if_changed(3), wincache_ucache_meminfo(3), wincache_ucache_info(3), wincache_scache_info(3), wincache_scache_mem-
info(3).
PHP Documentation Group WINCACHE_OCACHE_MEMINFO(3)