Newsgroups: comp.sys.sinclair
Path: ulke.hiMolde.no!trane.uninett.no!Norway.EU.net!EU.net!CERN.ch!frodet
From: frodet@www.cern.ch (Frode Tenneboe)
Subject: Re: Clean screen (sort of)
X-Nntp-Posting-Host: wwwlab.cern.ch
Message-ID: <DAHDLp.D81@news.cern.ch>
Sender: news@news.cern.ch (USENET News System)
Organization: CERN European Lab for Particle Physics
X-Newsreader: TIN [version 1.2 PL2]
References: <3rvaut$6vt@everyday.everyday.se> <DAD4GI.97t@news.cern.ch> <1995Jun20.091240.5340@lsl>
Date: Tue, 20 Jun 1995 16:53:49 GMT
Lines: 47

timbe@lsl.co.uk wrote:

: > 	ld (stack+1),sp
: > 	ld de,0
: > 	ld bc,3456
: > 	ld sp,23295
: > loop	push de
: > 	dec bc
: > 	ld a,b
: > 	or c
: > 	jr nz,loop
: > stack	ld sp,0

: wouldn't using djnz loop; dec c; jr nz,loop be faster (and take the same ammout
: of memory) (but bc would have to hold the correct number ie b=oldc;c=oldb - I
: am lazy and dont want to work out the decimal numbers)

Probably is..yes...

: To speed this up you could put in about 200 push de instructions. This doesnt
: increase the length too much, but does increase the speed.

This is also true. A number deviceable bye the number of bytes
you want to PUSH is often handy....

: > 
: > or even faster (but takes some more mem):
: > 
: > 	ld hl,some-adr
: > 	ld bc,3456
: > loop	ld (hl),213	; opcode for push de
: > 	inc hl
: > 	dec bc
: > 	ld a,b
: > 	or c
: > 	jr nz,loop
: > 	ld (hl),201	;return

: why not just assemble the code directly (unless you can reuse the space!)

...or you put it in a free bank on a 128K. :)

 -Frode

--
Frode Tenneboe, ECP/PT, CERN, CH-1211 Geneva 23, Switzerland
frodet@www.cern.ch             http://www.himolde.no/~frodet
