68kMLA Classic Interface
This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.
| Click here to select a new forum. | | MacBASIC 1.0, A Complete Mac 128K IDE In 53K! | Posted by: Snial on 2026-09-25 14:51:31 Hi folks,
I've gone down a bit of a rabbit hole thanks to @bigmessowires Quiz Application project for a Mac 128K! My inner Pedantic-Man unveiled his super-power and convinced me that for real authenticity, the application should be developed on an actual Mac 128K (or an emulator for it).
It's amazingly hard to actually develop an app on a Mac 128K. Almost all development was done on a Lisa.
However, I know that it could be done using MacASM, since that's only about 26kB and I've already used it to develop an earlier program, MiniMorse! But it's very masochistic. So, then I thought MacPascal would be a reasonable compromise, because it does run on an original Mac and under System 1.x. However, there are two problems. Firstly, you need to use INLINE definitions to gain access to the ToolBox and there isn't a full list of them in the standard distribution. Secondly, it really doesn't have much RAM left for coding so I'm not sure whether it could fit, despite Big Mess 'O' Wires' quiz app being a small app and having the questions in a neat resource format.
However, because I was playing with a Mac 128K emulator via Infinite Mac, I noticed that it also had a copy of MacBASIC 0.336. Now, MacBASIC has a really interesting history, as recounted in Folklore.org:
www.folklore.org
They worked on it for 2-3 years, building a viable BASIC IDE that could create real Mac applications only to have it killed by Microsoft blackmailing Apple to use their Macintosh MSBASIC over a continued MS licence for Apple ][ BASIC. Bill Atkinson was furious and the core developer, Donn Denman was so distraught he ended up crashing his car!
But the 0.336 version was widely distributed, and somehow the 1.0 version also escaped and is on Macintosh Garden. There's an interesting review of it from BYTE Magazine, which gives you a flavour of the language (it's very comprehensive). Importantly, it's only 48kB and only about 32kB is resident!
I couldn't see a proper manual anywhere, so I used ResEdit to analyse the CODE segments to find out if all the commands are there. And they are... and there's a lot of them! Segment 5 contains the language commands, all 261 of them...
| PRINT | STR$ | DIV | FOR | NEXT | GOTO | IF | LET | | PERFORM | END | = | <> | >= | <= | >< | => | | =< | > | < | ≠ | ≤ | ≥ | INFINITY | ∞ | | NAN | + | - | ERASE | CLEARWINDOW | PENMODE | SIZE | ASK | | DO | STOP | FRAME | PAINT | & | BTNWAIT | REM | SHOWDIGITS | | DIM | LEN | LEFT$ | RIGHT$ | MID$ | ASC | CHR$ | TIME$ | | DATE$ | ? | ELSE | THEN | GOSUB | RETURN | POP | ENDIF | | LOOP | DATA | READ | RESTORE | SET | DEF | INPUT | OPEN | | CLOSE | WINDOW | POS | HPOS | PLOT | VAL | RECT | ROUNDRECT | | ROUND | PENPOS | PEN | PATTERN | BLACK | WHITE | GRAY | LTGRAY | | DKGRAY | MENU | CONTROL | ABS | ATN | MOUSEB | MOUSEB~ | MOUSEH | | MOUSEV | COS | EXP | INT | LOG | PI | π | ∏ | | RND | SGN | SIN | SQR | TAN | POS | NOT | AND | | FREE | VAL | ERR | KBD | TYP | FORMAT$ | INVERT | TO | | PENSIZE | PENNORMAL | OR | STEP | WITH | EXIT | TRUNC | ^ | | COMPOUND | ANNUITY | LOGP1 | EXPM | TICKCOUNT | GPRINT | FONTSIZE | FONT | | PROGRAM | INKEY$ | IS | CASE | SELECT | ENDSELECT | RANDOMIZE | WHEN | | ENDWHEN | IGNORE | UPSHIFT$ | DOWNSHIFT$ | TRUE | FALSE | TOOL | TOOLBOX | | GTEXTFACE | GTEXTMODE | WRITE | REWRITE | DELETE | LOCK | UNLOCK | RENAME | | SETFILEINFO | GETFILEINFO | THERE | MISSING | EOF | EOR | OUTIN | TEXT | | BINY | SEQUENTIAL | STREAM | RECSIZE | APPEND | SAME | BEGIN | RECORD | | LINE | OUTPUTWINDOW | OPTION | COLLATE | NATIVE | STANDARD | TAB | SOUND | | SOUNDOVER | STOPSOUND | TONES | REMAINDER | INT | SCALB | LOGB | COPYSIGN | | NEXTSINGLE | NEXTDOUBLE | NEXTEXTENDED | LOG2 | EXP2 | RANDOM | SIGNNUM | RELATION | | CLASSSINGLE | CLASSDOUBLE | CLASSCOMP | CLASSEXTENDED | PROCENTRY | PROCEXIT | EXCEPTION | HALT | | PRECISION | ENVIRONMENT | INVALID | UNDERFLOW | OVERFLOW | DIVBYZERO | INEXACT | TONEAREST | | UPWARD | DOWNWARD | TOWARDZERO | EXTPRECISION | DBLPRECISION | SGLPRECISION | NAN | QNAN | | INFINITE | ZERONUM | NORMALNUM | DENORMALNUM | GREATERTHAN | LESSTHAN | EQUALTO | UNORDERED | | TABWIDTH | PICSIZE | MOD | SUB | CALL | FUNCTION | AT | GTEXTNORMAL | | GETVOLINFO | GETFILENAME$ | GETVOLNAME$ | MAIN | SCALE | LOCATION | DOCUMENT | OUTPUT | | DEVCONTROL | DEVSTATUS | ATEOF | EOF | CURPOS | EJECT! | SETVOL! | UNDIM | | TOSCREEN | TOWINDOW | CREATE | RESOURCE | MENU | MENUITEM | WINDOWITEM | MENUID | | ADDRESS | INDIRECT | HIGHWORD | LOWWORD | VALPOINTER | | | |
Amongst the most interesting commands are the use of Mac characters like '≤', '≥' and '≠' as synonyms for "<=", ">=" and "<>". There's also "NATIVE".
However, the really neat stuff follows in segment 6, which contains (as far as I can tell), the complete list of ToolBox calls!
| DISPOSECONTROL | SETCTITLE | GETCTITLE | HIDECONTROL | SHOWCONTROL | DRAWCONTROLS | HILITECONTROL | MOVECONTROL | | DRAGCONTROL | SIZECONTROL | SETCTLVALUE | SETCTLMIN | SETCTLMAX | SETCREFCON | DISPOSEWINDOW | CLOSEWINDOW/ | | SETWTITLE | GETWTITLE | SELECTWINDOW | HIDEWINDOW | SHOWWINDOW | HILITEWINDOW | BRINGTOFRONT | SENDBEHIND | | DRAWGROWICON | MOVEWINDOW | SIZEWINDOW | INVALRECT | VALIDRECT | INVALRGN | VALIDRGN | SETWREFCON | | SETWINDOWPIC | DISPOSEMENU | APPENDMENU | ADDRESMENU | INSERTRESMENU | INSERTMENU | DRAWMENUBAR | DELETEMENU | | CLEARMENUBAR | SETMENUBAR | HILITEMENU | SETITEM | GETITEM | DISABLEITEM | ENABLEITEM | CHECKITEM | | SETITEMICON | GETITEMICON | SETITEMSTYLE | GETITEMSTYLE | SETITEMMARK | GETITEMMARK | SETMENUFLASH | CALCMENUSIZE | | FLASHMENUBAR | OPENPORT | INITPORT | CLOSEPORT | SETPORT | GETPORT | GRAFDEVICE | SETPORTBITS | | PORTSIZE | MOVEPORTTO | SETORIGIN | SETCLIP | GETCLIP | CLIPRECT | BACKPAT | INITCURSOR | | SETCURSOR | HIDECURSOR | SHOWCURSOR | OBSCURECURSOR | SHIELDCURSOR | HIDEPEN | SHOWPEN | GETPENSTATE | | SETPENSTATE | PENPAT | MOVETO | MOVE | LINETO | LINE | TEXTFONT | TEXTFACE | | TEXTMODE | TEXTSIZE | SPACEEXTRA | DRAWCHAR | DRAWSTRING | DRAWTEXT | GETFONTINFO | FORECOLOR | | BACKCOLOR | COLORBIT | SETRECT | OFFSETRECT | INSETRECT | UNIONRECT | PT2RECT | PTTOANGLE | | FILLRECT | FILLROUNDRECT | FILLOVAL | FRAMEARC | PAINTARC | ERASEARC | INVERTARC | FILLARC | | DISPOSERGN | COPYRGN | SETEMPTYRGN | SETRECTRGN | RECTRGN | OPENRGN | CLOSERGN | OFFSETRGN | | INSETRGN | SECTRGN | UNIONRGN | DIFFRGN | XORRGN | FRAMERGN | PAINTRGN | ERASERGN | | INVERTRGN | FILLRGN | SCROLLRECT | COPYBITS | PICCOMMENT | CLOSEPICTURE | DRAWPICTURE | KILLPICTURE | | CLOSEPOLY | KILLPOLY | OFFSETPOLY | FRAMEPOLY | PAINTPOLY | ERASEPOLY | INVERTPOLY | FILLPOLY | | ADDPT | SUBPT | SETPT | LOCALTOGLOBAL | GLOBALTOLOCAL | STUFFHEX | SCALEPT | MAPPT | | MAPRECT | MAPRGN | MAPPOLY | NEWCONTROL | GETNEWCONTROL | GETWINDOWPIC | NEWMENU | GETMENU | | GETNEWMBAR | GETMENUBAR | GETMHANDLE | NEWRGN | OPENPICTURE | OPENPOLY | NEWWINDOW | GETNEWWINDOW | | FRONTWINDOW | DRAGWINDOW | GROWWINDOW | GETCREFCON | GETWREFCON | PINRECT | MENUSELECT | MENUKEY | | SECTRECT | PTINRECT | EQUALRECT | EMPTYRECT | PTINRGN | RECTINRGN | EQUALRGN | EMPTYRGN | | EQUALPT | GETPIXEL | TESTCONTROL | FINDCONTROL | GETCTLVALUE | GETCTLMIN | GETCTLMAX | FINDWINDOW | | TRACKCONTROL | COUNTMITEMS | CHARWIDTH | STRINGWIDTH | TEXTWIDTH | RANDOM | CREATERESFILE | OPENRESFILE | | CLOSERESFILE | RESERROR | CURRESFILE | HOMERESFILE | USERESFILE | COUNTTYPES | GETINDTYPE | SETRESLOAD | | COUNTRESOURCES | GETINDRESOURCE | GETRESOURCE | GETNAMEDRESOURCE | LOADRESOURCE | RELEASERESOURCE | DETACHRESOURCE | ADDRESOURCE | | UNIQUEID | GETRESINFO | GETRESATTRS | SETRESINFO | SETRESATTRS | CHANGEDRESOURCE | RMVERESOURCE | UPDATERESFILE | | WRITERESOURCE | SETRESPURGE | GETRESFILEATTRS | SETRESFILEATTRS | PACKBITS | UNPACKBITS | ALERT | CAUTIONALERT | | CLOSEDIALOG | DIALOGSELECT | DISPOSDIALOG | GETDITEM | GETITEXT | GETNEWDIALOG | ISDIALOGEVENT | MODALDIALOG | | NEWDIALOG | NOTEALERT | PARAMTEXT | SELITEXT | SETDITEM | SETITEXT | STOPALERT | CLOSEDESKACC | | OPENDESKACC | SYSTEMCLICK | SYSTEMEDIT | SYSTEMTASK | BUTTON | EVENTAVAIL | FLUSHEVENTS | GETMOUSE | | GETNEXTEVENT | STILLDOWN | TICKCOUNT | WAITMOUSEUP | GETFNUM | GETFONTNAME | REALFONT | BLOCKMOVE | | DISPOSHANDLE | DISPOSPTR | GETHANDLESIZE | GETPTRSIZE | HLOCK | HNOPURGE | HPURGE | HUNLOCK | | MOREMASTERS | NEWHANDLE | NEWPTR | SETHANDLESIZE | SETPTRSIZE | DELAY | READDATETIME | SECS2DATE | | SYSBEEP | UPRSTRING | DATE2SECS | PACK2 | PACK3 | PACK4 | PACK5 | PACK6 | | PACK7 | EXITTOSHELL | UNLOADSEG | GETAPPPARMS | GETSCRAP | INFOSCRAP | LOADSCRAP | PUTSCRAP | | UNLOADSCRAP | ZEROSCRAP | TEACTIVATE | TECLICK | TECOPY | TECUT | TEDEACTIVATE | TEDELETE | | TEDISPOSE | TEGETTEXT | TEIDLE | TEINSERT | TEKEY | TENEW | TEPASTE | TESCROLL | | TESETJUST | TESETSELECT | TESETTEXT | TEUPDATE | TEXTBOX | TECALTEXT | BITAND | BITCLR | | BITNOT | BITOR | BITSET | BITSHIFT | BITTST | BITXOR | FIXMUL | FIXRATIO | | FIXROUND | GETCURSOR | GETICON | GETPATTERN | GETSTRING | GETPICTURE | MUNGER | NEWSTRING | | PLOTICON | SETSTRING | GETKEYS | | | | | |
At the moment I wouldn't know how to use these. I'm not sure how Mac BASIC expects these to be called ( function names with brackets or without as implied by the Byte article?). I don't know how all the Toolbox data structures are defined and used within Mac BASIC. But at least you can see at least nearly all the APIs are there. So that's a starting point. | Posted by: David Cook on 2026-09-25 15:16:38 No peek or poke? 😛
Yes, a manual or even some sample programs would help a lot. | Posted by: Snial on 2026-09-25 16:55:29
No peek or poke? 😛 LOL!, Nor Deek or Doke! (In BBC BASIC it's addr?offset=byte or addr!offset=longword and in QL BASIC it's PEEK_W or POKE_L variants).
Yes, a manual or even some sample programs would help a lot. Well, the 0.336 disk has quite a few examples, but when you run some of them on version 1.0, some of the syntax has changed, so the compiler generates errors. However, the errors tell you something about what the syntax should be.
For example, in 0.336 you can type the command erase and it would clear the output window. However, in 1.0 you'd need to do clearwindow, because erase is used for things like erase rect 10,10;50,50.
What I want to do is basically (sic) bypass all the convenience commands and go straight to the toolbox. I've deduced command of the form: if toolbox button=true then ... which I used to write a bit of code that waits for a button press, like the command btnwait, but done the 'proper' way. Also toolbox textsize(9) passes syntax (whereas toolbox textsize 9 doesn't, which means it expects brackets for parameters), but if I follow it with a print it doesn't change anything.
toolbox moveto(10,5)
toolbox lineto(30,40)
pass syntax and work as expected!
toolbox drawstring("A String") works, so I can pass strings and they're treated as pascal strings.
I think it's time for bed, haven't figured out how to pass (or return) structured data. I can do:
dim r%(4)
toolbox setrect(@r%,50,50,80,90)
toolbox framearc(@r%,10,90)
And it'll draw what I intend, however, it then throws an out-of-memory error and clicking OK or whatever quickly leads to a bomb and a reset. So, it's partly right. Without the @ it doesn't think the parameters are correct, but I guess @r% returns something like 0; then it writes to a rectangle at 0 and so a crash follows shortly. | Posted by: Forrest on 2026-09-25 19:12:10 Looks interesting. I had not heard of MacBasic before, though I got into Macs a few years later with a MacPlus emulator SpectreGCR on my Atari ST running System 6.0.5. | Posted by: Snial on 2026-09-26 02:54:25
Looks interesting. I had not heard of MacBasic before, though I got into Macs a few years later with a MacPlus emulator SpectreGCR on my Atari ST running System 6.0.5. I had heard of it, but always confused it with the Microsoft Macintosh Basic which was deemed to be pretty poor.
When the Mac came out (1984), Pascal was all the rage and given that the ToolBox had a Pascal ABI, it was natural to dismiss Basic too. I’ve also had a little dabble with FastBasic on an Atari ST emulator as well as looking at a few Archimedes applications in BBC Basic.
The lack of proper structures in either makes programming substantial GUI apps clumsy and convoluted.
What I’m curious about in this case is whether there are any not utterly painful IDEs that will both run on a Mac 128K and allow people to develop proper Mac apps.
A bit more testing on MacBASIC shows that I can’t even do more than dim p%(7300) without running out of RAM. This implies about 14.6kB is free. That’s less than the free space on a 16K ZX81.
It all adds up to the sense that GUIs are incredibly resource hungry. Relatively sophisticated programming was possible using BASIC on much smaller, 8-bit computers, but not this.
However, MacBASIC 1.0 could be seen to be quite big at 85kB (not 53kB as the thread states-that must be v 0.336). A leaner approach, using a more traditional version of BASIC (perhaps 16kB-24kB), but with DIY ToolBox access (like MacPascal) could have made enough of a difference. | Posted by: cheesestraws on 2026-09-26 03:19:44
No peek or poke? 😛
presumably that's what INDIRECT and ADDRESS are for here?
But I'm generally in favour of the BBC BASIC approach to memory access, PEEK and POKE just feel grim to use after that | Posted by: bigmessowires on 2026-09-26 10:06:01 Nice, I'm glad I was able to serve as some kind of inspiration. I never knew it was possible to write a full-fledged Macintosh GUI application in BASIC. I'll be very interested to see what you come up with. | Posted by: Daxeria on 2026-09-26 11:14:47
Yes, a manual or even some sample programs would help a lot.
All three of the third-party MacBASIC books that saw print have been preserved as PDFs in VintageApple.org's Mac programming library:
# 13 — Introduction to Macintosh BASIC (1984) by Scott Kamins, published by Hayden Books
# 46 — Macintosh BASIC (1985) by Richard Norling, published by Osborne/McGraw-Hill
# 86 — The Macintosh BASIC Handbook (1984) by Thomas Blackadar & Jonathan Kamin, published by Sybex | Posted by: Snial on 2026-09-26 14:12:19
All three of the third-party MacBASIC books that saw print have been preserved as PDFs in VintageApple.org's Mac programming library:
# 13 — Introduction to Macintosh BASIC (1984) by Scott Kamins, published by Hayden Books
# 46 — Macintosh BASIC (1985) by Richard Norling, published by Osborne/McGraw-Hill
# 86 — The Macintosh BASIC Handbook (1984) by Thomas Blackadar & Jonathan Kamin, published by Sybex Yes indeed. I did have a look for MacBASIC manuals, and earlier today @Phipli pointed me to them! I have a much better idea of how to write a ToolBox app. I think the next step is to convert a few Macintosh Pascal Programming Primer applications to MacBASIC (or even my miniMorse Application!).
I think your profile icon is very cool!

It reminds me of all the 8-bit isometric video games from the 80s. | Posted by: David Cook on 2026-09-26 23:44:39
All three of the third-party MacBASIC books that saw print have been preserved as PDFs in VintageApple.org's Mac programming library:
# 13 — Introduction to Macintosh BASIC (1984) by Scott Kamins, published by Hayden Books
# 46 — Macintosh BASIC (1985) by Richard Norling, published by Osborne/McGraw-Hill
# 86 — The Macintosh BASIC Handbook (1984) by Thomas Blackadar & Jonathan Kamin, published by Sybex
Thank you! | | 1 |
|