Re: A86: Re: Porting Question


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

Re: A86: Re: Porting Question




 ld hl,string-1
 rst 20h
 rst 10h
 ret c
 call _DATA_SIZE_TO_DE  ;de=size, ahl=first byte past size bytes
 call _SET_ABS_SRC_ADDR
 xor a
 ex de,hl  ;get size from de
 call _SET_MM_NUM_BYTES
 inc a
 ld hl,$8100-$8000  ;copy to $8100 on ram page 1
 call _SET_ABS_DEST_ADDR
 call _MM_LDIR


In a message dated 2/18/00 2:26:17 PM Eastern Standard Time, acurti1@umbc.edu 
writes:

> Right, 2-7 are user memory, so your string will be in there.  To compile
>  something as a string, use Asm Studio's "compile as string" option :) 
>  To copy the string onto page 1, I would do something like this...
>  
>   ld hl,string-1
>   rst 20h
>   rst 10h
>   ret c
>   ex de,hl
>   ld a,b
>   call _load_ram_ahl
>   call _RAM_PAGE_1
>   out (5),a
>   ld de,-16384
>   add hl,de
>   ld de,$8100
>   ld c,(hl)
>   inc hl
>   ld b,(hl)
>   inc hl
>  copyloop:
>   ldi
>   dec bc
>   ld a,b
>   or c
>   ret z
>   ld a,h
>   rla
>   jr nc,copyloop  
>   ld h,$40
>   in a,(5)
>   inc a
>   out (5),a
>   jr copyloop
>  
>  ...but that's just because I like doing things the hard way.  _mm_ldir
>  would probably be better, I'm sure someone else will post something
>  about it...



----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/ (down)