Кіріспе
Компьютерлік ассемблер тіліндегі нұсқаулық INT – x86 процессорлары үшін бағдарламалық үзіліс жасауға арналған ассемблер тіліндегі нұсқаулық. Ол байттық мән ретінде берілген үзіліс нөмірін қабылдайды. Ассемблер тілінде нұсқау былай жазылады:
INT is an assembly language instruction for x86 processors that generates a software interrupt. It takes the interrupt number formatted as a byte value. When written in assembly language, the instruction is written like this:
INT X
where X is the software interrupt that should be generated (0 255). As is customary with machine binary arithmetic, interrupt numbers are often written in hexadecimal form, which can be indicated with a prefix 0x or with the suffix h. For example, INT 13H will generate the 20th software interrupt (0x13 is nineteen (19) in hexadecimal notation, and the count starts at 0), causing the function pointed to by the 20th vector in the interrupt table to be executed. INT is widely used in real mode. In protected mode, INT is still available but SYSENTER/SYSEXIT or SYSCALL/SYSRET is more commonly used due to efficiency reasons.
INT X
INT is an assembly language instruction for x86 processors that generates a software interrupt. It takes the interrupt number formatted as a byte value. When written in assembly language, the instruction is written like this:
INT X
where X is the software interrupt that should be generated (0 255). As is customary with machine binary arithmetic, interrupt numbers are often written in hexadecimal form, which can be indicated with a prefix 0x or with the suffix h. For example, INT 13H will generate the 20th software interrupt (0x13 is nineteen (19) in hexadecimal notation, and the count starts at 0), causing the function pointed to by the 20th vector in the interrupt table to be executed. INT is widely used in real mode. In protected mode, INT is still available but SYSENTER/SYSEXIT or SYSCALL/SYSRET is more commonly used due to efficiency reasons.
мұнда X – жасалуы тиіс бағдарламалық үзіліс нөмірі (0–255). Машиналық бинарлық арифметикадағы қалыпты жағдай бойынша, үзіліс нөмірлері көбінесе он алтылық (hexadecimal) түрде жазылады, оны 0x префиксімен немесе h суффиксімен көрсетуге болады. Мысалы, INT 13H 20-шы бағдарламалық үзілісті (0x13 он алтылық жүйеде он тоғызға (19) тең, ал санау 0-дан басталады) тудырады, нәтижесінде үзіліс кестесіндегі 20-шы вектор көрсеткен функция орындалады. INT нақты режимде кеңінен қолданылады. Қорғалған режимде INT әлі де қолжетімді, бірақ тиімділік тұрғысынан SYSENTER/SYSEXIT немесе SYSCALL/SYSRET жиірек қолданылады.
INT is an assembly language instruction for x86 processors that generates a software interrupt. It takes the interrupt number formatted as a byte value. When written in assembly language, the instruction is written like this:
INT X
where X is the software interrupt that should be generated (0 255). As is customary with machine binary arithmetic, interrupt numbers are often written in hexadecimal form, which can be indicated with a prefix 0x or with the suffix h. For example, INT 13H will generate the 20th software interrupt (0x13 is nineteen (19) in hexadecimal notation, and the count starts at 0), causing the function pointed to by the 20th vector in the interrupt table to be executed. INT is widely used in real mode. In protected mode, INT is still available but SYSENTER/SYSEXIT or SYSCALL/SYSRET is more commonly used due to efficiency reasons.
Нақты режим
Бағдарламалық үзіліс жасалғанда процессор үзіліс адресі кестесінде көрсетілген 256 функцияның біреуін шақырады, бұл кесте нақты режимде жадтың алғашқы 1024 байтында орналасқан (Үзіліс векторына қараңыз). Сондықтан, флаг регистрін жиып алғаннан кейін үзіліс функциясын қолмен іске қосу үшін алыс шақыру командасын қолдану толыққандай мүмкін. DOS жүйесіндегі пайдалы бағдарламалық үзіліске 0x21 үзілісі мысал бола алады. Регистрлердегі әртүрлі параметрлермен (көбінесе ah және al) шақыру арқылы түрлі IO операцияларын, жол шығару және тағы да басқаларға қол жеткізуге болады. Көптеген Unix жүйелері мен олардан туындағандары бағдарламалық үзілістерді қолданбайды, бірақ 0x80 үзілісі – жүйелік шақырулар жасау үшін қолданылатын ерекше жағдай. Бұл процессордың EAX регистріне ядролық функцияға сәйкес 32 биттік мәнді енгізу арқылы және содан кейін INT 0x80 командасын орындау арқылы іске асырылады.
INT3
INT3 нұсқауы – кодты тоқтату нүктесін орнату үшін жөндеушілерге орындалып жатқан бағдарламадағы нұсқауды уақытша ауыстыруға арналған бір байттық нұсқау. Көбінесе INT XXh нұсқаулары екі байтпен кодталады. Бұл оларды нұсқауларды түзетуде қолдануға қолайсыз етеді (олар бір байттық болуы мүмкін); SIGTRAP қараңыз. INT3 опкоды 0xCC, ал INT immediate8 опкоды 0xCD immediate8 болып табылады. INT3 үшін арнайы 0xCC опкодының, жалпы екі байттық INT3 опкодында жоқ, жөндеу үшін қажетті артықша қасиеттері бар, сондықтан құрастырушылар әдетте мнемоникадан 0xCD 0x03 опкодын жасамайды.
INTO
INTO нұсқауы бір байттық нұсқау. Бұл шартты түрде орындалатын үзіліс, ол осы опкод орындалған кезде ағындылық туы қойылғанда іске қосылады. Бұл автоматты түрде 4-нөмірлі үзіліске шақыруды білдіреді. INTO опкоды 0xCE, бірақ ол x86 64 біт режимінде қолжетімді емес.