Welcome, Guest. Please login or register.

Author Topic: BADDR () ??  (Read 2210 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: BADDR () ??
« on: June 29, 2005, 08:16:19 PM »
Isn't it a macro to convert a BCPL pointer to a C pointer (or vice versa, I don't recall) ?

BCPL pointers *shudder* They're just totally wrong.

Alternatively it might be a function to create a HaroldShipman object....

/hides
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: BADDR () ??
« Reply #1 on: June 29, 2005, 09:03:41 PM »
Quote

Piru wrote:

BADDR is used to convert BPTR to APTR (* 4).
MKBADDR is used to convert APTR to BTPR (/ 4).


Like I said, wrong. Evil, infact, :lol:
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: BADDR () ??
« Reply #2 on: June 30, 2005, 06:03:58 PM »
Quote

Thomas wrote:
Quote

Karlos wrote:
Like I said, wrong. Evil, infact, :lol:


Well, with a BPTR you could theoretically address up to 16 GB of memory as opposed to the 4GB of a usual C pointer. Of course the processor architecture has to support it.

Bye,
Thomas



Well, first off there's nothing in C that says a pointer is 32 bits. This is a machine implementation. Secondly, the 68K has this particular 32-bit pointer implementation anyway, so the BPTR offers nothing. Lastly, I don't know of any common architectures that do perform this kind of n*sizeof(element) type addressing so in most cases, it's simply a total waste of cycles to store it in this fashion when at best you are going to have to shift it every time you want to dereference it ;-)

As I said. BCPL pointers are wrong, evil and they smell too :lol:
int p; // A