Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with the MOV instruction 1

Status
Not open for further replies.

vonnegut

Programmer
Jul 15, 2004
11
US
Can somebody make me understand the statement:

MOV [C23H], EDX

Here DS = E50H, ES = 1210H, SI = 50H, BX = F3H, and CX = 9800H.
I have to determine the address accessed by the above instruction assuming real-mode operation.

I need some conceptual help here,what is real-mode instruction and how do I find the address?
 
Vonnegut.
What you have is an indirect addressing situation. control does not go to C23H It goes to the address that is held in the location C23h and controll is sent to the address saved in C23H, Not address C23H. The notation [C23H] is an indirect Addressing Notation.
 
Thanks a lot for your reply. But I was confused as to what EDX was. How do I find out the value of EDX?
 
dosseg
.model small
.stack 100h

.data

.code
main proc
mov ax,@data
mov ds,ax

mov ah,9
mov dx, edx
int 21h

mov ax,4C00h
int 21h
main endp
end main

This will print the value of edx on the screen for you
 
I really appreciate your reply but as a newbie to assembly I would very much like it if you run me down your code.

thanks a lot
 
What you really need to do is get a good book on assembly that contains the DOS interrupts. Once you have the book, breaking down that code is a piece of cake.
 
Do you have any suggestions as to which book I should follow to decipher that piece of code ?
 
oh oh oh,

(1) At least in tasm, the instruction "mov [C23h], edx" moves the contents of the edx register into the 4 bytes that start at ds + 0C23h. Get a good tasm/masm textbook and turn to the back where the 8086 familly instruction set is writen out. You can down-load it also. (you ask for a recommendation: I'd just try the local library and see what they've got.)

(2) You cannot do instructions like mov dx, edx. It makes no sense at all. dx is the 16-bit bottom half of edx, which is the full 32-bit register (and to avoid confusion, yes, you can refer to edx in real mode, 16-bit code).

(3) DOS interrupts output the ascii code, not the number, so if you get DOS to output "0" it won't output the character "0". "32" will be output as a space, etc. etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top