+ Reply to Thread
Results 1 to 7 of 7

Thread: CPU Code Help

  1. #1
    Wire Amateur LфяÐ ZZ†'s Avatar
    Join Date
    Sep 2008
    Posts
    44

    Default CPU Code Help

    Well ill get right to the point..
    my code fails and i need a new one
    i have remade it over 20 times and all of them have the same error not a CPU Error tho

    this is part of the entire code but this is the only part that fails

    Code:
    Data;
    define Var,67583
    Code;
    mov #1336,3
    
    Change:
    mov ecx,0
    Change1:
    inc ecx
    mov eax,ecx
    mov ebx,ecx
    inc ebx
    add eax,Var
    add ebx,Var
    mov edx,#ebx
    cmp #eax,edx
    je Skip
    mov edx,#eax
    mov #ebx,edx
    Skip:
    cmp ecx,#1336
    jge Rett
    jmp Change1
    
    Rett:
    ret
    Now what this code needs todo is recode the pos of a dot and where it moves with a history of 3 dots if that makes sence
    so if it goes from 10 to 11 then 12 then 13 It will have the poss for dots 11-13

    if anyone has any suggestions or a code that works in this way it would help

    Any and All Help is Greatly Appreciated
    Last edited by LфяÐ ZZ†; 01-28-2009 at 02:13 AM.

  2. #2
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: CPU Code Help

    Code:
    mov edx,#ebx
    cmp #eax,edx
    je Skip
    mov edx,#eax
    mov #ebx,edx
    Skip:
    That doesn't make sense to me.
    Why do you use edx?

    Code:
    cmp #eax,#ebx
    je Skip
    mov #ebx,#eax
    Skip:
    Why not like this?

    But let's say you have in your memory
    67584 - 18
    67585 - 9
    67586 - 60
    67587 - 1

    First loop you compare if #eax (18) and #ebx (9) are equal
    if not equal you move #eax into #ebx
    So now:
    67584 - 18
    67585 - 18
    67586 - 60
    67587 - 1

    So, after the three loops you simply have:
    67584 - 18
    67585 - 18
    67586 - 18
    67587 - 18

    I really don't see what you are trying to achieve.
    Where are your three points supposed to go?

    (I'm a total cpu fruitcake.. but this is what my logic came up with)
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  3. #3
    Wire Amateur LфяÐ ZZ†'s Avatar
    Join Date
    Sep 2008
    Posts
    44

    Default Re: CPU Code Help

    Thats what happends i forgot to say it

    and the 3 dots go where the 1st dot used tobe

    1st dot goes to 5 then 2nd dot goes to 0
    1st dot goes to 6 2nd dot goes to 5 3rd dot to 0
    1st dot goes to 7 2nd dot goes to 6 3rd to 5
    Get it?
    also the reson its set up this way is because the 3 dots are not a set value i could make it 6 dots if i needed too witch i will at one point

  4. #4
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: CPU Code Help

    Then 2nd dot goes to 0??
    hmm.. no it doesn't make sense at all.

    "3 dots go where the 1st dot used tobe"
    You are doing nothing with the 1st dot place during the loops so why should they all pass the 1st dot place.

    Before changing:
    67584 - 22
    67585 - 35
    67586 - 65
    67587 - 0
    67588 - 0
    67589 - 0

    After changing:
    67584 - 0
    67585 - 0
    67586 - 0
    67587 - 22
    67588 - 35
    67589 - 65

    Is that what you mean?
    If not, can you make a diagram like that.

    I do understand that you want the amount of changed values easily changable.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  5. #5
    Wire Amateur LфяÐ ZZ†'s Avatar
    Join Date
    Sep 2008
    Posts
    44

    Default Re: CPU Code Help

    well think of it like the game snake the 2nd dot was where the 1st dot was the 3rd dot is where the 2nd dot was and so on

  6. #6
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: CPU Code Help

    I threw a lot of the useless stuff away
    The are equal compare /skip was useless,
    It takes longer to check if it needs to be moved then the actual move.

    Code:
    Change:
    mov ecx,0
    
    Change1:
      inc ecx           //The counter increase
        mov eax,ecx  //Move EAX to the right position
        add eax,Var
          mov ebx,eax  //Move EBX to the position after EAX
          inc ebx
             mov #eax,#ebx   //Drop EBX contents into EAX content
      cmp ecx,#1336   //compare counter with total
         jl Change1         // if less, loop again
    ret                   // otherwise return
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  7. #7
    Wire Amateur LфяÐ ZZ†'s Avatar
    Join Date
    Sep 2008
    Posts
    44

    Default Re: CPU Code Help

    Well i just checked..
    that code rewrites dot 1 and because it does it from dot 2 it just resets everything to 0
    anyway to reverse your perfect script?!
    Last edited by LфяÐ ZZ†; 01-29-2009 at 03:14 PM.

+ Reply to Thread

Similar Threads

  1. Still okay to code in raw ZCPU code?
    By BrokenGlass in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 14
    Last Post: 12-11-2008, 10:10 AM
  2. Need help with this code...
    By Eirath245 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 13
    Last Post: 11-03-2008, 11:40 AM
  3. How to Lua Code?
    By Ssnipersteve in forum Wiremod Addons & Coding
    Replies: 1
    Last Post: 03-19-2008, 02:00 AM
  4. Help with this code
    By penguini in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 1
    Last Post: 06-14-2007, 02:56 PM
  5. my first cpu code needs sum help
    By undead82004 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 6
    Last Post: 06-07-2007, 06:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots