;Library Name: ARRAYLIB ;Module Name: ALOGIC ;Author: Al Hawley ;Date: 31 Mar 1987 ;Version number: 1.0c ;Version History: ;Program Function: ARRAYLIB is a collection of subroutines which ; implement the management of byte arrays in programs written ; for Z80 or HD64180 based computers. This module is one of the ; set, and may require the presence of others. ;*************************************************** ; COPYRIGHT NOTICE ;ARRAYLIB is copyright by A. E. Hawley on March 4, 1987. ;It may be freely distributed, but it must not be sold ;either separately or as part of a package without the ;written consent of the author. The author may be reached ;via electronic mail at the Ladera Z-Node in Los Angeles, ;213-670-9465, or by Voice Phone at: 213-649-3575 ; ;*************************************************** MACLIB ARRHDR name alogic ;This module contains the following routines: public arrb1msk,arrbcmsk,arrmanda,armemora arrb1msk: ;set a single bit in reg A, reset all others. ;on entry, ; a = bit position to set (0-7) ;on exit, ; a = requested bit set, others 0 ; flags are undefined ;all other registers preserved. push bc ld b,a inc b xor a scf b1msk1: rla djnz b1msk1 pop bc ret ;************************************* arrbcmsk: ;set n least significant bits in reg A. ;Remaining bits are reset. ; n is specified as a number, 0-7 which ; defines the highest bit set. ;on entry, ; a = highest bit to set (0-7) ;on exit, ; a = filled with 1's from position ; 0 up through position specified ; all other registers preserved push bc ld b,a inc b xor a bcmsk1: scf rla djnz bcmsk1 pop bc or a ;reset cy (=no error) ret ;************************************* arrmanda: ;perform the logical and of the byte ;in the accumulator with the byte @hl ;preserves all registers push af and a,(hl) ld (hl),a pop af ret ;************************************* armemora: ;perform the logical or of the byte ;in the accumulator with the byte @hl ;preserves all registers push af or a,(hl) ld (hl),a pop af ret ;********************************************** end