============== idProgram::Disassemble ============== */
| 1716 | ============== |
| 1717 | */ |
| 1718 | void idProgram::Disassemble( void ) const { |
| 1719 | int i; |
| 1720 | int instructionPointer; |
| 1721 | const function_t *func; |
| 1722 | idFile *file; |
| 1723 | |
| 1724 | file = fileSystem->OpenFileByMode( "script/disasm.txt", FS_WRITE ); |
| 1725 | |
| 1726 | for( i = 0; i < functions.Num(); i++ ) { |
| 1727 | func = &functions[ i ]; |
| 1728 | if ( func->eventdef ) { |
| 1729 | // skip eventdefs |
| 1730 | continue; |
| 1731 | } |
| 1732 | |
| 1733 | file->Printf( "\nfunction %s() %d stack used, %d parms, %d locals {\n", func->Name(), func->locals, func->parmTotal, func->locals - func->parmTotal ); |
| 1734 | |
| 1735 | for( instructionPointer = 0; instructionPointer < func->numStatements; instructionPointer++ ) { |
| 1736 | DisassembleStatement( file, func->firstStatement + instructionPointer ); |
| 1737 | } |
| 1738 | |
| 1739 | file->Printf( "}\n" ); |
| 1740 | } |
| 1741 | |
| 1742 | fileSystem->CloseFile( file ); |
| 1743 | } |
| 1744 | |
| 1745 | /* |
| 1746 | ============== |
no test coverage detected