Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: ASM Please Check THis

  1. #1

    Default ASM Please Check THis

    Hey Guys.


    Made an ARDS Code for ACWW that You hold a button to advance time however long you like and hold another button to subtract from the time however long you like. Just wanted it to be checked for errors and such.


    Finished Code Hold Left + L to go back in time however long and Right + R to go Forward in Time However Long

    Code:
    94000130 FEEF0000
    023FF090 012FFF11
    E0000000 00000018
    E59F000C E5901000
    E2811002 E5801000
    E12FFF1E 021ECD84
    023FF090 E3520003
    D2000000 00000000
    94000130 FDDF0000
    023FF090 012FFF11
    E0000000 00000018
    E59F000C E5901000
    E2411002 E5801000
    E12FFF1E 021ECD84
    023FF090 E3520003
    D2000000 00000000
    I think It'll Work. I'll Post meh ASM Source



    Code:
    I added a regular activator here.
    
    ldr r0,TimeAddress
    ldr r1,[r0]
    add r1,#2
    str r1,[r0]
    bx lr
    
    TimeAddress:
    .long 0x21ecd84
    
    Regular Terminator Here
    
    Regular Activator Here
    
    ldr r0,TimeAddress
    ldr r1,[r0]
    sub r1,#2
    str r1,[r0]
    bx lr
    
    TimeAddress:
    .long 0x21ecd84
    
    Regular Terminator
    Look Good?
    http://siestacat.webs.com/GetAttachment.jpg

  2. #2

    Default

    If it works then Also ask DB how to use @thumb to make your codes shorter I'm not learning ASM but I know it helps.

  3. #3

    Default

    Yeah I know thumb is more efficiant in some ways, but it also has some limitations such as you cannot use three digits when using arithmatic whereas in ARM 9 (7?) you can.
    http://siestacat.webs.com/GetAttachment.jpg

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

    Default

    Quote Originally Posted by siestacat View Post
    Yeah I know thumb is more efficiant in some ways, but it also has some limitations such as you cannot use three digits when using arithmatic whereas in ARM 9 (7?) you can.
    Oh and I need to teach you how to make that into just one routine, instead of two separate ones

    By the way I've never had any problems with thumb, other than the fact that you only have 6 general purpose registers that you can use (which sometimes is barely enough, and sometimes isn't enough)

  5. #5

    Default

    K so you can put that into one routine?
    http://siestacat.webs.com/GetAttachment.jpg

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

    Default

    Quote Originally Posted by siestacat View Post
    K so you can put that into one routine?
    Code:
    @Convert to thumb
    add r2,pc,#1            
    bx r2
    .thumb
    
    ldr r3,TimeAddress
    ldr r4,[r3]
    
    ldr r0,IOKeys
    ldrh r0,[r0]
    mov r1,#0x11
    lsl r1,#4
    
    CheckForward:
    tst r0,r1
    beq Forward
    add r1,r1
    
    tst r0,r1
    bne Exit
    sub r4,#4
    Forward:
    add r4,#2
    str r4,[r3]
    Exit:bx lr
    
    
    
    .arm
    IOKeys:
    .long 0x4000130
    TimeAddress:
    .long 0x21ECD84
    Code:
    023FF090 012FFF11
    E0000000 00000030
    E28F2001 E12FFF12
    681C4B08 88004806
    01092111 D0034208
    42081849 3C04D102
    601C3402 00004770
    04000130 021ECD84
    023FF090 E3520003
    same exact thing as you put, except in one routine. Try it (no need to add activator lines or anything)

    sorry if there are errors, I'm half asleep

  7. #7

    Default

    Can it be done In standard ASM? I don't know Thumb ASM yet...
    http://siestacat.webs.com/GetAttachment.jpg

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

    Default

    Quote Originally Posted by siestacat View Post
    Can it be done In standard ASM? I don't know Thumb ASM yet...
    Uh,
    Code:
    ldr r3,TimeAddress
    ldr r4,[r3]
    
    ldr r0,IOKeys
    ldrh r0,[r0]
    mov r1,#0x11
    lsl r1,#4
    
    CheckForward:
    tst r0,r1
    beq Forward
    add r1,r1
    
    tst r0,r1
    bne Exit
    sub r4,#4
    Forward:
    add r4,#2
    str r4,[r3]
    Exit:bx lr
    
    
    IOKeys:
    .long 0x4000130
    TimeAddress:
    .long 0x21ECD84
    Code:
    023FF090 012FFF11
    E0000000 00000044
    E59F3038 E5934000
    E59F002C E1D000B0
    E3A01011 E1A01201
    E1100001 0A000003
    E0811001 E1100001
    1A000002 E2444004
    E2844002 E5834000
    E12FFF1E 04000130
    021ECD84 00000000
    023FF090 E3520003
    Notice what I did?

  9. #9

    Default

    Just took away the Convert to Thumb? lol
    http://siestacat.webs.com/GetAttachment.jpg

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

    Default

    Quote Originally Posted by siestacat View Post
    Just took away the Convert to Thumb? lol
    Yup
    Thumb isn't very different from standard, except some things are limited
    Just try making a regular ASM code then add the convert part and the .arm at the end

    if it gives you problems, look closely at the error output and do what it says, pretty soon you'll know what you can and can't do in thumb (that's how i learned)

Posting Permissions

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