5 ms·
> Processor operations have to be strongly typed, by definition. Individual instructions assume the data they operate on is of a particular type, but it doesn'
by II2II 9d ago
> Processor operations have to be strongly typed, by definition.
Individual instructions assume the data they operate on is of a particular type, but it doesn't differentiate data types in memory. Here's an example where I forced the C compiler to treat the bit pattern of two floats as integers, then add those values as integers. The result is, of course, absolutely meaningless.
float dx = 1.0;
float dy = 1.0;
int *pix = &dx;
int *piy = &dy;
int isum = *pix + *piy;
float *pdsum = &isum;
printf("%d\n", isum);
printf("%f\n", *pdsum);
That's just how processors work, right? Apparently it doesn't have to be that way. From my understanding of the iAPX 432, attempts were made to encode object types in hardware.