News:

;) This forum is the property of Proton software developers

Main Menu

Problem: 'Invalid operands specified'

Started by charliecoutas, Nov 17, 2026, 10:30 AM

Previous topic - Next topic

charliecoutas

I have just tried to recompile a massive "old computer emulation" program that I wrote a few years ago. The compilation fails with "Invalid operands specified: ('repeat #0xffff')". I fished out the offending ASM, below, but I'm now stuck, it looks OK to my eyes. Any suggestions please? The chip is a 33EP512GP806, compiler vsn  1.1.3.3

It doesn't look right, clearing 64K-1???
Charlie

; clearing ram For the Clear directive
    Clr.w W0
    Mov.w #0x1000,W1
    Repeat #0xffff      <-------- this instr
    Mov.w W0,[W1++]
    Clr.w TBLPAG
    Clr.w BPF
; setup usart1
    Mov.w #0x8808,W0

charliecoutas

I've got some large ".inc" files which appear to be causing the problem. I'll fiddle around and see if I can narrow it down......

top204

His compiler needs to be updated, with either the 'free' update, or the 'payed for' upgrade.

The assembler Repeat mnemonic has a maximum amount of loops of: 0x3FFE, and the older compiler version is using 0xFFFF, which will cause the assembler to create an error message. The assembler code is produced when the Clear command is used in the code listing.

The current Positron16 compiler produces the following assembler code for the Clear command:

; clearing ram For the Clear directive
    clr.w W0
    mov.w #0x1000,W1
    repeat #0x3ffe
    mov.w W0,[W1++]

Notice the repeat's amount of loops, to clear 32768 words of RAM, before the user program starts, and before any Static variables are assigned.

It can be corrected in the compiler versions used, by removing the Clear command from the code listing.

Regards
Les


charliecoutas

Thanks Les, Paypal transaction for latest compiler done just now.

Charlie

top204

#4
Many thanks Charlie, a forum message has been sent with the download link, but if I had known it was for yourself, I would not have dreamt of receiving money from you...

My day at Bletchley Park that you arranged was something I will never forget, and my gratitude to yourself, and our lovely friend Tim for coming up here to drive me down to it, will always be part of me.

Very best regards
Les

charliecoutas

No worries Les. The program now compiles OK. Many years ago I wrote an emulator for our dear old Elliott 803 computer at the museum. I used a 33EP512GP806 because it has 56K of RAM and the 803 had the equivalent of 40K. To make my emulator run at the same speed as the 803 I had to slow the PIC down by a factor of 35,000.

The museum want to make my emulator part of an exhibit so I thought I ought to dust of the code in case it needs changing.

Take care and thanks again.

Charlie

trastikata

Quote from: charliecoutas on <strong>Today</strong> at 08:50 AMNo worries Les. The program now compiles OK. Many years ago I wrote an emulator for our dear old Elliott 803 computer at the museum. I used a 33EP512GP806 because it has 56K of RAM and the 803 had the equivalent of 40K.

Hi Charlie,

there's a limit to how much RAM you can actually address in the compiler.

charliecoutas

Hiya

Yes I think it's 64K but I'm not sure. I had to search quite a lot to find a PIC with enough RAM. I could have used an external SRAM but I wanted to put the whole emulation, two large compilers (Algol and H-Code) plus about ten programs on a single tiny chip.

The 803 cost £29,000 in 1960 when it was made, today's equivalent cost is around £750,000. The clock of the 803 is about 200KHz, the DSP 140MHz. It's quite a stark comparison to see a little £4 chip outperforming a large machine by a speed factor of 35,000:1!

Charlie

trastikata

Looks wonderful.

P.s. I think the limit is 32k, but Les should confirm.

▲