avva: (Default)
[personal profile] avva

Пишу на ассемблере! Просто чуть ли не "бойцы вспоминают минувшие дни".


       .text
.globl readcounter
readcounter:
        pushl   %ebx
        pushl   %ecx
        subl    %eax, %eax
        cpuid
        rdtsc
        pushl   %eax
        pushl   %edx
        subl    %eax, %eax
        cpuid
        popl    %edx
        popl    %eax
        popl    %ecx
        popl    %ebx
        ret
        .size   readcounter, .-counter

Мне вот интересно,

Date: 2007-02-13 05:22 pm (UTC)
From: (Anonymous)
а вот 64-разрядные регистры как сейчас называются? Особенно как выглядит программа для интелей (пусть и дуо).

Date: 2007-02-13 05:30 pm (UTC)
From: [identity profile] avva.livejournal.com
rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, and r15.

В общем, как обычно выглядит. eax это нижняя половина rax итд.
Основные инструкции те же.

February 2026

S M T W T F S
1 2 3 4 5 67
8 9 10111213 14
15 16 17 18192021
2223 24 25262728

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 25th, 2026 03:58 pm
Powered by Dreamwidth Studios