Liazon wrote:
2.) @something1990: ASM was actually my 2nd programming language. Basic was my first. I think the reason why everything clicked instantly was because I was bad at basic. btw, you've made a lot of progress in ASM Good Idea

I've made progress in ASM? I haven't picked up an ASM tutorial in a while. Very Happy Maybe it's been the practice I've been doing with BZC, but that hasn't worked out well either.
How is the BZC going? I haven't heard news about it in ages...
Chipmaster wrote:
Really, asmin28days was all that I needed. I know of no other good tutorials out right now.


Same here

I think a major turning point was when someone (I think CoBB) gave me a better, but still far Far FAR from complete, understanding of how a computer works at the hardware level.
Aye, he knows what he's talking about.
I haven't heard anything about BZC either, and I've stopped trying to integrate those Asm routines into BZC because I just can't do it. I need more Asm knowledge.
Well, what do you need to know? Is it a couple of pieces you need filled in, or has the language as a whole not yet clicked for you?
Just a couple of pieces. Right now I need just enough Asm to make those routines work with BZC.
something1990 wrote:
Just a couple of pieces. Right now I need just enough Asm to make those routines work with BZC.
Well, what are you waiting for? Tell me what you need to understand. Smile
I haven't worked on it in a while, so I'll try to do something and tell you what I think needs fixing. I think it has something to do with the ret's. I don't know which ones come back after a call within the routine itself or return to the call within the actual program, so I don't know which ret I should remove.
I've found that in order to fix that, the best thing is to print out the source code and use a pen to draw lines between associated pushes and pops. That way you can find out if you're pushing and forgetting to pop, or popping something you never pushed.
iirc this is what ret does

ret will pop the last thing off the stack and then jump to that address.

simple as that I think. I forget if I learned that from ASM in 28 or somewhere else.

So that means it all depends on what is on your stack. I believe when you run the program, the return address is pushed onto the stack so that your "final" return will go back there.

theoretically, you can manipulate the stack so that your rets go anywhere you want. In theory, this replaces the need for calls and returns, and instead you can just use jps or jrs and rets. The only problem with calls, jps, and jrs, is that they mess up the stack, so be careful what you push onto the stack before calling a routine. Very Happy
Liazon, that is correct. That's why it's bad to have an uneven number of pushes and pops in a routine: when you get to the ret, you should have sp (the stack pointer) at the same place as when the routine started, and that can only happen if you pop every single thing you push.
  
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 5 of 5
» 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