#9235 - johnny_north - Thu Jul 31, 2003 4:36 am
I admit I don't know what I'm doing when it comes to assembly, could someone help me here?
When I do this:
void MBClient::SWI25(MBStruct mp){
asm("mov r0, %0\n"
" mov r1,#1\n"
" swi 0x25\n" //NOTE!!!!! Use 0x250000 for ARM C Compiler mode.
: // Outputs // 0x25 here will only work for Thumb mode.
: // Inputs
: "r0","r1","r2","r8","r9","r10","r11","r12" // Regs crushed & smushed
);
}
I get the error:
mbclient.cpp: In member function `void MBClient::SWI25(MBStruct)':
mbclient.cpp:140: invalid `asm': operand number out of range
I'm trying to take Jeff F's multiboot struct out of the global variable space, instead passing the struct to swi25 as a local. How can I set r0 to mp and avoid this error?
Maybe someone could help me with the main issue: when I declare the MBStruct as a global (MBStruct is just a struct with info for the bios to do multiboot cliet stuff, about 40 bytes) the program starts fine, then hangs in the same place every time. If I make the MBStruct a member of a class and declare an instace of the class, no problem. Any reason declaring a global would do this?
devkit R4, C++
CFLAGS = -I $(INCDIR2) -I $(INCDIR) -I $(PRJDIR) -mthumb-interwork -c -g -Wall
SFLAGS = -I $(INCDIR2) -I $(INCDIR) --warn -mthumb-interwork -marm7tdmi
LDFLAGS = -L $(LIBDIR) -L $(LIBDIR2) -L $(PRJDIR) -T lnkscript -lm -lg -lstdc++ -lgcc -nostartfiles -Wl,-Map,bin.map
When I do this:
void MBClient::SWI25(MBStruct mp){
asm("mov r0, %0\n"
" mov r1,#1\n"
" swi 0x25\n" //NOTE!!!!! Use 0x250000 for ARM C Compiler mode.
: // Outputs // 0x25 here will only work for Thumb mode.
: // Inputs
: "r0","r1","r2","r8","r9","r10","r11","r12" // Regs crushed & smushed
);
}
I get the error:
mbclient.cpp: In member function `void MBClient::SWI25(MBStruct)':
mbclient.cpp:140: invalid `asm': operand number out of range
I'm trying to take Jeff F's multiboot struct out of the global variable space, instead passing the struct to swi25 as a local. How can I set r0 to mp and avoid this error?
Maybe someone could help me with the main issue: when I declare the MBStruct as a global (MBStruct is just a struct with info for the bios to do multiboot cliet stuff, about 40 bytes) the program starts fine, then hangs in the same place every time. If I make the MBStruct a member of a class and declare an instace of the class, no problem. Any reason declaring a global would do this?
devkit R4, C++
CFLAGS = -I $(INCDIR2) -I $(INCDIR) -I $(PRJDIR) -mthumb-interwork -c -g -Wall
SFLAGS = -I $(INCDIR2) -I $(INCDIR) --warn -mthumb-interwork -marm7tdmi
LDFLAGS = -L $(LIBDIR) -L $(LIBDIR2) -L $(PRJDIR) -T lnkscript -lm -lg -lstdc++ -lgcc -nostartfiles -Wl,-Map,bin.map