Msg: 4879 *Conference*
01-12-94 17:11:57
From: RON WIESEN
To : BRUCE HANSEMANN
Subj: REPLY TO MSG #4243 (ROM2/CLEUSEAU ROM PROBLEM)
I'm familiar with the symptom and researched it when I first got ROM2/Cleuseau and tried to duplicate an example from the user manual. I suspected the problem was the assembler confusing a memory designator ("B" in the operand and label fields of the example) with a reserved Register designator. Eventually I spoke to Polar Engineering in Alaska about it. They checked it out and confirmed my suspicion. Your not doing anything wrong and your ROM is OK. The assembler has a quirk and doesn't work quite as advertised in the user manual. The manual is "re-printed" and the example differs ever so slightly from what was in the original manual. Here's the quirk. When you refer to a one-character label that happens to be the same character as any of the one-character designators that are reserved for Register or Register-pair designation, you MUST end the operand with a colon (:). Without colons, the assembler associates one-character operands like A, B, D, and H respectively with the A register, and the BC, DE, and HL register pairs. So when the assembler resolves such an operand into a memory address for a memory reference type of instruction, the result is zero because memory address resolution does not apply to reserved register designators. The fact that the instruction is not a register reference type is overlooked! Here's a simple work-around. Never use one-character labels. In fact aside from the example in the user manual, I never use such non-descriptive labels in real world programs. If it weren't for the "re-printed" user manual I'll bet the quirk would never be noticed. Glad to see I'm not the only guy who "wastes time" working through the childish examples in documentation before he launches into practical projects. Here's the best work-around. The safe way to go is ALWAYS end all operands and labels with a colon. It's overkill to be sure but it sure beats looking for coding bugs that you haven't made. By the way Bruce, a colon doesn't count as far as the maximum number of characters in a label. As regards the reply from David Firth with concern about ROM2 abilities to handle forward references (like JUMP), and concerns about it being "buggy", I have used ROM2 extensively and have not found any bugs or any quirks other than the one I mentioned here. Regards, Ron Wiesen