znalazłem program tutaj na forum elektrody pod adresem : https://www.elektroda.pl/rtvforum/topic96492.html
---------------------------
#include <iostream.h>
#include <stdlib.h>
void zapisz(char dana);
main(){
char liczba;
cout<<"Wpisz wartosc do wystawienia na porcie...";
cin>>liczba;
zapisz(liczba);
return(0);
}
void zapisz(char dana){
__asm{
mov dx,0378h
mov al,dana
out dx,al
}
system("pause");
}
---------------------------------
nie potrafie go skąpilować u siebie, korzystam w szkole z kompilatora Dev-C++ 4.9.9.2 i nie chciałbym go zamieniać, nie wiem w czym jest bląd. Dostaje następujące komunikaty:
------------------------------------
Wykonywanie g++.exe...
g++.exe "D:MarcinLPT_1.cpp" -o "D:MarcinLPT_1.exe" -I"C:Dev-Cpplibgccmingw323.4.2include" -I"C:Dev-Cppincludec++3.4.2backward" -I"C:Dev-Cppincludec++3.4.2mingw32" -I"C:Dev-Cppincludec++3.4.2" -I"C:Dev-Cppinclude" -L"C:Dev-Cpplib"
In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
from D:MarcinLPT_1.cpp:1:
C:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
D:MarcinLPT_1.cpp: In function `void zapisz(char)':
D:MarcinLPT_1.cpp:15: error: expected `(' before '{' token
D:MarcinLPT_1.cpp:15: error: expected asm body before '{' token
D:MarcinLPT_1.cpp:16: error: `mov' undeclared (first use this function)
D:MarcinLPT_1.cpp:16: error: (Each undeclared identifier is reported only once for each function it appears in.)
D:MarcinLPT_1.cpp:16: error: expected `;' before "dx"
D:MarcinLPT_1.cpp:16:8: invalid digit "8" in octal consta
---------------------------------
Ten program to odpowiedz, na czesc pytan na które jeszce nie umiałem do tej pory odpowiedziec. Chce koniecznie pobawić sie LPT sterować tymi wejsciami D0-D7. Tylko właśnie nie potrafie sobie poradzić z tym programem, prosze o pomoc. korzystam z windowsa XP, nie chciałbym zmieniac tego kompilatora jeżeli to możliwe, co mam zrobić żeby to działało ? z góry dziękuje mufi
---------------------------
#include <iostream.h>
#include <stdlib.h>
void zapisz(char dana);
main(){
char liczba;
cout<<"Wpisz wartosc do wystawienia na porcie...";
cin>>liczba;
zapisz(liczba);
return(0);
}
void zapisz(char dana){
__asm{
mov dx,0378h
mov al,dana
out dx,al
}
system("pause");
}
---------------------------------
nie potrafie go skąpilować u siebie, korzystam w szkole z kompilatora Dev-C++ 4.9.9.2 i nie chciałbym go zamieniać, nie wiem w czym jest bląd. Dostaje następujące komunikaty:
------------------------------------
Wykonywanie g++.exe...
g++.exe "D:MarcinLPT_1.cpp" -o "D:MarcinLPT_1.exe" -I"C:Dev-Cpplibgccmingw323.4.2include" -I"C:Dev-Cppincludec++3.4.2backward" -I"C:Dev-Cppincludec++3.4.2mingw32" -I"C:Dev-Cppincludec++3.4.2" -I"C:Dev-Cppinclude" -L"C:Dev-Cpplib"
In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
from D:MarcinLPT_1.cpp:1:
C:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
D:MarcinLPT_1.cpp: In function `void zapisz(char)':
D:MarcinLPT_1.cpp:15: error: expected `(' before '{' token
D:MarcinLPT_1.cpp:15: error: expected asm body before '{' token
D:MarcinLPT_1.cpp:16: error: `mov' undeclared (first use this function)
D:MarcinLPT_1.cpp:16: error: (Each undeclared identifier is reported only once for each function it appears in.)
D:MarcinLPT_1.cpp:16: error: expected `;' before "dx"
D:MarcinLPT_1.cpp:16:8: invalid digit "8" in octal consta
---------------------------------
Ten program to odpowiedz, na czesc pytan na które jeszce nie umiałem do tej pory odpowiedziec. Chce koniecznie pobawić sie LPT sterować tymi wejsciami D0-D7. Tylko właśnie nie potrafie sobie poradzić z tym programem, prosze o pomoc. korzystam z windowsa XP, nie chciałbym zmieniac tego kompilatora jeżeli to możliwe, co mam zrobić żeby to działało ? z góry dziękuje mufi