Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 56

Thread: ASM To be or not to be?

  1. #41

    Default

    Cool :-D
    3DS Friend Code: 4699-6293-3106

  2. #42

    Default

    This is my version of your code in thumb lol:

    Code:
    @Convert to thumb
    add r2, pc, #1
    bx r2
    .thumb
     
    ldr r5,Mail        @r5 holds mail
    ldr r3,Drawer      @r3 holds drawer
    mov r1,#0xC        @C in hexadecimal=12 in decimal  (0x21EC200+0xC should give yu tenth slot)
    ldrh r0,=0x894     @Lol i think...[0x021D8014+0x894=-0x21D88A8 (last mail slot)
     
    Loop:
    ldrh r2,[r3,r1]    @load items in last slot of drawer
    strh r2,[r5,r0]    @store that item in last slot of mail
    sub r0,r0,#0xF4    @subtract the difference
    sub r1,r1,#0x2     @subtract the difference so now theres an item in all slots
    bpl Loop              
    bx lr                    
     
    .arm
    Mail:
    .long 0x21D8014
    Drawer:
    .long 0x21EC200
    Compiles to [activator L+R]:

    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 00000028
    E28F2001 E12FFF12
    4B054D04 4805210C
    522A5A5A 390238F4
    4770D5FA 021D8014
    021EC200 00000894
    023FF090 E3520003
    D2000000 00000000
    Last edited by Demonic722; 07-12-2012 at 12:41 PM. Reason: Formatting...
    3DS Friend Code: 4699-6293-3106

  3. #43

    Default

    I'll try to test it but I don't entirely understand what you did! Lol

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

    Default

    What dont you understand about it...?

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


  5. #45

    Default

    I think i figured it out. Thanks though!

  6. #46

    Default

    No problem.
    3DS Friend Code: 4699-6293-3106

  7. #47

    Default

    I made my code shorter...

    heres my version in thumb. (Needs activator and terminator added if one were to use it.)

    023FF090 012FFF11
    E0000000 0000002A
    E28F2001 E12FFF12
    49054806 880D4C03
    31028005 42A130F4
    4770DDF9 021EC212
    021EC200 021D8014
    0000F402 00000000
    023FF090 E3520003

    Heres the source:

    @{{Convert to thumb}}
    add r2, pc, #1
    bx r2
    .thumb

    ldr r0, Mail
    ldr r1, Dresser
    ldr r4, Limit

    Fred:
    ldrh r5, [r1]
    strh r5, [r0]
    add r1, #0x2
    add r0, #0xf4
    cmp r1, r4
    ble Fred
    bx lr

    .arm
    Limit:
    .long 0x021ec212
    Dresser:
    .long 0x021ec200
    Mail:
    .long 0x021d8014
    D:
    .byte 0x02
    M:
    .byte 0xf4
    Last edited by Drew956; 07-25-2010 at 10:27 PM. Reason: Smooshed some bugs :D

  8. #48

    Default

    Cool. Using the Code BBC is better.

    Example:

    Code:
    023FF090 012FFF11
    E0000000 0000002A
    E28F2001 E12FFF12
    49054806 880D4C03
    31028005 42A130F4
    4770DDF9 021EC212
    021EC200 021D8014
    0000F402 00000000
    023FF090 E3520003
    Code:
    @{{Convert to thumb}}
    add r2, pc, #1
    bx r2
    .thumb
     
    ldr r0, Mail
    ldr r1, Dresser
    ldr r4, Limit
     
    Fred:
    ldrh r5, [r1]
    strh r5, [r0]
    add r1, #0x2
    add r0, #0xf4
    cmp r1, r4
    ble Fred
    bx lr
     
    .arm
    Limit:
    .long 0x021ec212
    Dresser:
    .long 0x021ec200
    Mail:
    .long 0x021d8014
    D:
    .byte 0x02
    M:
    .byte 0xf4
    Last edited by Demonic722; 07-12-2012 at 12:34 PM.
    3DS Friend Code: 4699-6293-3106

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

    Default

    Since this is an ASM thread, I'll ask one of my own questions
    In THUMB, I noticed there's an "if-then" instruction, but I can't figure out how to use it. If I could figure it out, I could execute conditional stuff in THUMB (like streq, strne, etc)
    Does anyone here know how?
    Code:
    Makes up to four following instructions conditional, according to pattern. pattern is a string of up to three
    letters. Each letter can be T (Then) or E (Else).
    The first instruction after IT has condition cond. The following instructions have condition cond if the
    corresponding letter is T, or the inverse of cond if the corresponding letter is E.
    I do that but it never compiles, and keeps saying "incorrect condition in IT block"
    Always willing to help with anything, code-related or not. :]

  10. #50

    Default

    Well.. I am still not very good at asm but I understand the basics so I am happy

    But I do have a question that I would like answered please...

    How do you trace or use a debugger to find the asm a game uses?
    I want to find the asm in acww for digging holes and things like that.
    Also.. is their a specific nds code for NOP? Or is it just a bunch of zeros?

    Thank you!!

    Sincerely,

    ~Drew956
    (Also I think I need to download an emulator to use a debugger right? Do I need to download anything else?)

Posting Permissions

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