===========================================================================
| 356 | |
| 357 | //=========================================================================== |
| 358 | bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ ) |
| 359 | { |
| 360 | bool bStatus = false; |
| 361 | |
| 362 | if (pArg && pAddressValue_) |
| 363 | { |
| 364 | // Check if we refer to reg A X Y P S |
| 365 | for ( int iReg = 0; iReg < (NUM_BREAKPOINT_SOURCES-1); iReg++ ) |
| 366 | { |
| 367 | // Skip Opcode/Instruction/Mnemonic |
| 368 | if (iReg == BP_SRC_OPCODE) |
| 369 | continue; |
| 370 | |
| 371 | // Skip individual flag names |
| 372 | if ((iReg >= BP_SRC_FLAG_C) && (iReg <= BP_SRC_FLAG_N)) |
| 373 | continue; |
| 374 | |
| 375 | // Handle one char names |
| 376 | if ((pArg->nArgLen == 1) && (_stricmp(pArg->sArg, g_aBreakpointSource[iReg]) == 0)) |
| 377 | { |
| 378 | switch ( iReg ) |
| 379 | { |
| 380 | case BP_SRC_REG_A : *pAddressValue_ = regs.a & 0xFF; bStatus = true; break; |
| 381 | case BP_SRC_REG_P : *pAddressValue_ = regs.ps & 0xFF; bStatus = true; break; |
| 382 | case BP_SRC_REG_X : *pAddressValue_ = regs.x & 0xFF; bStatus = true; break; |
| 383 | case BP_SRC_REG_Y : *pAddressValue_ = regs.y & 0xFF; bStatus = true; break; |
| 384 | case BP_SRC_REG_S : *pAddressValue_ = regs.sp ; bStatus = true; break; |
| 385 | default: |
| 386 | break; |
| 387 | } |
| 388 | } |
| 389 | else |
| 390 | if (iReg == BP_SRC_REG_PC) |
| 391 | { |
| 392 | if ((pArg->nArgLen == 2) && (_stricmp( pArg->sArg, g_aBreakpointSource[ iReg ] ) == 0)) |
| 393 | { |
| 394 | *pAddressValue_ = regs.pc ; bStatus = true; break; |
| 395 | } |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | return bStatus; |
| 400 | } |
| 401 | |
| 402 | |
| 403 | //=========================================================================== |