SlideShare uma empresa Scribd logo
1 de 8
Baixar para ler offline
MITS Altair Programming Tutorial
By Mihai Pruna
mihaipruna.com
I always wanted to learn to program a computer in Machine Code (just 1s and 0s, the true language of
computers). Recently I started reading a biography of Bill Gates (ISBN-10: 0385420757), which starts in
the early days of widely available computing. The era of the personal computer and the success of
Microsoft were both ushered in by a device that, if purchased without accessories, did not have a
keyboard or monitor, yet could be fully programmed using switches and blinking lights: The MITS Altair.
This is a tutorial for a simple program for the MITS Altair computer.
You can use a web-based emulator of the MITS Altair, as well as read the full operating manual, here:
http://www.s2js.com/altair/
The Intel 8080 processor of the Altair is a great device to learn to program in Assembly Language.
Here are more resources for programming the 8080 in Assembly:
http://www.hartetechnologies.com/manuals/Unclassified/8080_Machine_Language_Programming_for
_Beginner.PDF
http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf
This tutorial shows a simple program comparing two numbers. You should do this tutorial after you are
able to write and run and understand the first program in the Altair Operating Manual
(http://www.classiccmp.org/dunfield/altair/d/88opman.pdf) which adds two numbers, as this tutorial is
based on the addition example. This example is more complex than the addition example in the manual,
but, also, much simpler than the multiplication example.
Below is a memory map and program and data storage. I found Excel to be a great way to organize and
design your code. Just like in the addition tutorial, I used memory locations 128 and 129 to store the two
numbers, and memory address 130 to store the result, in this case the largest number. These numbers
are in decimal notation. Binary equivalents also given for every address and instruction for inputting via
the Altair front panel.
The first column is the contents of the memory of the Altair in decimal. The second in binary. The third is
the instruction mnemonic. The instruction can occupy more than one byte if values or addresses are
specified as arguments.
Memory Address Dec
Memory
Address Bin
Instruction Binary Value Comment
0 00000000 LDA 00 111 010
Load accumulator w
content at address 128
1 00000001 10 000 000
2 00000010 00 000 000
3 00000011 MOV A->B 01 000 111
Move from Accumulator to
Register B
4 00000100 LDA 00 111 010
Load accumulator w
content at address 129
5 00000101 10 000 001
6 00000110 00 000 000
7 00000111 CMP A,B 10 111 000
Compare accumulator with
register B . If B>A then
carry bit is 1 otherwise
carry bit is 0. This means if
# at 129> # at 128 carry bit
is 0
8 00001000 JC 11 011 010
Jump to address and
execute instruction there
9 00001001 00 010 001
10 00001010 00 000 000
11 00001011 STA 00 110 010
This is no carry so # at 129
> # at 128 thus we write
#129 in address 130.
Accumulator already has
129 so we write A to 130
12 00001100 10 000 010
13 00001101 00 000 000
14 00001110 JMP 11 000 011
Go back to beginning of
program
15 00001111 00 000 000
16 00010000 00 000 000
17 00010001 LDA 00 111 010
This is for carry where we
jump so we can set 130 to
the value of 128
18 00010010 10 000 000
19 00010011 00 000 000
20 00010100 STA 00 110 010
Store accumulator which
has value from 128 at 130
21 00010101 10 000 010
22 00010110 00 000 000
23 00010111 JMP 11 000 011
Go back to beginning of
program
24 00011000 00 000 000
25 00011001 00 000 000
26 00011010
27 00011011
28 00011100
29 00011101
… …. …. …. ……
125 01111101
126 01111110
127 01111111
128 10000000 first number
129 10000001 second number
130 10000010 largest number
….
255 11111111
Below are some relevant excerpts from the operating manual:
How to start writing the program (from example)
Load accumulator with memory content for number 1:
The load accumulator command reference:
Move from accumulator to B
Move data command reference:
Load accumulator with memory content for number 2
Compare B to Accumulator. If B>Accumulator, Carry bit is 1.
Code for register B:
The Jump if Carry command goes to specified address if carry bit is 1.
Write accumulator to result memory address
Store accumulator at memory address command reference:
Jump to beginning of program to keep executing it:
Jump command reference:
How to use the program:

Mais conteúdo relacionado

Mais procurados

Linea del tiempo microprocesadores
Linea del tiempo microprocesadoresLinea del tiempo microprocesadores
Linea del tiempo microprocesadoresJacobo Garduño
 
Mantenimiento y ensamblaje de computadoras
Mantenimiento y ensamblaje de computadorasMantenimiento y ensamblaje de computadoras
Mantenimiento y ensamblaje de computadorasAldo Quispe Ramos
 
Emsamblaje y configuración de una computadora ppt
Emsamblaje y configuración de una computadora pptEmsamblaje y configuración de una computadora ppt
Emsamblaje y configuración de una computadora pptLa Razón Mas Grande
 
Power point memoria ram
Power point memoria ramPower point memoria ram
Power point memoria ramKoldo92
 
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...anyelisbrito
 
Jenis & proses interupsi
Jenis & proses interupsiJenis & proses interupsi
Jenis & proses interupsisigitpurnama12
 
Electronica Digital
Electronica DigitalElectronica Digital
Electronica Digitalchisco1967
 
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de Expansion
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de ExpansionManual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de Expansion
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de ExpansionJohn Nelson Rojas
 
Modul simulasi pemograman mikrokontroler
Modul simulasi pemograman mikrokontrolerModul simulasi pemograman mikrokontroler
Modul simulasi pemograman mikrokontrolerpersonal
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
Seguridad informática.pptx
Seguridad informática.pptxSeguridad informática.pptx
Seguridad informática.pptxFrankAlfarooyola
 
Mantenimiento y reparación de pc guias y ejercicios
Mantenimiento y reparación de pc  guias y ejerciciosMantenimiento y reparación de pc  guias y ejercicios
Mantenimiento y reparación de pc guias y ejerciciosYahairaDomnguez
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 

Mais procurados (20)

Linea del tiempo microprocesadores
Linea del tiempo microprocesadoresLinea del tiempo microprocesadores
Linea del tiempo microprocesadores
 
Mantenimiento y ensamblaje de computadoras
Mantenimiento y ensamblaje de computadorasMantenimiento y ensamblaje de computadoras
Mantenimiento y ensamblaje de computadoras
 
Procesadores
ProcesadoresProcesadores
Procesadores
 
Emsamblaje y configuración de una computadora ppt
Emsamblaje y configuración de una computadora pptEmsamblaje y configuración de una computadora ppt
Emsamblaje y configuración de una computadora ppt
 
Power point memoria ram
Power point memoria ramPower point memoria ram
Power point memoria ram
 
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...
Grupo 3 descripción a nivel de registros del proceso de ejecución de instrucc...
 
Jenis & proses interupsi
Jenis & proses interupsiJenis & proses interupsi
Jenis & proses interupsi
 
Set intruksi ppt
Set intruksi pptSet intruksi ppt
Set intruksi ppt
 
Electronica Digital
Electronica DigitalElectronica Digital
Electronica Digital
 
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de Expansion
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de ExpansionManual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de Expansion
Manual Ensamblaje PCS-ACTIVIDAD 5_Tarjetas de Expansion
 
Unidad aritmética lógica (ALU)
Unidad aritmética  lógica (ALU)Unidad aritmética  lógica (ALU)
Unidad aritmética lógica (ALU)
 
Modul simulasi pemograman mikrokontroler
Modul simulasi pemograman mikrokontrolerModul simulasi pemograman mikrokontroler
Modul simulasi pemograman mikrokontroler
 
Ppt cpu
Ppt cpuPpt cpu
Ppt cpu
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Unsigned multiplication
Unsigned multiplicationUnsigned multiplication
Unsigned multiplication
 
Seguridad informática.pptx
Seguridad informática.pptxSeguridad informática.pptx
Seguridad informática.pptx
 
La BIOS
La BIOSLa BIOS
La BIOS
 
STRUKTUR DAN FUNGSI CPU
STRUKTUR DAN FUNGSI CPUSTRUKTUR DAN FUNGSI CPU
STRUKTUR DAN FUNGSI CPU
 
Mantenimiento y reparación de pc guias y ejercicios
Mantenimiento y reparación de pc  guias y ejerciciosMantenimiento y reparación de pc  guias y ejercicios
Mantenimiento y reparación de pc guias y ejercicios
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 

Semelhante a A tutorial on programming the Mits Altair computer by Mihai Pruna

Microproccesor and Microcontrollers hardware basics
Microproccesor and Microcontrollers hardware basicsMicroproccesor and Microcontrollers hardware basics
Microproccesor and Microcontrollers hardware basicsashmus
 
Programming with 8085.pptx
Programming with 8085.pptxProgramming with 8085.pptx
Programming with 8085.pptxSachinKupade
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEr. Raju Bhardwaj
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoKarim El-Rayes
 
Presentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxPresentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxMinahilUmar1
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Sivaranjan Goswami
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...ssuserd6b1fd
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processorArun Umrao
 
Avr generator
Avr generatorAvr generator
Avr generatorHarie Tr
 
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptx
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptxCHAPTER 2_INTRO TO COMPUTER SYSTEM.pptx
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptxssuser2f3ce7
 
Computer arithmetics coa project pdf version
Computer arithmetics coa project pdf versionComputer arithmetics coa project pdf version
Computer arithmetics coa project pdf versionSuryaKumarSahani
 

Semelhante a A tutorial on programming the Mits Altair computer by Mihai Pruna (20)

Siemens PLC Programming Example #2
Siemens PLC Programming Example #2Siemens PLC Programming Example #2
Siemens PLC Programming Example #2
 
Microproccesor and Microcontrollers hardware basics
Microproccesor and Microcontrollers hardware basicsMicroproccesor and Microcontrollers hardware basics
Microproccesor and Microcontrollers hardware basics
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
 
CH06 (1).PPT
CH06 (1).PPTCH06 (1).PPT
CH06 (1).PPT
 
Programming with 8085.pptx
Programming with 8085.pptxProgramming with 8085.pptx
Programming with 8085.pptx
 
8051notes
8051notes8051notes
8051notes
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower Bot
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
Lab manual mp
Lab manual mpLab manual mp
Lab manual mp
 
Sap 1
Sap 1Sap 1
Sap 1
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Presentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptxPresentation of ICT.ppt.pptx
Presentation of ICT.ppt.pptx
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
Avr generator
Avr generatorAvr generator
Avr generator
 
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptx
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptxCHAPTER 2_INTRO TO COMPUTER SYSTEM.pptx
CHAPTER 2_INTRO TO COMPUTER SYSTEM.pptx
 
Computer arithmetics coa project pdf version
Computer arithmetics coa project pdf versionComputer arithmetics coa project pdf version
Computer arithmetics coa project pdf version
 
Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

A tutorial on programming the Mits Altair computer by Mihai Pruna

  • 1. MITS Altair Programming Tutorial By Mihai Pruna mihaipruna.com I always wanted to learn to program a computer in Machine Code (just 1s and 0s, the true language of computers). Recently I started reading a biography of Bill Gates (ISBN-10: 0385420757), which starts in the early days of widely available computing. The era of the personal computer and the success of Microsoft were both ushered in by a device that, if purchased without accessories, did not have a keyboard or monitor, yet could be fully programmed using switches and blinking lights: The MITS Altair. This is a tutorial for a simple program for the MITS Altair computer. You can use a web-based emulator of the MITS Altair, as well as read the full operating manual, here: http://www.s2js.com/altair/ The Intel 8080 processor of the Altair is a great device to learn to program in Assembly Language. Here are more resources for programming the 8080 in Assembly: http://www.hartetechnologies.com/manuals/Unclassified/8080_Machine_Language_Programming_for _Beginner.PDF http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf This tutorial shows a simple program comparing two numbers. You should do this tutorial after you are able to write and run and understand the first program in the Altair Operating Manual (http://www.classiccmp.org/dunfield/altair/d/88opman.pdf) which adds two numbers, as this tutorial is based on the addition example. This example is more complex than the addition example in the manual, but, also, much simpler than the multiplication example. Below is a memory map and program and data storage. I found Excel to be a great way to organize and design your code. Just like in the addition tutorial, I used memory locations 128 and 129 to store the two numbers, and memory address 130 to store the result, in this case the largest number. These numbers are in decimal notation. Binary equivalents also given for every address and instruction for inputting via the Altair front panel. The first column is the contents of the memory of the Altair in decimal. The second in binary. The third is the instruction mnemonic. The instruction can occupy more than one byte if values or addresses are specified as arguments.
  • 2. Memory Address Dec Memory Address Bin Instruction Binary Value Comment 0 00000000 LDA 00 111 010 Load accumulator w content at address 128 1 00000001 10 000 000 2 00000010 00 000 000 3 00000011 MOV A->B 01 000 111 Move from Accumulator to Register B 4 00000100 LDA 00 111 010 Load accumulator w content at address 129 5 00000101 10 000 001 6 00000110 00 000 000 7 00000111 CMP A,B 10 111 000 Compare accumulator with register B . If B>A then carry bit is 1 otherwise carry bit is 0. This means if # at 129> # at 128 carry bit is 0 8 00001000 JC 11 011 010 Jump to address and execute instruction there 9 00001001 00 010 001 10 00001010 00 000 000 11 00001011 STA 00 110 010 This is no carry so # at 129 > # at 128 thus we write #129 in address 130. Accumulator already has 129 so we write A to 130 12 00001100 10 000 010 13 00001101 00 000 000 14 00001110 JMP 11 000 011 Go back to beginning of program 15 00001111 00 000 000 16 00010000 00 000 000 17 00010001 LDA 00 111 010 This is for carry where we jump so we can set 130 to the value of 128 18 00010010 10 000 000 19 00010011 00 000 000 20 00010100 STA 00 110 010 Store accumulator which has value from 128 at 130 21 00010101 10 000 010 22 00010110 00 000 000
  • 3. 23 00010111 JMP 11 000 011 Go back to beginning of program 24 00011000 00 000 000 25 00011001 00 000 000 26 00011010 27 00011011 28 00011100 29 00011101 … …. …. …. …… 125 01111101 126 01111110 127 01111111 128 10000000 first number 129 10000001 second number 130 10000010 largest number …. 255 11111111 Below are some relevant excerpts from the operating manual: How to start writing the program (from example)
  • 4. Load accumulator with memory content for number 1: The load accumulator command reference: Move from accumulator to B
  • 5. Move data command reference: Load accumulator with memory content for number 2 Compare B to Accumulator. If B>Accumulator, Carry bit is 1.
  • 6. Code for register B: The Jump if Carry command goes to specified address if carry bit is 1. Write accumulator to result memory address Store accumulator at memory address command reference:
  • 7. Jump to beginning of program to keep executing it: Jump command reference:
  • 8. How to use the program: