浏览代码

fix(docs): use the new version of the `asm!` syntax

Previous version of the `asm!` macro is renamed to `llvm_asm!`. It will
not be stable.
toku-sa-n 4 年之前
父节点
当前提交
1ff7a1f9fd
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/lib.rs

+ 4 - 2
src/lib.rs

@@ -11,14 +11,16 @@
 //! # Examples
 //!
 //! ```ignore
+//! #![feature(asm)]
+//! 
 //! use multiboot2::load;
 //!
 //! // The Multiboot 2 specification dictates that the machine state after the
 //! // bootloader finishes its job will be that the boot information struct pointer
 //! // is stored in the `EBX` register.
 //! let multiboot_info_ptr: u32;
-//! unsafe { asm!("mov $2, %ebx" : "=r"(multiboot_info_ptr)) };
-//! let boot_info = unsafe { load(multiboot_info_ptr) };
+//! unsafe { asm!("mov {}, ebx", out(reg) multiboot_info_ptr) };
+//! let boot_info = unsafe { load(multiboot_info_ptr as usize) };
 //! ```
 
 use core::fmt;