assembly - Why isn't this RedCode MOV working? -


so, i'm in assembly class, , keep things interesting, have tournaments bi-weekly core wars. i'm trying make simple application copies imp further down in memory, jumps , has 2 imps going @ same time. idea once part working put tight loop , make more two.

here's code:

jmp start        ; jump starting point  addr dat #1, #0  ; remember last address dropped @ move mov 0, 1    ; imp copied  start            ; starting point add #-1, addr    ; take 1 off address add #80, addr    ; move 80 forward add #1, addr     ; make 81  mov move, addr   ; move imp addr spl addr         ; split new processes @ addr  jmp move 

however, what's happening first mov/spl doesn't work, , first imp running. going wrong in logic? works if remove addr , use magic number.

here's screen snippet of memory before starts running.

screen snippet of memory

thanks.

change:

mov move, addr   ; move imp addr spl addr         ; split new processes @ addr 

to:

mov move, @addr   ; move imp addr spl @addr         ; split new processes @ addr 

and change jmp move jmp start if want loop work.

plus should change first line org start instead of jmp start


i think misunderstood part of question, looks you're trying create 2 imp processes whereas said make loop, have 2 imps running if make this:

org start  addr dat #0, #1  start     add #80, addr     mov imp, @addr     spl @addr  imp mov $0, $1 

but doesn't jump start , overwrite original instructions.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -