I need a complete ASM program listing that:

1. Read BASIC variable X into a register
2. Archive BASIC Program "ABC"
3. Unarchive BASIC Program "DEF"
4. Run BASIC Program "DEF"
So NOBODY is able to help me on this? I REALLY need the help I can get. I can't seem to find ANYTHING about how to read a BASIC Variable to register A on the internett.

So I would be very, very, very happy if ANYBODY would help me on this, thanks.
Here you go, I missed the topic the first time around:


Code:
Start:
;First we move the contents of X to the accumulator
   bcall(_zerooop1)
   ld hl,op1+1
   ld (hl),'X'          ;or any other var
   bcall(_rclvarsym)          ;op1 / op2 -> value
   bcall(_convop1)
   ld a,e
;in theory you'll want to use the accumulator now
;now archive program ABC
   ld hl,ProgABC
   rst 20h         ;mov9tooop1
   bcall(_chkfindsym)
   ret c            ;if carry is set, does not exist
   ld a,b
   or a            ;is it in RAM?
   bcallz(_arc_unarc)   ;only archive if not already archived
;now unarchive program DEF
   ld hl,ProgDEF
   rst 20h         ;mov9tooop1
   bcall(_chkfindsym)
   ret c            ;if carry is set, does not exist
   ld a,b
   or a            ;is it in RAM?
   bcallnz(_arc_unarc)   ;only unrchive if not already in RAM
;now execute program DEF.
;I'm giving you a much, much simpler version of this than DCS uses
   ld hl,ProgDEF
   rst 20h         ;mov9tooop1
   bcall(_getK)      ;this eliminates any residual keypresses
   bit ProgExecuting,(iy+NewDispf)
   push af
   set ProgExecuting,(iy+NewDispf)
   bcall(_parseImp)              ;Run the program!
   pop af
   jr nz,FinishExec
   res ProgExecuting,(iy+NewDispf)
FinishExec:                   ;all done running the BASIC program!
   ret
Prog_ABC:
   .db 5,"ABC",0
Prog_DEF:
   .db 5,"DEF",0
Thanks, that was what I need.

How do you figure all of that by the way?
olav_nordmann wrote:
Thanks, that was what I need.

How do you figure all of that by the way?
I just examined the TI documentation. That's bits of code from DCS4 and DCS6.
There is like thousands of system calls for the calculators, why couldn't TI make just 32 well documented general purpose calls, as the first IBM PC uses?

When I read the TI documention, I have to seek for years to find the commands I would need...
Well, you rarely need most of the commands; If you read through a guide like learn ASM in 28 days, you will probably learn all of the commands that you are likely to need. For most commands, it's not that hard to write your own routine anyway...

Basically, the only ones you will want are:
Displaying text / numbers
possibly getkey, but custom getkey is actually much easier to use
system variable management (archiving / unarchiving, etc)
runindicoff/runindicon
clearing the screen, etc

However, if you do more, then you might need some of the math routines they have...

But the point is that in general, you will be writing the routines you need by yourself, not using a lot of built in routines.
olav_nordmann wrote:
When I read the TI documention, I have to seek for years to find the commands I would need...
I often don't know what system calls I need for a particular problem. I generally take the assembly coder's approach: Break it down. I split the problem up into the logical segments, and keep splitting it up until there is a system routine that will do one part, or it's simple enough for me to write my own routine to do one part.
That's for general ASM programs. The special routines I needed here was for interacting with BASIC programs, and that's typically not what people commonly use.

b-flat wrote:
Well, you rarely need most of the commands; If you read through a guide like learn ASM in 28 days, you will probably learn all of the commands that you are likely to need. For most commands, it's not that hard to write your own routine anyway...

Basically, the only ones you will want are:
Displaying text / numbers
possibly getkey, but custom getkey is actually much easier to use
system variable management (archiving / unarchiving, etc)
runindicoff/runindicon
clearing the screen, etc

However, if you do more, then you might need some of the math routines they have...

But the point is that in general, you will be writing the routines you need by yourself, not using a lot of built in routines.
  
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 1
» 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