MSX2-Technical-Handbook

APPENDIX 3 - BIT BLOCK TRANSFER

The bit block transfer corresponds to the COPY command in BASIC and is used to transfer data from RAM, VRAM, and the disk. It is easily executed by the routine in expansion ROM and available from the assembly language program. Since it is in expansion ROM, use SUBROM or EXTROM of BIOS for this routine.

 

Index

1. Transferring in VRAM

2. Transferring data between RAM and VRAM

3. Transferring between the disk and RAM or VRAM

 

1. Transferring in VRAM

BLTVV (0191H/SUB)

 

2. Transferring data between RAM and VRAM

To use the routines below, the following memory space should be allocated as graphic area for screen modes.

Note to raise fractions.

For disk or RAM, data to indicate the size is added as the array data. The first two bytes of data indicate the number of dots in X direction; the next two bytes indicate the number of dots in the Y direction.

 

BLTVM (0195H/SUB)

 

BLTMV (0199H/SUB)

 

3. Transferring between the disk and RAM or VRAM

The filename should be set first to use the disk (specify the filename as BASIC). The following is an example:

                .
                .
                .
        LD      HL,FNAME                ; Get pointer to file name
        LD      (FNPTR),HL              ; Set it to parameter area
                .
                .
                .
FNAME:  DB 22H,"B:TEST.PIC",22H,0       ; "TEST.PIC", end mark

When an error occurs, control jumps to the error handler of the BASIC interpreter. Set the hook to handle the error in the user program or to call this routine from MSX-DOS or a ROM cartridge. This hook is H.ERRO (FFB1H).

 

BLTVD (019DH/SUB)

 

BLTDV (01A1H/SUB)

 

BLTMD (01A5H/SUB)

 

BLTDM (01A9H/SUB)