* Run once to create .bin file lcBinFile = chr(180)+chr(43)+chr(139)+chr(15)+chr(138)+; chr(119)+chr(2)+chr(138)+chr(87)+chr(3)+chr(205)+chr(33)+chr(203) handle=fcreate("setdate.bin") =fwrite(handle,lcBinFile,13) =fclose(handle) * Run once to create .bin file * Creates this *!* mov ah,2b // Set date subfunction *!* mov cx,[bx] // Year *!* mov dh,[bx+02] // Month *!* mov dl,[bx+03] // Day *!* int 21 // Call dos int *!* retf * Creates this function mySetDate parameters lnYear, lnMonth, lnDay load setdate.bin lnYearLowByte = lnYear % 256 lnYearHighByte = int(lnYear / 256) lcDate=CHR(lnYearLowByte)+CHR(lnYearHighByte)+CHR(lnMonth)+CHR(lnDay) call setdate.bin with lcDateAnd another one reading diskette A physical sectors :
set talk off clear set memowidth to 512 load CETIN.bin =psector(12,0,18) && Track12, Head0, Sector18 =psector(0,0,1) && Boot sector function psector parameters track,head,sector MP=CHR(SECTOR)+CHR(TRACK)+CHR(0)+CHR(HEAD)+space(508) call CETIN.bin with mp ? "Track : "+str(TRACK,2) ?? "Head : "+str(HEAD,2) ?? "Sector : "+str(SECTOR,2) ? "-----------------------------------------" ? mp ? "=========================================="ASM code (pls discard the way code is written. I'm no good in writing ASM) :
;Cetin.bin .MODEL LARGE .CODE Org 0h ana: PUSH DS POP ES mov ah,00h mov cx,ds:[bx] mov dx,ds:[bx+2] int 13h mov ax,0201h int 13h cmp ax,0h jz success mov ax,0201h int 13h cmp ax,0h jz success mov ax,0201h int 13h success: retf end anaCetin