TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Paul Edwards
from: Bob Lawrence
date: 1996-09-27 07:50:40
subject: Public Domain Pascal

BL> Whaaat? How does the machine know it's a signed integer? It's
 BL> just 32-bits in a register. Are you telling me that computer
 BL> hardware has a list of ints, longints, char, words, arrays, and
 BL> all that crap?

 PE> No, what it actually has (potentially, anyway) is a list of
 PE> instructions that assume the 32-bits represent a signed
 PE> integer, or an unsigned integer. E.g. the C64, from memory, had
 PE> an ASR (arithmetic shift right) and a SHR (shift right), the
 PE> latter treating the register as unsigned. MVS had the same, and
 PE> I presume intel has the same (look it up). The compiler knows
 PE> whether the value is signed or unsigned, and generates the
 PE> correct instruction. BFN. Paul. 

  I was not talking about the compiler. That can do *anything*.

  I've just been through the 80386 instrution set summary (Christ only
knows why I get sucked into these insanities) and I think I see where
you got confused. It does a multiply and divide as a signed or
unsigned integer, but we were talking about logical bitwise shifts.
Your code doesn't do any divides or multiplies, which is what I said
in the first place.

  But in any case, wouldn't the compiler use the correct instruction
to the CPU? VB for instance does not do shifts or unsigned integers,
so it must use the IDIV instruction.

Regards,
Bob
___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 711/934 712/610
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.