התגובות שלי בפורום
-
מאתתגובות
-
DL!משתתף
Hi Gal,
The survivors are now available in the engine's Google Code project:
http://code.google.com/p/corewars8086/downloads/detail?name=survivors-2011.zipDanny
DL!משתתףYou can download the survivors here:
http://corewars8086.googlecode.com/files/survivors-2010.zipDL!משתתףHi Zest,
(I wrote most of the engine's code)
I love the debugging-related ideas – they would be very useful to anyone using the engine.Feel free to contact me if you're having trouble integrating with the engine.
My email is dleshem at gmail dot com.Best, Danny
DL!משתתףThere might be a minor change in the SHR opcode implementation (on rare cases it would return the wrong result, due to sign issues).
Other than that, there are no planned changes for this year.
DL!משתתף2008 survivors are available for download (filename is survivors_2008.zip):
http://sourceforge.net/project/showfiles.php?group_id=131621DL!משתתףOnly your two survivors can access (read or write) the ES segment – trying to access another team's private segment "kills" the survivor.
DL!משתתףSpeed example
@loop:
WAIT ; 4 WAITs in a row is the NRG virtual opcode
WAIT
WAIT
WAIT
; you can do something here
jmp short @loopBombing
; The following example bombs the start of the Arena with INT3's.
; Note that it will kill the survivor itself if it was loaded to this area…; set ES:DI to CS:0000
PUSH CS
POP ES
MOV DI, 0; Set DX:AX to CCCC:CCCC (which translates to the invalid opcode INT3)
MOV AX, CCCC
MOV DX, CCCC; Bomb!
INT 86DL!משתתףSarthobi:
The engine is an open-source project, so you can easily verify that the "JMP NEAR r16" opcode is indeed implemented correctly.
I believe the reason your survivor dies, is because BX is not pointing to where you think it is. Remember that the engine loads your survivor to a random memor address (a random offset in the Arena's segment). However, the Assembler you use to compile your code usually assumes that the code will be loaded to a specific offset (for example, COM files are loaded to offset 0x100). What happens is that your first opcode actually translates to
LEA BX, [0104]
and then your second opcode tries to jump to offset 0x104, which is usually invalid (hence your survivor dies).The engine lets you know where you are loaded by setting the initial value of the AX register. So, the following code should work:
@start:
MOV BX, AX ; point BX to @start
ADD BX, (offset @check – offset @start) ; point BX to @check
@check:
JMP BX ; infinite loop (jumps to @check)Notice that in this code the Assembler still assumes the code is loaded to 0x100, but this doesn't matter since we only use the difference between two offsets, which doesn't change even if the code is loaded somewhere else.
31 בינואר 2008 בשעה 15:41 בתגובה ל: מישהו יכול לתת קוד דוגמה להעברת תוכן אוגר למקטע המשותף לשורדים? #78300DL!משתתףSarthobi:
A workaround for the English/Hebrew problems: copy the text, paste to Notepad and press right ctrl+shift.
Rahamim's comment is correct. To read more about the LODSW and STOSW opcodes, try searching them in Google (the first result explains exactly what each of them does).
Generally speaking, there are several ways to read and write to the memory in 8086 assembly. The important thing to notice here, is that you need to access memory that is in a different segment than CS and DS (in fact, it is pointed to by ES). Since most opcodes that access memory assume it is in the segment pointed to by DS, you usually need to set DS to ES before executing them (like Rahamim did: PUSH ES and then POP DS). After you do so, you can use any opcode you like. For example, calling
MOV WORD PTR [0000], AA55
will write AA55 to the first word in the segment, and
MOV AX, WORD PTR [0000]
will read it to the AX register.DL!משתתףהיי אי.טי,
אני לא בטוח שהבנתי את כוונתך.
האופקוד המדובר אמנם תופס ארבעה בתים בזיכרון, אבל המעבד מריץ אותו בתור בודד כמו כל אופקוד אחר. האם לדעתך הבדל של שני בתים בזיכרון הוא משמעותי כל כך?
למיטב זכרוני לא היתה סיבה מיוחדת לכך שהאופקוד מומש כארבעה בתים מלכתחילה, אך לשינויו כעת יש השלכות: ראשית, אנו מעוינים לשמור, במידת האפשר, על תאימות לאחור (כך שניתן יהיה להריץ שורדים שנכתבו עבור תחרויות קודמות על המנוע העדכני ביותר). שנית, כל משתתפי התחרות יאלצו להוריד מחדש את מנוע המשחק. האם השינוי שהצעת יתרום למשחק תרומה משמעותית מספיק, לדעתך?
דני
DL!משתתףכל הכבוד, ממש עבודה יפה.
DL!משתתףYour first question has been answered in the forum not so long ago. See this thread:
http://codeguru.co.il/CS/forums/478/ShowPost.aspxIf you want to know for sure whether some specific opcode is supported by the engine (for example, if you are not sure if it is part of the original 8086 instruction set, or only added later) – you can check out the engine's source code, which is available for download.
As for your second question(s) – I'm not sure I understand what you mean. Please clarify.
20 בפברואר 2007 בשעה 16:53 בתגובה ל: One last item for today (sorry) Are there any more Sored-codes? #78386DL!משתתףLast year's survivors are available for download from SourceForge:
http://codeguru.co.il/CS/forums/291/ShowPost.aspx20 בפברואר 2007 בשעה 16:44 בתגובה ל: Maybe everyone else already knows this, but I don't. How will the battles happen? #78387DL!משתתףWhen it comes to the rules, this year is actually quite different from last year. All participants should have received a mail with the full details, so I'll just give the main points:
1. Round A will start at 09:00 – the submitted survivors (the ones you should mail us soon) will compete in Houses of 12. Each single battle will consist of 4 survivors and the Zombie.
2. For the next 3 hours, you can do whatever you want – change your survivor as you see fit, have it target specific programs – anything really! At 12:00 you should give us a new version of your survivor (or even the old one if you want). These survivors will compete in Round B (in the same Houses as in Round A).
*** Important: unlike last year, you will not receive penalty points, no matter what changes you make.***
Your team's score will consist of both rounds scores (50-50).
The best 3 teams from each House will advance to the finals, but you will not be able to change your survivors again at this stage. Again, you will run 4 at a time (plus the Zombie).
Your competition score will consist of 2/3 the pre-final score, and 1/3 the final score.
And again, you should receive the full details in mail.
DL!משתתף1. A single participant is regarded as a one-person team, and thus can submit two survivors – just like any other team.
2. Smart bombs do, in fact, wrap-around the segment. This can be easily verified either by looking at the engine's source code, or by running a simple test.
3. Battles last until a single survivor remains in the Arena, or the 200,000 round has been reached. The number of battles in the actual competition will depend on the final number of teams. Teams will probably be divided to several "houses" (around 12 teams in each house), and the battles will be run in groups of 4 (not including the Zombie).
-
מאתתגובות