FAQ
Hi

Recently I became interested in using jump tables in an assembler
implementation of my 6502 instruction set simulator. I ran into trouble
while trying to set up jump tables and inquired on the Go Nuts mailing
list: https://groups.google.com/d/msg/golang-nuts/6M0BLgrKBRk/TnxtMuFmk30J

The TL;DR is that with 6a "there is no way to emit a data reference to a
specific instruction within a function".

In the days following my post I came up with three approaches to avoid the
abovementioned limitation. I will present them below, complete with
examples for the amd64 architecture. I'm convinced that they are easy to
port to other architectures.

Find the code and an accompanying writeup at
https://github.com/distributed/jumptables


Cheers,
distributed

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Michael Jones at Apr 1, 2013 at 2:26 pm
    Wow, you really do want this to work. Bravo. Maybe your dedication
    will convince the Go team that storing statement labels in an array and
    extending *goto label* to allow *goto label[I]* is a good thing for Go 1.2

    Michael
    On Mon, Apr 1, 2013 at 1:02 AM, distributed wrote:

    Hi

    Recently I became interested in using jump tables in an assembler
    implementation of my 6502 instruction set simulator. I ran into trouble
    while trying to set up jump tables and inquired on the Go Nuts mailing
    list: https://groups.google.com/d/msg/golang-nuts/6M0BLgrKBRk/TnxtMuFmk30J

    The TL;DR is that with 6a "there is no way to emit a data reference to a
    specific instruction within a function".

    In the days following my post I came up with three approaches to avoid the
    abovementioned limitation. I will present them below, complete with
    examples for the amd64 architecture. I'm convinced that they are easy to
    port to other architectures.

    Find the code and an accompanying writeup at
    https://github.com/distributed/jumptables


    Cheers,
    distributed

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    Michael T. Jones | Chief Technology Advocate | mtj@google.com | +1
    650-335-5765

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 1, '13 at 8:02a
activeApr 1, '13 at 2:26p
posts2
users2
websitegolang.org

2 users in discussion

Michael Jones: 1 post Distributed: 1 post

People

Translate

site design / logo © 2021 Grokbase