0

Help me please, i don't understand this code:

...
BUFFER = 0x0600
...
rep movs jmpf BUFFER+migrate, 0 ;???
migrate:
findactive:
testb dl,dl ; ???
jns nextdisk
starblue
  • 55,348
  • 14
  • 97
  • 151
Glebka
  • 1,420
  • 3
  • 20
  • 37

2 Answers2

1

I'm an old x86 coder. I have to admit I don't understand your code either. The "movs" instruction line looks illegal. Are you sure you've transcribed the code correctly?

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
  • this code may be AVC(or AVK) - assembler for minix os. translate testb to test, jmpf to jmp, and movs to mov. And help me understend this code plz. – Glebka May 30 '10 at 18:20
  • movs ins't the same as mov, if they are using the intel mnemonics. If his isn't microsoft syntax, then my best guess is: [rep movs] means "repeat movs for ECX count" (see Intel instrution set manual). [jmpf BUFFER+migrate] means go to the label migrate + 0x600; that location isn't listed in your code and this is a pretty strange thing to say. [migrate:] and [findactive:] are code labels on the testb instruction. [testb dl,dl] means check to see if the [dl] register is signed/zero, and [jns nextdisk] branches if the [dl] register top bit was set. – Ira Baxter May 31 '10 at 00:19
  • 1
    .... somehow I doubt this analysis will help you. I think you've left a lot of critical code out of this example. And what do you mean *may* be AVC/AVK? Either you know what it is, or you don't. If you don't know which assembler it is, you'll never quite be sure you've understood what it says. – Ira Baxter May 31 '10 at 00:21
  • thanks for the help. I forgot the name: ACK(http://en.wikipedia.org/wiki/Amsterdam_Compiler_Kit) – Glebka May 31 '10 at 06:01
1

This is a part of the code from MasterBootRecord. After coping a sector from bootdrive to memory address 7C00h for IBM PC, need copy this code to new address(usualy on 0600h, first free memory), using "rep movs", and then continue safe execution but from new allocation "jmpf BUFFER+migrate,0"(jmpf offset, segment). Someone forgot push "Enter" after "rep movs".