diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-05-19 16:14:26 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-05-19 19:53:38 -0700 |
| commit | 1683c69fb79c5ae7498e154ec877b5e714247a4e (patch) | |
| tree | 0b555fa356d5552088cce94367304dd9581df8af /Source/Core | |
| parent | a4cb691058cbd49cb3be1aa386f188de96cbff84 (diff) | |
DSPAssembler: add WARNPC directive from xkas (technically, from asar)
This adds the WARNPC directive from xkas/asar to complement the existing ORG
directive. A common useful idiom is "WARNPC 0xXXXX\nORG 0xXXXX," which only
seeks forward and raises an error if you've already written to that part
of the file.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/DSP/DSPAssembler.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/Core/DSP/DSPAssembler.cpp b/Source/Core/Core/DSP/DSPAssembler.cpp index 8f4f51f278..b5ca9dd01b 100644 --- a/Source/Core/Core/DSP/DSPAssembler.cpp +++ b/Source/Core/Core/DSP/DSPAssembler.cpp @@ -956,6 +956,24 @@ bool DSPAssembler::AssemblePass(const std::string& text, int pass) continue; } + if (strcmp("WARNPC", opcode) == 0) + { + if (params[0].type == P_VAL) + { + if (m_cur_addr > params[0].val) + { + std::string msg = StringFromFormat("WARNPC at 0x%04x, expected 0x%04x or less", + m_cur_addr, params[0].val); + ShowError(ERR_OUT_RANGE_PC, msg.c_str()); + } + } + else + { + ShowError(ERR_EXPECTED_PARAM_VAL); + } + continue; + } + if (strcmp("SEGMENT", opcode) == 0) { if (params[0].type == P_STR) |
