# unit b_utils

### Common Utils

author: bocianu bocianu@gmail.com

Set of useful procedures to simplify common tasks in Atari 8-bit programming.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs

## Interface:

name: | description:
--- | ---
CountBits | #### function CountBits(b: byte):byte;assembler; Counts number of ones in bits of any byte value. ##### parameters: b - byte value to count bits in ##### returns: (byte) - number fo bits turned on
WriteLnCentered | #### procedure WriteLnCentered(s: string); Outputs string aligned to center of screen width. Length of string should not exceed screen width (40). ##### parameters: s - string to write
WriteRightAligned | #### procedure WriteRightAligned(w: byte; s: TString); Outputs string aligned to right of provided width. Length of string should not exceed provided width of field. ##### parameters: w - width of field to align s - string to write
NullTermToString | #### function NullTermToString(ptr: word): string; Parses null terminated string into regular pascal string variable. ##### parameters: ptr (word) - address in memory of null terminated string ##### returns: (string) - regular pascal string type variable
ExpandRLE | #### procedure ExpandRLE(src: word; dest: word); Expands RLE compressed data from source memory location and writes expanded data at destination memory address. ##### parameters: src (word) - source address of compressed data dest (word) - destination address where data is expanded