📄 m16cvec.cpp
字号:
fputs(lf, pfo); set_org(pfo, fvector); for(i = 0 ; i < (MAX_EXC-1) ; i++) set_vector(pfo, EXC_STATE, i); fputs("\t.lword\t_hardware_start\t\t\t; RESET", pfo); fputs(lf, pfo); } fclose(pfi); fclose(pfo); return 0;}/* * set_M30620FCAFP(OAKS16)脱のベクトルを肋年する */static void set_M30620FCAFP(FILE* pfo, int no, int m){#ifdef OAKS16_JSP13 struct VEC *v; int x;#endif /* OAKS16_JSP13 */ int i;#ifdef OAKS16_JSP13 if(no == 2){ set_global(pfo, in_portid); set_global(pfo, out_portid); fputs(lf, pfo); fputs(func01, pfo); fputs(lf, pfo); fputs("_", pfo); fputs(in_portid, pfo); fputs(":", pfo); fputs(lf, pfo); fputs(func02, pfo); fputs(lf, pfo); fputs("_", pfo); fputs(out_portid, pfo); fputs(":", pfo); fputs(lf, pfo); fputs(func02, pfo); fputs(lf, pfo); fputs(lf, pfo); v = &vec_table[0][0]; for(i = x = 0 ; i < num_vec[0] ; i++, v++){ if(v->no >= 17 && v->no < 21){ x = 1; break; } } if(x){ fputs(func03, pfo); fputs(lf, pfo); v = &vec_table[0][0]; for(i = x = 0 ; i < num_vec[0] ; i++, v++){ if(v->no == 17 || v->no == 19){ fputs(out_handler, pfo); fputs("1:", pfo); fputs(lf, pfo); fputs("\tmov.w\t#1, _", pfo); fputs(out_portid, pfo); fputs(lf, pfo); fputs("\tjmp\t_", pfo); fputs(v->no_label, pfo); fputs(lf, pfo); fputs(out_handler, pfo); fputs("2:", pfo); fputs(lf, pfo); fputs("\tmov.w\t#2, _", pfo); fputs(out_portid, pfo); fputs(lf, pfo); fputs("\tjmp\t_", pfo); fputs(v->no_label, pfo); fputs(lf, pfo); break; } } v = &vec_table[0][0]; for(i = x = 0 ; i < num_vec[0] ; i++, v++){ if(v->no == 18 || v->no == 20){ fputs(in_handler, pfo); fputs("1:", pfo); fputs(lf, pfo); fputs("\tmov.w\t#1, _", pfo); fputs(in_portid, pfo); fputs(lf, pfo); fputs("\tjmp\t_", pfo); fputs(v->no_label, pfo); fputs(lf, pfo); fputs(in_handler, pfo); fputs("2:", pfo); fputs(lf, pfo); fputs("\tmov.w\t#2, _", pfo); fputs(in_portid, pfo); fputs(lf, pfo); fputs("\tjmp\t_", pfo); fputs(v->no_label, pfo); fputs(lf, pfo); break; } } } }#endif /* OAKS16_JSP13 */ set_comment(pfo, int_vec); fputs("\t.section\tvvector", pfo); fputs(lf, pfo); set_org(pfo, "VECTOR_ADR"); for(i = 0 ; i < MAX_INT ; i++){ if(no == 2){ if(i >= 17 && i < 21) set_vector2(pfo, INT_STATE, i); else set_vector(pfo, INT_STATE, i); } else set_vector(pfo, INT_STATE, i); }}/* * M30262F8FG(OAKS16 MINI)のベクトルを肋年する */static void set_M30262F8FG(FILE* pfo, int no, int m){ int i; set_comment(pfo, int_vec); fputs("\t.section\tvector", pfo); fputs(lf, pfo); set_org(pfo, "VECTOR_ADR"); fputs(";", pfo); fputs(lf, pfo); set_vector(pfo, INT_STATE, 0); set_org(pfo, "(VECTOR_ADR+44)"); fputs(lf, pfo); for(i = 11 ; i < 15 ; i++) set_vector(pfo, INT_STATE, i); set_org(pfo, "(VECTOR_ADR+68)"); fputs(lf, pfo); if(m < MAX_INT) m = MAX_INT; for(i = 17 ; i < m ; i++) set_vector(pfo, INT_STATE, i);}/* * グロ〖バル离咐を肋年する */static void set_global(FILE* pfo, char const * t){ fputs("\t.glb\t_", pfo); fputs(t, pfo); fputs(lf, pfo);}/* * コメントを肋年する */static void set_comment(FILE* pfo, char const * t){ fputs(";", pfo); fputs(lf, pfo); fputs(comment, pfo); fputs(lf, pfo); fputs(int_vec, pfo); fputs(lf, pfo); fputs(comment, pfo); fputs(lf, pfo); fputs(";", pfo); fputs(lf, pfo);}/* * オリジンを肋年する */static void set_org(FILE* pfo, char const * t){ fputs("\t.org\t", pfo); fputs(t, pfo); fputs(lf, pfo);}/* * ベクトルを肋年する */static void set_vector(FILE* pfo, int kind, int no){ struct VEC* v = &vec_table[kind][0]; char s[6]; int i; fputs("\t.lword\t_", pfo); s[0] = '\t'; s[1] = ';'; s[2] = ' '; s[3] = (no/10)+'0'; s[4] = (no%10)+'0'; s[5] = 0; for(i = 0 ; i < num_vec[kind] ; i++, v++){ if(v->no == no){ fputs(v->no_label, pfo); fputs(s, pfo); fputs(lf, pfo); return; } } fputs(unused_vec[kind], pfo); fputs(s, pfo); fputs(lf, pfo);}/* * ベクトルを肋年する(泼侍惹) */static void set_vector2(FILE* pfo, int kind, int no){ struct VEC* v = &vec_table[kind][0]; char s[8]; int i; s[1] = '\t'; s[2] = ';'; s[3] = ' '; s[4] = (no/10)+'0'; s[5] = (no%10)+'0'; s[6] = 0; for(i = 0 ; i < num_vec[kind] ; i++, v++){ switch(no){ case 17: s[0] = '1'; if(v->no == 17 || v->no == 19){ fputs("\t.lword\t", pfo); fputs(out_handler, pfo); fputs(s, pfo); fputs(lf, pfo); return; } break; case 18: s[0] = '1'; if(v->no == 18 || v->no == 20){ fputs("\t.lword\t", pfo); fputs(in_handler, pfo); fputs(s, pfo); fputs(lf, pfo); return; } break; case 19: s[0] = '2'; if(v->no == 17 || v->no == 19){ fputs("\t.lword\t", pfo); fputs(out_handler, pfo); fputs(s, pfo); fputs(lf, pfo); return; } break; case 20: s[0] = '2'; if(v->no == 18 || v->no == 20){ fputs("\t.lword\t", pfo); fputs(in_handler, pfo); fputs(s, pfo); fputs(lf, pfo); return; } break; default: break; } } fputs("\t.lword\t_", pfo); fputs(unused_vec[kind], pfo); fputs(s, pfo); fputs(lf, pfo);}/* * 矢机误を孺秤して票办ならばTURE */static bool test_string(char** s, char const *t){ char* p; char c; p = *s; while(*p <= ' '){ if(*p == 0) return false; p++; } while((c = *p++) != 0){ if(c != *t++) break; if(*t == 0){ *s = p; return true; } } return false;}/* * 回年のキャラクタまでスキップ */static bool skip_char(char** s, char const c){ char* p; p = *s; while(*p != c){ if(*p == 0) break; p++; } if(*p){ p++; *s = p; return false; } else{ *s = p; return true; }}/* * スペ〖スまたはタブをスキップする */static bool skip_space(char** s){ char* p; p = *s; while(*p <= ' '){ if(*p == 0) break; p++; } *s = p; if(*p) return false; else return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -