[A83] Re: tst + tstio instructions


[Prev][Next][Index][Thread]

[A83] Re: tst + tstio instructions





-----Original Message-----
From: ComAsYuAre@aol.com <ComAsYuAre@aol.com>
To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Date: dinsdag 3 juli 2001 14:52
Subject: [A83] Re: tst + tstio instructions


>
>The m and p flags are minus and positive, which merely reflect the sign of
>the result.  Note that this is distinctly different from the carry, as
>adding 2 to -3 still results in the m flag being set even though the carry
>is not.  And p is true when m isn't true.

Well, I don't understand carry too, actually.

>As for pe and po, those stand for parity even and parity odd, which are
>alternate states of the parity/overflow flag.  Parity is defined as the
>number of bits set in a piece of data, so %10101010 has 4 bits set and
>therefore parity even, while %00000111 has 3 bits set and therefore parity
>odd.  The parity flag is also useful when using ldi, cpi, and all the other
>opcodes that automatically decrement bc (not dec bc itself though!),
because
>they will set pe when bc is 0 and po when bc is not 0.  So you can do a
loop
>such as this:

Wow! Cool, especially when making a serial signal WITH parity!

>invert_and_copy:
> ld a,(hl)
> cpl
> ld (hl),a
> ldi
> jp po,invert_and_copy
>
>This inverts bc bytes at hl and also copies them to de.
>
>Also keep in mind that the sign flag (m/p) and parity flag (pe/po) are not
>supported by the jr instruction, only by jp, call, and ret.

To save space, probably.

>In a message dated Tue, 3 Jul 2001  8:38:46 AM Eastern Daylight Time,
"Ronald Teune" <rtwolf@gmx.net> writes:
>
>
>And how about jp m,xxxx ? And what's the use of ld a,a ?
>RET  C       D8   1 NOP 1    ;ret if carry (whatever it is)
>RET  M       F8   1 NOP 1    ;?
>RET  NC      D0   1 NOP 1 ;ret if not carry
>RET  NZ      C0   1 NOP 1  ;ret if not zero
>RET  P       F0   1 NOP 1    ;?
>RET  PE      E8   1 NOP 1  ;?
>RET  PO      E0   1 NOP 1  ;?
>RET  Z       C8   1 NOP 1   ;ret if zero
>
>>You probably mean that if it contains a 2 at the end, it's junk to us...
>>
>>Includes OUT0, OTIM* OTDM*, (SLP), [
>>
>>but
>>IND, INDR, INI and INIR don;t have that (yeah, I found more insturctions
>:-)
>>
>>What do they do?

Here my ION enhancer ;-)

; Ion Enhancer by Zeekoe
; how many times did you 'do something' in ion?
; (2 times triggered while starting, 1 time when typing)

#include "ion.inc"

#ifdef TI83P
        .org    sram-2
        .db     $BB,$6D
#else
        .org    sram
#endif
        ret
        .db     $02 ;$02
ld hl,times    ;or 8000h, it seems to be a safe place in ram.
ld a,(hl)
inc a
ld (hl),a
cp $FF
.db 00h    ;these should
.db 00h    ;be changed
.db 00h    ;to CA00C9
ret            ;or another ramclear-routine
times:        ;(on-calc, probably)
.db 0,0,0,0    ;extra zeros for safety or just for fun
.end
END





Follow-Ups: