June 30th, 2010

Juiced.GS Volume 15, Issue 2 now available

Juiced.GS V15I2Volume 15, Issue 2 (June 2010) of Juiced.GS, the longest-running Apple II publication in print, shipped today to all subscribers. This issue features a review of the FC5025 floppy controller; a tutorial for using the Super-Mon programming utility; an opinion piece on the growing divide between users and programmers of Apple products; and the second in a five-part series on transferring files between the Apple II and other computers.

This is Juiced.GS‘s second quarterly issue of 2010. Annual subscriptions are available for $19 for United States customers and $26 for international customers.

June 21st, 2010

Some Assembly Required: Hello World

Among programmers, there’s a long-standing tradition whereby one’s first program in any given language is one that simply displays the message “Hello world.”

In this installment of Some Assembly Required, we’re going to create “Hello world.” I’m not going to really explain how it works this time around. We’ll get into understanding the programming next time. The goal, for now, is to simply learn the commands needed to build and run your programs, so we won’t have to deal with that later.

ORCA/M 4.1 (8-bit)

Let’s start by building our program for ORCA/M for 8-bit Apple IIs. Start by launching ORCA.SYSTEM, which will drop you into the ORCA command shell. Type “NEW” to start editing a new file, and press the Return key.

Once you’re in the editor, type in the following listing. Note that the editor is slightly unusual if you’re used to other editors; you’ll want to read through Chapter 3 of the ORCA/M manual to learn its commands.

If your computer is an older Apple II without support for typing lower-case letters, that’s fine, just use all upper-case instead.

COUT     gequ  $FDED                    ;The Apple II character output func.

         keep  HelloWorld

main     start
         ldx   #0                       ;Offset to the first character
loop     lda   msg,x                    ;Get the next character
         cmp   #0                       ;End of the string?
         beq   done                     ;->Yes!
         jsr   COUT                     ;Print it out
         inx                            ;Move on to the next character
         jmp   loop                     ;And continue printing
done     rts                            ;All finished!

msg      dc    c'Hello world.'
         dc    h'0D'
         dc    h'00'

Once you’ve finished entering the code, press control-Q to bring up the quit and save menu, then press “N” to save the file to a new name. Type “HelloWorld.asm” and press return, then press “E” to exit the editor.

Running the program is as simple as typing “RUN HelloWorld.asm”. This will compile, link, and run the program. If any errors occur, type “EDIT HelloWorld.asm” to open the file back up in the editor and find and fix any discrepancies between what you typed and the listing above, then try again.

ORCA/M (16-bit)

To build the program using the 16-bit version of ORCA/M (but still run it as an 8-bit program), start up the ORCA shell by launching ORCA.SYS16 from the Finder. At the command line, first type “ASM65816” to select the assembly code edit mode, then type “EDIT HelloWorld.asm” to start up the editor.

Enter the following code:

         65816 off
         65C02 off                      ;Use 6502 opcodes only

COUT     gequ  $FDED                    ;The Apple II character output func.

         keep  HelloWorld

main     start
         ldx   #0                       ;Offset to the first character
loop     lda   msg,x                    ;Get the next character
         cmp   #0                       ;End of the string?
         beq   done                     ;->Yes!
         jsr   COUT                     ;Print it out
         inx                            ;Move on to the next character
         jmp   loop                     ;And continue printing
done     rts                            ;All finished!

         msb   on
msg      dc    c'Hello world.'
         dc    h'8D'
         dc    h'00'

Once you’ve entered the code, press Command-S to save your work, then Command-Q to quit to the command line prompt. Type “CMPL HelloWorld.asm” to compile and link the program. If any errors occur, type “EDIT HelloWorld.asm” to edit the program and fix the problems, then try again.

Since this program is designed as an 8-bit program, to be run under ProDOS 8, but we’ve built it using the 16-bit version or ORCA, we need to do an extra step. We need to convert it from a GS/OS load file into a ProDOS 8 compatible binary file. To do this, type “MAKEBIN HelloWorld Hello”. This will take the compiled “HelloWorld” program and convert it into an 8-bit binary file named “Hello”.

Then you can quit the ORCA shell, start up Applesoft BASIC, use the PREFIX command to make your way into the directory containing the program, and type “BRUN HELLO” to run it.


These instructions are for Merlin 8/16+. Your mileage may vary somewhat on other versions of Merlin.

Once you’ve launched Merlin, press “F” to open the full-screen editor, then enter the following code.

            org       $2000

COUT        equ       $FDED         ;Apple II character out func.

            ldx       #0            ;Offset to first character
:loop       lda       msg,x         ;Get the next character
            cmp       #0            ;End of the string?
            beq       :done         ;->Yes!
            jsr       COUT          ;Print it out
            inx                     ;Move on to the next character
            jmp       :loop         ;And continue printing
:done       rts                     ;All finished!

msg         asc       "Hello world."
            dfb       $8D
            dfb       $00

            sav       Hello

Once you’ve entered the code, press Command-6 to save (Type “Hello” for the filename when prompted) and assemble and link your code. You should wind up with a binary file named “Hello” in the same directory as the source code file you just saved (which will be named “Hello.S”).

You can then switch to Applesoft BASIC, use the PREFIX command to make your way into the directory containing the program, and type “BRUN HELLO” to run it, and type “BRUN HELLO” to run the program.

That’s the gist of how to build a simple program in these three environments. Don’t worry about how this stuff works for now. We’ll start learning actual assembly language next time.

June 21st, 2010

New Google command line API may benefit retro-computing platforms

Exciting news for the Apple II Community (and retro-computing at large). Google has launched GoogleCL, a command line API project that may enable developers to write Apple II applications that are capable of interfacing with Blogger, Calendar, Contacts and other Google services.

June 18th, 2010

Some Assembly Required: Choosing an Assembler

Over the coming weeks (or maybe months or even years), I’ll be posting a series of articles introducing you to the glorious, glamorous world of assembly language programming for the 6502 series of microprocessors. While, sure, there are plenty of other languages out there, and in this day and age, assembly is something of a line of last resort among “modern” computer programmers, on the Apple II, assembly remains the optimal way to build software for the best possible performance.

However, assembly language can be a little scary to newcomers, with a lot of seemingly cryptic stuff to look at and somewhat daunting code listings.

My intention with this series of articles is to introduce assembly language in a gentle, easy to manage way, taking very small steps. This will have two advantages:

  1. It should make it easier for you to follow and learn.
  2. It will reduce the size and complexity of articles, thereby hopefully letting me post more often. This will make Sean very happy.

The first thing you need to do is to select an assembler. There are a great many of them out there. The two best-known, and most highly-regarded, are arguably Merlin (which comes in both 8 and 16 bit versions) and ORCA/M (which also comes in both 8 and 16 bit versions).

Both of these options are good ones, and I can easily recommend them both. I do have some comments on them that you might want to consider while trying to decide between the two.

Merlin is easily the faster of the two assemblers. It also has a less steep learning curve, as its user interface is quite a lot simpler. That said, I find its editor to be rather quirky, with non-standard key equivalents for many things. In addition, source code files saved by Merlin have the high bits set on all the text, which means it’s not trivial to load the files in other editors, or to open them on other computers.

ORCA/M uses a Unix-like command line interface for everything. It has a significantly more powerful macro system, but that does have the drawback that the macros are rather harder to figure out how to create and use. Once you master it, however, ORCA/M’s power is formidable.

The Apple IIgs version of ORCA/M works within the ORCA shell environment, which lets you use multiple languages in one project. In ORCA, you can build your main code in, for example, C, then write key tidbits of your code in assembly to speed things up. This isn’t something you can do in Merlin.

All that said, choosing an assembler is a surprisingly personal decision. I like a great many things about both Merlin and ORCA, and use them both.

The primary drawback to Merlin is that its legal status is somewhat uncertain. The wife of its author, Glen Bredon, released it as freeware upon his death a few years back. However, it’s unclear whether or not she actually had the legal right to do so, since Roger Wagner Publishing owned the copyright to the software, and RWP has since been absorbed through multiple companies until ownership of the copyright is somewhat hard to determine.

If you can find a used copy of Merlin, you might find that you like it.

Both the 16-bit and 8-bit versions of ORCA/M, on the other hand, are still available for purchase (please note that I own the company that sells it; it’s only fair for me to mention that).

Because ORCA is still available in a clearly legal fashion, the code examples I’ll be providing will be using its syntax most of the time; however, I will strive to point out the differences as we go.

Next time, we’ll take a look at how to go about actually building code in these assemblers, so you’ll be ready to go when we start learning how to write assembly code.

June 8th, 2010

Applied Engineering Repository on RetroMacCast

Bill Martens and Brian Wiser are interviewed on episode 161 of the podcast RetroMacCast about their Applied Engineering Repository Web site. The interview starts about 15 minutes into the show. Hear some of the history of Applied Engineering and their excellent Apple II hardware products such as the Transwarp, Ramworks and PC Transporter.

June 7th, 2010

CFFA 3000 release pushed back

Rich Dreher has posted an update that the CFFA 3000 card will be delayed at least until September 2010. Rich also posted additional information on upcoming features of the new card which we’ve re-printed here.

  • Disk images files can be used from both a USB drive and a CF card at the same time.
  • If a USB device is present at boot time, we wait for it to finish connecting.
  • FAT performance is greatly improved for disk image files that are not highly fragmented (we now spend a fraction of a second analyzing the file up-front, and it sped up a GS/OS boot (with lots of extras installed) from 102 seconds down to 72).
  • The interactive menu screens are coming along, but many menu choices are stubs that are not hooked up yet. Preferences can be stored in the AVR’s EEPROM.
  • The “Upgrade CPLD” feature works, allowing a field upgrade of the CPLD logic from a file on a CF card.
  • Automatically installs an Apple IIgs CDA that allows quick access to the CFFA menus without having to reboot.
June 5th, 2010

Denis Molony’s Disk Browser updated

Denis Molony wrote in to share an update to his cross-platform, Java-based disk image tool, Disk Browser.

I just wanted to let you know that I have finally worked out how to release a Mac version, and that the server has changed to dmolony.dyndns.biz/apple.

There are a large number of new features and bug fixes (including hard disk image support).

As I said previously, DiskBrowser is not intended to compete with the other disk image tools, its main benefit is that it can decompile files like Wizardry and Infocom disks, and Pascal object code. And it can’t even do those things perfectly. But I’m happy to look at any disk image that a user sends me.

And it’s written in Java, so it’s cross-platform.