Article View: rec.games.programmer
Article #1051Re: speedup PutBlock
From: J E Holderness
Date: Tue, 10 Nov 1992 09:17
Date: Tue, 10 Nov 1992 09:17
22 lines
1087 bytes
1087 bytes
In <23707@galaxy.ucr.edu> blaisdel@ucrengr.ucr.edu (james blaisdell) writes:
> > mov ax, 320 <<<-- change this to mov bx, y
> > mul y ; AX = y * 320 <<<-- and this to add bx, bx
> then set ds, si for the table lookup by: lds si, table
> then load ax with screen addr by mov ax, ds:[si+bx]
The way I usually do these things is:
mov ah, y
sub al, al
mov bx, ax
shr bx, 1
shr bx, 1
add ax, bx
I remember comparing that with the table method, and this was faster,
although I may be wrong. It probably also depends on what machine you're
using.
- James
Technical Details
Message-ID:
<BxHtt3.3JE@casper.cs.uct.ac.za>Path:
arc1-ca.pugleaf.net!sparky!uunet!psgrain!ee.und.ac.za!shrike.und.ac.za!casper.cs.uct.ac.za!jholdernReferences:
<23707@galaxy.ucr.edu>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!psgrain!ee.und.ac.za!shrike.und.ac.za!casper.cs.uct.ac.za!jholdern From: jholdern@casper.cs.uct.ac.za (J E Holderness) Subject: Re: speedup PutBlock Message-ID: <BxHtt3.3JE@casper.cs.uct.ac.za> Organization: Computer Science Department, University of Cape Town References: <23707@galaxy.ucr.edu> Date: Tue, 10 Nov 1992 09:17:27 GMT Lines: 23