Chinaunix首页 | 论坛 | 博客
  • 博客访问: 408086
  • 博文数量: 121
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1393
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-11 12:17
个人简介

www.vibexie.com vibexie@qq.com

文章分类

全部博文(121)

文章存档

2015年(55)

2014年(66)

我的朋友

分类: C/C++

2014-03-24 21:05:37


点击(此处)折叠或打开

  1. #include<stdio.h>
  2. typedef unsigned char BYTE;
  3. typedef unsigned short WORD;

  4. int main()
  5. {
  6.     union
  7.     {
  8.         struct
  9.         {
  10.             WORD ax,bx,cx,dx;
  11.         }word;
  12.         struct
  13.         {
  14.             BYTE al,ah,bl,bh,cl,ch,dl,dh;
  15.         }byte;
  16.     }regs;

  17.     regs.byte.ah=0x12;
  18.     regs.byte.al=0x34;

  19.     printf("0x%hx\n",regs.word.ax);

  20.     return 0;
  21. }

阅读(1728) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~