[A83] Re: AF'


[Prev][Next][Index][Thread]

[A83] Re: AF'




First disable interrupts (DI)
Then you can swap AF with the shadow AF'.

CrappyExample:
  DI
  ld a,4
Loop:
  ex af,af'
  ld a,7
Loop2:
  dec a
  ;do something
  jr nz,Loop2
  ex af,af'
  dec a
  jr nz,Loop

So it's kinda like pushing and popping, but faster, and it swaps with shadow 
registers.  If interrupts are enabled, the shadow registers get overwritten 
by the interrupt routine.

The other shadow command, EXX, swaps all 16 bit registers except AF.  Useful 
when working with 2 routines that need to be alternated a lot.


>From: Mike3465@aol.com
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] AF'
>Date: Mon, 24 Sep 2001 15:54:09 EDT
>MIME-Version: 1.0
>Received: from [195.67.128.9] by hotmail.com (3.2) with ESMTP id 
>MHotMailBD78DA6F005F4004320AC343800910450; Mon, 24 Sep 2001 12:54:37 -0700
>Received: from towerguard. (mx-1.sollentuna.net [195.67.128.9])by 
>mx-1.sollentuna.net (Postfix) with ESMTPid 25FB21807E; Mon, 24 Sep 2001 
>21:54:19 +0200 (CEST)
>Received: with LISTAR (v1.0.0; list assembly-83); Mon, 24 Sep 2001 21:54:19 
>+0200 (CEST)
>Received: from imo-m07.mx.aol.com (imo-m07.mx.aol.com [64.12.136.162])by 
>mx-1.sollentuna.net (Postfix) with ESMTP id 4C5461807Dfor 
><assembly-83@lists.ticalc.org>; Mon, 24 Sep 2001 21:54:17 +0200 (CEST)
>Received: from Mike3465@aol.comby imo-m07.mx.aol.com (mail_out_v31_r1.7.) 
>id z.12.12e6adf8 (25914) for <assembly-83@lists.ticalc.org>; Mon, 24 Sep 
>2001 15:54:09 -0400 (EDT)
>From assembly-83-bounce@lists.ticalc.org Mon, 24 Sep 2001 12:54:38 -0700
>Delivered-To: lists.ticalc-assembly-83@mx-1.sollentuna.net
>Message-ID: <12.12e6adf8.28e0e961@aol.com>
>X-Mailer: AOL 4.0 for Windows 95 sub 114
>X-listar-version: Listar v1.0.0
>Sender: assembly-83-bounce@lists.ticalc.org
>Errors-To: assembly-83-bounce@lists.ticalc.org
>X-original-sender: Mike3465@aol.com
>Precedence: bulk
>X-list: assembly-83
>
>
>I was reading though Asmguru recently, looking at the commands, and checked
>out ex.  There i saw as an example: '  ex AF,AF'  ", now what is the AF'
>variable, and what would you use it for?
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp