https://forge.ispras.ru/https://forge.ispras.ru/favicon.ico?16490126692014-11-17T15:08:48ZOpen-Source ProjectsMicroTESK - Task #5350: Labels in the text of instruction callshttps://forge.ispras.ru/issues/5350?journal_id=212012014-11-17T15:08:48ZAlexander Kamkinaskamkin@gmail.com
<ul><li><strong>Target version</strong> set to <i>2.1</i></li></ul> MicroTESK - Task #5350: Labels in the text of instruction callshttps://forge.ispras.ru/issues/5350?journal_id=222622015-03-13T05:05:09ZAlexander Kamkinaskamkin@gmail.com
<ul><li><strong>Subject</strong> changed from <i>[model] Labels in the text of instruction calls</i> to <i>Labels in the text of instruction calls</i></li><li><strong>Category</strong> set to <i>ISA Simulator</i></li></ul> MicroTESK - Task #5350: Labels in the text of instruction callshttps://forge.ispras.ru/issues/5350?journal_id=224882015-03-25T03:27:36ZAlexander Kamkinaskamkin@gmail.com
<ul><li><strong>Target version</strong> changed from <i>2.1</i> to <i>2.2</i></li></ul> MicroTESK - Task #5350: Labels in the text of instruction callshttps://forge.ispras.ru/issues/5350?journal_id=322742018-01-11T10:53:09ZAndrei Tatarnikovandrewt@ispras.ru
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>The problem has been solving for establishing a special addressing mode responsible for label handling. Here is an example:</p>
<pre><code>
// This mode calculates offset on the basis of the target label address and the current instruction address.
label mode BRANCH_LABEL(target: WORD, current: WORD) = target<17..2> - current<17..2> - 1
syntax = "" // This will be replaced by the label name.
image = format("%s", target<17..2> - current<17..2> - 1)
// The immediate offset.
mode BRANCH_IMM(imm: SHORT) = imm
syntax = format("0x%X", imm)
image = format("%s", imm)
mode BRANCH_OFFSET = BRANCH_LABEL | BRANCH_IMM
op beq (rs: REG, rt: REG, offset: BRANCH_OFFSET)
syntax = format("beq %s, %s, %s", rs.syntax, rt.syntax, offset.syntax)
image = format("000100%s%s%s", rs.image, rt.image, offset.image)
action = {
if rs == rt then
BRANCH = 1;
JMPADDR = CIA + 4 + (sign_extend(WORD, offset) << 2);
endif;
}
</code></pre> MicroTESK - Task #5350: Labels in the text of instruction callshttps://forge.ispras.ru/issues/5350?journal_id=350742018-10-08T11:39:52ZAlexander Kamkinaskamkin@gmail.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>