الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

هل هذه التعليمات تكافئ .....

مغلق
بدأه MAE في 4 نوفمبر 2006 · 1 رد · 724 مشاهدة · في لغة Assembly لأنظمة 16, 32, 64 بت
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

هل call تساوي

push cs

push ip

jmp des

وهل int تساوي

pushf

push cs

push ip

jmp des

و هل ret تساوي

pop ip

pop cs

وهل iret تساوي

pop ip

pop cs

popf

يا ريت الاجابة تكون صح او غلط

مفيش توقيع

#2

sorry for writing in english

really it is a good topic to compare such replacement of instructions

i see that you are using real mode 16 bit registers.

for call instruction

there is two types of call

--- short call --> call addr

--- far call --> call cs:addr

both of these instruction may written call but for the far call you have to supply

the destination cs beside the address of the called code. But be cautious, the syntax

depents on the assembler you are using

for short call you just push the eip to the stack and simply jump

so we can replace it safely ( that just work for real-mode) by

push ip
jump addr

you may notice that the first instruction is not allowed

and the processor does not allow you to simply push ip, or pop ip.

but you can get arround that and pay more than simple call

for int n; instruction the same goes ok, provided that you are in real-mode

it can be replaced with this fake instructions

pushf
push cs
push ip
jmp des

but note that des=ds:[4*n]

so what about ret?

as you may notice the action of ret should be dependent on the past calling

whether it is shot or far. But ret generally does not pop cs from the stack

it just pops ip

iret?

this is used when return from interrupt

is just do the reverse of the int

for 32bit protected mode, thing differ

for example, the iret instruction will return for the back link

of the current TSS, provided that the NT flag is set

the call and jump may be used to make switch be jumping to the

desired TSS selector

the int n; is used in system calls, so is changes the current run level

and push the eip,cs,esp,ss,flags.

هذا الموضوع مغلق.

مواضيع مشابهة