{"id":1538,"date":"2021-05-29T19:37:59","date_gmt":"2021-05-29T17:37:59","guid":{"rendered":"https:\/\/www.pagetable.com\/?p=1538"},"modified":"2021-05-29T19:37:59","modified_gmt":"2021-05-29T17:37:59","slug":"commodores-assemblers-part-3-bso-cr6502-11","status":"publish","type":"post","link":"https:\/\/www.pagetable.com\/?p=1538","title":{"rendered":"Commodore&#039;s Assemblers: Part 3:\u00a0BSO CY6502"},"content":{"rendered":"<p>In the series about the assemblers Commodore used for developing the ROMs of their 8-bit computers, this article covers the 1984 &ldquo;Boston Systems Office&rdquo; (BSO) cross-assembler running on VAX\/VMS.<\/p>\n<pre><code>6502 relocating cross assembler version 20.53.12\nCopyright, The Boston Systems Office, Inc. 1978\n(617) 894-7800   TWX: 710-324-0760\nType \/H for help\n<\/code><\/pre>\n<h2 id=\"series-overview\">Series Overview<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.pagetable.com\/?p=1518\">Part 0:\u00a0Overview<\/a><\/li>\n<li><a href=\"https:\/\/www.pagetable.com\/?p=1520\">Part 1:\u00a0MOS Cross-Assembler<\/a><\/li>\n<li><a href=\"https:\/\/www.pagetable.com\/?p=1522\">Part 2:\u00a0MOS Resident Assembler<\/a><\/li>\n<li><strong>Part 3:\u00a0BSO CY6502<\/strong> \u2190 this article<\/li>\n<li><a href=\"https:\/\/www.pagetable.com\/?p=1540\">Part 4:\u00a0HCD65<\/a><\/li>\n<li><a href=\"https:\/\/www.pagetable.com\/?p=1542\">Part 5:\u00a06502ASM<\/a><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"docs\/cbmasm\/cbmasm_history.png\" alt=\"\" \/><\/p>\n<h2 id=\"history\">History<\/h2>\n<p>Commodore bought the chip-maker MOS in 1976 and with it its development tools: They used the so-called MOS &ldquo;Resident Assembler&rdquo; (<a href=\"https:\/\/www.pagetable.com\/?p=1522\">part 2<\/a> of the series) \u2013 first on the MDT650 and later on the PET \u2013 to develop for machines like the VIC-20 and the C64, and for disk drives like the 8250 and the 1541.<\/p>\n<p>In 1984, they switched to a cross-assembler by the company &ldquo;Boston Systems Office&rdquo; (BSO).<\/p>\n<h2 id=\"boston-systems-office\">Boston Systems Office<\/h2>\n<p>Boston Systems Office had been specializing on cross-development tools since 1975, offering dozens of cross-assemblers for <a href=\"https:\/\/ia803207.us.archive.org\/20\/items\/bitsavers_tymsharetygramIndexRev11May77_1215271\/Tymcom-X_User_Program_Index_Rev11_May77_text.pdf\">Tymshare<\/a> systems that were hand-written in PDP-10 assembly for maximum speed, and that aimed at full compatibility with the CPU-makers&#8217; own tools.<\/p>\n<p>Since 1976, they had been offering a 6502 assembler. The 1979 version of the BSO 6502 cross-assembler, called &ldquo;CA6500&rdquo; (<a href=\"https:\/\/github.com\/TYMCOM-X\/169273.tape\/blob\/abc68e373db6be0104efe986d23624462ef691b9\/*6news\/ca6502.doc\">documentation<\/a>, <a href=\"https:\/\/github.com\/TYMCOM-X\/169273.tape\/blob\/abc68e373db6be0104efe986d23624462ef691b9\/sys\/ca6502.sav\">PDP-10 binary<\/a>) was highly compatible with the original MOS assemblers, and had added a few features.<\/p>\n<p>According to <a href=\"https:\/\/archive.org\/details\/AtariOperatingSystemUsersManualAugust1980\">internal documentation<\/a>, Atari had used CA6500 on a PDP-11 for their in-house 6502 development as early as mid-1980.<\/p>\n<p>In early 1984, BSO <a href=\"https:\/\/archive.org\/details\/computerworld1816unse\/page\/46\/mode\/2up?q=cy65xx\">released<\/a> a version for PDP-11 and VAX\/VMS named CY65XX<sup id=\"fnref:1\"><a href=\"#fn:1\" rel=\"footnote\">1<\/a><\/sup>, which was then licensed by Commodore. This version had many additional features added.<\/p>\n<p>No binary of the assembler seems to be archived anywhere, but we do have the manual of the last version Commodore used:<\/p>\n<ul>\n<li><a href=\"docs\/cbmasm\/cy6502.txt\">CY6502 Version 20.53.12 Manual<\/a> (1985)<\/li>\n<\/ul>\n<h2 id=\"usage\">Usage<\/h2>\n<p>When run, the BSO assembler shows the following prompt:<\/p>\n<pre><code>6502 relocating cross assembler version 20.53.12\nCopyright, The Boston Systems Office, Inc. 1978\n(617) 894-7800   TWX: 710-324-0760\nType \/H for help\nC65&gt;\n<\/code><\/pre>\n<p>The output file (ABS) file, the LST file and the SRC file would be specified like this:<\/p>\n<pre><code>C65&gt;PROG.ABS,PROG.LST=PROG.SRC\n<\/code><\/pre>\n<p>The file name extensions are optional. If they are omitted, the defaults are used.<\/p>\n<p>The output file is in BSOs&#8217; own &ldquo;ABS&rdquo; format, and needs another conversion step using the tool OBJCNV:<\/p>\n<pre><code>Object file converter  Version 3.25\nCopyright, The Boston Systems Office, Inc. 1978\nTEL: (617) 894-7800 TWX: 710-324-0760\nType \/H for help\n&gt;\n<\/code><\/pre>\n<p>To convert the resulting ABS file into the MOS &ldquo;OBJ&rdquo; format, you would type this at the prompt:<\/p>\n<pre><code>&gt;PROG.OBJ\/F:MTK=PROG.ABS\/F:BSO\n<\/code><\/pre>\n<p><code>MTK<\/code> stands for MOSTEK, a chipmaker unrelated to MOS Technology, Inc. BSO seems to have had confused the two companies: ABS files also contain the string <code>6502,MOSTEK<\/code>.<\/p>\n<p>In practice, one would use a DCL script to invoke both tools with the right arguments.<\/p>\n<h2 id=\"differences-to-original-mos-spec\">Differences to Original MOS Spec<\/h2>\n<p>The BSO assembler diverged in two aspects from the original MOS syntax:<\/p>\n<ul>\n<li>Labels have to start at column 1, so lines with labels cannot have any leading whitespace. But it is still legal for statements to also start on column 1: The assembler can tell them apart, since all mnemos are reserved keywords, which can&rsquo;t be used as labels.<\/li>\n<li>The <code>.OPT<\/code> directive is not supported. Several of the options are supported through dedicated directives though. See below.<\/li>\n<\/ul>\n<h2 id=\"differences-to-updated-resident-assembler\">Differences to Updated Resident Assembler<\/h2>\n<p>The syntax of both the Resident Assembler and the BSO cross-assembler are based on the original MOS syntax, but some features that are supported by later versions of both have diverged.<\/p>\n<h3 id=\"include-syntax\">Include Syntax<\/h3>\n<p>The Resident Assembler uses the <code>.LIB<\/code> directive to include source files. The BSO assembler uses the <code>.INCLUDE<\/code> directive:<\/p>\n<pre><code>.include disclaimer\n<\/code><\/pre>\n<h3 id=\"macro-syntax\">Macro Syntax<\/h3>\n<p>Macros for the BSO assembler look like this:<\/p>\n<pre><code>dpinc  .macro arg    ;double precision increment\n       inc arg\n       bne 1$\n       inc arg+1\n1$     .endm\n<\/code><\/pre>\n<p>The name of the macro is defined as a label. Arguments can be any string of characters after the <code>.MACRO<\/code> directive, and are blindly searched and replaced in the macro&rsquo;s body. <code>.ENDM<\/code> marks the end of the body.<\/p>\n<h3 id=\"conditional-assembly-syntax\">Conditional Assembly Syntax<\/h3>\n<p>Conditional assembly on the BSO assembler uses an <code>.IF<\/code>\/<code>.ELSE<\/code>\/<code>.ENDIF<\/code> construct, like this:<\/p>\n<pre><code>.ifn gdebug\n       jsr grbpri      ;garbage debug\n.endif\n<\/code><\/pre>\n<h2 id=\"new-features\">New Features<\/h2>\n<p>There are a number of additional features supported by the BSO assembler compared to the original MOS assemblers.<\/p>\n<h3 id=\"text-format\">Text Format<\/h3>\n<p>Source files can now use the complete ASCII character set, as opposed to just uppercase. This means that comments can use mixed case and that TABs can be used for indenting.<\/p>\n<p>In addition, labels, statements and operands are now case insensitive. In practice, all Commodore BSO source code uses lower case for those.<\/p>\n<h3 id=\"local-labels\">Local Labels<\/h3>\n<p>Local labels are in the form of a number from 1 to 255 followed by a <code>$<\/code> sign, e.g.:<\/p>\n<pre><code>100$    ; this is legal\n001$    ; this is the same as the next\n1$      ; this is the same as the previous\n999$    ; this is illegal (1-255).\n<\/code><\/pre>\n<p>The range of local labels is delimited by global labels as well as the <code>.LOCAL<\/code> directive.<\/p>\n<h3 id=\"additional-directives\">Additional Directives<\/h3>\n<p>The BSO assembler supports a number of additional directives:<\/p>\n<ul>\n<li><code>.NAME<\/code>\/<code>.TITLE<\/code>: set name of project<\/li>\n<li><code>.SUBTTL<\/code>: set name of section (like <code>.PAGE<\/code> on MOS)<\/li>\n<li><code>.SKIP<\/code>\/<code>.SPACE<\/code>: skip lines in LST<\/li>\n<li><code>.FORMLN<\/code>: set number of lines per page<\/li>\n<li><code>.LIST<\/code>\/<code>.NLIST<\/code>: enable\/disable LST (like <code>.OPT LIST<\/code>)<\/li>\n<li><code>.CLIST<\/code>\/<code>.NCLIST<\/code>: show\/hide disabled conditional assembly in LST<\/li>\n<li><code>.MLIST<\/code>\/<code>.NMLIST<\/code>\/<code>.BLIST<\/code>: control macro expansions in LST<\/li>\n<li><code>.GEN<\/code>\/<code>.NOGEN<\/code>: enable\/disable extra lines in LST (like <code>.OPT GENERATE<\/code>)<\/li>\n<li><code>.INCLUDE<\/code>: include file<\/li>\n<li><code>.MACRO<\/code>\/<code>.ENDM<\/code>: macro definition (existed on MOS, but different syntax)<\/li>\n<li><code>.REPT<\/code>\/<code>.ENDR<\/code>: repeat<\/li>\n<li><code>.IRP<\/code>\/<code>.IRPC<\/code>: extended repeat<\/li>\n<li><code>.IFE<\/code> conditional assembly if == 0 (existed on MOS, but different syntax)<\/li>\n<li><code>.IFN<\/code>\/<code>.IF<\/code> conditional assembly if != 0 (existed on MOS, but different syntax)<\/li>\n<li><code>.IFGE<\/code> conditional assembly if is >= 0<\/li>\n<li><code>.IFGT<\/code> conditional assembly if is > 0<\/li>\n<li><code>.IFLT<\/code> conditional assembly if is &lt; 0<\/li>\n<li><code>.IFLE<\/code> conditional assembly if is =&lt; 0<\/li>\n<li><code>.IFB<\/code>\/<code>.IFNB<\/code> conditional assembly if (not) blank<\/li>\n<li><code>.IFIDN<\/code>\/<code>.IFNIDN<\/code> conditional assembly if strings are (not) identical<\/li>\n<li><code>.IFDEF<\/code>\/<code>.IFNDEF<\/code> conditional assembly if symbol is (not) defined<\/li>\n<li><code>.LOCAL<\/code>: delimit the range of local labels<\/li>\n<li><code>.MESSG<\/code>: print message during pass 2<\/li>\n<li><code>.RMB<\/code>: reserve memory byte<\/li>\n<li><code>.RADIX<\/code>: change default radix for literals without a prefix<\/li>\n<\/ul>\n<p>All these features are also <a href=\"ftp:\/\/www.zimmers.net\/pub\/cbm\/schematics\/computers\/c128\/servicemanuals\/C128_Developers_Package_for_Commodore_6502_Development_%281987_Oct%29.pdf\">documented<\/a> in the &ldquo;Commodore 128 Developer&rsquo;s Package&rdquo;, which cloned the BSO assembler for the C128. (More details in part 4 of the series.)<\/p>\n<h3 id=\"relocating\">Relocating<\/h3>\n<p>It was possible to create relocatable object files with the BSO assembler. Commodore never made use of this feature. The following directives control this:<\/p>\n<ul>\n<li><code>.AORG<\/code>\/<code>.RORG<\/code>\/<code>.ZORG<\/code><\/li>\n<li><code>.SECT<\/code>\/<code>.ASECT<\/code>\/<code>.RSECT<\/code>\/<code>.ZSECT<\/code><\/li>\n<li><code>.EXTERN<\/code>\/<code>.INTERN<\/code><\/li>\n<li><code>.LINK<\/code><\/li>\n<\/ul>\n<h3 id=\"lst-files\">LST Files<\/h3>\n<p>Listing files had an updated format. Here is an example:<\/p>\n<pre><code>1581 DOS v10  318045-01  (c)1987 CBM    CR6502\/11 version 20.53.12  19-Mar-87  20:17:11 Page 26\n\"copy\"   COPY.SRC\n\nError Addr  Code          Seq   Source statement\n\n                         1755   ; copy file(s) to one file\n                         1756\n     87A2   20 82B9      1757   copy    jsr  lookup     ; look ip all files\n     87A5   AD 022F      1758           lda  f2cnt\n<\/code><\/pre>\n<p>The header distinguishes between the project name (<code>.NAME<\/code>, first field of first line), the section name (<code>.SUBTTL<\/code>, first field of second line) and the filename (second field of second line), and contains the assembler&rsquo;s name and the current date.<\/p>\n<p>The body lines have a new first column that can contain one or more characters that indicate errors in the line, e.g. <code>U<\/code> for undefined symbol. This is instead of added lines with error messages.<\/p>\n<h2 id=\"use-at-commodore\">Use at Commodore<\/h2>\n<p>From the headers of the Commodore LST that have been preserved, we can see that Commodore was using at least the following versions:<\/p>\n<ul>\n<li>version 10.36.6 since at least July 1984 (TED KERNAL and Char ROM)<\/li>\n<li>version 20.51.10 since at least August 1984 (TED BASIC, 1570, original C128 ROM)<\/li>\n<li>version 20.53.12 since at least December 1985 until July 1990 (later C128 ROM, 1551, later 1541\/1541C\/1541-II, 1571, 1571CR, 1581, C64GS)<\/li>\n<\/ul>\n<p>CY6502 was available for VAX\/VMS and PDP-11 systems. Everything points towards Commodore using VAX hardware. The <a href=\"http:\/\/www.zimmers.net\/anonftp\/pub\/cbm\/src\/c128\/c128_dev_pack.tar.gz\">original C128 source archive<\/a> contains a VAX reference dated October 1984 (file <code>monitor.sum<\/code>). A different file (<code>c65.doc<\/code>) in the C128 source archive mentions that the C128 ROM was developed on a VAX-8600 (12.5 MHz, 4+ MB RAM; released in October 1984).<\/p>\n<p>According to a <a href=\"https:\/\/archive.org\/download\/usenet-net\">usenet post to net.micro.cbm<\/a> from December 1985, Commodore had multiple VAX systems at least as early as December 1985:<\/p>\n<blockquote>\n<p>[&hellip;] which consists of the cbmvax 11\/750 and a host of VMS Vaxen, Sun&rsquo;s and developmental systems at both Commodore and Commodore [Amiga].<\/p>\n<\/blockquote>\n<p>(<code>cbmvax<\/code> was the UUCP-connected machine at Commodore. Usenet identifiers and (later) email addresses of Commodore employees contained this machine name.)<\/p>\n<p>Another document (<code>howto.doc<\/code>) in the source archive describes how the result was transferred from the VAX to the Commodore computer: VAX computers were multi-user, and each developer had their own VT100-like terminal connected through RS-232. Each terminal had a second AUX\/printer RS-232 connection that was connected to the Commodore computer (at 9600 baud if it had an ACIA chip). The tool &ldquo;DOWNLOAD&rdquo; on the VAX then sent the contents of the OBJ file through the terminal to the Commodore computer, which used a tool named &ldquo;RSX&rdquo; to receive the data.<\/p>\n<p>The <a href=\"https:\/\/www.pagetable.com\/?p=1540\">next article<\/a> will discuss the HDC65 assembler on C128 that Commodore built in 1986 as a clone of the BSO assembler.<\/p>\n<p><!--\n--><\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:1\">\n<p>The BSO 6502 cross-assembler seems to have many names. The 1976 documentation called it CA6500: Back then, the 6502 was part of the 6500-series that consisted of the 6501 and the 6502. The version Commodore used 8 years later was called CY6502 in the documentation, but in LST files, it called itself CR6502\/11: The &ldquo;11&rdquo; must have stood for either PDP-11 or VAX-11, or both. The &ldquo;R&rdquo; could stand for &ldquo;relocatable&rdquo;, which seemed to have been a recent feature.<a href=\"#fnref:1\" rev=\"footnote\">&#8617;<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the series about the assemblers Commodore used for developing the ROMs of their 8-bit computers, this article covers the 1984 &ldquo;Boston Systems Office&rdquo; (BSO) cross-assembler running on VAX\/VMS. 6502 relocating cross assembler version 20.53.12 Copyright, The Boston Systems Office, Inc. 1978 (617) 894-7800 TWX: 710-324-0760 Type \/H for help Series Overview Part 0:\u00a0Overview Part &#8230; <a title=\"Commodore&#039;s Assemblers: Part 3:\u00a0BSO CY6502\" class=\"read-more\" href=\"https:\/\/www.pagetable.com\/?p=1538\" aria-label=\"Read more about Commodore&#039;s Assemblers: Part 3:\u00a0BSO CY6502\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[],"class_list":["post-1538","post","type-post","status-publish","format-standard","hentry","category-2","category-commodore"],"_links":{"self":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/1538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1538"}],"version-history":[{"count":0,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/1538\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}