вот писал с другом прогу, которая бы определяла характеристики сканера... но не можем понять где мы допустили ошибки, в листинге вообще пишет ошибку на "yellow" мол неизвестная команда... и таких много
Кто знает, а чем дело? Спасибо.
;===========Код
ideal
p386
locals
model medium
framelistbaseaddr equ 200000h
include "list1_03.inc"
include "list1_04.inc"
dataseg
txt0 db lightcyan,0,26
db "usb", 0
txt1 db 2,27, 0
db 4,10, 0
db 5,8, 0
db 6,8, 0
db 9,24, 0
db 11,23, 0
db 12,21, 0
db 13,7, 0
db 14,27, 0
db 15,11, 0
db 16,14, 0
db 17,13, 0
db 18,13, 0
db 20,0, 0
db 22,0, 0
full db lightcyan,22,16, 0
lows db lightmagenta,22,16, 0
txt2 db 2,23, 0
db 4,14, 0
db 5,18, 0
db 6,9,"usb:",0
db 7,17, 0
db 8,14, 0
db 9,14, 0
db 10,1, 0
db 11,22, 0
db 12,27, 0
db 13,10, 0
txt3 db 2,23, 0
db 4,14, 0
db 5,18, 0
db 6,14, 0
db 7,16, 0
db 8,15, 0
db 9,11, 0
db 10,13, 0
anyk db yellow,24,29, 0
"get device descriptor"
getdevdesc db 80h,6
dw 100h,0,8
"set address"
setaddrdesc db 0,5
dw 1,0,0
"get configuration descriptor"
getconfdesc db 80h,6
dw 200h,0,8
ends
Segment usb_descr para public 'data'
qh_descriptor dd 00000003h
dd 00000000h
dd 0,0,0,0,0,0
td_array dd 8*64 dup(?)
ends
segment sseg para stack 'stack'
db 400h dup(?)
ends
codeseg
proc usb_device_search
mov ax,dgroup
mov ds,ax
mov [cs:maindataseg],ax
mov ax,3
int 10h
mov [sreenstring],25
mov [screencolumn],0
call setcursorposition
; PCI BIOS
mov ax,0b101h
int 1ah
jc @@pcibiosnotfound
cmp edx,20494350h
jne @@pcibiosnotfound
call initialization
call initializedeascriptors
mov [usb_hostindex],0
@@nexthost:
call findusbcontroller
cmp [searchresult],0
jne @@nohost
mov dx,[usb_baseaddr]
mov ax,100b
out dx,ax
call wait05s
mov ax,0
out dx,ax
call wait05s
mov [usb_portnum],1
mov dx,[usb_baseaddr]
mov dx,10h
in ax,dx
test ax,000fh
jnz @@saveportreg
mov [usb_portnum],2
add dx,2
in ax,dx
test ax,000fh
jz @@nexthost
@@saveportreg:
mov [usb_portreg],dx
mov dx,[usb_baseaddr]
add dx,6
mov ax,0
out dx,ax
add dx,2
mov eax,framelistbaseaddr
out dx,eax
call clearscreen
mshowcolorstring txt0
mov [textcolorandbackground],lightgreen
mshowtext 15,txt1
mov [textcolorandbackground],lightgrey
mshowdecbyte 4,40,<[byte ptr usb_hostindex]>
mshowhexword 5,40,[usb_baseaddr]
mshowhexbyte 6,40,[usb_intline]
mov dx,[usb_baseaddr]
in ax,dx
mshowhexword 11,40,ax
add dx,2
in ax,dx
mshowhexword 12,40,ax
add dx,2
in ax,dx
mshowhexword 13,40,ax
add dx,2
in ax,dx
mshowhexword 14,40,ax
add dx,2
in eax,dx
mshowhexdword 15,40,eax
add dx,4
in al,dx
mshowhexbyte 16,40,al
mov dx,[usb_baseaddr]
mov dx,10h
in ax,dx
mshowhexword 17,40,ax
add dx,2
in ax,dx
mshowhexword 18,40,ax
mshowdecbyte 20,32,[usb_portnum]
mov dx,[usb_portreg]
in ax,dx
test ax,100000000b
jnz @@low
mov [dword ptr shdevtype],0
mshowcolorstring full
jmp short @@ waitanykey
@@low: mov [dword ptr shdevtype],4000000h
mshowcolorstring lows
@@waitanykey:
mshowcolorstring anyk
call getchar
mov dx,[usb_baseaddr]
mov ax,1
out dx,ax
mov [usb_device_number],0
call enumeration
mov si,offset getdevdesc
call statusin_transaction
call clearscreen
mshowcolorstring txt0
mov [textcolorandbackground],lightgreen
mshowtext 11,txt2
mov [textcolorandbackground],lightgrey
mshowdecbyte 4,40,[databuffer]
mshowhexbyte 5,40,<[databuffer+1]>
mshowhexword 6,40,<[word ptr databuffer+2]>
mshowhexbyte 7,40,<databuffer+4]>
mshowhexbyte 8,40,<[databuffer+5]>
mshowhexbyte 9,40,<[databuffer+6]>
mshowdecbyte 10,40,<[databuffer+7]>
mshowhexword 11,40,<[word ptr databuffer+8]>
mshowhexword 12,40,<[word ptr databuffer+10>
mshowdecbyte 13,40,<[databuffer+17]>
mshowcolorstring anyk
call getchar
call getconfigurationdescriptor
call clearscreen
mshowcolorstring txt0
mov [textcolorandbackground],lightgreen
mshowtext 8,txt3
mov [textcolorandbackground],lightgrey
mshowdecbyte 4,40,[databuffer]
mshowhexbyte 5,40,<[databuffer+1]>
showdecword 6,40,<[word ptr databuffer+2]>
mshowdecbyte 7,40,<[databuffer+4]>
mshowhexbyte 8,40,<[databuffer+5]>
mshowbinbyte 9,40,<[databuffer+7]>
xor ax,ax
mov al,[databuffer+8]
shl ax,2
mshowdecword 10,40,ax
mshowcolorstring anyk
call getchar
mov dx,[usb_baseaddr]
mov ax,0
out dx,ax
mov ax,3
int 10h
mov ah,4ch
int 21h
@@PCIBIOSnotfound:
fatalerror nopci
@@nohost:
cmp [usb_hostindex],0
je @@hostnotfound
@@devicenotfound:
mfatalerror nodev
@@hostnotfound:
mfatalerror nousb
endp usb_device_search
ends
include "list1_02.inc"
include "list2_01.inc"
include "list2_05.inc"
include "list8_01.inc"
end