Results 1 to 10 of 10

Thread: O:

  1. #1

    Default O:

    I am learning ASM and I wanna make a simple code, like, an inventory slot modifier or something. Can someone help? *coughdemonicdrew&shawncough* :p
    Says the noob. :3

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

    Default

    :P well
    First of all, you need to understand how ASM works. Basically any ASM code you make is gonna load something, mess with that, and then store it somewhere, or some variation of that.
    To load something you use a "ldr" operation. You can think of it as standing for "load directly into register"
    To load a byte, youd use ldrb, a halfword would use ldrh, and a word would use ldr
    A code like, 121D88FE 0000XXXX is a 16 bit write. So, to make this in ASM

    ldr r0, =0x21D88FE @load where the value will be written to (in this case slot 1 address)
    ldrh r1, =0x1566 @load 16bit value to write
    strh r1, [r0] @store 0x1566 into 0x21D88FE
    bx lr @this ends the code
    Always willing to help with anything, code-related or not. :]

  3. #3

    Default

    Okay, I understand the registers and ldr things and all, but what's with the x's? ;p
    Says the noob. :3

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

    Default

    XXXX is just the item hex, replace it with whatever item you want XD
    Always willing to help with anything, code-related or not. :]

  5. #5

    Default

    Nonono, just the simple 1 x in...

    =0x21D88FE
    Says the noob. :3

  6. #6

    Default

    Do you have someone that teaches you via PM or IRC yet? If not, I'm sure Demonic or I could help. I think dboy would be happy to help too. It is much more efficient than posting on the forum every time you have a question.


    The x is just part of the address. Don't question it.
    http://siestacat.webs.com/GetAttachment.jpg

  7. #7
    Member
    Join Date
    Aug 2008
    Location
    Vancouver, Washington
    Posts
    226

    Default

    Quote Originally Posted by siestacat View Post
    Do you have someone that teaches you via PM or IRC yet? If not, I'm sure Demonic or I could help. I think dboy would be happy to help too. It is much more efficient than posting on the forum every time you have a question.


    The x is just part of the address. Don't question it.
    And this is the part that i took forever to figure out xD
    I Lost the Game.

    -Lord Was

  8. #8

    Default

    If you mean the x like:

    Code:
    sub r5, #0x10
    sub r1, #0x10
    That x is basically a notation used to show that its in hex because you could do this:

    Code:
    sub r5, #16
    sub r1, #16
    Its still telling the code to subtract r5 and r1 by the same amount since 0x10[hex]=#16[decimal]
    But for a simple item slot code, I would do this:

    Code:
    ldr r0, InventorySlot1               //load the inventory slot1
    ldrh r1, BlueFeather                //since items are 16bits, load the value with ldrh
    strh r1, [r0]                      //store the bluefeather into inventoryslot1 and use strh since the bluefeather is a 16bit we store the 16bit 
    bx lr                             //End the Code
     
    InventorySlot1:
    .long 0x21D88FE               //Define the Literals, for acww 1.0 this is the first slot of the inventory address
    BlueFeather:
    .short 0x13FF                 //this is the blue feather hex
    (It would be best to use ards codetypes for simple one line codes though)
    Last edited by Demonic722; 09-10-2010 at 10:57 AM.
    3DS Friend Code: 4699-6293-3106

  9. #9
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    Isn't assembly super fun?! lul.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

  10. #10

    Default

    I think I'm starting to get it...
    Says the noob. :3

Posting Permissions

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