JQ> I consider myself to be fairly experienced assembly programmer,
JQ>however there is a simple task in which I've tried and failed numerous
JQ>times over. That task is moving data into a specific address. If somebody
JQ>could help me I would deeply apreciate it, as it has given me headaches
or
JQ>days. Would code like this work (to place the value 1h into memory at
JQ>0000:0000)?
JQ> mov ax,01h
JQ> mov [00000],ax
JQ>or maybe something like this?
JQ> mov ax,01h
JQ> xchg [00000],ax
First, I wouldn't recommend trying to write to 0000:0000, since on some
computers (mine included), even under real mode, this will reboot the
computer. However, if you want to get an exact address, you have to load a
segment register. Here's an example for writing to A000:0000 (which in real
mode maps to A0000):
mov ax, 0a000h
mov es, ax
xor ax, ax
mov es:[0], ax
You can use other segment registers, but I'd recommend against using SS since
it takes care of the stack for interrupts and function calls. If you want to
use DS, it's usually a good idea to preserve it on the stack. ES, FS, and GS
rarely need to be preserved, especially in real mode.
((Cloud))
MauveCloud@juno.com
* OLX 2.2 * I'm in shape ... round's a shape isn't it?
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|