A 6 byte Commodore 64 Demo

What if I told you ... 7e 00 8d 20 d0 50 is a Commodore 64 demo

If you thought my last post about a 32 byte (plus 2 byte load address) Commodore 64 demo was esoteric, wait until you burrow into this one.

Back in March at Lovebyte I released a C64 demo that is a total of 6 bytes. I contrived this one so that the 4b of code ends up overwriting part of a zero-page routine that runs every time RETURN is pressed. The effect is a pulsing pattern on the border. (You can just as easily make the screen pulse, which I personally find less aesthetically pleasing because the pulsing in that case happens over any text that is on the screen. It’s also a bit more eye watering and more likely to trigger seizures.) While it’s a very simple effect, I don’t know of any demo at all for this platform that has this file size or any smaller one. Some extensive trickery was involved in injecting my code into existing memory contents to produce this effect.

You can download the demo, NONMONOCHROME.

For my several readers who enjoy reading 6502 assembly, here’s what I did:

; NONMONOCHROME
; 6b C64 demo (2b header + 4b)
; by nom de nom/TROPE

; RETURN to begin.
;
; This demo loops about every 1.45 seconds (on an NTSC
; machine).
;
; Holding down a key while this runs will produce an extra
; effect.
;
; RUN STOP - RESTORE will stop the program, but as soon as
; RETURN is pressed the demo will just start again. To
; restore normal function, it's necessary to power-cycle
; the C64.

.outfile    "nonmonochrome"

.word $007e  ; Wedge the code into CHRGET on the zero page.
.org  $007e  ; Note that CHRGET itself begins at $0073.

sta $d020    ; Set the border color with whatever's in the
; accumulator. The value varies as the code from $73
; through $7e runs. It oscillates between black and white
; for one phase and colorful for another phase. A detailed
; explanation of why is provided below.

.byte $50    ; This makes the next instruction bvc, clobbering
; $20. The following value in memory, $f0, had been used as
; beq. $50 $f0 = bvc $73, which (infinitely) takes us back to
; the beginning of CHRGET at $0073.

; A disassembly of CHRGET, left, and how it's been modified,
; right:
;
; .org  $0073                 .org  $0073
;
; chrget   inc txtptr         nonmono  inc txtptr
;          bne chrgot                  bne chrgot
;          inc txtptr+1                inc txtptr+1
; chrgot   lda                chrgot   lda
; txtptr   .word $0207        txtptr   .word $0207
; pointb   cmp #$3a                    cmp #$3a
;          bcs exit                    sta $d020
;          cmp #$20                    bvc nonmono
;          beq chrget
;          sec
;          sbc #$30
;          sec
;          sbc #$d0
; exit     rts

; CHRGET keeps increasing TXTPTR until it reaches the end of
; whatever BASIC input it's reading -- whether in immediate
; mode or when reading a BASIC program.
;
; NONMONO, however, loops forever and keeps increasing TXTPTR
; until it overflows past $ffff back to $0000.
;
; Because of the LDA TXTPTR, the accumulator is being
; consecutively loaded with each of the bytes in the C64's
; 64kb of accessible RAM and ROM. Then, after the CMP
; (which does nothing but slow the demo down by two cycles
; per loop), the contents of the accumulator are stored
; so as to set the border color.
;
; A large region of the C64's memory has $0 or $1 as the
; low nibble -- at least at power on, with no BASIC program
; loaded. Thus, black or white. Then, another large region
; (including ROM and the zeropage) has more "interesting"
; contents which manifest themselves as colors.

My demo was also taken up as an object of discussion in the first 7 minutes and 30 seconds of this YouTube video, where some of this explanation is provided as the demo runs on a C64c. This a later model of the Commodore 64, not the system I used in testing it, so the pulsing effect is slightly different. Among other things, my name for the demo, NONMONOCHROME, makes less sense when it’s running on this computer!

It could be an interesting challenge for others to try writing a Commodore 64 demo of only 6 bytes total, or of fewer bytes. For reasons I’d be glad to discuss, it seems to me that injecting the code into some productive context (an existing routine such as CHRGET or elsewhere in memory) is the only workable approach.

C64 Coding Under (Many) Constraints

Screenshot from Tyger Tyger; black and white border, scattering of orange and black characters on blue

Yesterday I wrote a little demoscene production, an intro, called “Tyger Tyger.” It’s a Commodore 64 machine language program with 32 bytes of code and the requisite 2 byte header, found on all C64 PRG files. It only garnered third place out of five entries in the 256b compos at @party 2021, behind two impressive entries that were for a different platform (DOS) and went to the limit of allowable code (eight times as much).

I wrote this intro under a formal constraint (32 bytes of machine language code) and several process constraints. Specifically, I wrote it all yesterday, mostly on a Amtrak train, finishing up the sound once I got to the party itself in Somverville. I also exclusively used a hardware Commodore 64 running Turbo Macro Pro v1.2, rather than cross-assembling the code on a contemporary computer and testing it on an emulator. To be specific, I used an unofficial hardware version of the Commodore 64 called the Ultimate 64, which is a modern FPGA implementation of Commodore’s hardware—not, however, an emulator. I placed a SID chip (a 6581) in the machine, so the only analog component that would otherwise need to be emulated was an authentic original.

Writing the code exclusively on the train provided me with some additional challenges, because the power kept cutting out and my system (which has to be plugged into AC power) shut off each time.

I’d never used any version of Turbo Macro Pro before, neither the C64 assembler nor TMPx, the cross-assembler. I figured out the basics of how to use the editor and learned the syntax the assembler used. It’s quite an excellent piece of software—thanks, Style!

And tremendous thanks to Dr. Claw, who put on a safe, responsible, demoparty—masks required when not eating, full vaccination required for all. It was a tiny one, yes, but it was a party! The event continues the important social and artistic traditions of the North American demoscene.

Concise Computational Literature is Now Online in Taper

I’m pleased to announce the release of the first issue of Taper, along with the call for works for issue #2.

Taper is a DIY literary magazine that hosts very short computational literary works — in the first issue, sonic, visual, animated, and generated poetry that is no more than 1KB, excluding comments and the standard header that all pages share. In the second issue, this constraint will be relaxed to 2KB.

The first issue has nine poems by six authors, which were selected by an editorial collective of four. Here is how this work looked when showcased today at our exhibit in the Trope Tank:

Weights and Measures and for the pool players at the Golden Shovel, Lillian Yvonne-Bertram
“Weights and Measures” and “for the pool players at the Golden Shovel,” Lillian Yvonne-Bertram
193 and ArcMaze, Sebastian Bartlett
“193” and “ArcMaze,” Sebastian Bartlett
Alpha Riddims, Pierre Tchetgen and Rise, Angela Chang
“Alpha Riddims,” Pierre Tchetgen and “Rise,” Angela Chang
US and Field, Nick Montfort
“US” and “Field,” Nick Montfort
God, Milton Läufer
“God,” Milton Läufer

This issue is tiny in size and contains only a small number of projects, but we think they are of very high quality and interestingly diverse. This first issue of Taper also lays the groundwork for fairly easy production of future issues.

The next issue will have two new editorial collective members, but not me, as I focus on my role as publisher of this magazine though my very small press, Bad Quarto.

Sliders

Sliders front cover, with battlements

My minimal book Sliders has been published by my press, Bad Quarto. The book contains 32 poems, some of which are only one word long. In a break from tradition, they are not computer-generated.

Currently Sliders is only available for sale at the MIT Press Bookstore, 301 Massachusetts Ave, Cambridge, Mass.

Sliders back cover, with blurbs

Paging Babel

About 12 hours ago I was reading “The New Art of Making Books” by Ulises Carrión, a text I’d read before but which I hadn’t fully considered and engaged with. As I thought about Carrión’s writing, I felt compelled to put together a short piece on the Web. That took the form of a Web page containing a rapidly-moving concrete poem. The work I devised is called “Una página de Babel.”

Screen capture of Babel

Many will surely note that it is based on Jorge Luis Borges’s “Una biblioteca de Babel” (The Library of Babel). And, I hope people are aware of some the other interesting digital projects based on this story. I have seen one from years ago on CD-ROM; one that is very nice, and available on the Web, is Jeremiah Johnson’s BABEL. There’s also the exquisite Library of Babel by Jonathan Basile.

My piece does not try to closely and literally implement the library that Borges described, although it does have a page that is formally like the ones in Borges’s library: 80 characters wide, 40 lines long. Given this austere rectangular regularity, I assumed a typewriter-like monospace font.

The devotion of “Una página” to what the text describes stops there; instead of using the 23-letter alphabet that Borges sketches to populate this 80×40 grid, I use the unigram probabilities of letters in the story itself, in the Spanish text of “La biblioteca de Babel.” So, for instance, the lowercase letter a occurs a bit less than 8.4% of the time, and this is the probability with which it is produced on the page. The same holds for spaces, for the letter ñ, and for all other glyphs; they appear on the page at random, with the same probability that they do in Borges’s story. Because each letter is picked independently at random, the result does not bear much relationship to Spanish or any other human language, in which the occurrence of a glyph usually has something to do with the glyph before it (and before that, and so on).

“Una página” is also non-interactive. One can zoom, screenshot, copy and paste, and so on, but the program itself does not accept user input.

I sketched the program in Python before developing it in JavaScript, and when I was done with the HTML page that includes the JavaScript program, I thought I’d make a Python version, too. But when I did, I was disappointed; the Python program isn’t a page, and doesn’t produce a page, and so doesn’t seem to me to fit the concept, which has to be that of a page. Thus, I’m not going to release the Python program. The JavaScript version is the right one, in this case.

Only the Staring from the Twilight Saga

You can now watch a 26-minute supercut of all the instances of staring in all the Twilight movies.

I recommend it.

Yes, the framing is a bit corny, as if it were a video game or an educational video made to inform you about how much staring there was. Less could have been more.

There are earlier video art projects that do similar things, and more of them. One of my favorite precursors is the brilliant Every Shot, Every Episode by Jennifer & Kevin McCoy. Housed in a suitcase, it is an interactive installation that allows access to 10,000 clips from Starsky & Hutch which have been categorized in 300 ways — every extreme closeup, every yellow Volkswagon, every affirmative response, and so on.

In fandom there seems to be less interest in exhausting every shot of a certain type, but I think each of the individual parts of 21 Vidlets about Buffy the Vampire Slayer is a bit like this.

I liked the video because it raises questions about movies in general (is this amount of staring too much? What’s typical? Which directors have the most staring?) and about staring (how can it be different? What counts as staring?). And, of course, the movie or YouTube viewer’s activity, in the most stereotypical case, is nothing more than staring.

Ouliperrata and Palindromes

The End of Oulipo? : An Attempt to Exhaust a Movement by Lauren Elkin & Scott Esposito (2013) claims that “Georges Perec … wrote a palindrome of over 5,000 words …” (p. 15, also mentioned on p. 25). However, this is wrong, unless these authors have access to an extraordinarily surprising never-before published palindrome of Perec’s. His long palindrome does not have this many words.

In 1980, Hachette published Perec’s La Clôture et autres poèmes, which contains “Le Grand Palindrome,” written in 1969. “Le Grand Palindrome” is also online; it is posted on another page without its title but with a declaration that the palindrome is 1247 words long.

Wikipedia states that this text has 1247 words and 5566 letters, and the French entry on Perec agrees. (The number of letters was probably the source of the confusion about 5,000 words in Elkin & Esposito’s book.) Since the palindrome is online, we can do some original research to determine the word and letter count – someone must have, because the cited source does not say how many words and letters there are; the source is simply the text itself. The Web is littered with different numbers that are supposed to be the length, in words, of Perec’s palindrome. David Bellos, who quoted and translated the beginning and ending of Perec’s long palindrome in his extraordinary biography, Georges Perec: A Life in Words, described the palindrome as consisting of two halves, each of five hundred words (pp. 428-429).

Standard word-count programs come up with a larger number of words than either Bellos or Wikipedia have: The Gnu utility wc counts 1367, for example. In part, that’s because some of the punctuation is set off with spaces. But it may also have to do with a reasonable way of counting words in French being different than wc’s method.

So, leaving aside the question of words for the moment — but noting that the answer seems to be in the 1000-1400 range, and couldn’t be 5000 – let’s take a look at the number of letters. I placed the palindrome’s text (all of it, including the strange title that is a reversal of Perec’s name and the place and date of writing) in a file called perec.txt and did the following to count the letters:

% fold --width=1 perec.txt | grep -c '[[:alpha:]]'

The result is 5219. Yes, I checked to make sure that accented letters are being counted on my system. I’m not sure where the extra 5566-5219=347 letters are supposed to be. There are only eight digits, so the ‘1969’ at the end (and ‘9691’ at the beginning) couldn’t account for the larger number. And I counted 736 punctuation marks, so the puzzle isn’t solved by considering punctuation marks to be letters, since that (in addition to being incorrect) would make the palindrome too long. Unless my text is corrupt, I suppose that some of the punctuation marks were counted as letters before.

You can read in Daniel Levin Becker’s 2012 book Many Subtle Channels: In Praise of Potential Literature that Perec “wrote a palindrome of more than 1,200 words, the world’s longest until a computer program eclipsed it” (p. 181). The approximate word count seems right, but what about the rest of the statement?

On January 1, 2002, the first edition of Nick Montfort & William Gillespie’s 2002: A Palindrome Story was published. This text, published in a much nicer edition later in the year and made available in several formats online, is a 2002-word palindrome that we wrote together. We had actually hoped that the suite of software we developed, Deep Speed, would generate text for us and serve as a third co-author, but unfortunately its main use ended up being to check our work. In the end, 2002 was about as much generated by computer as “Le Grand Palindrome” was generated by typewriter.

(Perhaps Becker was referring to the data-driven palindrome found by Google’s Peter Norvig? That was composed and published on February 20, 2002, weeks after 2002 was first published in celebration of the new year. Also, while I consider it a brilliant hack, and while I certainly think that computer programs can produce literary output, I’m not sure how to understand or learn from this program and this text as a literary project. In terms of pure length, it’s a long palindrome, yes, but so is this; in fact, that one is longer than any that Norvig has produced.)

Now, to reassure Oulipo fans, 2002 and “Le Grand Palindrome” are written in different languages, so it would be awkward at best to claim that we directly outdid Perec. Also, it took two of us to write our English palindrome and only one of Perec to write his palindrome in French, so Perec still holds the record per-person per-palindrome. And finally, as my parenthetical remark and link above is supposed to show, it’s just silly to compare palindromes’ length alone; it’s important to read them and see how compelling they are. Writing a palindrome of more and more words involves conducting a more lengthy and profound exploration of language. Perhaps that type of exploration means falling off a cliff – as some thought Perec did; as some surely thought that William & I did in writing the exceedingly difficult text 2002. But it’s an exploration, and for us, as for Perec, it resulted in a radical and unusual literary work.

2002 received praise from members of the Oulipo and a positive review in the Review of Contemporary Fiction. It certainly wasn’t the usual one-line palindrome fare that many are used to. Although it’s challenging, I hope that more intrepid readers will eventually engage with text. I’m disappointed that a major magazine article on palindromes and the Wikipedia page on the topic don’t mention it. I’m disappointed that scholars and literary critics (who have devoted time to other works of mine and of William’s) haven’t delved into 2002. And it doesn’t give me much hope when the well-known long palindrome of a tremendously famous and influential French writer, however well-known it is, is still widely unread. We can’t even figure out how many words and letters it has.

An Auto-Interview about All the Way for the Win

Poet Michael Leong “tagged” me, not by spray-painting me or by assigning me a folksonomical string, but by sending me the following template of interview questions. This process is part of the project “The Next Big Thing,” in which people answer robotic, monomaniacal questions about recent or forthcoming books. I was supposed to post this on Wednesday, apparently, so it’s a good thing that I can set the date arbitrarily on my blog posts.

What is the working title of the book?
All the Way for the Win.

Where did the idea come from for the book?
Decades of intense poetic engagement with the English language.

What genre does your book fall under?
In terms of literary tradition, it’s an example of the sort of constrained writing that was pioneered by the Oulipo; in terms of the retail channel, it will end up in the poetry section if anywhere.

What actors would you choose to play the part of your characters in a movie rendition?
Mos Def, Zhu Zhu, Rex Lee, Won Bin, and (although I don’t think he’s a member of the SAG) Tan Lin.

What is the one sentence synopsis of your book?
A book written using only three-letter words.

How long did it take you to write the first draft of the manuscript?
I haven’t written anything close to a complete draft. I’ve only been working on the project seriously for about four years.

Who or what inspired you to write this book?
All the Way for the Win is 0% inspiration.

What else about your book might pique the reader’s interest?
The English langauge bursts with words brought to us by commerce and colonialism, is scarred by decades of wars and invasions, and both traces and propels our thinking as a culture. It is an urgent and important project to find principled, unusual subsets of this language and to make new works out of these, revealing qualities of our language through poetic practice. Readers of this book may also considerably improve their Scrabble play.

Will your book be self-published or represented by an agency?
No.

Radical Books of 2012 (5/7)

Cutting Time with a Knife

Cutting Time with a Knife
Michael Leong

Black Square Editions · 124 pages

When randomness is employed in poetics and succeeds, it is because of how it plays within regularity of different sorts. This book sutures the two very well. Concrete elemental sqaures sit at the top of each page, containing irregularly arranged phrases of regular syntax (“The [buttock] of the poet is the [geodesic dome] of [Rhodium].”) The text and sometimes symbols underneath read like a Google Books snippet view. Leong constructed this book “by etherizing T.S. Eliot’s classic essay,” “Tradition and the Individual Talent,” upon the periodic table. The cyborg text, animated with galvanic force, is made from cut-ups of this essay and the Wikipedia articles for the 118 elements. The periodic table has offered a rich lattice for poetic production, digital and otherwise; here, the unique twist was provided by the amalgamation of this tabular framework with an (ostensibly random) avant-garde writing technique, a classic essay on how individuality relates to commonality and a collaboratively-authored encyclopedia.

Shuffle Literature? Read ‘Em and Weep

Among several notable new articles in ebr (electronic book review), please find “Shuffle Literature and the Hand of Fate” by Zuzana Husárová and Nick Montfort:

Zuzana Husárová and Nick Montfort up the ante for experimental writing by examining the category of “shuffle literature.” What is shuffle literature? Simply put: books that are meant to be shuffled. Using formal reading of narrative and themes, but also a material reading of construction and production, Husárová and Montfort show that there are many writing practices and readerly strategies associated with this diverse category of literature.

A Thousand Twitters

News of a strange new social network, Monolyth, reaches us from December of this year and from Chris McDowall.

To sate the great appetites of the system, which will only publish messages at least 140,000 characters long (and will abbreviate longer ones), authors turn to unusual techniques.

One of these is generating massive texts using modified versions of Taroko Gorge, one of which is included in the blog post.

Ubu Runs Ubuntu!

Welcome back to the Web’s major agglomeration of the avant-garde, Ubuweb.

(I don’t know that Ubu actually runs Ubuntu, but some statements are univocalically true regardless. And the site is back up, that’s for sure.)

Language and Code at the Gate

What are we waiting for, assembled in the forum?

A technical report is to arrive today.

No need to worry about what will become of you without a technical report! The report, the fourth “Trope Report” in the Trope Tank series that started this year, is here:

In “Carrying across Language and Code,” Natalia and I discuss issues of translation and computational writing. With reference to electronic literature translation projects in which we have been involved as translators or as authors of the source work, we argue that the process of translation can expose how language and computation interrelate in electronic literature. Various small poetry generators, a cybertext poem, and two works of interactive fiction are discussed in this report.

Share and enjoy…