Project

General

Profile

Actions

Feature #6154

closed

Directive for instructions replacement

Added by Mikhail Chupilko almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
-
Target version:
Start date:
07/07/2015
Due date:
% Done:

100%

Estimated time:
Published in build:
2.2.9

Description

Example:

org 0x2000

This directive should update inner base address for the following instructions replacement and print .org 0x2000 into the resulting assembler file.

Actions #1

Updated by Alexander Kamkin almost 9 years ago

  • Target version set to 2.2

.align 4 is one more directive to be implemented.

Actions #2

Updated by Andrei Tatarnikov almost 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Done. Here is an example:


class MinMaxTemplate < MiniMipsBaseTemplate

  def pre
    super

    data {
      org 0x00010001
      align 8
      label :data
      word rand(0, 9), rand(0, 9), rand(0, 9), rand(0, 9), rand(0, 9)
      label :end
      space 1
    }
  end

  def run
    text  '.text'
    trace '.text'

    trace_data :data, :end

    org 0x00020000

    la t0, :data
    la t1, :end

    lw t2, 0, t0
    add s0, zero, t2 
    add s1, zero, t2

    trace "" 
    label :cycle
    addi t0, t0, 4
    beq t0, t1, :done 
    lw t2, 0, t0

    slt t3, t2, s0
    beq t3, zero, :test_max
    nop
    add s0, zero, t2 

    label :test_max
    slt t4, s1, t2
    beq t4, zero, :cycle
    nop
    add s1, zero, t2

    j :cycle
    nop

    label :done
    trace "\ns0(min)=%d, s1(max)=%d", gpr_observer(16), gpr_observer(17)
  end

end
Actions #3

Updated by Andrei Tatarnikov almost 9 years ago

  • Status changed from Resolved to Closed
  • Published in build set to 2.2.9
Actions

Also available in: Atom PDF