Changelog for the Sarcasm Z80 Assembler The format of this log is as such: Indented lines mention changes made between releases. Unindented lines mention when releases were made. For that reason, the changes mentioned before a release apply to that release, and all changes mentioned after a release do not. That makes all of the sense in the world, right? It's still confusing, though. Original Release Any and all changes between the original release and the next mentioned release are undocumented. It wasn't until recently that I learned the value of archiving old releases and maintaining a change log. Released version 2008-01-17 !! Now remember, the changes I'm about to list apply to the next !! release, not release version 2008-01-17 that I just mentioned. ** I added 'verbose' comments to enable various debugging features. ** I subsequently wrote a test file to check Sarcasm's parsing of different line terminators and found it to be so incorrect that I'm not sure I ever tested it to begin with. It's fixed now. You can test it like this: ./sarcasm.pl test/line-terminators.asm Each comment line in the source file tells you what line it belongs on. The interesting thing about that test file is that it contains so many different line terminators that you won't find a text editor that understands it, but Sarcasm does, and so it should also understand any source files anyone creates. ** While reading the code that looks for things like "mov a -6 + label" and turns them into "mov a -6+label" I thought to myself "there's no way this works correctly." So I wrote a test file for it, and sure enough, it only worked correctly with numbers. Toss in a label or three and it was all messed up. So I rewrote some of that code, and created test files for it as well: ./sarcasm.pl test/plus-minus-sane.asm ./sarcasm.pl test/plus-minus-insane.asm If someone can think of a test case which isn't in these files that should be, please send it to me, even if Sarcasm correctly handles it. The purpose of that file is to ensure that it continues to handle that stuff correctly in the future, not just right now. ** I thought it was odd that 'section' requires an address and a size, while 'output' requires a first address and a last address. I didn't want to change the behavior of section, partly because that would cause incompatibility with existing code, but mostly because having the last operand be both a size or an address is useful. For that reason, I added a 'range' directive which is identical to 'section' except that the last number is an inclusive address. Just for comical effect, I made Sarcasm remember whether you defined a section using 'range' or 'section' and refer to it as a 'range' or a 'section' in error messages. They are identical entities, however. ** Wrote some test files to test error messages. ./sarcasm.pl test/error-messages-parser.asm ./sarcasm.pl test/error-messages-assembler-pass-one.asm ./sarcasm.pl test/error-messages-assembler-pass-two.asm In the process, I discovered that you get the wrong error message if you use a directive with the incorrect number of operands, e.g. "output 'filename.rom'" I also modified a lot of error messages to make them a little more helpful and easier to understand. Particularly the message "I hate this label name" for which even I didn't know the meaning. ** Changed opcodes 'rcla' and 'rcra' to 'rcl' and 'rcr' as they were dissimilar with the other opcodes, but quite similar to the standard opcodes of the same name which function differently. Can't have that. ** In an attempt to write better documentation, I found myself trying to justify the many renamed opcodes, but there just wasn't good reason for "ld" to be "mov" and "jp" to be "jmp" aside from being more like the Intel 8086 assembly language. So I changed them back to their Z80 names. I didn't change everything as there's just too good a reason for a lot of the changes. ** I guess I'll toss this on the web site, even though I'm too lazy to update the documentation right now. ...besides, it really needs to be totally rewritten, and I'm totally too lazy for that. Because of that, I'm putting the old opcodes file in place. The new one is there as "opcodes.new" if anyone wants to rename it to "opcodes." Released version 2008-05-01 ** The line number of section definitions is stored in the same hash that stores the line numbers of label definitions. The hash keys were of the same format as labels, which was dumb, so now they're not. ** Just now tried assembling something with more than one source file. Discovered it didn't work due to an uninitialized array being re-used for every source file. I wonder how many other features I've added but somehow forgotten to test. ** Found a few more instructions which hadn't been changed to standard Z80 syntax. ...and I did something else, but I forget what. ** Made range/section addresses accessible as a label: ".name." ** Finally decided to write some half-assed documentation in "examples/simple.asm" which turned out to be not-so-simple after all, but what the fuck? You just can't do assembly without learning a few directives first. It isn't BASIC. ...and fuck, this thing's been without documentation since 2008-05-01? Seems like it was just yesterday. I suppose it's time for a new release, as I'm sick of the Sarcasm web page stating what a useless piece of shit it is since it lacks documentation. Released version 2009-03-11 ** While pointlessly reading the source (I love the source) I noticed it wouldn't handle more than two consecutive "0x10 0x13" line terminators correctly, so I fixed it, even though I don't know of any OS which uses that sequence of bytes to terminate lines. ** Let's not bitch about relative locations being too far away when we don't even know where the location is. ** Modified start conditions for each multi-file assembly pass. Namespaces were being cleared for each pass, which made it impossible to use them before they were declared, which is just silly. Also, only the first file began in the 'default' section, now all files do. ** Fixed a nasty parsing error which occurred when double quoted strings contain double quotes. Also made it so that double quoted strings can contain double quotes. It's dumb that way, but the only alternative was an error message to the effect of "I know what you're trying to do but I'm not going to allow it" and I'm not going there. Added a bit of code to catch similar nasty parsing errors even though I can't imagine the same thing would ever happen again. ** Found that forgetting to include the operands of an instruction caused it to be accepted as a label. Now an error is generated. ** Made Sarcasm look in a few clever places for the opcodes file, so that it can be installed like a normal program, at least in Linux. ** "retn" and "reti" were listed as "ret n" and "ret i" in the opcodes file. ** Realizing that every source file I created began with a namespace command specifying the name of the file without the .asm extension, I thought this would make a nice default namespace for each file, and so it is. ** Wow... Apparently you can open a directory as a file, and it won't generate an error. You don't get an error until you read it. Well, fuck, I guess I now need code to see if the source files really are files before assuming that they are. ** Started the removal of the section/range duality. I don't think I ever used the "section" form of the declaration without a calculator's help, and so fuck it, it's gone. I also changed the behavior of a range definition causing a section change. Now you must explicitly use the 'section' command. ...and "must" is the word, as I've done away with the default section as it seemed like an easy way to cause an error that is very difficult to figure out the source of. Now each source file must contain a 'section' command to explicitly choose a section. ** Tried to make the error messages for the newly required range and section directives as clever as possible, since anyone who just tries to use the assembler without reading the documentation is going to see this error. ** Changed a whole bunch of "\n" to "\r\n"; portability is such a bitch. ** Discovered that "--" in a string was changed to "+". Corrected by positioning a few lines of code within a set of curly brackets. ** Added ';' to the list of characters which may follow quotation marks which terminate strings to fix "untermianted string" errors. ** Wow, this list is getting long. Maybe I should do another release? Released version 2010-05-12 ** Found a bug in the code in the documentation. Not that it matters since that code is entirely non-functional anyway, but whatever. ** Someone emailed me and asked about an 'EQU', prompting me to copy the 'replace' directive from Sarcasm's twin sister Orgasm. ** Tweaked a couple of error messages to account for them not being strictly correct in their explanation of the problem. ** Renamed "opcodes" file to "opcodes.txt" so that it is easier to open and examine in Windows. Released version 2014-12-03 ** So sick of "this sub-label does not have a parent label." Who cares? So I made it stop bitching and just accept the fucking sub-label. ** I decided that colons need to appear after labels. Otherwise if I typo an instruction with no operands, there's no error message. For convienence, labels that contain a period still do not require a colon. Released version 2016-12-03