TODO: merge _CmdDisasmDataDefByteX() and _CmdDisasmDataDefWordX add params( iDirective, iOpcode ) to allow ASM_DEFINE_FLOAT, NOP_FAC ===========================================================================
| 364 | // add params( iDirective, iOpcode ) to allow ASM_DEFINE_FLOAT, NOP_FAC |
| 365 | //=========================================================================== |
| 366 | Update_t _CmdDisasmDataDefByteX (int nArgs) |
| 367 | { |
| 368 | // DB |
| 369 | // DB symbol // use current instruction pointer |
| 370 | // DB symbol address |
| 371 | // DB symbol range:range |
| 372 | // DB address |
| 373 | // To "return to code" use ."X" |
| 374 | int iCmd = g_aArgs[0].nValue - NOP_BYTE_1; |
| 375 | |
| 376 | // 2.9.2.2: Bug fix: DB HGR = 2000:3FFF was displaying help instead of being parsed. |
| 377 | if (nArgs > 5) // 2.7.0.31 Bug fix: DB range, i.e. DB 174E:174F |
| 378 | { |
| 379 | return Help_Arg_1( CMD_DEFINE_DATA_BYTE1 + iCmd ); |
| 380 | } |
| 381 | |
| 382 | DisasmData_t tData; |
| 383 | int iArg = 2; |
| 384 | |
| 385 | if (nArgs == 3) // 2.7.0.31 Bug fix: DB range, i.e. DB 174E:175F |
| 386 | { |
| 387 | if (g_aArgs[ 2 ].eToken == TOKEN_COLON) |
| 388 | iArg = 1; |
| 389 | } |
| 390 | |
| 391 | WORD nAddress = _CmdDefineByteRange( nArgs, iArg, tData ); |
| 392 | |
| 393 | // TODO: Allow user to select which assembler to use for displaying directives! |
| 394 | tData.iDirective = g_aAssemblerFirstDirective[ g_iAssemblerSyntax ] + ASM_DEFINE_BYTE; |
| 395 | |
| 396 | // 2.9.1.22 Fixed: `df FAC` was incorrectly getting marked up as `db` |
| 397 | if (g_aArgs[0].nValue == NOP_FAC) |
| 398 | { |
| 399 | tData.iDirective = g_aAssemblerFirstDirective[ g_iAssemblerSyntax ] + ASM_DEFINE_FLOAT; |
| 400 | } |
| 401 | |
| 402 | tData.eElementType = (Nopcode_e)( NOP_BYTE_1 + iCmd ); |
| 403 | tData.bSymbolLookup = false; |
| 404 | tData.nTargetAddress = 0; |
| 405 | |
| 406 | // Already exists, so update |
| 407 | DisasmData_t *pData = Disassembly_IsDataAddress( nAddress ); |
| 408 | if ( pData ) |
| 409 | { |
| 410 | *pData = tData; |
| 411 | } |
| 412 | else |
| 413 | Disassembly_AddData( tData ); |
| 414 | |
| 415 | return UPDATE_DISASM | ConsoleUpdate(); |
| 416 | } |
| 417 | |
| 418 | /* |
| 419 | Usage: |
no test coverage detected