Re: [cc65] More assignments and typecasting questions

Date view Thread view Subject view

From: Shawn Jefferson (sjefferson_at_sd62.bc.ca)
Date: 2002-07-23 22:07:56


>There are several possibilities but the following one generates the best 
>code:
>
>        struct lo_hi {
>            unsigned char lo, hi;
>        };
>
>        hdt_lo = ((struct lo_hi*) &hdtable)->lo;
>        hdt_hi = ((struct lo_hi*) &hdtable)->hi;
>

Thanks, I got that to work.  I actually understand what you are doing here too, but I never would have thought of that myself.

BTW: you really have to pay attention to warnings about functions not being prototyped, as it can really screw the parameter stack!  Just spent about 30 minutes trying to debug this function that I threw cgetc() into just for debugging and didn't bother to include conio.h since it was just temporary... big mistake! :)



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-07-23 22:09:45 CEST