Author Topic: Axe Q&A  (Read 587426 times)

0 Members and 2 Guests are viewing this topic.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Axe Q&A
« Reply #1950 on: May 21, 2016, 04:37:15 pm »
Perhaps this just got lost in the manual copying process, but is ax1end defined properly?

If it appears so, nothing seems obviously wrong to me. If you posted the assembeld axiom, I could probably figure out what's wrong, though.
Yes I did forget to add it.
The program compiles sucessfully.
The actual function is a little different. (It displays "Magic!")
Here is the compiled code:
I'm still around... kind of.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Axe Q&A
« Reply #1951 on: August 18, 2016, 01:24:00 pm »
Just wondering if there was a way to include and run compiled assembly programs in Axe.
I've tried:([])():[prgmNAME] but, it won't work. Does it have something to do with the offset?
I am compiling the code with mimas.
Thanks!
I'm still around... kind of.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1952 on: August 18, 2016, 02:41:32 pm »
For many reasons, one of the largest being code origin, you cannot simply include one assembly program into another.

Provided you have access to the source of this program (which it sounds like you do), the only way I can think to legitimately include assembly code into an Axe program is to modify the assembly program into an Axiom. Depending upon the complexity of the assembly program, you may need to utilize many of the more advanced/confusing Axiom features. I'll refrain from attempting to explain them all unless it is discovered that some of them are needed.

A much simpler way is to abandon the requirement that the assembly program be included in the Axe program and simply call the assembly program from the Axe program with the RunPrgm Axiom.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Axe Q&A
« Reply #1953 on: August 18, 2016, 03:55:16 pm »
I've been using RunPrgm. A am slowly porting small parts of my projects to assembly to learn how to use it, since this gives me the benefit of not having to work out the logic of the section and knowing that the logic works.
I was hoping to avoid RunPrgm so I wouldn't have the slowdown of having to run it each time. (especially in a time sensitive loop)  :-\
I'll try "un-squishing" the code into hex (removing the C9 at the end) and pasting the hex to the desired location.
I'm still around... kind of.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Axe Q&A
« Reply #1954 on: September 10, 2016, 06:16:03 pm »
I looked in the chat and saw @neuronix was asking about renaming Axe 1.3.0 to something else to have both at once.
If @Runer112 doesn't care I'll post my renamed version of Axe 1.3.0 "Axe1.3"  ;)
Edit: I can so here it is...
I'm still around... kind of.

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1955 on: September 14, 2016, 12:34:55 pm »
@E37 How did you make?

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Axe Q&A
« Reply #1956 on: September 17, 2016, 11:16:20 am »
I opened Axe with the text editor.
Then I downloaded BrandonW's FixInititalHex.
I got rabbitsign from inside the Axe download folder.
I looked on the second or third full line of hex and found Axe's name in ASCII hex. (You may need to look up a chart of the 84's version of ASCII - zStart's font editor shows the hex that corresponds with every character.)
I modified the name to what I wanted it to be. Note that space is $20 not $00 (so you can look for "2020202020" in the app's hex for the five spaces after Axe's name to help you find it).
Then I copied all but the LAST TWO HEX CHARACTERS into fixinitialhex and replaced the final two hex characters with the corrected checksum from fixinitialhex.
Save and exit.
Use rabbitsign to sign the app and you should be done!
I'm still around... kind of.

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1957 on: September 22, 2016, 07:19:04 am »
Ok, thanks

Offline ferbplatypult

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1958 on: July 03, 2022, 07:31:56 pm »
Hello again!
I am once again having problems figuring out how to do something, this time arrays. I’ve seen people ask about them but still can’t understand how to make/ use one. I could probably copy code but I’d like to understand what it does just in case I need to do it again.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Axe Q&A
« Reply #1959 on: July 03, 2022, 07:39:06 pm »
In Axe, it's really low-level-- say you want 10, 1-byte elements. What you do is find (or allocate) a 10-byte chunk of RAM that is free, and you write and read bytes from it. For convenience Axe has L1 pointing to a 768-byte chunk of free RAM, so you can "{L1+2}→A" or "A→{L1+2}" to read/write the third element.

Axe has built-in ways to access 1- and 2-byte values, but in the end, it's up to you how you want to interpret the data :)

EDIT: A word of caution: Axe has no safety nets, so it won't stop you from reading or writing to data outside of your array on accident. If you aren't comfortable with arrays like this, make sure to back up your data in case you corrupt the data you have in RAM and need to clear RAM!

Offline ferbplatypult

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1960 on: July 03, 2022, 07:45:13 pm »
So if I wanted a 5*5array I should make 25 variables? What if I wanted to dynamically access array spots

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Axe Q&A
« Reply #1961 on: July 03, 2022, 07:50:45 pm »
Not 25 variables per se, but 25 elements, so if you want 1-byte elements, you'd need 25 bytes :)

This is an example of where it's up to you how you want to store and retrieve the data, but commonly, people choose to store it row-by-row. The first five elements are the first row, the next five elements are the second row, and so on.

Arrays start at 0, so an easy (not necessarily best) implementation might be to refer to element (Y,X) as "{L1+(5*Y)+X}" where Y and X are between 0 and 4.

Offline ferbplatypult

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1962 on: July 03, 2022, 07:56:24 pm »
This is going to sound dumb but what are bits and how many do I need to store a 2 digit number?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Axe Q&A
« Reply #1963 on: July 03, 2022, 08:02:16 pm »
Nah, that's not dumb :) A "bit" is a "binary digit" so a 0 or a 1. A 2-digit number has 102 (100) possible values, and a 7-bit number has 27 (128) possible values, so technically, you can fit a 2-digit number in 7 bits.

In reality, you'll usually be interacting with 8-bit and 16-bit  numbers (0-255 and 0-65535), so you'd just use an 8-bit value to store 2 digits.

Note: there are 8 bits per byte :)

Offline ferbplatypult

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 15
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1964 on: July 03, 2022, 08:06:10 pm »
So I’d do{L1+(8*Y)+X}?