[00:00] Join: Metcalf joined #corewars [00:00] snap, i leave for a sec and people are actually talking [00:02] yes [00:05] evening [00:06] right [00:07] have you found out an answer for your A & B -field question already? [00:07] kinda, it's a little bit confusing. [00:09] I guess I'm kind of cunfused as to what are the questions I should be asking [00:10] ask them all [00:10] MOV 0,1 : each guide says this is the most basic of all programs, and I see that it seems to just copy itself to the next [00:10] 0 is A field [00:10] 1 is B field [00:10] does that mean 0 is current location, while 1 means move up to the next relative instruction? [00:11] the numbers have nothing to do with which is which field [00:11] no [00:11] i meant the 0 is in the A field [00:11] sorry [00:11] first field is A-field, and is almost always used in context of 'source', second, b-field is used in context of 'target' [00:12] in that case source would mean current instruction? [00:12] the numbers in corewars's core (battlefield) are relative, so 'current instruction' is 0, previous is -1, next is 1 [00:13] so if you puta 1 in the A field then it would say "on the next instuction"? [00:13] that would be 'move (next) on (next)' [00:14] what id you did MOV 1,2 [00:14] and have a diff command for the enxt line after [00:14] ? [00:14] if* [00:14] next* [00:14] then youd have [00:14] MOV 1,2 [00:14] (nextinstruction) [00:14] (nextinstruction) [00:15] and after the MOV -command is run, the next line is chosen to be run, in this case the first (nextinstruction) [00:16] so if you did MOV 1,2 it would execute the next instruction and move 2 addresses? [00:16] forgive me if I'm sounding dumb, i do appreciate your time [00:16] MOV moves only one instruction per times run [00:17] so the starting situation before MOV is run in the previous example is [00:17] MOV 1, 2 [00:17] (nextinstruction) [00:17] (empty) [00:18] and when the MOV is run, it moves (nextinstruction) over (empty) [00:19] so the MOV is run during (nextinstruction)? and move (Nextinstruction) over the empty? [00:20] the running moves like this: [00:20] MOV 1,2 [00:20] (nextinstruction) [00:20] argh [00:20] MOV 1,2 * [00:20] (nextinstruction) [00:20] (empty) [00:20] ---- [00:21] MOV 1,2 [00:21] (nextinstruction) * [00:21] (nextinstruction) [00:22] when you dont go into the fanciness of paraller execution, instructions are run systematically [00:23] execute instruction - go to next - execute - go to next... [00:24] interesting [00:24] of course, JMP -instruction (and its 3 variants) allow looping a code, or even start running the warrior at some place far away [00:28] cool stuff [00:29] seems kind of complicated though, but i supposed just like any other language, it just requires some quality practice time [00:29] yes [00:34] how long have you been creating programs for corewar, if it's ok to ask? [00:34] MSG: Ping timeout: 245 seconds [00:34] since about Jan 2003 [00:35] wow [00:35] i did lurk around earlier, but that was when i really started [00:35] now why is it that when i put in MOV 0,2 that the program seems to move one then terminate? [00:35] MOV 0,2 * [00:35] (empty) [00:35] (empty) [00:35] --- [00:36] MOV 0, 2 [00:36] of course! [00:36] (empty)* [00:36] (empty) [00:36] "empty" equals dat 0,0 , which kills a process (or to say simply - kills a warrior) [00:40] now if an address has just executed DAT 0,0 if a warrior moves over it on the next step is it terminated or only if the DAT 0,0 is on top of the address the warrior is at currently? [00:40] execution is required [00:41] i see, so when the DAT 0,0 is on a warrior and when it executs it's next command it will actually be the DAT 0,0 [00:41] ? [00:41] i mean next instruction [00:42] so for instance if i have [00:43] if the next line is a DAT, then the next instruction run will be a DAT (unless you JMP away. Har har.) [00:43] interesting [00:44] so it's possible that when you JMP to avoid execution of the DAT instruction? [00:44] well, you could [00:44] JMP 2, 0 (b-field is ignored) [00:44] DAT 0,0 [00:44] (safety) [00:45] JMP simply starts running the program at different location, in this case a DAT is jumped over [00:45] if i have: [00:46] MOV 0,1 [00:46] JMP -2 [00:46] will that be (empty) [00:46] and then terminate? [00:46] because 2 instructions back wouldn't have anything? [00:46] that is correct [00:49] however when i run such a program against another program in "corewin" the warrior running those 2 instructions in that order seems to behave like JMP-2 doesn't exists and seems to only be copying itself to the enxt address [00:49] and not terminating? [00:50] running starts from first instruction, in that case mov 0,1 [00:50] the mov 0,1 overwrites the jmp -2 [00:50] so JMP -2 never actually gets run [00:51] yes [00:51] interesting [00:51] and running a program CAN start from place other than first instruction, but when no starting location is given, a program is run from first instruction [00:52] (and thats why every once in a while you see warriors that lose 98% of time, when the sender forgot to clarify where to start the warrior) [00:52] how do you specify where to start at w/e instruction? [00:53] you need to label a line [00:53] eg: [00:53] start mov 0,0 [00:53] jmp -1, 0 [00:53] and then either add end start at end of program, or org start near the beginning [00:54] pretty much every name can be used, but 'start' is hard not to misunderstand [00:54] ugh, hard to misunderstand [00:54] 3am here.. [00:55] late [00:56] well thanks for your time and help [00:56] im not in a hurry [00:57] MOV 0,0 [00:57] JMP -2 seems to terminate, moves then terminates after reach the empty instruction [00:58] as lame as it sounds, getting osmething that simple right feels good to have something work [00:58] well, its a new enviroment for you [00:59] yeah. I have fair knowledge of multiple programming languages, but this is all new to me. [00:59] by fair i really mean basics [01:05] honestly I don't know where to go from here, so I learned that by executing an empty instruction it's equivilant to DAT 0,0. I learned a little about A and B fields, and know that JMP X means to move down X and execute the instruction [01:06] well, you could go back to the corewar tutorial, and try to reunderstand how Dwarf works [01:06] (the 4-line warrior near beginning) [01:06] yeah I'm currently looking at it [01:08] I realized while i was looking at the code I've really been thinking not really of realtive addressing [01:09] ex. MOV 0,1 Move current to next instruction. or ADD #4,3 is add the number for to the 3 instruction down [01:13] four* [01:20] ill go get some sleep now [01:21] most familiar faces here live in euro-time, so if you get questions and no-one is here, feel free to ask me by mail, [01:23] thanks again for your help, take it easy [03:14] MSG: Quit: ChatZilla 0.9.79 [Firefox 2.0.0.12/2008020121] [14:13] MSG: Remote host closed the connection [14:52] Join: alexander joined #corewars [18:35] Join: yoR joined #corewars [18:39] Join: Metcalf joined #corewars [18:39] Hi! :-) [18:39] Hiya [18:39] Hi Roy [18:47] MSG: Ping timeout: 245 seconds [18:47] Join: Metcalf joined #corewars [18:54] MSG: Ping timeout: 245 seconds [19:03] Join: Metcalf joined #corewars [19:28] MSG: Ping timeout: 245 seconds [19:50] MSG: