68000 assembly resource ... resources?

Apprentice
Posts: 8
Joined: 2007.06
Post: #1
I've been trying to learn Mac OS 68000 assembly language programming off and on for a few years (MPW 1.0.1, and ResEdit), and made some small progress, mainly with editing some example software and reading Inside Macintosh vol 1-3 and some third party books I found which contain sample code that for the most part won't run. The main problem I'm having with making progress is with getting resources into a program, so I wouldn't have to draw a window, button, etc. in code. I can't find anything that describes the process clearly enough for a beginner, and would greatly appreciate any tips and/or resources that anyone can point me to.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #2
I don't know if there are many resources available anymore for 68k. You could try http://www.lightsoft.co.uk/Fantasm/fant.html, and also see if you can find some docs on Macsbug.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #3
I just have to ask: why?
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #4
Can't be sure just yet. There seem to be some 68k examples with resources. I haven't run them on the SE, yet, but at least it's something else to look at for a while. Thanks for the idea.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #5
Josh Wrote:I just have to ask: why?

Easier to learn assembly on smaller systems
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #6
68k is a huge system! Might as well learn x86 assembly!

If I were trying to learn assembly on a `smaller' system I'd go shopping around for popular modern microcontrollers. Particularly one with OS X support of some kind. That'd be much more enjoyable (and relevant) IMHO.

If you are still going to stick with 68k assembly, I just remembered that you should check through Mactech's archives. They used to put out a lot on 68k assembly as I recall.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #7
I already started learning some on the Apple I replica, and eventually I'd like to learn some assembly on any machine I have to work with, but another reason to use an older machine, is that the outdated machines are not as big of a loss, if something I do damages them. (And I've not seen any memory maps for PowerPC machines (I don't have an X86 machine) anywhere I've looked yet), and I doubt you're actually trying to tell me that the size and complexity of a 68000 is comparable to a PowerPC or X86.

and I do plan on programming some smaller embedded systems.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #8
vieuxnez Wrote:... and I doubt you're actually trying to tell me that the size and complexity of a 68000 is comparable to a PowerPC or X86.
I am... I've done PPC and 68k and can tell you that 68k is just as complicated.

I'd be willing to bet you can find a relative who would give you an old PC to do with as you please. With plentiful x86 assembly documentation literally everywhere, it would be very easy to go that route instead. Plus, learning that would be highly useful considering all Macs are now i386 based. 68k is dead, dead, dead... Not that it wouldn't be fun to some degree, but I'd say learning i386 assembly would be a *much* wiser use of one's time if you asked me.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #9
Well, I plan on building a Linux box sometime in the future, but really, no relatives with computers that they're not using right now. I'm thinking of buying an old junker, whenever the money brings it up on the priority list (not that high, right now).

Where would you start if you wanted to jump into PowerPC assembly?... Right now the machines I have to work with are <Apple I Replica>, <Macintosh SE>, <PowerMac PPC 604e 9600>, <PowerBook G4 Titanium 15">, <PowerBook G4 Aluminum 17">, basically, the SE and the 9600 are... well, not throwaway machines, but machines that I wouldn't miss too much. I want to try doing hardware hacking to the Replica board, and the PowerBooks are the machines I actually get constant use out of (i.e. I don't want to risk breaking the 15" Titanium till I have an Intel Mac in the collection.) The 9600 is the most beat machine, and I've got a spare CPU card (the one I'm running is overclocked via resistor swap), so I'd probably be most willing to risk dumb mistakes with it. I'd planned on trying to work out the IOKit framework to control USB controlled devices with the 9600, but that plan doesn't seem to be moving forward, for various reasons. I was thinking of trying to hack a device to connect to the SE printer port to control sensors and motors, but am finding little that leads in that direction, as well, so where the SE and the 9600 are networked so I can move files via PBs <-> 9600 <-> SE, I'm not finding any reason to do so, since people are more likely to question the purpose than offer ideas. Is assembly with a 68000 very comparable to programming with the 68hcxx line? One possibility I was thinking of was building with the 68hcxx or mc68000 processors, using concepts from the 68000, (similar ideas with the 6502).

I'm going to start experimenting pretty soon with the AVR processors, starting with a butterfly, and maybe something from the PIC line, though I'm not sure why to choose one over another just yet, and am still reading up on various microcontrollers, trying to find what would be most compatible with what I have. (perhaps you have some sugesstions in this area? so far I've found the most information on programming AVRs from Mac OS X, though to be honest that's where I've searched the most, as the book/s I've been reading use them in their most seemingly easily applicable example systems to build/program)

"68k is dead, dead, dead..." does that include the 68hcxx and mc68000 processors?
Quote this message in a reply
Member
Posts: 100
Joined: 2006.05
Moderator
Posts: 3,579
Joined: 2003.06
Post: #11
vieuxnez Wrote:Where would you start if you wanted to jump into PowerPC assembly?...
Lightsoft's site I linked to above is pretty good. They have a ppc beginners guide: http://www.lightsoft.co.uk/Fantasm/Begin...egin1.html

Quote:Is assembly with a 68000 very comparable to programming with the 68hcxx line? One possibility I was thinking of was building with the 68hcxx or mc68000 processors, using concepts from the 68000, (similar ideas with the 6502). ... "68k is dead, dead, dead..." does that include the 68hcxx and mc68000 processors?
That I don't know for sure, sorry. I would imagine the instruction set would be similar, but I don't know any details there at all. I have a few mc68xxx ICs lying around, which I was going to play with a long time ago, but never got around to it. In terms of general computing though, I can say for sure that 68k will not be coming back.

Yeah, AVRs and PICs appear to be pretty popular (and modern). I'd definitely prefer going that direction first if I didn't have resources to hit up i386 assembly.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #12
Nevada Wrote:http://www.mactech.com/articles/mactech/...index.html

I have looked at the mactech articles before, but I couldn't make anything of them before. This time, I downloaded all the ftp site to an external drive, and though I still don't see much in the way of assembly examples that will serve my purpose directly, I think that what I've learned from the Inside Macintosh volumes would make translating some of the simple Pascal exampes <sigh> into assembly a good path for me. There are some real simple Pascal 68k examples that do little more than set up some resources for a program with a window and some menus, etc. Thanks for pointing me back to mactech.
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #13
I tried, but then I couldn't figure out how to make system calls (printing, etc) without calling printf. (with x86 and linux/dos/win/*bsd you use an interrupt....)
BTW, I recommend something very basic to start out with. I just wrote a small macro that printed int's, one character at a time. Not very fast, but an excellent way to realize the extraordinary potential of wasting time writing assembly.

Or, you could use ruby.

It's not magic, it's Ruby.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2007.06
Post: #14
Nayr Wrote:I tried, but then I couldn't figure out how to make system calls (printing, etc) without calling printf. (with x86 and linux/dos/win/*bsd you use an interrupt....)
BTW, I recommend something very basic to start out with. I just wrote a small macro that printed int's, one character at a time. Not very fast, but an excellent way to realize the extraordinary potential of wasting time writing assembly.

Or, you could use ruby.

Did you get the idea of pushing the arguments onto the stack, then calling the toolbox function you wanted to call? I believe the return argument is then pushed onto the stack.

Or do you just mean the terminal I/O? I haven't figured that out yet, myself. It seems like putting values into something with a window is better documented. So far, all I've really done is print somethings onto a window, but not with resources yet. The resource functions are documented pretty well, but not in a way that tells me how to set them up simply to practice how to use them, but more in a way that you'll get something out of the documentation if you have a good idea what you're doing already.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #15
I would like x86 resources.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Post Reply