Welcome, Guest. Please login or register.

Author Topic: PowerPC asm programming  (Read 7861 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC asm programming
« on: February 26, 2003, 12:38:37 PM »
Quote

fatman2021 wrote:
I'm a x86 programmer.  So when I do my asm programming I use the x86 8-bit, 16-bit, and 32-bit registers. Now what I need to know is the PowerPC  equivalents of the x86 8-bit, 16-bit, and 32-bit registers. This will help me port my x86 VESA VBE programs over to AmigaOS. So if any one knows a table or any other infomation, let me know thanks
I also need to know the PowerPC equivalent to the x86 interrupt 10h


A couple of things here, the PPc does not have 8bit,16bit and 32bit modes, instead it had a single set of 32, 32bit general purpose registers which will work in the size of the addressing mode of the instruction you are using.. Some registers are reserved for use by the OS (some registers don;t get saved in a context* switch,), and this depends on the OS you are using, so get a good book on the subject.

*Linux, BFD, MacOSX, AmigOS4,MorphOS and AROS are all multitasking OS's, so you must remember that your task is going to not going to have total control over the CPU and will be switched out quite regularly.

Doue to the design of MSDOS, System calls had to made made using an interupt, thus System calls and Interupt have become interchangeable for the MSDOS programmer.
This is not the case for Multitasking OS's, and system calls should not be confused with interupts. you will probably never need to invoke an interupt in AmigaOS.
AmigaOS has a dedicated graphics subsystem called, strangly enough, the graphics.library which as a programmer you probably won't need very much. It is more common now to use the GUI system known as the intuition.library. This provides the programmer full graphics functions but keeps them in the context of the GUI, which users and graphics cards like!
I suggest you buy/download some developer docs, AmigaOS is very different to MSDOS.
I would also suggest you forget about PPC asm (porting x86 Code to that will be hell) and switch to C which is portable across systems (remember to abstract out the system depandant stuff to allow quicker and easier porting).

 Have fun :-D

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC asm programming
« Reply #1 on: February 26, 2003, 01:27:29 PM »
as I said, he probably wouldn't need the Graphics.library very much. I didn't mean to make it sould like I was excluding it altogether!!!  :-D

I just prefered to used the inutition library for as much as possible as that allowed me to support graphics cards without modification. And the guy did say he wanted to program the PPC, so I'm guessing he isn't going to be using AmigaOS on an Amiga Classic (yes, yes, yes, I have a BlizzPPC... :-P )

I loved ASM coding... on the 68k... but the PPC is really quite boring (loved all those regs though!!!!). I've done very little x86 coding though.
I'm no fan of C... but it is probably the best language available (C/C++ ...Blah...)

P.S. I'm sure there's an intuition function for line drawing and filled polys...etc...!!! But it has been 5 years, I may have forgoten a few things...

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC asm programming
« Reply #2 on: February 26, 2003, 02:23:45 PM »
Quote

Tickly wrote:
Quote

I just prefered to used the inutition library for as much as possible as that allowed me to support graphics cards without modification


That doesn't make any sense! Using graphics.library doesn't exclude graphics cards at all! And there are NO intuition routines for line drawing or filled poly's, THAT is graphics.libraries job!

If you want to draw graphics into a rastport, you use graphics.library. That is what it is for.


I mean for rendering directly to a GUI window.   I'm sure window drawing was in intuition. I stoped working on bitmaps, screens and rastports, when I switched to CGX.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC asm programming
« Reply #3 on: February 26, 2003, 02:58:26 PM »
Quote

Tickly wrote:
Quote

Karlos wrote:
Tickly must be climbing the walls by now :lol:


Thats OK.. he can carry on being wrong, it doesn't really matter  :-D


I'll be reading the Tech docs tonight... But I'm sure there were drawing functions in intuition (for rendering to windows, not bitmaps..blah..) . :-D

I know I'm probably gonna be proved wrong.. but at will stand by my views. :-P  

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC asm programming
« Reply #4 on: February 26, 2003, 03:15:34 PM »
hmmm, ok then  :-D