News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Values not showing up in registers

Started by sefaen, December 27, 2008, 08:55:36 AM

Previous topic - Next topic

sefaen

I tried writing a simple program that set the value of the ax register to 0001.

When I run debug -r, it AX shows 0000.

I assume this is normal, but I remember a tutorial where that register still contained 1 after the program ended.

How do I get the registers to stay a certain value?

Perhaps it's in my best interest that those registers not contain that value after the program finishes (?).

I'm primarily learning assembly to start working on opensource emulators and I think it's important that I know as much about this as possible.

I was also curious about the 64-bit registers available RAX, RBX, RCX, RDX, RSI, RDI, RSP, and RBP.

I read on the HLA homepage(?) that v2.0 may have 64-bit support.

I'm hoping this is true, because I want to be able to modify an emulator to take advantage of the 64-bit registers.

Hopefully general talk about CPU emulation is acceptable to some degree here. If not feel free to edit it out of my post, or delete it.

Thanks!

Sevag.K

Quote from: sefaen on December 27, 2008, 08:55:36 AM
I tried writing a simple program that set the value of the ax register to 0001.

When I run debug -r, it AX shows 0000.

I assume this is normal, but I remember a tutorial where that register still contained 1 after the program ended.

How do I get the registers to stay a certain value?[\quote]

It is possible that another function is changing the value of EAX/AX/Al

Quote
Perhaps it's in my best interest that those registers not contain that value after the program finishes (?).

The OS takes care of this.

Quote
I'm primarily learning assembly to start working on opensource emulators and I think it's important that I know as much about this as possible.

I was also curious about the 64-bit registers available RAX, RBX, RCX, RDX, RSI, RDI, RSP, and RBP.

I read on the HLA homepage(?) that v2.0 may have 64-bit support.

I'm hoping this is true, because I want to be able to modify an emulator to take advantage of the 64-bit registers.

Hopefully general talk about CPU emulation is acceptable to some degree here. If not feel free to edit it out of my post, or delete it.

Thanks!

Emulation is not out of topic here, in fact there was someone on this forum who started an emulator.  Another person who occasionally posts at the aoaprogramming yahoo group has a functional emulator of an older chip written in HLA.

As for 64 bits, HLA might not be your best choice at this time.  Version 2 may contain 64 bit support, but it's a long way from being complete.

sefaen

Thanks for the quick reply. This clears things up for me.

I think I'll stick with HLA even without 64-bit support, as it seems to be a great place to start.