(Z80) Setting a BITMAP
From: CTG (spamtrap_at_crayne.org)
Date: 09/16/04
- Next message: Frank Kotler : "Re: Problems using HLA with LINK.EXE version 7.10.3077"
- Previous message: Matthew: "Problems using HLA with LINK.EXE version 7.10.3077"
- Next in thread: Ray M. Ransom: "Re: (Z80) Setting a BITMAP"
- Reply: Ray M. Ransom: "Re: (Z80) Setting a BITMAP"
- Reply: spamtrap_at_crayne.org: "Re: (Z80) Setting a BITMAP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Sep 2004 01:24:14 +0000 (UTC)
TThis routine is clumsy and only deals with setting bitmaps up to bit
64
and fails after (65)
Does anyone know of any piece of reliable code that would go beyond
the 8th Byte and set bits up to 128
Thanks
;--------------------------------------------------------------------
; set the bit in the bitmap for an added field
; On entry: A = bit to set (1-64)
; BITMPTR holds address of bitmap in request
; On exit: A = 0 (False) if bit invalid, else A = True
SET_MBIT_LONG
; check that bit is valid (1-64)
OR A
RET Z
CP 65
JR C,BIT_OK
XOR A
RET
BIT_OK
; point to bitmap in request message
LD HL,(BITMPTR)
LD B,A
XOR A
SCF
;loop til pointer & mask correct
BIT_LOOP1
RRA
JR NC,BIT_CHECK
;select next byte of bitmap
RRA
INC HL
BIT_CHECK
DJNZ BIT_LOOP1
; set bit in correct location
OR (HL)
LD (HL),A
LD A,TRUE
RET
- Next message: Frank Kotler : "Re: Problems using HLA with LINK.EXE version 7.10.3077"
- Previous message: Matthew: "Problems using HLA with LINK.EXE version 7.10.3077"
- Next in thread: Ray M. Ransom: "Re: (Z80) Setting a BITMAP"
- Reply: Ray M. Ransom: "Re: (Z80) Setting a BITMAP"
- Reply: spamtrap_at_crayne.org: "Re: (Z80) Setting a BITMAP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|