[A83] Re: How does _ckint works exactly?


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

[A83] Re: How does _ckint works exactly?




Hehe, I now know how it works: _ckint checks only the byte you say it has to 
check, so when you do "ld hl,op1" it only checks the first byte of op1. But 
_ckint must check the exponent, which is the second byte from op1 (so I used 
"ld hl,op1exp" after editing my ti83asm.inc)

W00t! next time I'll search a bit better before annoying you ;-)


>From: "Jelle Fresen" <jellefresen_ti83@hotmail.com>
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] How does _ckint works exactly?
>Date: Sat, 23 Feb 2002 14:33:53 +0100
>
>
>How does _ckint works exactly, what is affected and which flags are set 
>how?
>According to 83rom.txt the Zero-flag is set if the number is integer and
>reset if the number is not integer. I wrote this:
>
>========================================================================
>
>.NOLIST
>#define end .end
>#define END .end
>#define equ .equ
>#define EQU .equ
>#include "squish.inc"
>#include "ti83asm.inc"
>#include "tokens.inc"
>.LIST
>.org $9327
>call _runindicoff       ; blablabla....
>call _clrlcdfull        ;
>ld de,$821C             ; ================
>ld hl,prompt            ;
>ld bc,16                ; Get users input
>ldir                    ;
>ld a,1                  ; and store in op1
>ld (asm_ind_call),a     ;
>call pgmio_exec         ; ================
>call _clrlcdfull        ;
>call _homeup            ;
>ld hl,op1               ; (so _ckint knows which number to check)
>call _trunc             ; round the input
>call _op2set2           ;
>call _fpdiv             ; divide op1 by 2
>call _ckint             ; check if op1 is integer (then the original input
>is even)
>jp z,even               ; jump to even when op1 is integer (83rom.txt:
>Zero-flag = 0 if not integer ; 1 if integer)
>odd:                     ; =============
>call _clrlcdfull        ;
>call _homeup            ; when original
>ld hl,numberodd         ; input is odd
>call _puts              ;
>jp endprog              ; =============
>
>even:                    ; =============
>call _clrlcdfull        ;
>call _homeup            ; when original
>ld hl,numbereven        ; input is even
>call _puts              ;
>jp endprog              ; =============
>
>endprog:                 ; =============
>call _newline           ; end program
>call _clrtxtshd         ;
>ret                     ; =============
>
>prompt:
>.db "Number:         ",0
>numbereven:
>.db "It is even",0
>numberodd:
>.db "It is odd",0
>
>.end
>end
>
>========================================================================
>
>But it never jumps to "even", whatever number I fill in.
>Is it because of a wrong use of the Zero-flag? (with the condition "z" you
>check the zero-flag, huh?)
>
>I hope someone can help me and that I provided enough info.
>
>------------
>Jelle Fresen
>------------
>
>_________________________________________________________________
>Meld je aan bij de grootste e-mailservice wereldwijd met MSN Hotmail:
>http://www.hotmail.com/nl
>
>




_________________________________________________________________
Chat on line met vrienden en probeer MSN Messenger uit: 
http://messenger.msn.nl




Follow-Ups: