Re: A86: accessing video mem and strings during an interupt


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

Re: A86: accessing video mem and strings during an interupt




In a message dated 7/5/99 10:29:31 PM Eastern Daylight Time, McBorder@aol.com 
writes:

> i have a string on my calc called "data" it is 1024 bytes. it contains a 
>  picture i want to display as a background
>  this is my code
>  it is the same interupt template that david phillips posted a while ago 
>  the template works the problem is at the InsStart label
>  
>  #include "ti86asm.inc"
>  
>  .org _asm_exec_ram
>  
>  InstallInt:
>   ld hl,IntHandler
>   ld de,_alt_interrupt_exec
>   push de
>   ld bc,IntEnd-IntStart
>   ldir
>   ld de,$28
>   pop hl
>   ld a,(hl)
>   dec hl
>   push hl
>   ld b,5
>  CalcChecksum:
>   add hl,de
>   add a,(hl)
>   djnz CalcChecksum
>   pop hl
>   ld (hl),a
>   set alt_int,(iy+exceptionflg)
>   ret
>  
>  IntHandler:
>   .org _alt_interrupt_exec
>  IntStart:
>  	ld a,(counter)
>  	cp 100
>  	jp z,showtime
>  	inc a
>  	ld (counter),a
>  	ret

this ret is the problem, though this whole routine is quite inefficient.  
assuming the point of this is a delay, here's a working version:


IntStart:
	ld b,200
IntLoop:
	nop
	djnz IntLoop


>  showtime:
>  	xor a
>  	ld (counter),a
>  	ld hl,varname-1
>  	rst 20h
>  	rst 10h
>  	ret c
>  	ld a,b
>  	ex de,hl

right here, you have ahl pointing to the start of this string.  however, 
you've forgotten that the first 2 bytes are the size bytes.  so, adding in 
this:
	call _ahl_plus_2_pg3
will point ahl to the first byte in the actual string data.

>  	call _SET_ABS_SRC_ADDR
>  	xor a
>  	ld hl,$fc00
>  	call _SET_ABS_DEST_ADDR
>  	xor a
>  	ld hl,1024
>  	call _SET_MM_NUM_BYTES
>  	call _mm_ldir
>  	ret

this will work, but you could just as easily do:
	jp _mm_ldir
instead of:
	call _mm_ldir
	ret

>  
>  varname:
>  	.db 4,"data"
>  

you can probably just take out counter.

>  counter:
>  	.db 0
>  IntEnd:
>  
>