We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hello all,
I am trying to get my arm7tdmi.. better yet an at91sam7x256 processor to do the simplist of assembly programs.. I have the program done and it should be flawless..
write the sum of cubes from 1 to 10 to a register..
AREA cubesum, CODE, AT 0x00000000 PUBLIC ?ASM?INIT
?ASM?INIT
begin: MOV R0, #0 MOV R1, #1 next: MUL R2, R1, R1
MLA R0, R2, R1, R0
ADD R1, R1, #1
CMP R1, #0xb
BNE next END
anyway I keep getting these errors when I compile..
FirstProgram.asm(1): error: A1163E: Unknown opcode cubesum, , expecting opcode or Macro
FirstProgram.asm(2): error: A1355U: A Label was found which was in no AREA
I don't understand. shouldnt cubesum be the program name at the top? and dont you need to declare the asminit so it knows it's using assembly? This is really iritating me considering my text book doesn't explain startup files at all and has no useful information on what headers I need, and also that there is no decent support on the web (like no one has run into this before). help would be much appreciated. once I have it initialized coding is the easy part. oh and I'm using the stock startup file for that specific processor.
thanks all,
justin
Did you look at the sample startup files supplied with the Keil tools?
Give a tab for all keywords.
Suvidh
as in my original post.. "oh and I'm using the stock startup file for that specific processor."
I don't understand what you're asking. what do you mean give a tab for all keywords?
Yes, I'm aware that you are using the standard startup file, but my implied question was:
Have you looked at exactly _how_ the standard startup file made it's declarations, since the standard startup file _is_ possible to get through the assembler without any errors.
I assume that he mean: how are you indenting (or not indenting) your code?
"I am trying to [...] do the simplist of assembly programs.. I have the program done and it should be flawless"
Only if you supply correct syntax.
1) Assemblers are VERY sensitive to formatting. A directive such as AREA needs whitespace (space or TABs) preceding it. NEVER start a assembler line at column 0;
2) The AREA directive (RVCT 3.x) does not have a section attribute AT, and even if it had, code should not be located at absolute position 0x00000000, since this is the address of the default interrupt vectors table. You should load the PC with your routine address at 0x00000000;
"and dont you need to declare the asminit so it knows it's using assembly"
"?ASM?INIT" has no special meaning whatsoever to the assembler. You could just called your entry point "SUPERCALIFRAGILISTICEXPIALIDOCIOUS". The way the assembler knows you are 'using assembly' is a correct line syntax, with proper column spacing, and proper assembler directives.
Read the MANUAL Real View Compilation Tools Assembler Guide, especially section 2.3 and section 7.8.2
Just another thing, to think of after you get the white space and line syntax right: where does the program flow go when R1 equals 0x0000000b ?
what is the proper syntax for adding an enrty point? and in what file do i declare it? I the other errors worked out but I get a warning about the entry point still
Do you have the ARM RVCT Assembler guide? Read the directives reference under ENTRY.
The ENTRY directive tells the assembler to generate correct object file entry point, that will be used by the linker at link time to create an entry point to the image.
The ENTRY directive is *not* required for the assembler to create the object file, i.e., if you leave it out, the linker will only issue a warning.