From: werner.huysegoms@dg11.cec.be
Subject: Re: Fast copy high to low port?
Date: 10 Jul 1998 00:00:00 GMT
Message-ID: <6o540s$13l$1@nnrp1.dejanews.com>
References: <6o3t2h$7pj$1@nnrp1.dejanews.com> <6o4o9t$epv$1@nnrp1.dejanews.com>
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Fri Jul 10 13:13:00 1998 GMT
Newsgroups: comp.sys.hp48
X-Http-User-Agent: Mozilla/3.02 (WinNT; I) via proxy gateway CERN-HTTPD/3.0 libwww/2.17

*****************************************************************************
* PNC1
*
* Copy Port n to port 1
* In : n (real)
* Out:
*
* Error conditions:
* 1. Must run on a GX (not tested)
* 2. 2 cards must be present, card 1 must be writable ( (0010F) = #11x1h )
*	--> Port Not Available
* 3. port 1 not merged ( (8052F) = xx0x )
*	--> Port Not Available
* 4. port n exists ( (80533) = #banks >= n-2, n>1)
*  --> Bad Argument Value
*
* The actual copy is carried out as follows:
* 0. select bank n-2
* 1. reconfigure the bank switcher from 7F000 to 3F000
* 2. reconfigure port 1 from C0000 to 40000
* 3. copy 40000 nibbles from C0000 to 40000
* 4. reconfigure port1 from 40000 to C0000
* 5. reconfigure bank switcher from 3F000 to 7F000
*****************************************************************************
::
  CK1NoBlame
  CK&DISPATCH1
  ONE
  ::
    COERCE
    CODE
        GOSBVL  =POP#
        GOSBVL  =SAVPTR
        C=0     A
        D0=(5)  =CARDSTAT
        C=DAT0  1
        C=C+1   P
        GOC     L10
        C=C+1   P
        C=C+1   P
        GONC    LPNA
L10     D0=(5)  #8052F
        C=DAT0  1
        ?CBIT=1 1
        GOYES   LPNA
        D0=D0+  4
        C=DAT0  B
        A=A-1   A
        GOC     LBAV
        A=A-1   A
        GOC     LBAV
        ?A<=C   A
        GOYES   LDOIT
LBAV    LCHEX   502
LERR    GOVLNG  =GPErrjmpC
LPNA    LCHEX   A
        GOTO    LERR
LDOIT   GOSBVL  =DisableIntr
        A=A+A   A                * select bank n-2
        LCHEX   #7F040
        A=A+C   A
        D0=A
        A=DAT0  B
        C=0     B                * reconfig bank switcher at 3F000
        UNCNFG
        P=      3
        LCHEX   FC               * -#4000h = 16k * 16 nibs
        B=C     C
        LCHEX   FF
        CONFIG
        LCHEX   3F
        CONFIG
        LCHEX   C0               * reconfig port 1 at 40000
        D0=C
        UNCNFG
        CONFIG
        LCHEX   40
        D1=C
        CONFIG
L50     A=DAT0  W                * copy
        DAT1=A  W
        D0=D0+  16
        D1=D1+  16
        B=B+1   A
        GONC    L50
        UNCNFG                   * reconfig port 1 at C0000
        LCHEX   C0
        CONFIG
        CONFIG
        LCHEX   3F               * reconfig bank switcher at 7F000
        UNCNFG
        LCHEX   FF
        CONFIG
        LCHEX   7F
        CONFIG
        GOSBVL  =AllowIntr
        P=      0
        GOVLNG  =GETPTRLOOP
    ENDCODE
  ;
  DEEPSLEEP
;

And the corresponding ASC code:

%%HP:T(1);
"D9D20D29512BF819FF30D9D20AEC81CCD209F0008F146608FB9760D21BF01001
5E0B064B0B06B065531BF250815E0808B13216314ECC4C0CC4708BA51322058D
04F0130A65FF8F51110C434040F7CA13014AAE28042331CFD531FF80531F3805
310C13480480531041358051527151716F17FE55FE804310C80580531F380431
FF80531F78058F5E010208D34150B2130DE140B213049ED"

--
Best Regards,
Werner Huysegoms
Reply-To: werner.huysegoms@dg11.cec.be