gut das war schonmal einiges.
jetzt zu den fehlern die nasm noch meldet:
LPT_ini.asm:38: error: invalid combination of opcode and operands
LPT_ini.asm:39: error: invalid combination of opcode and operands
LPT_ini.asm:40: error: invalid combination of opcode and operands
der code:
mov word LPT_data_register, 378h
mov word LPT_status_register, 379h
mov word LPT_steuer_register, 37Ah
LPT_ini.asm:45: warning: unsigned byte value exceeds bounds
der code:
in al,379h
und die fehler wiederholen sich dann bei den anderen lpt ports....
hier nochma der ganze source:
mov dx,378h
mov ax,0xAA
out dx,al
in ax,dx
cmp ax,0xAA
je LPT1_vorhanden
LPT1_nicht_vorhanden:
mov dx,278h
mov al,0xAA
out dx,al
in al,dx
cmp al,0xAA
je LPT2_vorhanden
LPT2_nicht_vorhanden:
mov dx,3BCh
mov al,0xAA
out dx,al
in al,dx
cmp al,0xAA
je LPT3_vorhanden
LPT3_nicht_vorhanden:
mov si,no_LPT
mov al,0x01
int 0x21
jmp LPT_ini_end
LPT1_vorhanden:
mov word LPT_data_register, 378h
mov word LPT_status_register, 379h
mov word LPT_steuer_register, 37Ah
mov si,LPT1_present
mov al,0x01
int 0x21
in al,379h
test ax,00010000b
jnz LPT_offline
test ax, 00100000b
jz LPT_no_Paper
test ax, 00001000b
jz LPT_error
jmp LPT_ini_end
LPT2_vorhanden:
mov word LPT_data_register, 278h
mov word LPT_status_register, 279h
mov word LPT_steuer_register, 27Ah
mov si, LPT2_present
mov al, 0x01
int 0x21
in al, 279h
test al, 00010000b
jnz LPT_offline
test al, 00100000b
jz LPT_no_Paper
test al, 00001000b
jz LPT_error
jmp LPT_ini_end
LPT3_vorhanden:
mov LPT_data_register, 3BCh
mov LPT_status_register, 3BDh
mov LPT_steuer_register, 3BEh
mov si, LPT1_present
mov al, 0x01
int 0x21
in al, 3BDh
test al, 00010000b
jnz LPT_offline
test al, 00100000b
jz LPT_no_Paper
test al, 00001000b
jz LPT_error
jmp LPT_ini_end
LPT_offline:
mov si, LPT_offline_msg
mov al, 0x01
int 0x21
jmp LPT_ini_end
LPT_no_Paper:
mov si, LPT_no_Paper_msg
mov al, 0x01
int 0x21
jmp LPT_ini_end
LPT_error:
mov si, LPT_error_msg
mov al, 0x01
int 0x21
LPT_ini_end:
mov si, LPT_ini_ready
mov al, 0x01
int 0x21
looping:
jmp looping
LPT_ini_ready db "LPT initialisiert",13,10,0
LPT_error_msg db "Error initalising LPT",13,10,0
LPT_no_Paper_msg db "Please refill paper in your LPT",13,10,0
LPT_offline_msg db "LPT offline",13,10,0
LPT1_present db "LPT1 present",13,10,0
LPT_data_register dw 378h
LPT_status_register dw 379h
LPT_steuer_register dw 37Ah
LPT2_present db "LPT2 present",13,10,0
no_LPT db "No LPT found",13,10,0