0 Members and 1 Guest are viewing this topic.
.NOLIST#define EQU .equ#define equ .equ#define END .end#define end .end#include "ti83plus.inc".LIST .org 9D93h .db $BB,$6DStartProg:Conditional: ld a,3 cp 7 jp z,IsSeven cp 3 jp z,IsThree jp nz,IsNoneOfTheseIsSeven ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHell B_CALL(_PutS) rettxtHell: .db "7",0IsThree ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHel B_CALL(_PutS) rettxtHel: .db "3",0IsNoneOfThese ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHello B_CALL(_PutS) rettxtHello: .db "Hello World",0 .end
.NOLIST#define EQU .equ#define equ .equ#define END .end#define end .end#include "ti83plus.inc".LIST .org 9D93h .db $BB,$6DStartProg:Conditional: ld a,3 cp 7 jp z,IsSeven cp 3 jp z,IsThree jp nz,IsNoneOfTheseIsSeven ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHell B_CALL(_PutS) retIsThree ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHel B_CALL(_PutS) retIsNoneOfThese ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHello B_CALL(_PutS) rettxtHello: .db "Hello World",0 txtHel: .db "3",0txtHell: .db "7",0.end
#define B_CALL(xxxx) .db $EF \ .dw xxxx
.module ConvDec8ConvDec8: LD C, 0_Loop: CALL GetChar CCF ; End if no more characters RET NC SUB '0' ; Throw out all characters below '0' JR C, _Check CP 10 ; Throw out all characters above '9' CCF RET C LD D, A ; Save value in D LD A, C ; Load running total CP 26 ; Halt if there would be an overflow (260+) JP NC, Ungetc ; Return gotten character LD E, C ; Save current number in case of overflow ADD A, A ; Multiply by 10 ADD A, A ADD A, C ADD A, A ADD A, D ; Add gotten character LD C, A ; Halt if overflow (256 to 259) JR NC, _Loop LD C, E JP Ungetc_Check: CP ' ' - '0' ; If a space is encountered exit without error RET Z SCF RET
.NOLIST#define EQU .equ#define equ .equ#define END .end#define end .end#include "ti83plus.inc".LIST .org 9D93h .db $BB,$6DStartProg: B_CALL(_ClrLCDFull)GetKeyLoop: B_CALL(_GetKey) cp k1 jp z,Numb1 cp k3 jp z,Numb3 cp k7 jp z,Numb7 jp GetKeyLoopConditional: cp 7 jp z,IsSeven cp 3 jp z,IsThree jp nz,IsNoneOfTheseIsSeven ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHell B_CALL(_PutS) retIsThree ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHel B_CALL(_PutS) retIsNoneOfThese ld a,0 ld (CURCOL),a ld a,0 ld (CURROW),a ld hl,txtHello B_CALL(_PutS) rettxtHell: .db "7",0txtHel: .db "3",0txtHello: .db "Hello World",0Numb1: ld a,1Numb3: ld a,3Numb7: ld a,7.end
You could have a jump back to the conditions (I don't remember much from HotDog's tutorials, but I think you could also just place a ret after each so it automatically returns to where it was before)Unless I'm thinking of something different...
;Get the value in Ans B_CALL(_RclAns) ;Ans→OP1 B_CALL(_ConvOP1) ;OP1 converted to DE, E→A;At ths point, A contains the value of Ans ld hl,37 ;37→HL cp 13 ;If A=13 call z,SetHLto4 ;Then call the routine cp 7 ;If A=7 call z,SetHLto11 ;Then call the routine B_CALL(_DispHL) ret;======SetHLto4: ld hl,4 ;4→HL ret ;ReturnSetHLto11: ld hl,11 ;11→HL ret ;Return
yeah, basically just add a ret after each of the ld cmds, but make sure to use call instead of jp.