void FCChkIOStmtLabel( void ) { //========================== if( EndEqStmt != NULL ) { RefStmtLabel( EndEqStmt ); } if( ErrEqStmt != NULL ) { RefStmtLabel( ErrEqStmt ); } }
void FCStmtDefineLabel( void ) { //=========================== sym_id sn; sn = GetPtr(); CGControl( O_LABEL, NULL, GetStmtLabel( sn ) ); RefStmtLabel( sn ); }
void FCStmtJmpAlways( void ) { //========================= sym_id sn; sn = GetPtr(); CGControl( O_GOTO, NULL, GetStmtLabel( sn ) ); RefStmtLabel( sn ); }
void FCIfArith( void ) { //=================== // Set up control structure for arithmetic if. cg_name if_expr; sym_id lt; sym_id eq; sym_id gt; cg_type typ; typ = GetType( GetU16() ); if_expr = XPopValue( typ ); lt = GetPtr(); eq = GetPtr(); gt = GetPtr(); if( lt == gt ) { CGControl( O_IF_TRUE, CGCompare( O_EQ, if_expr, CGInteger( 0, typ ), typ ), GetStmtLabel( eq ) ); CGControl( O_GOTO, NULL, GetStmtLabel( lt ) ); } else if( lt == eq ) { CGControl( O_IF_TRUE, CGCompare( O_GT, if_expr, CGInteger( 0, typ ), typ ), GetStmtLabel( gt ) ); CGControl( O_GOTO, NULL, GetStmtLabel( eq ) ); } else if( eq == gt ) { CGControl( O_IF_TRUE, CGCompare( O_LT, if_expr, CGInteger( 0, typ ), typ ), GetStmtLabel( lt ) ); CGControl( O_GOTO, NULL, GetStmtLabel( eq ) ); } else { CG3WayControl( if_expr, GetStmtLabel( lt ), GetStmtLabel( eq ), GetStmtLabel( gt ) ); } RefStmtLabel( lt ); RefStmtLabel( eq ); RefStmtLabel( gt ); }
void FCAssign( void ) { //================== // Process ASSIGN statement. sym_id stmt; stmt = GetPtr(); if( stmt->u.st.flags & SN_FORMAT ) { CGDone( CGAssign( SymAddr( GetPtr() ), CGBackName( GetFmtLabel( stmt->u.st.address ), TY_LOCAL_POINTER ), TY_LOCAL_POINTER ) ); } else { CGDone( CGAssign( SymAddr( GetPtr() ), CGInteger( stmt->u.st.address, TY_INTEGER ), TY_INTEGER ) ); RefStmtLabel( stmt ); } }
void FCAssignedGOTOList( void ) { //============================ // Perform assigned GOTO with list. sel_handle s; label_handle label; sym_id sn; sym_id var; obj_ptr curr_obj; var = GetPtr(); curr_obj = FCodeTell( 0 ); s = CGSelInit(); for(;;) { sn = GetPtr(); if( sn == NULL ) break; if( ( sn->u.st.flags & SN_IN_GOTO_LIST ) == 0 ) { sn->u.st.flags |= SN_IN_GOTO_LIST; label = GetStmtLabel( sn ); CGSelCase( s, label, sn->u.st.address ); } } label = BENewLabel(); CGSelOther( s, label ); CGSelect( s, CGUnary( O_POINTS, CGFEName( var, TY_INTEGER ), TY_INTEGER ) ); CGControl( O_LABEL, NULL, label ); BEFiniLabel( label ); FCodeSeek( curr_obj ); for(;;) { sn = GetPtr(); if( sn == NULL ) break; sn->u.st.flags &= ~SN_IN_GOTO_LIST; RefStmtLabel( sn ); } }