3 Copyright 1992 Werner Almesberger */
6 Licensed under the terms contained in the file 'COPYING' in the
16 _main: mov bl,0x80 ! NUL-terminate the command line
20 aloop: mov al,(bx) ! get the next character
23 je aloop ! yes -> skip it
25 jne error ! no -> invalid
26 cmpb (bx),#120 ! 'x' ?
29 jne error ! no -> invalid
30 okay: cmpb 1(bx),#56 ! '8' ?
31 jne error ! no -> invalid
32 cmpb 3(bx),#0 ! one more digit ?
33 jne error ! no -> invalid
34 mov dl,2(bx) ! get the digit
35 sub dl,#48 ! convert to a number
37 ja error ! no -> error
38 add dl,#0x80 ! adjust the number
39 mov ah,#8 ! get the drive parameters
42 jnz derror ! yes -> display a message
43 push cx ! save the parameters
45 mov al,cl ! number of sectors
50 pop dx ! number of heads
56 pop ax ! number of cylinders
67 error: mov dx,#errmsg ! display the error message
70 derror: mov dx,#invdrv ! display the error message
73 space: mov dx,#spc ! display two blanks
76 decout: mov bx,#decend ! set the pointer to the end
77 declp: xor dx,dx ! divide by 10
80 add dl,#48 ! make a digit
84 jnz declp ! no -> go on
85 mov dx,bx ! display the string
90 errmsg: .ascii "usage: dparam 0x80"
92 .ascii " or dparam 0x81"
96 invdrv: .ascii "Invalid drive"
102 decbuf: .byte 0,0,0,0,0