12
« am: 20. November 2006, 14:27 »
mhh... geht net.. aber sagt mal was ich falsch mache ich meine nicht inhaltliche fehler sondern am coden... und das loop am ende is nur testweie..
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 al,378h
mov si,LPT1_present
mov al,0x01
int 0x21
in al,379h
test al,00010000b
jnz LPT_offline
test al, 00100000b
jz LPT_no_Paper
test al, 00001000b
jz LPT_error
jmp LPT_ini_end
LPT2_vorhanden:
mov LPT_data_register, 278h
mov LPT_status_register, 279h
mov 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 db 378h
LPT_status_register db 379h
LPT_steuer_register db 37Ah
LPT2_present db "LPT2 present",13,10,0
no_LPT db "No LPT found",13,10,0