Author Topic: Bug Reports  (Read 402072 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bug Reports
« Reply #240 on: May 30, 2010, 01:24:41 am »
what would sub-routine usage in expression do?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #241 on: May 30, 2010, 01:35:00 am »
what would sub-routine usage in expression do?

In my example:
Code: [Select]
91-(sub(CS))
I have:
Code: [Select]
Lbl CS
S=8*2
Return

This allows me to return a calculation I use in many places throughout the program without having to retype the expression everywhere it is needed, thereby reducing program size.
« Last Edit: May 30, 2010, 01:35:45 am by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bug Reports
« Reply #242 on: May 30, 2010, 01:48:32 am »
aaaah ok I see. Sounds like a cool idea :)

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Bug Reports
« Reply #243 on: May 30, 2010, 08:37:22 am »
Right. That is exactly how I did it on the calculator. Token for token, hex for hex, and number for number

edit: Ok, I added the same [xxxxxxxxx]->pic1 right after pause 100, and it worked... I guess it forgot that pic1 was stored?  :o
edit: I put the diagnostic off after the sprite, and it worked. I think thats what did it
« Last Edit: May 30, 2010, 11:50:02 am by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bug Reports
« Reply #244 on: May 30, 2010, 01:58:04 pm »
strange I didn't realise the order would make much of a difference. It's always a habit for me to put the entire data at the very top of the program, below the header, though, so I never really encountered this.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #245 on: May 30, 2010, 04:29:29 pm »
I don't think that retrieving and storing two-byte expressions work correctly. Both of the following examples would be affected:

Code: [Select]
{V+2}r→T
T→{L1+2}r

I believe this is because, although the r modifier is supposed to simply signify two bytes in this case, it signifies both two bytes and it swaps the bytes. Taking the first line as an example, if {V+2}=01 and {V+3}=F0, T becomes F001, although one would think that it should become 01F0. The second example acts even more oddly, the incorrect behavior of which I am spending a lot of time trying to counteract.


EDIT: This really needs looking into. I've spend the last hour just trying to get a few two-byte values to work correctly. And I haven't even been successful yet.

ANOTHER EDIT: I finally got it to work, but the code that makes it work took a lot of trial and error and doesn't logically make sense. This is still a problem that needs to be checked.


jk
« Last Edit: May 30, 2010, 06:25:25 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Bug Reports
« Reply #246 on: May 30, 2010, 06:10:00 pm »
So if i understand you correctly, you are saying that storing 2 byte numbers works incorrectly because it stores the bytes in backwards order?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #247 on: May 30, 2010, 06:12:26 pm »
So if i understand you correctly, you are saying that storing 2 byte numbers works incorrectly because it stores the bytes in backwards order?

I'm really not sure anymore. I just spent over an hour trying to get two-byte data manipulations to work in my program. What works in one case doesn't work in another case. I can't explain what is wrong anymore, it doesn't even seem to be a constant flaw.

jk again
« Last Edit: May 30, 2010, 06:25:45 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Bug Reports
« Reply #248 on: May 30, 2010, 06:14:05 pm »
Do you understand how if i store a 2 byte number into {L1+0}, the first byte gets stored into {L1+1} and the second byte into {L1+0}?  This is what is known as Little-Endian format (since the little end goes in first)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #249 on: May 30, 2010, 06:18:35 pm »
Do you understand how if i store a 2 byte number into {L1+0}, the first byte gets stored into {L1+1} and the second byte into {L1+0}?  This is what is known as Little-Endian format (since the little end goes in first)

Ok wait, I'm confused now. If I stored 1025 (0401) into {L1+2}r, I would get {L1+2}=01 and {L1+3}=04? Then what would I get if I evaluated {L1+2}r?

EDIT: Shit fail, now it all makes sense... :-[ *facepalm, goes to strike out other posts*
« Last Edit: May 30, 2010, 06:26:27 pm by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Bug Reports
« Reply #250 on: May 30, 2010, 06:28:49 pm »
That is correct, and then when you evaluated {L1+2}r it would evaluate right back to 1025

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Bug Reports
« Reply #251 on: May 30, 2010, 07:17:41 pm »
Right. That is exactly how I did it on the calculator. Token for token, hex for hex, and number for number

edit: Ok, I added the same [xxxxxxxxx]->pic1 right after pause 100, and it worked... I guess it forgot that pic1 was stored?  :o
edit: I put the diagnostic off after the sprite, and it worked. I think thats what did it
That shouldn't be happening, I'll look into it.

I hate little endian!  It was so confusing when I was learning assembly and caused all sorts of errors.  But you kinda grow to like it eventually because it makes some things simpler.  Fortunately you never have to deal with that directly in Axe unless you actually go to look at the data you wrote in some non-conventional way.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: Bug Reports
« Reply #252 on: May 30, 2010, 07:22:16 pm »
allrighty then. Yeah, I hated little-endian too.
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bug Reports
« Reply #253 on: May 31, 2010, 12:08:59 am »
I always wondered what was little-endian before. Glad people summed it up now, because the Wikipedia article seemed to be TL;DR x.x

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Bug Reports
« Reply #254 on: June 01, 2010, 05:21:02 pm »
Yeah, it can definitely be annoying at first, though, as the wikipedia article states, there are advantages to it, namely that different-length parts of the data can all be accessed at the same address and extending a number is pretty easy (just add 0's), though the second point is a bit less important for z80 programming.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.