| ??? 08/06/00 08:15 Read: times |
#4179 - Mystic switch()/"Address space overflow" |
Hi, everyone, I have some questions regarding Keil C51_v550/ICE_Ceibo_DS-51
tools as following. Please take a minute to read the code below. #pragma OE DB SB CD OR NOIP MODDP2 SMALL OT(6, SPEED) #include <reg320.h> void main(void) { chk_hdwr(); init_vm; while(1) { key = get_key(); switch(key) { case MUSIC1: msc_key(); break; case MUSIC2: msc_key(); break; case MUSIC3: msc_key(); break; case MUSIC4: msc_key(); break; case TEST : tst_key(); break; case RECORD: rec_key(); break; /*--------------------------*/ case ERASE1: del_key(); break; case ERASE2: del_key(); break; case ERASE3: del_key(); break; case ERASE4: del_key(); break; case ERASE : del_key(); break; } key = NO_KEY; VOX_manager(); Speaker(sp); leds(); } } When some of key pressed, a *_key() function is called and program is stopping by a breakpoint. Further program running is activated manually, step by step. As soon as it comes into switch(key) again, and next step is executed, the program goes on, as if "RUN" command performed. I tried to exclude last five cases of the switch. In this way the linker tells me WARNING: "Uncalled segment" (del_key();) - it's ok, and ERROR: "Address space overflow". I return back one case with the del_key(). All the error messages go away, and the switch is ok, while stepping debuging now. 01. What's the mystery of "address space overflow" error? Why the error depend on an uncalled segment? 02. Why the switch functions differently depending on its size? It was noted at ICE's dissasembler window, that some C?CCASE() subroutine is called while switch size of 11 cases, and some branch table used, while size is 7 cases. Best regards to everyone, and a lot of thanks to anyone who is not so much experienced to anwser for my questions. Oleg |
| Topic | Author | Date |
| Mystic switch()/"Address space overflow" | 01/01/70 00:00 | |
| RE: Mystic switch()/"Address space overflow&q | 01/01/70 00:00 | |
| RE: Mystic switch()/"Address space overflow&a | 01/01/70 00:00 | |
| RE: Mystic switch()/"Address space overflow&q | 01/01/70 00:00 | |
RE: Mystic switch()/"Address space overflow&a | 01/01/70 00:00 |



