Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: Free movie (ZOMBIELAND!) playing at unitec 5.30pm Thursday 20th.

  1. #16
    Join Date
    7th April 2009 - 19:32
    Bike
    VFR400 NC30 "Silver Surfer"
    Location
    Mt Eden, Auckland
    Posts
    959
    Quote Originally Posted by Danae View Post
    Institute? But then it sounds like a crazy house. I usually call it 'school'.

    if ((universityName == "Natcoll") || (universityName == "Institute") {
    universityName = "school";
    universityName++;
    }
    Wtf at =/=... != or <> (for sql) or even at a pinch 'not equal' for the wordier languages.

    Also I can only assume that this is some crazy c# style language where universityName is a separate class and has overridden ++ and '= String' operators, because in all the ones that I know, doing that would either result in universityName being "chool" due to you having incremented the string pointer by 1.... Then again, in that case the == statements would be incorrect too....

    Both of you go learn some C and get back to me.

    or better yet:

    LDI R16,"univsersityNameStrPtr"
    LDI R17,"universityNameCompareStrPtr"

    Compare:
    CPI R16, 0
    BREQ 'NoStringMatch'
    LDS R19,R16+

    CPI R17, 0
    BREQ 'Compare'
    LDS R20,R17+

    CMP R19,R20
    BREQ 'CharMatch'
    LDI R17,0
    JUMP 'Compare'

    CharMatch:
    CPSE R19,R0
    JUMP 'StringMatch'
    JUMP 'Compare'

    NoStringMatch:
    LDI R16,0
    JUMP 'Return'

    StringMatch:
    LDI R16,1
    JUMP 'Return'

    Return:
    ST "CompareResult",R16
    RET

    Doesn't check to ensure strings stay within length and are null terminated (is memory safe if not though) and doesn't do the replacement, but that parts easy enough. Probably a little register heavy but oh well, it's written as if in a subroutine with all other registers pushed onto the stack so there are plenty to go around. Runtime: about 4 cycles + 18 cycles per correct character tested, not including time to pre-push/post-pop registers from the stack.

    Edit: That's actually pretty quick all told...

  2. #17
    Join Date
    18th May 2005 - 09:30
    Bike
    '08 DR650
    Location
    Methven
    Posts
    5,255
    Quote Originally Posted by jono035 View Post
    Wtf at =/=


  3. #18
    Join Date
    7th April 2009 - 19:32
    Bike
    VFR400 NC30 "Silver Surfer"
    Location
    Mt Eden, Auckland
    Posts
    959
    You mean ≠... It is part of the ascii char set...

  4. #19
    Join Date
    18th May 2005 - 09:30
    Bike
    '08 DR650
    Location
    Methven
    Posts
    5,255
    Quote Originally Posted by jono035 View Post
    You mean ≠... It is part of the ascii char set...
    XD


  5. #20
    Join Date
    11th March 2009 - 20:39
    Bike
    1986 Honda GB 400F
    Location
    Auckland
    Posts
    1,492
    Lol jono I was only joking.... And it's javascript; only it is nonsensical javascript.

  6. #21
    Join Date
    7th April 2009 - 19:32
    Bike
    VFR400 NC30 "Silver Surfer"
    Location
    Mt Eden, Auckland
    Posts
    959
    Quote Originally Posted by Danae View Post
    Lol jono I was only joking.... And it's javascript; only it is nonsensical javascript.
    I wasn't exactly being 100% deadpan serious, myself

  7. #22
    Join Date
    19th August 2007 - 00:07
    Bike
    Too many to count
    Location
    Auckland
    Posts
    5,949
    Quote Originally Posted by jono035 View Post
    *assembly code*
    got something to be procrasinating there?

  8. #23
    Join Date
    7th April 2009 - 19:32
    Bike
    VFR400 NC30 "Silver Surfer"
    Location
    Mt Eden, Auckland
    Posts
    959
    Quote Originally Posted by motorbyclist View Post
    got something to be procrasinating there?
    Still in the parts accrual stage given that I have no valve spring compressor and no valve grind stick/paste (poke poke).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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