Msg: 4987 *Conference*
03-04-94 09:41:52
From: RON WIESEN
To : BRUCE HANSEMANN
Subj: REPLY TO MSG #4243 (ROM2/CLEUSEAU ROM PROBLEM)
Here's my record of correspondence about the bug in ROM2. Sorry I didn't have it when I responded to you before but my response was off the top of my head. 8085 ASSEMBLER BUG IN ROM2 The 8085 straight assembler in ROM2 has a flaw. Any memory reference instruction that refers to a one-character symbolic label name that mimics the one-character name of a register-pair (i.e., B, D, and H) produces no memory address and no assembly error. Thus memory address 0000 is the effective address after assembly. The flaw is avoided by adding a colon after the one-character operand, regardless of whether the label is defined with a colon. The examples below illustrate the flaw and the way to avoid it. CALL B: ;this avoids the flaw CALL B ;this will be flawed RET B NOP ;the intended address RET Surprisingly, I noticed the flaw when I attempted the example program that demonstrates program simulation for the Model 100/102 on page 49 of the Club 100 ROM2/Cleuseau manual! Can it be that nobody tried this since the manual was published? I contacted Rick Hanson of Club 100: He said the assembler Copyright belonged to Professor Tom Bennett, Polar Engineering & Consulting, P. O. Box 7188, Nikiski, Alaska 99635, (907) 776-5529, CIS: 72136,1443. Rick referred me to Professor Tracy Allen at Berkeley, California who has had years of experience with this assembler. I called Professor Allen. I explained the symptom noted when attempting the simulation example and what I thought was the nature and root cause at that time. Professor Allen and I agreed that I should experiment a bit to confirm my suspicions and call him back. My experiments confirmed the nature and extent of the flaw. I called Professor Allen back with the results. In the meantime, Professor Allen has fired up the assembler and was experiencing said flaw there at Berkeley. He explained that the manual had been retyped from an original by Traveling Software and his copy of an original showed a penned in colon only where the flaw would show itself. Obviously, Traveling Software had taken steps in their publication to avoid the flaw. Professor Allen said he would call Rick Hanson of Club 100 to coordinate sending out alerts to other ROM2 users. He told me that Professor Bennett's Copyright 8085 assembler was used throughout industry for many years by large companies and thus some of their application programs that they market were assembled with no knowledge about the flaw. Thus many commercial software products may have been flawed in assembly! We agreed that it is fortunate that few programmers would use non-descriptive one-character symbolic labels and thus few products would contain the flaw. Unfortunately, all the companies that use the Copyright assembler will have to do regression tests or scrutinize their source programs to see if their products are flawed. The remaining conversation with Professor Allen was chit chat about our early computer experiences. He gave me the following useful tidbits. Debug command N disassembles the option ROM. CALL 0 (which the flaw produced in my example) is a warm-start that works fine in Model 100 but fails about once in 80 times in Model 102 due to interrupt handler that is left open. Regards, -= Ron =-