Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 69

Thread: I've started trying ASM finally

  1. #41

    Default

    24.48K because?

    Remember to always click the thanks button of those who help you! It makes them feel wanted:

  2. #42
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Area51_Hacker2 View Post
    24.48K because?
    I dunno it seems like a nice number XD
    20,480 in hex is 5000, which is easy enough to use.

  3. #43
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    For the fa one its easier just to do this...
    Code:
    ldr r0, text
    ldr r1, slot
    ldrh r3, word
    ldrh r5, done
    ldrh r4, item
    ldrh r2, [r0]
    cmp r2, r3
    bxne lr
    strh r5, [r0]
    strh r4, [r1]
    bx lr
    
    text:
    .long 0x22AF136 
    slot:
    .long 0x21D88FE
    word:
    .ascii "fa"
    done:
    .ascii "ok"
    item:
    .short 0x14FD
    Same goes for the other one, well sorta :\

    Say what you mean, mean what you say, and let your actions speak for you.


  4. #44
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Maniac View Post
    For the fa one its easier just to do this...
    Code:
    ldr r0, text
    ldr r1, slot
    ldrh r3, word
    ldrh r5, done
    ldrh r4, item
    ldrh r2, [r0]
    cmp r2, r3
    bxne lr
    strh r5, [r0]
    strh r4, [r1]
    bx lr
    
    text:
    .long 0x22AF136 
    slot:
    .long 0x21D88FE
    word:
    .ascii "fa"
    done:
    .ascii "ok"
    item:
    .short 0x14FD
    Same goes for the other one, well sorta :\
    Well, it doesn't really shorten the code at all but it shortens the source. But thanks, that really is easier to do, i'll keep that in mind XD

  5. #45
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    While gh was down, I got bored and made 2 new codes. They're practically the same codes though, but whatever. I based these off of someone else's codes, except they didn't use assembly and they used button activators, while I use assembly an text activators.
    Code:
    removed
    I could have made them into a single code, but it'd be huge.
    Last edited by dragonboy269; 04-28-2009 at 06:19 PM.

  6. #46
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Here is my smart inventory code with loops
    Type "st" and send it to store the item in the first empty slot. If the code finds an empty slot, it will store the item and alert you by saying "ok"
    if the code doesn't find an empty slot (if your inventory is completely full) it will alert you by saying "no". It's set to store a pitfall, but you can replace 1566 with the item you want(it's near the bottom of the code)
    (spoiler used to shorten this post)
    and the source

    Do you guys think I'm good now?
    Last edited by dragonboy269; 04-28-2009 at 06:20 PM. Reason: shortened the code even more, and fixed up the source so it looks nice

  7. #47
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Sorry for posting AGAIN...I wish I could delete all my other threads in the "amateur coding" section (please move them to the trash Maniac)
    but I have a question again. I was thinking of making a real-time acre editor. At first I was just gonna make it be a cycler, where I press an activator to add a certain amount then press something else to move to the next address. However, it'd be a lot easier if I could just type the value I want. But, I don't know how to get the right value that way, because for example if you type "1a" on the chat keyboard, it'll be equal to 361b...
    Also, I understand practically everything now, although I'm not sure when you'd need to use a logical shift (like lsl)
    At least, that's the only thing I've encountered so far in the TTI source that I didn't understand, and I need to know what it does in order to understand the loop part of TTI.

    Edit: here is the cycler source. It isn't fully working yet, but as you can tell it's HUGE. That's why I'd rather be able to write acres using a "text to acre" code of sorts.
    Code:
    removed
    Last edited by dragonboy269; 04-28-2009 at 06:20 PM.

  8. #48
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    lsl, each shift is a multiplication by 2 with the result anded by 0xFFFFFFFF, it's multiplying by 2^immediate.
    mov Rd, Rm, lsl #0ximmediate is the syntax for ARM mode.

    Say what you mean, mean what you say, and let your actions speak for you.


  9. #49
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Quote Originally Posted by Maniac View Post
    lsl, each shift is a multiplication by 2 with the result anded by 0xFFFFFFFF, it's multiplying by 2^immediate.
    mov Rd, Rm, lsl #0ximmediate is the syntax for ARM mode.
    if I understood all that, then I would have just used the arm reference sheet XD. Do you mean, like in text to item, it gets one byte then moves on and gets the next? Like, for a pitfall, 15 then 66? (or backwords)

  10. #50
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    mov r0, r1, lsl #0x4
    (2^4 = 16)
    That would multiple r1 by 16 and store it into r0... I really don't see what you don't understand but alright >_>

    Say what you mean, mean what you say, and let your actions speak for you.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •