dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Emulating General Purpose Registers

  1. #1
    Join Date
    Jul 2011
    Posts
    6

    Emulating General Purpose Registers

    I am creating a sort of 'virtual machine' which emulates a Pentium-class CPU. As such, I have 4 32-bit registers setup: EAX, EBX, ECX, EDX. Each of these has smaller 16-bit registers: AX, BX, CX, DX. Each 16-bit register has two 8-bit registers in them: AH and AL, BH and BL, and so on. My current method consists of simply calling variables to represent each register and their sub-registers.

    I would like to emulate each of these registers without calling so many variables with the goal of creating a faster program. Is it possible to 'split' a 32-bit variable, so that 16-bits of it and 8 further bits of it could be referenced and used, while retaining the ability to call the full 32-bits? The attachment I posted should explain this better.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)