Re: LZ: Advanced CP instructions
[Prev][Next][Index][Thread]
KEITH T BURZINSKI wrote:
>
> Hey, does anyone know about CPD, CPDR, CPI, and CPIR?
>
> How do they work?
>
> I tried using CPIR, but i can't seem 2 get it 2 work correctly...
>
> ____
> ~Keith
> FFNP69C@PRODIGY.COM
They work like scansb in 8086 asm
CPI: CP (DE),(HL) / INC DE / INC HL
CPD: CP (DE),(HL) / INC DE / DEC HL (or DEC DE / INC HL - don't remember)
CPIR (CPDR) does CPI (CPD) and decs B until the zero flag is set or B equals 0.
Useful when you want to search after a byte in a string. For example if you enter a sentence and
you want to know if there is a space somewhere.
----------------------------------------------------------------------------
| Real name: Jimmy Mårdell | "The concept of God it makes no sense |
| Email....: <mja@algonet.se> | An out-of-life experience |
| IRC-name.: Yarin | Free at last to do what I please |
| WWW......: - | In heaven there are no TVs" - Cat rapes Dog |
|----------------------------------------------------------------------------|
| "I'm the operator with my pocket calculator" - Kraftwerk |
----------------------------------------------------------------------------
References: