[A83] Re: textinverse asm input


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

[A83] Re: textinverse asm input







>From: Tijl Coosemans <tijl@ulyssis.org>
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Re: textinverse asm input
>Date: Sat, 01 Jun 2002 14:17:12 +0200
>
>
>It's normal.
>
>SUCKER [Pieter Van Nuffel] wrote:
> > I'm having problems with asm_ind_call and pgmio_exec.(83-)
> > I got it from ASMguru, the tutorial about ASM input:
> > numerical. I've got a full line of text on the first and
> > the last line of the screen (with textinverse). Then I
> > put a prompt " seconds:" with pgmio_exec in the middle of
> > the screen. What happens? Suddenly the lower line is
> > completely erased and the upper line is displayed regularly,
> > so no textinverse anymore. This is quite crappy. Is this
> > normal or is there a solution?
>
>

Any solution?

I copied the code from the program below. It should be
squished to be run with ZASMLOAD. There are so far 2
strange things. The problem discribed above and...
When I do the two different tests on my Ti-83, the amount
of interrupts/sec are different:
120 ints/sec with "wait 10 seconds"
149 ints/sec with "enter passed time"

How is that possible?

      SUCKER [Pieter Van Nuffel]



;  InterruptCounter V1.0 BY SUCKER
;  -------------------------------

; You may modify this source code for personal use only.
; You may NOT distribute the modified source or program file.



.nolist
#define end .end
#define END .end
#define equ .equ
#define EQU .equ
#include "squish.inc"


.list
saferam1	.equ	$8265
int_var		.equ	saferam1+1
.org 9327h


start_prgm:

        im 1					;
	call _homeup				;
	call _runindicoff			;
	call _clrscrnfull			;
	ld hl,intro				;
	set textinverse,(iy+textflags)		;
	call _puts				;
	call _eraseEOL				;blackens line '1'
	ld bc,9*256+46				;
	ld (pencol),bc				;
	call _vputs				;
	ld a,7					;
	ld (currow),a				;
	call _eraseEOL				;
	ld bc,56*256+23				;
	ld (pencol),bc				;
	call _vputs				;
	res textinverse,(iy+textflags)		;
	ld bc,24*256+17				;
	ld (pencol),bc				;
	call _vputs				;
	ld bc,40*256+13				;
	ld (pencol),bc				;
	call _vputs				;
	set textinverse,(iy+textflags)		;
	xor a					;
	ld hl,saferam1				;
	ld (hl),a
	inc hl					;
	ld (hl),a				;
	inc hl					;
	ld (hl),a				;

choice:
	res oninterrupt,(iy+onflags)		;
	ei					;
	halt					;
	call _getcsc				;
	cp 15
	jp z,stop_prgm
	cp 34					;"cp [1]"
	jp z,ten_seconds
	cp 26					;"cp [2]"

	jr nz,choice				;




passed_time:;
	call _clrscrn
	ld hl,passed				;
	call disp_above_below			;
	call _vputs				;
	call load				;
	ld b,9					;
	call wait_key				;
	im 2					;
	ld bc,7					;
	ld (currow),bc				;
	call _eraseEOL				;
	res textinverse,(iy+textflags)		;
	ld bc,2					;
	ld (currow),bc				;
	ld hl,ints				;
	call _puts				;

pt_loop:
	call interrupt_loop			;
	ld hl,(int_var)				;
	ld bc,2999				;3000 interrupts will occur
	sbc hl,bc				;
	jr nz,pt_loop				;

	im 1					;
	ld de,821ch            			;
	ld hl,secs				;
	ld bc,16				;
	ldir					;
	ld a,1					;
	ld (ASM_IND_CALL),a			;
	call PGMIO_EXEC				;

	call _runindicoff			;
	ld bc,3					;
	ld (currow),bc				;
	call _eraseEOL				;
	call _formdisp				;
	call _convop1				;
	push de					;
	ld a,3					;
	ld (currow),a				;
	ld hl,secs				;
	call _puts				;
	ld hl,3000				;
	call _setxxxxop2			;
	call _op2toop1				;
	pop de					;
	ex de,hl				;
	call _setxxxxop2			;
	call _fpdiv				;
	ld bc,5					;
	ld (currow),bc				;
	ld d,1					;
	call _round				;
	call _formdisp				;
	ld hl,currow				;
	dec (hl)				;
	ld hl,persec				;
	call _puts				;
	set textinverse,(iy+textflags)		;
	jp done_return				;
;






ten_seconds:;
	call _clrscrn				;
	ld hl,ten				;
	call disp_above_below			;
	call _vputs				;
	call load				;
	ld b,9					;
	call wait_key				;
	im 2					;

	ld hl,ten				;
	call disp_above_below			;
	ld hl,stop				;
	call _vputs				;
	res textinverse,(iy+textflags)		;
	ld bc,2					;
	ld (currow),bc				;
	call _puts				;

ten_loop:
	call interrupt_loop			;
	ld hl,(int_var)				;
	ld bc,9999				;
	sbc hl,bc				;
	jr z,overflow				;
	call _getcsc				;
	cp 9					;
	jr nz,ten_loop				;

overflow:
	im 1					;
	ld hl,secs				;
	call _puts				;
	call _puts				;
	call _newline				;
	ld hl,(int_var)				;
	call _setxxxxop2			;
	call _op2toop1				;
	call _fdiv10				;
	call _formdisp				;
	ld hl,currow				;
	dec (hl)				;
	ld hl,persec				;
	call _puts				;
	set textinverse,(iy+textflags)		;
	jp done_return				;
;




load:
	ld hl,$8400				;
	ld de,$8401				;
	ld (hl),$82				;
	ld bc,$0100				;
	ldir					;

        ld hl,interrupt_start			;
	ld de,$8282				;
        ld bc,interrupt_end-interrupt_start 	;
        ldir					;

	ld a,$84				;
        ld i,a					;
	ret 					;





interrupt_start:
	ex af,af'
	exx
	ld hl,(int_var)				;
	inc hl					;
	ld (int_var),hl				;
	jp $003A				;
interrupt_end:



interrupt_loop:
	ei					;
	halt					;
	ld bc,11*256+2				;
	ld (currow),bc				;
	ld hl,(int_var)				;
	jp _disphl				;


wait_key:
	res oninterrupt,(iy+onflags)		;
	halt					;
	call _getcsc				;
	cp b					;
	jr nz,wait_key				;
	ret					;


done_return:
	ld bc,7					;
	ld (currow),bc				;
	call _eraseEOL				;
	ld bc,56*256+21				;
	ld (pencol),bc				;
	ld hl,rettxt				;
	call _vputs				;
	ld b,15					;
	call wait_key				;
	jp start_prgm				;


disp_above_below:
	call _homeup				;
	call _puts				;
	ld bc,7					;
	ld (currow),bc				;
	call _eraseEOL				;
	ld bc,56*256+12				;
	ld (pencol),bc				;
	ld hl,alert				;
	jp _vputs				;


stop_prgm:
	res textinverse,(iy+textflags)		;
	call _homeup				;
	jp _clrscrnfull				;




; +------------------+
; | Installprgm data |
; +------------------+

intro:
	.db "InterruptCounter",0
	.db "V1.0  By SUCKER",0

rettxt:	.db "<CLEAR>:return",0

	.db "1: Wait 10 seconds.",0
	.db "2: Enter passed time.",0


ten:	.db "---10 seconds---",0
passed:	.db "--Passed times--",0

alert:	.db "Press <ENTER> to ",0
start:	.db "start.",0
stop:	.db "stop.",0

ints:	.db "Interrupts:",0
secs:	.db "   Seconds:",0
tens	.db "   10",0
persec:	.db "  Ints/sec:",0


.end
END


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com