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.
Hi, I need to save the values ​​in a .txt file that have the registers that go from R3 to R8. The condigo that you enter presents the following error:
final.s (18): error: A1163E: Unknown opcode InFileName:, expecting opcode or Macro
This is my code:
PRESERVE8 ;z = (a << 2) | (b & 15); AREA RESET, DATA, READONLY EXPORT __Vectors __Vectors DCD 0x20002000 ; activando memoria DCD Reset_Handler
ALIGN AREA |Random$$data|, CODE, READONLY ENTRY EXPORT Reset_Handler
InFileName: .asciz "Infile1.txt" InFileError: .asciz "Unable to open input file\n" .align InFileHandle:.word 0
;DOS: .word 0x02
Reset_Handler
ldr r0,=InFileName @ set Name for input file mov r1,#0 @ mode is input swi SWI_Open @ open file for input bcs InFileError @ if error? ldr r1,=InFileHandle @ load input file handle str r0,[r1] @ save the file handle
mov r0, #0 mov r3, #Tem ; # de dia en que se realiso la medida mov r4, #Hum ; # de hora en que se realiso la medida
mov r5, #0 ; I del contador 1 mov r6, #0 ; I del contador 2 mov r7, #Co1 ; N del contador 1 mov r8, #Co2 ; N del contador 2
mov r9, #Dia ; # de dia en que se realiso la medida mov r10, #Hor ; # de hora en que se realiso la medida
for1 mov r1, #1 mov r2, #1
cmp r5, r7
bge fin_for1
for2 cmp r6, r8
;########################
TST R1, R1, LSR #1 ; top bit into Carry MOVS R2, R0, RRX ; 33 bit rotate right ADC R1, R1, R2 ; carry into lsb of R1 EOR R2, R2, R0, LSR #29 ; (involved!) EOR R0, R2, R2, LSL #30 ; (similarly involved!) add r3, r3, r1 add r4, r4, r2
;ADD r3, r3, r0 ;###########################
bge fin_for2
add r6, r6, #1
b for2
fin_for2 mov r6, #0
add r5,r5,#1 b for1 fin_for1
AREA |Random$$data|, DATA, READWRITE
Dia EQU 0x1 Hor EQU 0X1 Tem EQU 0X20 Hum EQU 0X50 Co1 EQU 0X3 Co2 EQU 0X3 RD1 EQU 0X00 RD2 EQU 0X00
;varX DCD 0X00 END
thank
Please read the posting tips/instructions for source code, that way it will not look like a steaming heap of crap in the preview and posted forms?
Labels don't use colons
The rpoblema is presented with the following instructions:
InFileName: .asciz "Infile1.txt" InFileError: .asciz "Unable to open input file \ n" .align InFileHandle: .word 0
These are the reservations I made for the system:
RESERVE8 AREA RESET, DATA, READONLY EXPORT __Vectors __Vectors DCD 0x20002000; activating memory DCD Reset_Handler
ALIGN AREA | Random $$ data |, CODE, READONLY ENTRY EXPORT Reset_Handler
It is the Keil Assembler, you can't randomly mix in GNU/GAS syntax code
Try this, not using the COLON, or .ASCIZ
InFileName DCB "Infile1.txt",0
Use DCD instead or .WORD
Salient documentation for the Keil Assembler http://www.keil.com/support/man/docs/armasm/ www.keil.com/.../armasm_dom1361290005584.htm
Use PRE tags around source code