===========================================================================
| 123 | |
| 124 | //=========================================================================== |
| 125 | WORD _CmdDefineByteRange(int nArgs,int iArg,DisasmData_t & tData_) |
| 126 | { |
| 127 | WORD nAddress = 0; |
| 128 | WORD nAddress2 = 0; |
| 129 | WORD nEnd = 0; |
| 130 | int nLen = 0; |
| 131 | |
| 132 | nAddress = _GetDataRange(nArgs,iArg,tData_); |
| 133 | |
| 134 | std::string sSymbolName; |
| 135 | |
| 136 | SymbolTable_Index_e eSymbolTable = SYMBOLS_ASSEMBLY; |
| 137 | bool bAutoDefineName = false; // 2.7.0.34 |
| 138 | |
| 139 | if ( nArgs > 1 ) |
| 140 | { |
| 141 | if ( g_aArgs[ 2 ].eToken == TOKEN_COLON ) // 2.7.0.31 Bug fix: DB range, i.e. DB 174E:174F |
| 142 | { |
| 143 | bAutoDefineName = true; |
| 144 | } |
| 145 | else |
| 146 | { |
| 147 | g_aArgs[ 1 ].sArg[MAX_SYMBOLS_LEN] = 0; // truncate to max symbol length |
| 148 | sSymbolName = g_aArgs[1].sArg; |
| 149 | } |
| 150 | } |
| 151 | else |
| 152 | { |
| 153 | bAutoDefineName = true; |
| 154 | } |
| 155 | |
| 156 | // 2.7.0.34 Unified auto-defined name: B_, W_, T_ for byte, word, or text respectively |
| 157 | // Old name: auto define D_# DB $XX |
| 158 | // Example 'DB' or 'DW' with 1 arg |
| 159 | // DB 801 |
| 160 | Nopcode_e nopcode = NOP_BYTE_1; |
| 161 | |
| 162 | bool isFloat = (g_iCommand == CMD_DEFINE_DATA_FLOAT); |
| 163 | if ( isFloat ) |
| 164 | nopcode = NOP_FAC; |
| 165 | |
| 166 | bool isString = (g_iCommand == CMD_DEFINE_DATA_STR); |
| 167 | if ( isString ) |
| 168 | nopcode = NOP_STRING_ASCII; |
| 169 | |
| 170 | bool isWord1 = (g_iCommand == CMD_DEFINE_DATA_WORD1); |
| 171 | if ( isWord1 ) |
| 172 | nopcode = NOP_WORD_1; |
| 173 | |
| 174 | bool isAddr = (g_iCommand == CMD_DEFINE_ADDR_WORD); |
| 175 | if ( isAddr ) |
| 176 | nopcode = NOP_ADDRESS; |
| 177 | |
| 178 | if ( bAutoDefineName ) |
| 179 | { |
| 180 | sSymbolName = _GetAutoSymbolName( nopcode, tData_.nStartAddress ); |
| 181 | } |
| 182 |
no test coverage detected