就是继续向下运行语句。纯粹的通过“反复运行没啥意义的机器指令”短暂延时一下而已 "1:"::"a" (value),"d" (port)) //outb_p 和outb 差别在于前者有短暂延时。后者没有 #define inb_p(port) ({ \ unsigned char _v; \ __asm__ volatile ("inb %%dx,%%al\n" \ "\tjmp 1f\n" \ "1:\...
#defineoutb(value,port)\__asm__("outb %%al,%%dx"::"a"(value),"d"(port))//宏定义outb用汇编实现了在端口地址port处写入值value//使用的寄存器是al,一个byte长度,而端口port使用的是2byte长度地址来标记的寄存器,注意这里寄存器的使用#defineinb(port)({\unsignedchar_v;\__asm__volatile("inb %...
{ \ asm volatile("rep; outs" #bwl \ : "+S"(addr), "+c"(count) : "d"(port)); \ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ { \ asm volatile("rep; ins" #bwl \ : "+D"(addr), "+c"(count) : "d"(port)); \ } BUILDIO(b,...
boot.asm 1obj/boot/boot.out: file format elf32-i386234Disassembly of section .text:5600007c00<start>:7.set CR0_PE_ON, 0x1 # protected mode enable flag89.globl start10start:11.code16 # Assemble for16-bit mode12cli# Disable interrupts137c00:facli14cld# String operations increment157c01:...
#define OUTB(port, val) __GCC_OUT(b, b, port, val) #define OUTW(port, val) __GCC_OUT(w, w, port, val) #define OUT32(port, val) __GCC_OUT(l, , port, val) #define GET_CURRENT_EIP(_eip) __asm__ __volatile("call 0ntpopl %0" : "=r" (_eip): ); ...
индексыдля Basic и Extended CPUID информации ulong vendor[3]; // Имяпроизводителя __asm__ volatile("movl $0x0, %%eax\n" "cpuid" :"=a"(maxeax), "=b"(vendor[0]), "=c"(vendor[2]), "=d"(vendor[1]):); __asm__ volatile ("...