question about mov

Anything related to Keen Modding.
Post Reply
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

question about mov

Post by lemm »

How do I get the opcodes for:

mov ax, cs:[35FBh]

and

mov cs:[35FBh], ax


I am writing a patch and I want to manipulate the word at 35FB.

Could I Push DS and then load CS into DS?
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

I don't know enough to be of service here. But if you study a disassembly of a Keen executable, you're bound to find some examples of it.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

Got my question answered.

Prefixing mov with $2E means use CS (instead of DS, in this case)
However, this only works for one instruction, so I will just pop/push because I want to use the CS multiple times.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Do post the code when you've got it figured. Would be useful to have here for future reference.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

YES!!!

Just finished the jetpack patch... posting shortly.
Post Reply