|
|
אקסטרים
Started by Vendetta at 12-11-2010 4:15. Topic has 2 replies.
 
 
|
|
Sort Posts:
|
|
|
|
12-11-2010, 4:15
|
Vendetta
Joined on 11-05-2010
Posts 9
|
|
|
אז ככה הייתי רוצה לשנות את האוגר IP על מנת שהתוכנית שלי תרוץ ממקום אחר שאני קובע אבל לא משנה מה ניסיתי לעשות בדיבאג כלום לא עזר, גם לו push pop
ועד שאלה מה האבדל בין האוגר ip לאוגר cs
ודבר אחרון , הייתי ממליץ לכם לפרסם את הקישור הזה http://www.coval.net/teach/emu8086/helpfiles/asm_tutorial_01.html ממש מסביר טוב על השפה :)
|
|
|
|
|
Report
|
|
|
|
12-11-2010, 11:48
|
GalDor
Joined on 09-09-2008
Posts 48
|
|
|
First question: the jump opcode, jmp @label actually works by adding a certain amount to ip. Similarly, you can do jmp ax (which sets ip to ax), jmp [bx] (which sets ip to what's stored in [bx]) or jmp far [bx] (which, if I recall correctly, also sets cs to [bx+2]).
Second qeustion: any address in 8086 is always represented by a pair segment:offset, which is than translated into an absolute address by segment*0x10+offset. This has the advantage of allowing you to access 2^20 possible addresses on a 16-bit machine (so you are not limited to 2^16, as you should have been). The current instruction is kept in a similar fashion - your address is cs:ip, where cs is the segment register and ip is the offset within that segment.
Note that a lot of far-call based survivors use the fact that many segments overlap to operate from segments different from the initial arena segment, 0x1000. Instead, they use an offset in an almost completely overlapping segment such as 0x1010 and make sure that they never enp up out of the arena when the actual physical address is calculated. This is used in order to hide their actual address and make finding them musch more difficult for scanners.
---------------------------------- Have you heard about the new Cray super computer? It’s so fast, it executes an infinite loop in 6 seconds.
|
|
|
|
|
Report
|
|
|
|
12-12-2010, 15:02
|
shinigami
Joined on 01-30-2009
Posts 27
|
Re: שאלה בתיכנות אסבמלר
|
|
|
|
|
ניסית להשתמש בcall?
cs הוא סגמנט הקוד
ip הוא מצביע הקוד
אוגר מסוג סגמנט מצביע על תחילת הסגמנט המדובר ובדרך כלל קבוע
בעוד שמצביע הוא ההיסט הנוכחי בתוך הסגמנט ומשתנה במקרים רבים
ip הוא מיוחד בזה שהוא מצביע על הפקודה הבאה שתרוץ בתכנית שלך
|
|
|
|
|
Report
|
|
|
|
|
קודגורו » פורומים » אקסטרים » Re: שאלה בתיכנות אסבמלר
|
|
|
|