From owner-freebsd-chat Thu Aug 8 11:36:29 1996 Return-Path: owner-chat Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA04436 for chat-outgoing; Thu, 8 Aug 1996 11:36:29 -0700 (PDT) Received: from boner.mrami.com (mramirez.sy.yale.edu [130.132.57.207]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA04431 for ; Thu, 8 Aug 1996 11:36:25 -0700 (PDT) Received: (from mrami@localhost) by boner.mrami.com (8.7.5/8.6.9) id OAA09564; Thu, 8 Aug 1996 14:38:53 -0400 (EDT) Date: Thu, 8 Aug 1996 14:38:52 -0400 (EDT) From: Marc Ramirez To: chat@freebsd.org Subject: Jump to arbitrary label, intra-function Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-chat@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I have some 6507 machine code that I'm trying to run on my PC because I don't have a 6507 anymore. :) Software emulation just isn't cutting it, and I have been toying with the idea of writing a re-assembler. The problem comes when I try to write JSR/RTS in C. JSR is easy enough; push the 6507 PC and do a goto; RTS is trickier... how do I translate a 6507 PC back into a C label? The first thought that popped into my mind was to construct a jump table, but I can't seem to take the address of a label. Hmm... I'm pretty sure I could play around with assembly to do it, but I also eventually want to run this on a DECStation, too. Anyone know of an ANSI way to do this? Surely someone has come upon this problem before... Marc. -- Every improvement in communication makes the bore more terrible. -- Frank Moore Colby