Altair 680

61 views
Skip to first unread message

mon...@gmail.com

unread,
Jan 12, 2026, 8:31:26 PMJan 12
to Altair-Duino
Hello All,

I received and built the Altair 680, a fun project and would recommend to anyone who enjoys building kits.

My question since I am not a programmer is:

How do you Add Two Numbers in Altair 680 Machine Code

I tried the following code I found on the internet.  Some things do not make sense to me

Address Opcode Instruction Comments
0x00 0xA9 LDA #$05 Load the first number (5)
0x01 0x05
0x02 0xA2 LDX #$03 Load the second number (3)
0x03 0x03
0x04 0x86 ADD A, X Add the two numbers
0x05 0x00
0x06 0x00 STAA $FF Store the result at address $FF

Then hit RUN and then checked location FF - no luck

Any help would be greatly appreciated.

Thanks,
Maurice

Tom Lake

unread,
Jan 13, 2026, 1:01:53 AMJan 13
to Altair-Duino
Don't you need a HLT or RTN at the end? How does the code know when to stop trying to execute instructions?

Chris Davis

unread,
Jan 13, 2026, 9:43:58 AMJan 13
to Altair-Duino
It looks like this is 6502 code.  For example, LDA on a 6502 is 0xA9, but LDAA on a 6800 is 0x86.

Here's a version of that code for 6800:

        0x0000  0x86  LDAA  #$05     ; A = 5
        0x0001  0x05
        0x0002  0xC6  LDAB  #$03     ; B = 3
        0x0003  0x03
        0x0004  0x1B  ABA            ; A = A + B
        0x0005  0x97  STAA  $FF      ; store result at $00FF
        0x0006  0xFF

The final bytes are 86 05 C6 03 1B 97 FF

I have not tested this, but it should work.

Kelly Loyd

unread,
Jan 14, 2026, 6:15:43 AM (14 days ago) Jan 14
to Altair-Duino
The code works. I like to put an SWI at the end - seems to work universally between SWTPC and Altair680 and return me to the Monitor.

   0000                         org $0000
   0000   86 05         Start   ldaa #$05
   0002   c6 03                 ldab #$03
   0004   1b                    aba
   0005   97 ff                 staa $ff
   0007   3f                    SWI

Used the Altair Mon L command to transfer the S-record file

.J 0000
.M 00FF 08 


Maurice Onraet

unread,
Jan 14, 2026, 8:47:00 AM (14 days ago) Jan 14
to Kelly Loyd, Altair-Duino
Hello Kelly,

Thanks so much for your help.
Much appreciated.....

Kindly,
Maurice

--
You received this message because you are subscribed to a topic in the Google Groups "Altair-Duino" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/altair-duino/otb52_tPK6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to altair-duino...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/altair-duino/279862e8-0ad4-4622-8391-385f474976d2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages