VIC-20 RS-232 ROM Routines (was: VIC-1011A)

From: Carlsson, Anders (dal95acn_at_mds.mdh.se)
Date: 2001-05-30 09:44:58

Marko Mäkelä wrote:

> I'd like to read the article

Ok. Here it is. The source is "VIC= News no. 2/3, first year (1982)", a
Swedish magazine founded by a VIC user group. Later it was renamed to
"VIC= Rapport" and more or less officially adopted by Handic as the
leading Swedish Commodore magazine until it disappeared in 1985 or so.
The readers' letters in page 14, where Per-Olof Svensson in Karlstad says:

   I think I've found a couple of errors in the VIC-20's ROM:

1. When RS-232 is opened and you have the X-line interface, the DSR signal
   is tested on the wrong I/O port.

   ; OPEN RS-232
   F50C  LDA $0294	6551 command register
   F50F  LSR A
   F510  BCC $F51B	branch if 3-line
   F512  LDA $9120	?? should be $9110
   F515  ASL A
   F516  BCS $F51B	branch if DSR=1
   F518  JMP $F016
   F51B  LDA $029B	continue

2. When you shall send on RS-232 and you have the X-line interface, DSR and
   CTS are tested on the wrong I/O port.

   ; TRANSMIT BYTE RS-232
   EFEE  LDA $0294	6551 command register
   EFF1  LSR A
   EFF2  BCC $EFFB	branch if 3-line
   EFF4  BIT $9120	?? should be $9110
   EFF7  BPL $F016	branch if DSR=0
   EFF9  BVC $F019	branch if CTS=0
   EFFB  LDA #0		continue

   ; SET STATUS (no error)
   F016  LDA #$40	DSR signal missing
   F018  BIT $10A9	F019 = LDA #$10 (CTS signal missing)
   F01B  ORA $0297	RS-232 STATUS REGISTER
   F01E  STA $0297
   F021  LDA #$40	continue

3. When you shall read RS-232 status, the accumulator and the memory cell
   are loaded with zero after read. LDA, STA on address $FE60 and $FE62
   could be replaced by e.g. LDX, STX?

   ; READST
   FE57  LDA $BA	current device number
   FE59  CMP #2
   FE5B  BNE $FE68	branch if not RS-232
   FE5D  LDA $0297	RS-232 STATUS REGISTER
   FE60  LDA #0		??
   FE62	 STA $0297	??
   FE65  RTS

4. When you execute PRINT INT(2.6*2-.2), the answer you get is 4, but the
   real answer should be 5.

   If I am correct, can get new ROMs? I still have a valid warranty. 
   My serial number on my VIC is WG C 2367.

The editor answered only the fourth question, by saying that many micro
computers work in that way (INT rounds down also on negative numbers),
so changing ROMs is out of the question. Also try the following:

  A=-2.6*2-.2 : PRINT INT(A)
  PRINT INT(-.2)

The fourth question really is off-topic for us, but I thought I should
mention all of Per-Olofs problems.

So, here we have a few dumps from the KERNEL, and I just compared with
the files submitted with VICE to find they're identical. The next question
is whether Per-Olof was right. I don't know what the X-line interface is,
and which VIA or whatever it is connected to. Does anyone want to investigate?

Hmm. Quite a long mail. Let's hope somebody was interested.

/Anders Carlsson

-
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail cbm-hackers-request@dot.tml.hut.fi.

Archive generated by hypermail 2.1.1.