tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Need help with hardware i/o


From: livespi
Subject: [Tinycc-devel] Need help with hardware i/o
Date: Thu, 20 Aug 2009 22:04:41 -0700

I just discovered Tiny C and am giving it a try. I love the small executables. I primarily write quick-n-dirty utilities I run from the DOS command line on Win98SE/XP systems. I've
run into a couple of problems.
Problem #1:
Most of my utilities access hardware i/o ports, such as UART, cmosram, and
PIT (Programmable Interval Timer). MS 'QuickC for DOS' had the inp()/outp() functions defined in conio.h to do this. I can't figure out how to do this with TinyC. Since TinyC runs on PC hardware (whether Linux or Windows), shouldn't it be able to do i/o commands? Help!
Problem #2:
I also do direct access to video ram (xB8000000). Again, with QuickC I do
this with:

char _huge *vaddr;
        vaddr = (char *)0xB8000000;
        *vaddr = 'a';

The _huge term makes QuickC use 32-bit pointers instead of 16-bits (to get
to the video
ram). I removed the _huge term and compiled my program with Tinyc without
warning or error,
but when I ran it I get a 'Program attempted an Illegal operation' dialog
box from Windows.
Question: does TinyC use 32-bit pointers? Always? My program runs without a
problem when
compiled with QuickC, so I know what I'm doing can be done.

Don't suggest ways of doing this with a "Windowed" program, I don't need the
complication.
And if you're going to suggest doing it in assembler, SHOW ME HOW.
I feel TinyC can do these things, I just don't know how!  I can't be the
first one to stumble over this stuff.
Please help!!






reply via email to

[Prev in Thread] Current Thread [Next in Thread]