A86: Re: Memory Expander


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

A86: Re: Memory Expander




Are we talking 1024 bits or bytes?... words? what? (I don't know much at all
about ASM and stacks)

----- Original Message -----
From: "Kirk Meyer" <kirkmeyer@bigfoot.com>
To: "A86" <assembly-86@lists.ticalc.org>
Sent: Thursday, March 09, 2000 3:52 PM
Subject: A86: Memory Expander


>
> For the interested, a true memory expander, for the 86.
>
>      Kirk
>
> ;
> ; Pterodactyl -- Memory Expander
> ; (C) 2000 Kirk Meyer
> ;
> ; This program gives you extra memory. However, you must save SOME
> ; extra space for the OP & FP stacks. I recommend 1024 as a very safe
> ; value. You can increase or decrease this value with the #define SIZE
> ; below.
> ;
> ; WARNING! Many ASM programs have come to rely on using RAM page 1 as
> ; free space. This could cause major problems... Right now there is no
> ; way to remove this other than resetting your calculator.
> ;
> ; I am not responsible for anything that this does to your calculator.
> ;
>
> #include "asm86.h"
> #include "ti86asm.inc"
>
> ; Change this #define to change how much space you want to leave for the
> ; OP and FP stacks. 256 is a pretty good value for normal usage.
> #define SIZE   1024
>
> _OPBASE               equ         0D28Fh
> _OPS                  equ         0D291h ; op stack pointer
>
>      ld   hl,$8000+SIZE  ; move the op stack down... since we're using
>      ld   (_OPBASE),hl   ; _jforce at the end, we don't need to actually
>      ld   (_OPS),hl      ; move the stack contents.
>
>      ld   a,$01          ; this is our destination. we're going to move
>      ld   hl,SIZE        ; stuff so that there's SIZE bytes left for OP &
FP
>      ld   de,$4000-SIZE  ; stacks. (from the #define above)
>      call $475b          ; _copy_bkwd
>      push af             ; save A  \____ abs pointer to
>      push de             ;      DE /     "deleted" data
>      push bc             ; save BC ----- size of removal
>      xor  a              ; also, write the _ABS_ size of the removal
>      ld   ($D27A),a      ; to the _DELADJAMT thingie
>      ld   ($D27B),bc     ; (required for next call)
>      call $51FD          ; update most ptrs
>      pop  bc             ; pop size of removal
>      pop  de             ; pop A
>      pop  af             ;     DE
>      ld   h,0            ; HBC is used so we zero H
>      call $476F          ; update all of the VAT entries
>
>      jp   $409c          ; _jforce
>
> .end
>
>



References: