I have this code at the beginning:
Code: Select all
begin:
mov sp,stackstart
push cs; THANKS TROY!
pop ds
push cs
pop es ;done setting segments
mov BYTE[drive],dl ; store the boot drive
;;;;;;;;;;;;;;;Load next 3 Sectors To complete stage1;;;;;;;;;;;;;;;;;;
mov ah,0x08
mov dl,BYTE [drive]
int 0x13 ; get drive parameters
jc FAIL ;did this faiL?
;else store info for LBA TO CHS
After that is this section of code:
Code: Select all
mov BYTE [HPC], dh ;//store heads per cylinder
mov ax,0 ;; start counter for all the bits
testandset: ; tests and sets all the sector bits in cl
bt cx,ax ; test bit
jc set ; is the bit set? if yes set it in SPT
inc ax ; if no go to next bit and test set
cmp ax,6
je continue ;if we are finished, continue with the rest of the code
jmp testandset
set:
bts WORD [SPT],ax
inc ax
cmp ax,6
je continue ;if done setting, continue
jmp testandset ;we are not done
EDIT:
I tried using test, it doesn't change anything.
EDIT2:
I bet I'll be facepalming soon.