Hi, I am trying to get some assembly code to run in C. I am using mingw32 gcc compiler in a code blocks environment if that matters, and i want to get this code to store the keyboard's input to var kin.
assembly --- in al, 64h
From what I understand that line is suppodsed to read keyboard input and store it in the AL register.
When I use this C code it compiles fine no errors or warning but when i execute it, it gives me a segfault and i cannot figure out how to fix this. I've tried looking at various sites for inline assembly but none of them cover using ports for i/o if some one has any websites i could view or code that would be very much appreciated.
( note i've also tried using the i/o address of 60h and still same result. Also i have tried making everything relavent to a byte, word or dword with regards to the registers the kin variable and the suffix letter after the asm instruction)
"movw $0x64, %%dx;"
"inb %%dx, %%al;"
"movb %%al, %0;"
I am not a big fan of assembly but i figure getting to know a little would be helpful and learning to use it in a C environment will keep me from having to dive into full Assembly language usage and using MASM NASM etc.