🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1822

Unsigned long question

#1822
From: Peter J Diaz de Leon
Date: Wed, 08 Aug 1990 21:33
35 lines
1231 bytes
I am having problems with the following simple piece of code.
When reg1 is an unsigned int mode prints out correctly.
When reg1 is an unsigned long int mode prints out 
incorrect results. I have tried both Turbo C 2.0
and Turbo C++ 1.0 and get the strange results. 
Can somebody please explane to me what I am
over looking.

I am running on a Compaq Deskpro 286 using 
4dos ver:3.01a and DOS ver:3.31

	Thanks
	-Peter
	peter@csd4.csd.uwm.edu
	peter@cvax.cs.uwm.edu

=============================================================================

#include <stdio.h>
#define ME 0x12

test(reg1, mode)
unsigned long reg1;
int mode;
{
    printf("TEST: mode=0x%x \n", mode);
    return;
}


main()
{
    test(0x1, ME);
    return;
}
Technical Details
Message-ID: <5633@uwm.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!peter

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!peter
From: peter@csd4.csd.uwm.edu (Peter J Diaz de Leon)
Newsgroups: comp.os.msdos.programmer
Subject: Unsigned long question
Message-ID: <5633@uwm.edu>
Date: 8 Aug 90 21:33:39 GMT
Sender: news@uwm.edu
Reply-To: peter@csd4.csd.uwm.edu (Peter J Diaz de Leon)
Distribution: usa
Organization: University of Wisconsin-Milwaukee
Lines: 35