MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / _GetDataRange

Function _GetDataRange

source/Debugger/Debugger_DisassemblerData.cpp:65–122  ·  view source on GitHub ↗

@param tData_ Filled out with range data ===========================================================================

Source from the content-addressed store, hash-verified

63// @param tData_ Filled out with range data
64//===========================================================================
65WORD _GetDataRange (int nArgs, int iArg, DisasmData_t& tData_)
66{
67 WORD nAddress = 0;
68 WORD nAddress2 = 0;
69 WORD nEnd = 0;
70 int nLen = 0;
71
72 memset( (void*) &tData_, 0, sizeof(tData_) );
73
74 // DB address
75 // DB symbol
76 // bool bisAddress ...
77
78 if (nArgs < 1)
79 {
80 nAddress = g_nDisasmCurAddress;
81 }
82 else
83 {
84 // DB foo = 300 // nArgs == 3
85 // 2.9.2.3: Fixed: DB HGR = 2000:3FFF and DB FOO = 300 wasn't parsing correctly from 2.9.1.3. Fix for commit 48e0fe3a.
86 if (g_aArgs[iArg].eToken == TOKEN_EQUAL)
87 iArg++;
88
89 RangeType_t eRange = Range_Get( nAddress, nAddress2, iArg);
90 if ((eRange == RANGE_HAS_END) ||
91 (eRange == RANGE_HAS_LEN))
92 {
93 Range_CalcEndLen( eRange, nAddress, nAddress2, nEnd, nLen );
94 nLen--; // Disassembly_IsDataAddress() is *inclusive* // KEEP IN SYNC: _CmdDefineByteRange() CmdDisasmDataList() _6502_GetOpmodeOpbyte() FormatNopcodeBytes()
95 }
96 else
97 {
98 if (nArgs > 1)
99 {
100 // 2.9.1.1 Add: Support for equal sign, also make it optional for command DB
101 // DB FOO 300
102 // DB FOO = 300
103 nAddress = g_aArgs[ iArg ].nValue;
104 }
105 else
106 nAddress = g_aArgs[ 1 ].nValue;
107 }
108 }
109
110 // 2.7.0.35 DW address -- round the length up to even number for convenience.
111 // Example: 'DW 6062' is equivalent to: 'DW 6062:6063'
112 if ( g_iCommand == CMD_DEFINE_DATA_WORD1 )
113 {
114 if ( ~nLen & 1 )
115 nLen++;
116 }
117
118 tData_.nStartAddress = nAddress;
119 tData_.nEndAddress = nAddress + nLen;
120
121 return nAddress;
122}

Callers 2

_CmdDefineByteRangeFunction · 0.85
CmdDisasmDataDefCodeFunction · 0.85

Calls 2

Range_GetFunction · 0.85
Range_CalcEndLenFunction · 0.85

Tested by

no test coverage detected