If your file is name "hello.asm" or "hello.z80", you type, for the Doors CS SDK's compile.bat:

"compile hello"

without the .asm or the .z80, EVEN THOUGH IT'S PART OF THE FILE NAME.
Also, remember, Windows says "Oh, you are trying to run the program 'compile', I'll check for both 'compile.bat' and 'compile.exe'", so you don't need the .bat at the end of the file name. Are you sure you are saving the file in asm/source/ as blah.asm?

Edit: In the asm/ folder, could you run this command and post the output (if it is long, use your judgement, upload to pastebin or rafb.me)
Code:
dir /s
I second Catherine on that last idea. Do dir /s in the ./asm/ directory of the SDK, and pastebin the result.
KermM. I know _EXACTLY_ what the the problem is. I was making the blah of "compile Blah" As the Name I wanted the program to be. Not what the name of the source was. So I had a blank program. Will try it later to see if it works.
Aes_Sedia5 wrote:
KermM. I know _EXACTLY_ what the the problem is. I was making the blah of "compile Blah" As the Name I wanted the program to be. Not what the name of the source was. So I had a blank program. Will try it later to see if it works.
It sounds like it worked out for you. Sounds like quite the derp moment, but I'm glad you finally got it figured out. Keep those questions coming!
I will. I am working some "do nothing" code just to get the grasp on day 2 and 3 of the 28 day tutorial. I will post it here when I am done.
Aes_Sedia5 wrote:
I will. I am working some "do nothing" code just to get the grasp on day 2 and 3 of the 28 day tutorial. I will post it here when I am done.
That sounds like a plan. You should still be able to try some programs that do random sorts of math on registers and save and load from RAM areas. Smile
Here is what I have so far.
Note: It is far from finished


Code:

NOTE: ;blah; equals the Ti Basic code that I dont know in ASM yet.


 .nolist
 #include "ti83plus.inc"
 #define   Progstart      $9D95
 .list
 .org   ProgStart - 2
 ld A, 0
 ld hl, 0
   .db   t2ByteTok,   tAsmCmp
   ld
   ld ;input; Radius,A
   ld hl, A (pi)
   b_call(_PutS)
ret
 
 
 Pi:  .db    3.14159265358979323846
 .end
 .end


Well. I suppose tell me what I did wrong. haha
First off, do you mind starting on a simpler program? Believe it or not (you probably should Razz), it is rather difficult to do this in ASM. You don't get handed the simple "{Pi}R²->X", you have to implement floating point numbers yourself. Perhaps, an easier program would be "Count from 1 to 100, displaying all the numbers", or rather, a better first program. I think there was a thread about beginner's ASM program challenges, but some of those are more advanced than the level you are at Smile

Now, your code. Firstly, make sure everything is tabbed out correctly. If you were to try to compile it (besides the obvious blank "ld" line), you would get an error about "ld A, 0" and "ret" not being valid labels (or something of that nature). You need to _always_ tab your instructions out, and your labels need to be touching the far left side. Next, .db stands for "data byte", which basically means to the compiler: leave an extra byte here, oh and while you're at it, set the value to X. Bytes are integers in ASM (ie, no decimal parts), and they are limited to being within 0 and 255. So, you can't have ".db 3.1415<...>" because that's not an integer.

Also, it would seem that you are trying to multiply A by (pi) and store it in HL, which, first of all, is not the right way to do that. If you want, I can post how to do that, but just know that (ADDRESS) is called "indirection" and is a way to load values from memory locations. Math doesn't work the same way in ASM as it does in Basic. In Basic, you have something called "infix notation", which is like "3*(4+2)" (Which, we all know, is 24). But, in ASM, to express the same thing, you have to first change it into the correct order of operations, so "4+2*3". Otherwise, it will just run straight through it and will return "(3*4)+2". FWIW, here is how you would write that in ASM:
Code:
  ld a,4    ; Store 4 in the register A
  add a,2  ;   Add 2 to A
  ld b,a   ;   Back A up into B (So that we can add it later)
  add a,a  ;   A+A->A
  add a,b  ;   A + (4+2)->A
Or, annotated as its Basic counterpart:
Code:
  ld a,4  ;  4->A
  add a,2  ;   A+2->A
  ld b,a   ;   A->B
  add a,a  ;   A+A->A
  add a,b  ;   A+B->A
Does that make sense?
Ya that makes sense. I mostly was just putting that code together to try and make sense of what I had learned. I knew I had not really learned enough to write a program that really does anything. I will work on Day 4 when I get home and maybe I will learn a little more. Then I will try implementing all those things you mentioned. Also... A and B are the registers A and B correct? So They are Basically "Ans" of the ASM world. Meaning they are used once when they are not needed for very long. Just for quickly storing one thing then moving on the a Variable. Not sure if that makes sense.
Indeed! Registers are where you can do actual math (for instance, you can't just say add (MemoryLocation1), (MemoryLocation2), you'd have to say "ld a,(MemoryLocation1) \ ld b,a \ ld a,(MemoryLocation2) \ add a,b \ ld (MemoryLocation1),a". You can think of them as "The Ans of the ASM world", but they are really so much more than that Smile The reason you have to save registers into memory locations is because, every function assumes that it is getting its inputs through registers, and messes up ALL the registers (if it needs to), and then returns its outputs through registers. So, if you wanted to call a function, you'd have to make sure that you saved any values you had left in your registers, or else they'll disappear. Of course, you can use the stack also (Or not, if you aren't there yet. Don't let it confuse you Razz), or you can adopt a coding practice so that, for instance, register B always holds your health, but then you'd have to make sure that you don't overwrite B or call a function that does so. So, the obviously "better" solution is to just save things in memory locations.

(Umm, slightly ranty... Short answer: yes, A and B are registers A and B, and they are like the Ans of the ASM world)
Thanks that makes sense. Hopefully in Day 4 I will learn how to save the registers too memory locations.!
Update. Here is my current code.
It is a basic counter that counts to 1 since I dont know how to loop


Code:

 .nolist
 #include "ti83plus.inc"
 #define   Progstart      $9D95
 .list
 .org   ProgStart - 2
   .db   t2ByteTok,   tAsmCmp
   ld A,0
   ld hl,0
   inc A
   ld L,A
   ld H,0
   b_call(_DispHL)
   ret
 .end
 .end
Comments:

1) Does it run? I know the answer from looking at the code, but you'll only know (at this point) from testing it. And I only know because it's such a short segment; I would never trust my reading on a long section of code without testing
2) Be consistent with casing of registers: all uppercase or all lowercase. Lowercase is preferred.
3) No need to clear hl, because you immediately overwrite the contests of both h and l.
4) Where's your dcs7.inc include? Sad
You could also try out the SPASM compiler.

Here is the hello world tutorial that you can work with: http://dl.dropbox.com/u/902690/ti/spasm-tutorial.zip
(Forums for help are here: http://revsoft.tifreakware.net/phpBB3/viewforum.php?f=15)

Just double click "compile-hello.bat".

Hope that helps!
KermM.
1. It ran worked great, it incremented A by 1 and displayed. Which was the point.
2.I will try. Smile
3.Thanks. Good to know.
4. I had no idea about the Dcs7.inc. what does that do?
The dcs7.inc file contains a list of shell routines provided by Doors CS. You would use this whenever you want to use a routine that Doors CS provides. The Developers' SDK section of the Doors CS wiki describes the routines and tells you what arguments they expect.
NanoWar: Does SPASM have a built-in linker that works on 64-bit systems? I generally point people to the Doors CS SDK, which has a full toolchain using Brass + my own BinPac8x and can build any sorts of programs (not just for Doors CS).
Well. I did not include the Dcs7.inc mostly because I want to try to do everything with my own code. Not with code that has been written for me. If I really find the need for those programs then I might use it. No offence, but I would prefer to figure things out for myself or with guided help. Maybe later on down the road I might use them.
  
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 2 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