Author Topic: Clearing a GDB/String/etc???  (Read 2547 times)

0 Members and 1 Guest are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Clearing a GDB/String/etc???
« on: January 16, 2011, 01:53:47 pm »
Hi,

im busy with a program, and i have the code:

Code: [Select]
[010101->GDB1
...
[02->{GDB1}

and when i start the program over, the 010101 isnt stored in GDB1, but the 02

how to eliminate this 02?
thanx

aetios
I'm not a nerd but I pretend:

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Clearing a GDB/String/etc???
« Reply #1 on: January 16, 2011, 02:04:48 pm »
This is what is called SMC (self modifying code). What it means is that the code is actually modifying part of itself (usually data, but I guess it could be actual code as well). Anyways, I think the TiOS is supposed to prevent this. Are you using Noshell?
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Clearing a GDB/String/etc???
« Reply #2 on: January 16, 2011, 02:12:49 pm »
I use DCS. and I know that its SMC, but can you undo this?
I'm not a nerd but I pretend:

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Clearing a GDB/String/etc???
« Reply #3 on: January 16, 2011, 02:34:10 pm »
Yea, I think there is something in the options. However, unless this prog is something you are only using for yourself, you need to either compile it for something other than DCS (which might make it not use SMC, but that's just a guess), or have a sub-routine that initializes all the data, call it on the actual initialization, then Goto it when you want to exit (so the Return will act as the final return)
Code: [Select]
...
sub(IN)
...
Goto IN

Lbl IN
.init data
Return
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





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: Clearing a GDB/String/etc???
« Reply #4 on: January 16, 2011, 02:40:48 pm »
It's because Doors and Mirage "copy back" the program after it's executed (not exactly but close enough), so any changes you do to it stay in the program. It doesn't matter how you compile it; the shells will still keep the updated version. To avoid that issue you'll just have to initiate the data yourself when the program starts.