flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 20 Jan 2010, 21:27
muitnep, I didn't look at that source but are you sure your code is a proper fix? If MOV is the real fix then the code could be just this:
Code: hdapl1: add ecx, ecx ; add ebx,16 mov eax, [ebx+ecx*8] ; mov eax, [ebx} ; old : add eax,[ebx] xor ecx, ecx ; <- If really needed; loop hdapl1 Well, it is almost equivalent, LOOP here would have iterated 2^32 times when ECX is zero but I believe some code above was guarding against that possibility or it is impossible to have ECX=0 in the first place. |
|||
![]() |
|
muitnep 21 Jan 2010, 10:34
OK... a proper fix? maybe.. (it works now and didnt before,so yes? could be better code,thats true..
here some more code : Code: .... mov ecx,[fat32part] mov eax,0 mov,ebx,buffer+0x1be + 8 - 16 ; in buffer is the MBR and every partion is descrbed with 16 byte hdapl1: add ebx,16 mov eax,[ebx] loop hdapl1 mov [PARTION_START],eax .... so ecx is 0 if you use your first partion, and i am not sure what you say abbout the 2^32 iteration thing... anyway, i will have a look at ethernet.inc to see how pci scanning works. found out that my SIS900 card (linux says (rev. 6 ![]() |
|||
![]() |
|
LocoDelAssembly 21 Jan 2010, 16:42
AMD's description of LOOP wrote: Decrements the count register (rCX) by 1, then, if rCX is not 0 and the ZF flag meets For that reason, if ECX is zero then the code will iterate 2^32, i.e. 4294967296 times. If no page-fault/GP-fault occurs in the middle you'll actually get partition 0 due to the modular arithmetic thing but after some seconds due to the very long iteration count. If partitions are really zero-based you should use my code and if not then use "mov eax, [ebx+ecx*8-16]" After looking here I see this: Quote: 08h DWORD sectors preceding partition If that field counts from the beginning of the disk rather than from the previous partition then OK, you have to use MOV and you can remove the LOOP because it is useless, otherwise the ADD is required or the calculation is just not that simple. The code can be this: Code: mov ecx, [fat32part] ; I'll assume 1..4 range as it is typical to start from 1 on this. hdapl1: ; <- Not really required add ecx, ecx ; Pre-multiply by 2 since addresses index can't be scaled by 16 mov eax, dword [ebx + buffer + 0x1be + ecx*8 - 16 + 8] ; fasm will compile something of the form mov eax, [ebx+ecx*8+number] here mov [PARTITION_START], eax |
|||
![]() |
|
muitnep 22 Jan 2010, 07:27
ah, i see... partion count goes from 1 to 4, sorry.
but in my case "that field" counts from the beginning of the disk but not sure if its always like this... and or if its usefull to try both ?(think so) my disk is formated this year with some kind of debian install cd... by the way, anybody knows where to find ac97player sources for 32bitMos? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.