F From:	SMTP%"MACRO32%WKUVX1.BITNET@uu7.psi.com"  7-AUG-1993 12:17:59.55 To:	EVERHART CC:	 Subj:	Re: AMAC vs. computed JMP   , Message-Id: <9308040742.AA08370@uu7.psi.com>O X-Listname: "VMS Internals, MACRO, & BLISS Discussions" <MACRO32@WKUVX1.BITNET>  Warnings-To: <> - Errors-To: MacroMan%WKUVX1.BITNET@uu7.psi.com * Sender: MacroMan%WKUVX1.BITNET@uu7.psi.com% Date: Wed, 04 Aug 1993 09:37:23 +0200 5 From: "GWDGV1::MOELLER" <moeller@gwdgv1.dnet.gwdg.de> + Reply-To: MACRO32%WKUVX1.BITNET@uu7.psi.com  To: MACRO32@WKUVX1.BITNET " Subject: Re: AMAC vs. computed JMP  H <BJJ@ECL.PSU.EDU> writes [in response to my question and Arne's answer]: >[...]E >            Explanation: When an instruction such as MOVAx or PUSHAx G >            is used to store the address of a code label which has not F >            been declared as an entry point, the compiler reports theD >            STORCODLAB error. The reason for this is that any legalI >            reference to the stored address will result in a JSB or CALL I >            to that address. For example, JMP 4(R0) will be treated as a I >            JSB (followed immediately by an RSB in the current routine).  >  > : > You'd probably use .JSB32_ENTRY instead of .JSB_ENTRY so6 > the compiler doesn't go trashing all your registers.  D I think this still means that you cannot 'randomly' transfer controlB (all within the same module, of course) with JMP and have the same: semantics as a branch (with regard to the stack contents).  I In the meantime, I converted my program to use some big CASEL intructions : (by storing 'case labels' instead of the actual adresses).  A The 'stored code label' problem also affects the 'NEWPC' argument C to the $UNWIND system service: In my undestanding, in the following C example, the stack pointer changes when the 'alternate return' [x1] G is taken. This won't hurt if the main program returns soon (like in the I example), but if the main program would want to continue, I wouldn't know $ how to limit the stack expansion ...  ( Example (just to test the machine code):           .title  z  ; (         .psect  _rodata,quad,nowrt,noexe k_0:    .long   0  ; $         .psect  _code,quad,nowrt,exe ;  handler::       .call_entry +         $unwind_s       depadr=k_0,newpc=x1          ret  ;  main::  .call_entry          movab   handler,(fp)         clrl    r1         divl3   r1,#1,r0         ret  ;  x1:     .jsb32_entryE ;;                              ;; something pushed on stack here ???          movl    #4,r0          ret  ;          .end    main  K Wolfgang J. Moeller, GWDG, D-37018 Goettingen, F.R.Germany | Disclaimer ... O PSI%(0262)45050352008::MOELLER       Phone: +49 551 201516 | No claim intended! O Internet: moeller@gwdgv1.dnet.gwdg.de    | This space intentionally left blank. 