Quiz: Rare assembler code with 2 instructions per line

I found an interesting computer with this ASM code

        00   LS / 74  4096      
        73 link : 40 chars     
        00   FS / 74  4096    
        73 link : 40 chars     
        72 8191               

link:   0                      
chars:  26   ch : 32    ch      
        05  max : 42   rtn     
        00   ch / 74  4096      
        74 4124 : 44 chars     
rtn:    74 4125 : 74  4126     
        00 link / 40     1     

ch:     0                      
max:    26                      
LS:     31                     
FS:     27        

Who can name this computer?

And what other computer or languages use similar code or more than one instruction per line. I mainly know Commodore Basic.

1 Like

I can’t name that system, but I have used a system that features 2 instructions per line - the Intel i860.

It had a dual-instruction mode where the CPU would read a 64-bit word that represented 2 x 32-bit instructions - one for the Integer unit and anther for the floating point unit. The instructions would be executed in parallel.

That doesn’t look like i860 code, but it’s been many years and I lost a lot of the old grey cells to it…

-Gordon

I can’t name it either, but I offer the Elliott 803 as seen at TNMoC:

The Elliott 803 Instruction Set

An Elliott 803 instruction consists of two parts, the opcode, which is defined by 6 bits, and the address, which takes 13 bits. Together these 19 bits can be packed two to a 39-bit word, with an extra bit in between. This extra bit is known as the B-modifier, and, if the bit is a one, it causes the second instruction in the word to be modified by adding the contents of the location specified in the address of the first instruction.

One would be 6502 assembly in BBC BASIC. As this is wrapped in BASIC, this still supports multiple instructions in a line (separated by a colon). Labels are prefixed by a dot, though. So it looks different from your example.

Here’s a rather wierd example (The BASIC integer variable “P%” is also the program counter. Assigning to “$P%” – actuially a BBC BASIC indirection – insterts a string of characters, but also requires some updating to the program counter. Later versions of BBC BASIC had a more comfortable method for this.)

100 REM THIS IS BASIC
110 P% = &4000 : REM SET LOCATION COUNTER
120 TARGET = &4100 : REM A VARIABLE
130 FOR C=0 TO 2 STEP 2 : REM PASS LOOP 
140 [OPT C              \now in asm mode, also setting an option
150     LDX #&20        \copy 32 bytes
160 .LOOP  LDA SOURCE,X
170     STA TARGET,X
180     DEX:BNE LOOP    \two in a row!
190 .SOURCE
200 ]NEXT : REM BACK TO BASIC
210 $P%=":-) "+STRING$(28,"*") : REM INSERT SOME CHARS AT .SOURCE
220 P%=P%+LEN($P%) : REM UPDATE LOCATION
230 END

Here’s the solution.

SPOILER

I knew, that here are experts. Yes it’s the Elliott 803. I found 3 emulators.
One is a virtual 3D simulator. I haven’t checked that.
One is an old ~2011 emulator for BSD. I couldn’t compile that.
And one is a modern one with GUI under JAVA. That worked, takes some time to start.

You can open a core dump file (.803) and tape files (.tape, unknown short binary).
There are assembly files (*.a1) and Algol files *.algol.

The BSD emulator uses *.h-code and *.elliott for ASM files, *.a60 for Algol and has *.hex5 and *.hex8 files (one byte per line) and scripts.

Interesting is the control panel with a very large operate/enter key below and that it also used 35mm film tapes.

This is the commented source above (charset. a1) (C) Copyright Tim Baldwin 2009

**
* Procedure call example
*
* Prints the character set to the teletype
**

        @entry                  * Entry point

entry:  00   LS / 74  4096      * Print letter shift
        73 link : 40 chars      * Procedure call to write characters
        00   FS / 74  4096      * Print figure shift
        73 link : 40 chars      * Procedure call
        72 8191                 * Exit

link:   0                       * Stores return address
chars:  26   ch : 32    ch      * Clear ch, increment ch
        05  max : 42   rtn      * Check for end
        00   ch / 74  4096      * Write character
        74 4124 : 44 chars      * Write space and loop
rtn:    74 4125 : 74  4126      * Write final CR LF
        00 link / 40     1      * Return to address in link plus 1

ch:     0                       * Workspace
max:    26                      * Last character value
LS:     31                      * Letter shift
FS:     27                      * Figure shift

There are few samples. One is a music playing code.

Elliott 803 Simulation download | SourceForge.net

The code from the BSD emulator looking different. Has some more files. Here’s a sample

:LS(I,F63)

:LIST
(0→I
:DO(64)
-1→F(I)
1:ON(I)
:REPE
<76 1026:77    0)
:DO(4096)
<76 1025:77    F)
:REPE)
*
::
1 Like

Ah, nice! It’s an example of a machine with a nice front panel that - for me - gives a visual reminder of this odd aspect. Here’s Peter Onion, one of the curators:

Yes, he also wrote the 3D simulator/emulator.
Maybe the best emulator, but I don’t like that kind of design. Previously even with hands.

1 Like

I am reminded of the Playstation 2 VPU1 which was a 32 bit VLIW-SIMD vector unit. It has two instructions per line in its assembly language which executed simultaneously as it had two execution units. When programming you tried to make as much use of the processor as possible by not putting NOPs in either column. But sometimes there was no choice due to data hazards or other constraints.

Here’s a little example of what it looked like:

         itof15.z      VF09,VF09                                    mtir          VI12,VF09z                                 ;	STALL_LATENCY ?3
         mulax.xyz     ACC,VF11,VF20x                               loi           0x3f000000                          
         madday.xyz    ACC,VF12,VF20y                               iaddiu        VI11,VI00,0x0000001f                
         maddz.xyz     VF16,VF13,VF20z                              iand          VI11,VI11,VI12                      
         addi.z        VF09,VF09,I                                  iadd          VI11,VI11,VI11                      
         mulaw.xyz     ACC,VF14,VF00w                               iadd          VI11,VI11,VI11                      
         maddax.xyz    ACC,VF11,VF10x                               iaddiu        VI11,VI11,0x00000099                
         madday.xyz    ACC,VF12,VF10y                               lq.xyz        VF11,0(VI11)                        
         miniz.w       VF09,VF00,VF09z                              lq.xyz        VF12,1(VI11)                        
         maddz.xyz     VF09,VF13,VF10z                              lq.xyz        VF13,2(VI11)                        

2 Likes