This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 31 Aug 2003 08:58:42 am    Post subject:

This topic pertains to the other topic (Drawing Pics with ASM), but is an entire topic of its own (confusing, huh?).

How do you load the real variable A into register A in an ASM program?
Back to top
Tyraniek


Member


Joined: 07 Jun 2003
Posts: 133

Posted: 31 Aug 2003 10:41:27 am    Post subject:

First of all, you have to understand that you won't be able to load exactly the real number A in the register A, because the register is 8-bits (one byte), and the real variable is 18 bytes and can be decimal !

That means that while the variable A can be between -10^99 and 10^99 and can be decimal, the register will only be able to store a number between 0 and 255 !!!

Then, I'm not sure getting the variable A is a good idea. You'd better try to get the variable X or even "Ans", so that you're able to use a ROM call.

However, you could do the following (supposing you've stored A in X) :

Code:
   B_CALL(_rclX)         ; X is in OP1
   B_CALL(_convop1)   ; Now you get the Less Signifiant Byte of OP1 in register A


You could do the same with B_CALL(_rclAns), but 'm not sure there is any "_RclA".
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 31 Aug 2003 02:23:28 pm    Post subject:

techinacally, no, but acutally, yes...

Code:
rclA:  ;var A to ACC (Real A to Register a)
    bcall(_zeroop1)
    ld hl,op1+1
    ld (hl),'A'
    bcall(_rclvarsym)
    bcall(_convop1)
    ret
does that make sence? it is just a simple little thing i learned from MV's ZBasic source Very Happy Very Happy Very Happy

Last edited by Guest on 31 Aug 2003 02:23:38 pm; edited 1 time in total
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement