Posted: Wed Jan 08, 2003 11:39 pm
Restored from previous forum. Originally posted by hanz.
Hi all!
Having just purchased PB and now trying to do some bit fiddling with the printed port, I cannot get the following code snippet to work ( which I found here under a "WinIO" thread...)
The snippet compiles without any errors, but does not produce any change in the LEDs which I have connected to the port. I have put the winio.dll and winio.sys under pb\compilers and the 'wrapper' file under pb\plib\userlib.
However if I run Debug (under DOS) I can change the data ok. I have tried this on a laptop and also a desktop with win98.
;WinIO_Test
;compiles ok, but no effect on the port!
;
#DATA = $378 ; base address LPT1
#STATUS = $379
#CONTROL = $37A
;
If OpenLibrary(0, "WinIo.dll")
CallFunction(0, "InitializeWinIO")
;out $ff to LPT1
CallFunction(0, "SetPortVal", DATA, $ff, 1)
CallFunction(0, "ShutDownWinIO")
EndIf
End
Further I have unsuccesfully tried in-line assembly. Here I get an error message (forward the file..) or the compiler does not like the out $378, $ff instruction. Where do I find a list of asm opcodes? According to the NASM docs this is a legal opcode...
;Asm lpt1 test
;out $378, $ff ;does not like this...
mov dx, $378
mov ax, $ff
out dx, ax
end
Any assistance is greatly appreciated!
73,
de ZL1HB
Hi all!
Having just purchased PB and now trying to do some bit fiddling with the printed port, I cannot get the following code snippet to work ( which I found here under a "WinIO" thread...)
The snippet compiles without any errors, but does not produce any change in the LEDs which I have connected to the port. I have put the winio.dll and winio.sys under pb\compilers and the 'wrapper' file under pb\plib\userlib.
However if I run Debug (under DOS) I can change the data ok. I have tried this on a laptop and also a desktop with win98.
;WinIO_Test
;compiles ok, but no effect on the port!
;
#DATA = $378 ; base address LPT1
#STATUS = $379
#CONTROL = $37A
;
If OpenLibrary(0, "WinIo.dll")
CallFunction(0, "InitializeWinIO")
;out $ff to LPT1
CallFunction(0, "SetPortVal", DATA, $ff, 1)
CallFunction(0, "ShutDownWinIO")
EndIf
End
Further I have unsuccesfully tried in-line assembly. Here I get an error message (forward the file..) or the compiler does not like the out $378, $ff instruction. Where do I find a list of asm opcodes? According to the NASM docs this is a legal opcode...
;Asm lpt1 test
;out $378, $ff ;does not like this...
mov dx, $378
mov ax, $ff
out dx, ax
end
Any assistance is greatly appreciated!
73,
de ZL1HB