Author Topic: How to compile this sample inline assebly code  (Read 1198 times)

vroy

  • Newbie
  • *
  • Posts: 1
  • Karma: +10/-0
    • View Profile
    • Email
How to compile this sample inline assebly code
« on: September 21, 2006, 01:48:12 AM »
#include
#define NUM_LOGICAL_BITS 0x00FF0000

int main(void)
{
    unsigned int reg_ebx = 0, reg;
        __asm
       {
            mov eax, 1
            cpuid
            mov reg_ebx, ebx
        }
        reg = ((reg_ebx & NUM_LOGICAL_BITS) >> 16);
        printf ("reg =%d\\n", reg);
        return 1;
}

dynaweb

  • <b>Canine Deamon</b>
  • Administrator
  • Sr. Member
  • *****
  • Posts: 483
  • Karma: +10/-0
  • Generic personal text here ...
    • MSN Messenger - danno_d_manno@yahoo.com
    • View Profile
    • DynaWeb Designs
    • Email
How to compile this sample inline assebly code
« Reply #1 on: September 24, 2006, 08:30:57 PM »
Those who cannot learn from history are doomed to repeat it. -- Linux learns.

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1449 Views
Last post April 01, 2007, 07:18:11 PM
by ctwjr

members