Page 1 of 1

doe anybody now why i get a "executing binary error&quo

Posted: Sun Jul 16, 2006 3:15 pm
by sebt
I am new in purebasic programming. I wanted write assembler instructions to the 8042 keyboard controller. All the attempts failed because I think purebasic can not compile IN commands.
How can I integrate an IN command in purebasic for example for keyboard or soundcard reading?

I included this example that generate an error for an Illegal instruction.

!_start:
!IN al, $64
!AND al, 2 ;Test if command buffer is empty
!JNZ _start
!MOV al, dl
!OUT 60h, al ;Write

!_wa:
!IN al, 64
!AND al, 2 ;Test if command came through
!JNZ _wa

!MOV al, 0111b
!OUT 60h, al ;Set all LED's to ON.

End



Thankx Sebt

Posted: Sun Jul 16, 2006 4:02 pm
by Trond
Windows XP does not allow direct hardware access, that's the problem.

Posted: Sun Jul 16, 2006 4:15 pm
by KarLKoX
Great to know this, i was searching why my code crashes too :)

Posted: Sun Jul 16, 2006 6:40 pm
by sebt
Trond wrote:Windows XP does not allow direct hardware access, that's the problem.

Ok . I assume XP also blocks access to BIOS addresses?

sebt

Posted: Sun Jul 16, 2006 6:44 pm
by Pupil
You might want to look at this:
http://www.purebasic.fr/english/viewtop ... ight=winio

Or just search for "winio" on the forum..

Posted: Sun Jul 16, 2006 8:44 pm
by sebt
Thanks for this answer that will keep me from trying!
It seems the XP blocks memory access based on the kind of program (Drivers/some-DLLs/some-EXEs programs are able to read/write data). So it seems the program has to have privileged administrations/user rights. Is there a purebasic program that can adjust file registrations ?

sebt

Posted: Sun Jul 16, 2006 10:05 pm
by blueznl
best approach is probably to access ports via a dedicated dll, there are some on the net, load up google and, well, start googling :-)

Posted: Sun Jul 16, 2006 10:24 pm
by Trond
sebt wrote:Thanks for this answer that will keep me from trying!
It seems the XP blocks memory access based on the kind of program (Drivers/some-DLLs/some-EXEs programs are able to read/write data). So it seems the program has to have privileged administrations/user rights. Is there a purebasic program that can adjust file registrations ?

sebt
Every XP program runs in its very own private virtual address space. This is called protected mode. Do a google search for real mode and protected mode for more information.