The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: sefaen on December 27, 2008, 08:55:36 AM

Title: Values not showing up in registers
Post by: 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?

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!
Title: Re: Values not showing up in registers
Post by: Sevag.K on December 27, 2008, 11:49:15 PM
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.
Title: Re: Values not showing up in registers
Post by: sefaen on December 28, 2008, 03:32:56 AM
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.