Author Topic: Routine Thread Index  (Read 39408 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Routine Thread Index
« Reply #15 on: November 10, 2010, 11:04:43 am »
Awesome! This is really convenient. Thanks!




Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Routine Thread Index
« Reply #16 on: November 12, 2010, 11:57:43 am »
i have a question about Sir's program writeback routine. what exactly does that do? does it take a program in the vat, allow you to edit it, and then you can re-save it into the vat?


Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Routine Thread Index
« Reply #17 on: November 12, 2010, 12:09:05 pm »
Well, sort of. When programs are run with Asm( (or with a shell that copies the program instead of moving it to $9D95 to run), the original program's still somewhere else in RAM. So changes to, say, GDB0 wouldn't appear the next time you run the program. SIr's routine basically finds the original program in RAM, and you can edit it directly from there. No messing with the VAT is needed since all the VAT does is point to the program anyway.




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routine Thread Index
« Reply #18 on: November 12, 2010, 07:14:32 pm »
i have a question about Sir's program writeback routine. what exactly does that do? does it take a program in the vat, allow you to edit it, and then you can re-save it into the vat?
Unfortunately, Deep Thought's not entirely correct. :-\
Program write-back is used for Self Modifying Code (often used for Saving Highscores without an external AppVar).
Basically, Program Write-back allows you to make changes to the program from where it is copied and Sir's code will copy the resulting changes back in the program file.
for example:
.TEST
_delta_list(0r)->Str0
Disp {Str0}r+1->{Str0}r>Dec

This will display 1 every time unless Sir's program write-back is enabled.  I believe shells write-back automatically too, but that may be only if the program's archived.  I know in Mirage you can turn Write-back in Archive on and off.

Here's a helpful tutorial on the subject: http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/day20.html
« Last Edit: November 12, 2010, 07:27:40 pm by ztrumpet »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Routine Thread Index
« Reply #19 on: November 12, 2010, 07:24:54 pm »
i have a question about Sir's program writeback routine. what exactly does that do? does it take a program in the vat, allow you to edit it, and then you can re-save it into the vat?
Unfortunately, Deep Thought's not entirely correct. :-\
Program write-back is used for Self Modifying Code (often used for Saving Highscores without an external AppVar).
Basically, Program Write-back allows you to make changes to the program from where it is copied and Sir's code will copy the resulting changes back in the program file.
for example:
.TEST
_delta_list(0r)->Str0
Disp {Str0}r+1->{Str0}r>Dec

This will display 1 every time unless Sir's program write-back is enabled.  I believe shells write-back automatically too, but that may be only if the program's archived.  I know in Mirage you can turn Write-back in Archive on and off.

Actually, even if it's run from RAM, most shells move the program straight to $9D95 (instead of copying) so that no matter what, it writes back since the program has to be moved back eventually. For running from archive, writeback has to copy it back and forth (and that's why the choice is there).

Btw, how was I wrong (just wondering, don't want to give false info...)?




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routine Thread Index
« Reply #20 on: November 12, 2010, 07:28:51 pm »
Btw, how was I wrong (just wondering, don't want to give false info...)?
I was wrong, as I didn't realize this:
Actually, even if it's run from RAM, most shells move the program straight to $9D95 (instead of copying) so that no matter what, it writes back since the program has to be moved back eventually. For running from archive, writeback has to copy it back and forth (and that's why the choice is there).
Sorry.  :(
* ZTrumpet feeds himself to the lobster


Thanks for the info!  I didn't realize they did that. :)
« Last Edit: November 12, 2010, 07:29:19 pm by ztrumpet »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Routine Thread Index
« Reply #21 on: November 12, 2010, 07:40:19 pm »
Btw, how was I wrong (just wondering, don't want to give false info...)?
I was wrong, as I didn't realize this:
Actually, even if it's run from RAM, most shells move the program straight to $9D95 (instead of copying) so that no matter what, it writes back since the program has to be moved back eventually. For running from archive, writeback has to copy it back and forth (and that's why the choice is there).
Sorry.  :(
* ZTrumpet feeds himself to the lobster


Thanks for the info!  I didn't realize they did that. :)

No problem, I just learned that a few days ago too :D




SirCmpwn

  • Guest
Re: Routine Thread Index
« Reply #22 on: November 16, 2010, 01:02:19 am »
Wow, very useful topic!  Memo, the current version of Axe can modify programs.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routine Thread Index
« Reply #23 on: November 16, 2010, 02:03:19 am »
Are you talking about SMC? ???

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Routine Thread Index
« Reply #24 on: November 16, 2010, 02:16:19 am »
very usefull topic indeed! thanks for doing this!
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Routine Thread Index
« Reply #25 on: November 16, 2010, 02:33:55 am »
By the way ztrumpet, you still have yet to mark off fixed point multiplication and sprite rotating/flipping as being covered by Axe. I made a post a short while ago saying that they were outdated, but it looks like you must have missed that post. Don't miss this one! ;)
« Last Edit: November 16, 2010, 02:34:29 am by Runer112 »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routine Thread Index
« Reply #26 on: November 16, 2010, 03:49:05 pm »
Whoops, sorry.  Thanks Runer. :D

SirCmpwn

  • Guest
Re: Routine Thread Index
« Reply #27 on: December 07, 2010, 10:25:57 pm »
While reading through this, I realized that I did some pretty badass routines ;) I got writeback working, and appvar storage way before Axe got it, and I got MirageOS support before Axe officially got it, and I still have the only way of using a custom icon for MOS.  I actually have a few gems sitting on my calculator next time I can get them off ;)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routine Thread Index
« Reply #28 on: December 08, 2010, 04:07:08 am »
Yeah those were really great! I wonder if yoU'll have some more cool routines. :P

Also if I am ever less busy, I think one day I'll look through old Axe progress posts. It will be fun to see how things evolved since then. :P

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routine Thread Index
« Reply #29 on: June 12, 2011, 02:02:50 pm »
I just wanted to bump this and mention that I'm still updating it, as some of the newer members may not have seen it. ;)
« Last Edit: June 12, 2011, 02:03:02 pm by ztrumpet »