• Keine Ergebnisse gefunden

PROCESSOR ORIENTED UTILITY ROUTINES

Im Dokument first title (Seite 100-103)

3) READY 3.2 POWER-ON

4.3 MOOS SHARED SUBROUTINES

4.3.6 PROCESSOR ORIENTED UTILITY ROUTINES

These subroutines effectively extend the instruction set of the 8080 to provide for some commonly required operations.

When parentheses enclose an item in the following subs~~tians. this indicates the contents of the memory location specified by the value within the parentheses. For example. HL={HL} means that the HL register pair is replaced with the bytes at the address in HL and HL+l. If the HL registers contain the address 40~0 hex, and at location 4000 there is a 01. and at location 4001 there is a 02, then the HL register would be replaced by 0201 hex. The law byte goes into L and the high byte into H.

4.3.6.1 @HLADDA - ADO A TO HL

The @HLADDA routine adds the unsigned 8 bit value in the A register to the unsigned 16 bit value in the HL registers.

It expects a value in the HL. and the A registers.

It returns HL=HL+A.

It preserves the DE and BC registers.

4.3.6.2 @INXM - INCREMENT MEMORY

The @INXM routine increments a memory pair pointed to by the HL registers.

It ;s similar to an INR M instruction but it operates on a byte pair (16 bits) in memory.

It expects the address of the memory pair in the HL registers.

It preserves the DE and BC registers and the PSW.

4.3.6.3 @LHLINDEXED - LOAD HL INDIRECT INDEXED

The @LHLINDEXED routine loads the HL registers indirect from the location pointed to by the HL registers indexed by the A register.

It expects the address in the HL registers, and the index in the A register.

It returns HL={HL+2*A}.

It preserves the DE and BC registers.

Rev. 8 9/78 4-36

4.3.6.4 @LHLI - LOAD HL INDIRECT

The @LHLI routine loads the HL registers with the content of the byte pair pointed to by the HL registers.

It expects an address in the HL registers. / It returns HL = (HL).

It preserves the BC and DE registers.

4.3.6.5 @TRANSDHC - TRANSFER FROM DE TO HL FOR A COUNT OF C The @TRANSDHC routine copies a memory block pointed to by the DE

registers to a memory block pointed to by the HL registers for a length in the C register. It begins at the start of each block and working to the end.

It expects the start address of the source block in the DE registers and the start address of the destination block in the HL registers and the number of bytes to copy in the C register.

It returns (HL~ ... +C) = (DE+0 ... +C).

It preserves the B register.

4.3.6.6 @TRANSDHBC - TRANSFER FROM DE TO HL FOR A COUNT OF BC The @TRANSDHBC routine copies a memory block pointed to by the DE

registers to a memory block pointed to by the HL registers for a length in the BC registers. It begins at the start of each block and works to

the end. .

It expects the start address of the source block in the DE registers and the start address of the destination block in the HL registers and the number of bytes to copy in the BC registers.

It returns (HL~ ... +BC)

=

(DE+0 •.. +BC).

4.3.6.7 @TRANSDHBCR - TRANSFER FROM DE TO HL FOR A COUNT OF BC REVERSE The @TRANSDHBCR routine copies a memory block pointed to by the DE

registers to a memory block pointed to by the HL registers for a length in theBC registers. It begins at the end of each block and working to the beginning.

It expects the start address of the source block in the DE registers and the start address of the destination block in the HL registers and the number of bytes to copy in the BC registers.

It returns (HL+BC ••.. +0),= (DE+BC .... +0).

4-37 Rev. 7 3/78

4.3.6.8 @TRANSFILENAME - TRANSFER A FILENAME

The @TRANSFILENAME routine copies a filename from one of the ASCII buffers (@ASCBUFF0 through @ASCBUFF3) to the @ASCIIBUFF.

It expects the @ASCBUFF number (ie. 0 to 3) in the C register.

It preserves the HL, DE. and BC registers.

4.3.6.9 @FILLZER - FILL ZEROES

The @FILLZER routine fills a block of memory up to 256 bytes in length with zeros.

It expects the start address of the memory block in the HL registers and the number of bytes to fill in the 8 register.

It preserves the DE and C registers.

4.3.6.l0@FILLSPC - FILL SPACES

The @FILLSPC routine fills a block of memory up to 256 bytes in length with spaces (hex 20).

It expects the start address of the 'memory block in the HL registers and the number of bytes to fill in the B register.

It preserves the DE and C registers.

4.3.6.11 @FILLA - FILL FROM THE A REGISTER

The @FILLA routine fills a block of memory up to 256 bytes in length with the value specified in the A register.

It expects the start address of the memory block in the HL registers, the number of bytes to fill in the 8 register. and a fill value in the A register.

It preserves the DE and C registers.

4.3.6.12 @COMPARE - COMPARE HL TO DE

The @COMPARE routine compares the value in the HL registers to the value in the DE registers.

It expects a value in the DE register and the value to compare it to in the HL register. The forms are like an 8080 CMP 8 instruction where DE

;s analogous to the A register and HL is analogous to th~ B register.

Rev. 7 3/78 4-38

(

It returns the following sense:

DE

=

HL DE > HL DE < HL DE >=HL

zero flag set (Z), zero flag clear (NZ), zero flag clear (NZ), zero flag any state,

carry flag clear (NC) carry flag clear (NC) carry flag set (C) carry flag clear (NC) It preserves the HL, DE, and BC registers.

Im Dokument first title (Seite 100-103)