This is my question thread, for asking z80 questions.
Although, you probably know that anyways.
techboy6601 wrote:
This is my question thread, for asking z80 questions.
Although, you probably know that anyways.
Yup, that seems about right. Care to start us off with a question or two? Perhaps I can ask whether you're using the good old Doors CS SDK for your assembling needs?
Question #1:

How would I put a picture (in .asm format) on the graph screen?

Question #2:

Is there an easier way to get user input other than continually checking using _getkey?

Question #3:

How does DCS interpret the headers of BASIC programs?

---------------------------------------------------------------------------------
As for the DCS SDK - I plan on using it, however now I'm making a standalone application (formula solver, to be exact)
techboy6601 wrote:
Question #1:

How would I put a picture (in .asm format) on the graph screen?

[ . . . ]

As for the DCS SDK - I plan on using it, however now I'm making a standalone application (formula solver, to be exact)

If you're making an application, then you should read TI's SDK guide. Yes, it has errors, but it also has a lot of good facts.

Anyway, there are several ways to do this. Assuming you've already converted the picture to a format you can .inc into your program, and assuming the picture fills the screen, the easiest way is to B_CALL(_BufCpy) with HL pointing to your data.

techboy6601 wrote:
Question #2:
Is there an easier way to get user input other than continually checking using _getkey?

Not from an application. The OS supports event-based programming, but it's not well documented. Similarly, DCS supports event-based programming. Basically, most programs will have idle-loops that wait for input, process input, and then return to the idle loop.
So like,

ld hl, picture
B_CALL(BufCpy)
ret
picture: "01010100110blahblah"
?
Question #4:

How would you manipulate the clock on a '84 using ASM?
Insufficient information. The RTC, CPU clock, or something else?
Built-in clock that tells the actual time.
Click Tari's link with the text "RTC". Wink I believe the wiki is saying that ports 45h-48h give the time as a 32-bit integer representing the seconds since midnight of January 1, 1997 as if they were concatenated in the form of (48h)+(47h)+(46h)+(45h). Note that this is to represent concatenating the bytes together, not adding the values. I'm not very experienced with this, so I think you should rely on somebody else to explain using the values (Rolling Eyes), considering the z80 handles data in bytes or words (8 bits or 16 bits), as opposed to directly handling 32-bit values.

I can explain this much: you will need to use the in instruction to get the byte from the ports and the out instruction to write back. Sadly, I can't explain much more with enough accuracy to help.
Quote:
How would I put a picture (in .asm format) on the graph screen?
The answers as far as the actual ASM code are all good and well so far, but as far as turning a monochrome PNG, GIF, or BMP image into hex that you can use in your program, use SourceCoder:

http://sc.cemetech.net
Question #5:

The following code:

.nolist
#include "ti83plus.inc"
.list
.org $9D93
.db t2ByteTok, tAsmCmp
B_CALL(_clrlcdfull)
B_CALL(_homeup)
ld a, 0
ld (CURCOL),a
ld (CURROW),a
ld hl, txt
B_CALL(_puts)
ret
txt:
.db "Hiya",0

.end
.end


Results in the text "Hiya" displaying and then immediately disappearing. Why does it disappear?
Because as soon as it displays it, the program has a 'ret' and ends, you don't have any pausing.
How, then, would I 'pause' it?
techboy6601 wrote:
How, then, would I 'pause' it?



Code:
B_CALL(_GetKey)


This syscall will let you press a key and will "pause" until one is pressed. For bonus points, the key value is in register A.
Graphing Calculator

Using the following code..


Code:

.nolist
    #include    "ti83plus.inc"
.list
.org    $9D93
.db    t2ByteTok, tAsmCmp
    B_CALL(_clrlcdfull)
    B_CALL(_homeup)
    ld a, 0
    ld (CURCOL),a
    ld (CURROW),a
    ld hl, txt
    B_CALL(_puts)
    B_CALL(_getkey)
    ld hl, image
    B_CALL(_BufCpy)
    B_CALL(_getkey)
    B_CALL(_clrlcdfull)
    B_CALL(_homeup)
    ret
txt:
    .db "Hiya",0
image: "image in here"


The words "Hiya" display followed by a picture. However, after the final _getkey, the screen does NOT return to the homescreen, it still stays at the graph screen. How do I correct this?

Code:
  ld a, ' '
  B_CALL(_PutC)


bam. I'm sure there's a syscall to change to the homescreen, but it escapes me. ^ That will definitely work though.
The following code:

Code:

.nolist
    #include    "ti83plus.inc"
.list
.org    $9D93
.db    t2ByteTok, tAsmCmp

   ld hl, pic
   B_CALL(_BufCpy) ; copy image into buffer and display
   ld a, 45
     ld (PENROW), a
        ld (PENCOL), a
        ld hl, entertext
   B_CALL(_VPutS)
        B_CALL(_getkey)
        ld (CURROW), a
        ld (CURCOL), a
        ld hl, ' '
        B_CALL(_PutC)
   B_CALL(_ClrScrnFull)
   ret

pic:
.db blahblah
entertext:
.db "[ENTER]",0   
.end
.end


Displays a picture and the string "[ENTER]" under it. However, the left bracket isn't displayed properly and is replaced by the θ character. How should I fix this?
Just to follow up and get it written down, we solved it by doing:

Code:
.db $C1,"ENTER]",0
merthsoft wrote:
Just to follow up and get it written down, we solved it by doing:

Code:
.db $C1,"ENTER]",0
Thanks, Merth. Yes, the opening-bracket got moved in TI's ASCII set to make way for the theta character, presumably because for TI's sorting and alphabetized routines require that theta = 'Z'+1 just as 'Z'='Y'+1.
Back again after nearly a year ;3

Quote:

#include "ti83plus.inc"
#define progStart $9D95
.org progStart-2 ; Program start
.db $BB,$6D ; Tokens for TI-OS to identify as ASM prog
bcall(_ClrLCDFull) ; Clear the screen
ld HL, 20
ld (PenRow), HL
ld HL, 40
ld (PenCol), HL
ld HL, Message
bcall(_VPutS) ; Displays the string
ret
Message:
.db "TI-83 Plus",0


Outputs this:




For some reason, PenRow isn't taken into effect. What am I doing wrong?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement