armccurdy@yahoo.co.uk wrote:
Yick,
I ran the following command in 3 different systems:
madplay --output=raw:/tmp/clps7500 xxx.mp3 in CLPS7500
As far as I know, the ARM7 core in the ARM7500FE processor lacks the enhanced multiply instructions of the later ARM7TDMI core which the ARM assembler routines and multiply macros rely on. Worse still, I don't think an undefined instruction exception is generated.
The only multiply instructions available are MUL and MLA, which both return only the lower 32bits of a 32x32 multiply.
To run MAD on an ARM7500FE, try configuring MAD with --disable-aso and --enable-fpm=default. Then compile with gcc using -mcpu=arm7. The result will be fairly low quality, and very slow, but it should be music.
Good luck... :-)
Andre
Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
Dear Sir,
I have tried what you said and it works!!! but I like to try improving the decoding..
I would like to implement the 32bits x 32 bit instrution using macro: but I am not familiar with assembly code in gcc. I have written the following very simple function, it compiles successfully. However when I run it, I got segmentation fault....
In the C program side, I wrote (main.c):
--------------------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h>
long mul(long a, long b, long *c, long *d);
int main(int argc, char **argv) { long a, b, c, d;
a=atol(argv[1]); b=atol(argv[2]);
mul(a, b, &c, &d); fprintf(stderr, "%ld %ld\n", a, b); fprintf(stderr, "%lx %lx %lx %lx\n", a, b, c, d); } -------------------------------------------------------------------------------------------
The mul fuction is written in Assembly (mul.S) as follow: (not finished Yet, just simple function doing nothing) ---------------------------------------------------------------------- .text .align
.global mul .global _mul
mul: _mul: stmdb sp!, {r4-r12, lr} @ push everything onto the stack... adr r0, Rm_backup str r1, [r0] ldmia sp!, {r4-r12, pc} @ return with <lr> destroyed
Rm_backup: .word 12 Rs_backup: .word 12 ip_backup: .word 12
.end ---------------------------------------------------------------------------
The Makefile is --------------------------------------------------------------------------- CC=arm-linux-gcc CFLAGS= -Wall -O \ -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps \ -fcse-skip-blocks -fexpensive-optimizations -fregmove\ -fschedule-insns2 -fstrength-reduce -finline-functions\ -fomit-frame-pointer
all: main
main: mul.o main.o $(CC) $(CFLAGS) -o main mul.o main.o
main.o: main.c $(CC) $(CFLAGS) -c main.c -o main.o
mul.o: mul.S $(CC) $(CFLAGS) -c mul.S -o mul.o -------------------------------------------------------------------------------
The intention in mul.S is to declare 3 local variables, Rm_backup, Rs_backup and ip_backup and store value of r1 into it but when I run, I got segmentatin fault immediately. Why???
Can you tell me how can I implement the following C functions in ARM assembly language:
1) long mul(long a, long b, long *c, long *d) { long e=3;
*c=a+e; *d=*c; return *d; }
2) long mul(long a) { c=a; // c is global variable return d; // d is global variable... }
Yick