[Coco] Assembly help: Corrupted bin file ?

Robert Gault robert.gault at worldnet.att.net
Wed Dec 17 17:29:23 EST 2008


Fedor Steeman wrote:
> Thanks Robert, you are being a great help!
> 
> I must admit that I am going about this matter in a bit of a messy way. I
> have read and understood most of Barden's book amongst others, but since I
> never have the proper time to experiment with assembly I start forgetting
> even the most basic things again. Like most people, I learn best by doing.
> One of my problems has been a lack of a good assembler that I can move back
> and forth from whenever I find the time. The Portal-9 and RainbowIDE
> products are perfect for this, but for some reason I have never properly got
> them to work. The code fragment you are looking at actually is taken out of
> a CoCo program that I ran through a disassembler in order to analyse.
> 
> What I am doing now is just running the CASM assembler on a command prompt
> while editing the source file in a text editor. Since I have VCC installed I
> can simply double-click the bin-file and it is automatically mounted in the
> emulator. This works fine with the bubblesort program provided in
> RainbowIDE. So I am not using a virtual diskette as a go-between but have
> the machine code directly written in the emulated memory and executed.
> 
Hmm, that (double clicking on a .bin file) has stopped working for me. 
Guess I'll have to reinstall VCC.

> I now made the necessary changes to the source code I showed you and it is
> mounted without problems! The program is executed in VCC and shows a pmode 4
> screen with vertical stripes as expected. However, the stripes aren't as
> narrow as I expect them to be. Using $AAAA which translates to binary 1010
> 1010 1010 1010, I would expect pixel-wide alternating black and white
> vertical lines. What I am getting, though, are much broader vertical black
> bars interrupted by paired vertical stripes. Any explanation for that?
> 
> Cheers,
> 
> Fedor
> 

I've mounted the program on a disk and used LOADM and EXEC to run it. It 
does exactly what you asked it to although that might not be what you 
really want.
The first thing I see is the PMODE4 screen with alternate black and 
white vertical lines. I also see a short horizontal black line in the 
upper left quadrant. That is undoubtedly the result of your choice for 
the location of the PMODE4 screen at $400.
That is not a good location for a PMODE4 screen because you overlap part 
of the disk operating system in low RAM. $400 is the location of the low 
res text screen from $400-$5FF. The PMODE4 screen should start at $E00 
or higher on a disk system.
The first key press results in a low res text screen filled with 
vertical blue and black lines with the exception of the last two 
horizontal lines which are default green with OK on the second to last line.
This is also expected because you put graphics data on the text screen.

You should change your code as follows:
VIDRAM EQU $E00
VOFS1  EQU $FFC7
VOFS2  EQU $FFC9
VOFS3  EQU $FFCB

Change the program origin to:
  ORG $7000

  CMPX #$1C00  replace with
  CMPX #VIDRAM+$1800

  STA  VOFSET  replace with
  STA  VOFS1
  STA  VOFS2
  STA  VOFS3

See how the program works after the above changes.



More information about the Coco mailing list