Tag Archives: old-computers

8085 Machinecode at school

Funny story about learning machinelanguage at school.

It was around 1989, and was attending a class Microcomputer Programming in Machine Language.

We where given a problem we had to solve using 8085 machine code.
The machine we had to program this on was a Intel SDK-85, much like below example.

Intel SDK-85

Note it only had a hex keyboard and 7segmented display. You had to punch in the machinecode into memory slots yourself.

Problem we where given was something like searching for certain data in memory.

Normal procedure was :

  • Draw a flow of instructions (Flowchart)
  • Write the machine languages codes
  • Convert those assembly statements into Opcodes the machine could understand
  • Punch in those numbers, run and verify

Most of us knew a lot of opcodes by heart, but some knew all opcodes. And how many bytes where needed. besides that we had to remember jump and return addresses.

So our teacher presented the problem, when he stopped talking, my friend Martin and I when up to our machines … punching buttons.

” Guys .. you can’t expect it to work without writing the program down first!

A few minutes later .. we pressed enter .. and it worked.

A program like above looked like: 
01 2E 2B 21 00 00 79 BE C2 1F C0 CD 19 C0 CA 1E C0 78 BE C2 06 C0 C3 25 C0 2C C2 1E C0 24 C9 CD 19 C0 C3 06 C0 C9

Cut into opcodes:

01 2E 2B
21 00 00
79
BE
C2 1F C0
CD 19 C0
CA 1E C0
78
BE
C2 06 C0
C3 25 C0
2C
C2 1E C0
24
C9
CD 19 C0
C3 06 C0
C9

Some opcodes used 1 byte, others 2 or 3.
C2 1F C0 – means Jump to address C01F when not zero
C9 – means return, go back to a previous CALL statement

Example of machine language which is translated into above

ADDR ; INSTRUCTION
C000 ; LXI B,0X2B2E
C003 ; LXI H,0X0000
C006 ; MOV A,C
C007 ; CMP H
C008 ; JNZ C01F
C00B ; CALL CO19
COOE ; JZ CO1E
ETC
Almost 255 opcodes

BBC Acorn

While attending the LTS (lower vocational technical school), i could often be found in the computer lab.
I was the only student who had his own key.
We had a classroom with 16 computers, 2 drives at the master station and a printer.
Everything was connected using Econet. (These where the first networked computers i’ve worked with)
https://en.wikipedia.org/wiki/Econet

So every moment we didn’t have a class, i was there.
Even when i had to do final exams, i was late entering, and sometimes one of the first leaving.

Today (2022) i ran an emulator on my machine and typed in one of my old programs found in a notebook.
(The real system above pictured, i have to repair)
By the way, this is one of the computers from school, even with its original wooden monitor stand. The school contacted me (a few years after leaving this school) if i wanted to buy one of the machines.

My notebook containing programs

One of the shorter programs in basic

   20R=.8
   30Q=.05
   40MODE0
   50X=500
   60GCOL1,3
   70Y=500
   80MOVE650,650
   90DRAW670,650:DRAW670,670:DRAW650,670:DRAW650,650
  100A=GET-48
  110IFA=1THENX=X+Q
  120IFA=2THENX=X-Q
  130IFA=3THENY=Y+Q
  140IFA=4THENY=Y-Q
  150IFA=5THENR=.8
  160IFA=6THENR=0
  170X1=200*SIN(X)+500
  180X2=200*SIN(Y+X)+X1
  190X3=50*SIN(Y+X+R)+X2
  200X4=50*SIN(Y+X-R)+X2
  210Y1=200*COS(X)+500
  220Y2=200*COS(Y+X)+Y1
  230Y3=50*COS(X+Y+R)+Y2
  240Y4=50*COS(Y+X-R)+Y2
  250CLS
  260IFX4>650ANDX4<670ANDY4>650ANDY4<670THENPRINT"RAAK"
  270MOVE450,450
  280DRAW550,450
  290DRAW500,500
  300DRAW450,450
  310MOVE500,500
  320DRAWX1,Y1
  330DRAWX2,Y2
  340DRAWX3,Y3
  350MOVEX2,Y2
  360DRAWX4,Y4
  370GOTO80
  380MODE7
  390PRINTTAB(12,10)CHR$129CHR$141"FASH-SOFT"
  400PRINTTAB(12,11)CHR$130CHR$141"FASH-SOFT"
  410A=GET
  420RUN
Keys
1,2 - first arm (left/right)
3,4 - second arm (left/right)
5,6 - open/close grabber

This program got me in trouble because my teachers didn’t believe me. It wasn’t written by me according to them. Because my math grades were terrible!

Later versions had a nicer looking robotic arm. (More 3d, not a line but a arm with thickness)

Notes:

*CAT ; list disk files
LOAD"FSHDRAW" ; load

Print to file or clipboard
LIST07 ; page formatting
VDU2 ; start output redirection (screen + "printer")
LIST
VDU3 ; stop redirection

Installing the Emulator under linux

 git clone https://github.com/stardot/b-em.git
 sudo apt-get install autotools-dev automake
 sudo apt-get install liballegro5-dev
 cd b-em/
 ./autogen.sh 
 ./configure 
 make
 ./b-em