Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ti83plus.inc"
- #define progStart $9D95
- .org progStart-2
- .db $BB,$6D
- ; Input: {r, c, X}
- ; if not in this format, then exits
- ; First, get the list
- ; Second, get row and col
- ; Third, get number and store to hl
- ; Last, draw the digits
- ; WORKS FOR 8-BIT VALS
- ; bcall(_AnsName) gets the name of Ans in OP1
- ;
- bcall(_RclAns)
- and $1F ;masking
- dec a
- ret nz ;bail if not a list
- ex de,hl ;now hl has the size and de has the symentry
- ld c,(hl) ;I presume that c has the value?
- inc hl
- ld b,(hl)
- inc hl ;Thanks to Xeda for this code!
- ; "So the code I gave returns HL pointing to the data for the first element, BC is the number of elements"
- ; Checks if bc == 3
- ld a,c
- cp 3
- ret nz
- ld a,b
- or a
- ret nz ;this basically exits if the number of elements is not equal to 3
- rst rMov9ToOP1 ;What does this do?
- push hl
- bcall(_ConvOP1)
- pop hl
- ld (curRow),a
- rst rMov9ToOP1 ;What does this do?
- push hl
- bcall(_ConvOP1)
- pop hl
- ld (curCol),a
- rst rMov9ToOP1 ;What does this do?
- push hl
- bcall(_ConvOP1)
- pop hl
- jr WriteHex16
- ; In:
- ; DE: the number
- ; (curRow), (curCol): Obvious.
- ; Out:
- ; Nothing.
- ; Destroys:
- ; A,B,DE,HL
- WriteHex16:
- ld b,e
- call WriteHex8
- call Rec2
- ld b,d
- jr WriteHex8
- WriteHex8:
- ld a,b
- call GetHexDigit
- push bc
- bcall(_PutC)
- pop bc
- call Rec2
- ld a,b
- rra
- rra
- rra
- rra
- call GetHexDigit
- push bc
- bcall(_PutC)
- pop bc
- ret
- GetHexDigit: ; Thanks to Xeda for the optimization
- and 0Fh
- add a,30h
- cp 3Ah
- ret c
- add a,7
- ret
- Rec2:
- ld a,(curCol)
- sub 2
- ld (curCol),a
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement