Use of hex value 0x78 when copying data from one location to another

Viewed 43

Why are we using hex value 0x78 in below given code in the instruction mov bx,0x78. A very little code is given below:

cli
xor ax,ax
mov ss,ax
mov sp,0x7c00
push ss
pop es
mov bx,0x78  (why we are using 
          hex value 0x78 here)
lds si,ss:bx
push ds
push si
push ss
push bx
mov di,0x7c2b
mov cx,0xb
cld

more code here....

Sorry for inconvenience, I have one more problem as mentioned below:

I am working through a very old msdos 1.25 source code and I found an awkward instruction where "$" sign is used as given below. What is $ sign in mov sp,$0x7c00 ?

I want to know what is the difference between the following two instructions:

1. mov sp,$0x7c00
2. mov sp,0x7c00
1 Answers

The mov bx,0x78 instruction loads an offset address in the BX register. Because the associated segment register (in casu SS) holds zero, the datum that we will address is in the Interrupt Vector Table. It's the Int 1E Disk-initialization parameter table.

The lds si,ss:bx (better written as lds si, [ss:bx]) loads the SI register with the offset word found at SS:BX and loads the DS register with the segment word found at SS:BX+2.

Further code will then be copying the 11-byte table to a buffer within the bootloader.


I want to know what is the difference between the following two instructions:

1. mov sp,$0x7c00
2. mov sp,0x7c00

I have never seen the $ character used this way. My guess is that there's probably no difference at all.

Related