Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6020133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:31:25+00:00 2026-05-23T03:31:25+00:00

When I learned MIPS assembly a few months ago, a question popped into my

  • 0

When I learned MIPS assembly a few months ago, a question popped into my head that I forgot to ask then, so I thought I’d ask it now:

Is it possible to implement polymorphism without indirect jump instructions? If so, how?

(Indirect jumps are the "jump register" instructions, e.g. jr $t0 in MIPS or jmp EAX in x86.)

One such solution I came up with is self-modifying code, but I’m curious as to whether polymorphism (and so OOP) would be possible by any other means.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:31:26+00:00Added an answer on May 23, 2026 at 3:31 am

    The simplest answer to your question would be to write your program (and possible assembler) in such a way that all method calls can be resolved at runtime thus negating the need for a lookup table. I’m going to assume you’re talking about passing a subclass to a function that was designed for a superclass and it is therefore impossible to implement this optimization.

    Eliminating the lookup, I think, is outside the scope of your question so I’m going to suggest replacements for the jmp <reg> instruction (sorry, I only know x86).

    • You can execute a call <mem> on a memory
      address (isn’t this how you would do
      it using a lookup table?)
    • You can execute a call <reg> on a register
      (not entirely different from the jmp
      , but does answer your question)
    • You can jmp <mem> if you wanted, but
      that’s not all that different from jmp <reg>

    All of these are possible and solve your problem, but are all alike. I guess this illustrates my confusion on why you would want to do what you’re asking. You have to have some way to choose which method to call (the vtable) and some way to transfer execution to the method (using jmp or call).

    The only other possible way to do this would be to fiddle with the register that is used to point to the next command in the execution chain (EIP in x86). Whether you can or should is another question. I suppose if you were intimately knowledgeable of the architecture and weren’t worried about it changing you could do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I learned few minutes ago that adding data attributes is a nice way to
I learned some time ago about Decision Trees and Decision tables. I feel that
I learned how to authenticate users in Django months ago, but I've since upgraded
Learned all about computing algorithm costs in College, but that was so long ago
I learned that STL can forbid programmer putting an auto_ptr into a container. For
I learned the basics of web design a few months back and am trying
I learned today that NetBeans 6.5 should have an on-the-fly compilation of (single) Java
I learned Java in college, and then I was hired by a C# shop
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
I learned that by trying to use the tablesorter plug in from jquery the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.