8086 microprocessor

logistic_guy

Senior Member
Joined
Apr 17, 2024
Messages
2,214
Write a program for the \(\displaystyle \textcolor{red}{\bold{8086}}\) microprocessor. The program should store two integers in the memory, add them, and display their sum on the screen.
\(\displaystyle \textcolor{green}{\bold{Let \ your \ code \ be}} \textcolor{indigo}{\large{\ \bold{FANCY.}}}\)
 
.\(\displaystyle \text{MODEL SMALL}\)
.\(\displaystyle \text{STACK 100}\)h
.\(\displaystyle \text{DATA}\)
num\(\displaystyle 1\) \(\displaystyle \textcolor{darkblue}{\text{DB}} \ 3\)
num\(\displaystyle 2\) \(\displaystyle \textcolor{darkblue}{\text{DB}} \ 4\)
sum \(\displaystyle \textcolor{darkblue}{\text{DB}} \ 0\)
.\(\displaystyle \text{CODE}\)
MAIN \(\displaystyle \textcolor{blue}{\text{PROC}}\)
\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{red}{\text{AX}}\), @\(\displaystyle \text{DATA}\)
\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{darkred}{\text{DS}}\), \(\displaystyle \textcolor{red}{\text{AX}}\)

\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{red}{\text{AL}}\), num\(\displaystyle 1\)
\(\displaystyle \textcolor{blue}{\text{ADD}}\) \(\displaystyle \textcolor{red}{\text{AL}}\), num\(\displaystyle 2\)
\(\displaystyle \textcolor{blue}{\text{MOV}}\) sum, \(\displaystyle \textcolor{red}{\text{AL}}\)

\(\displaystyle \textcolor{blue}{\text{ADD}}\) \(\displaystyle \textcolor{red}{\text{AL}}\), '\(\displaystyle \textcolor{purple}{0}\)'

\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{red}{\text{DL}}\), \(\displaystyle \textcolor{red}{\text{AL}}\)
\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{red}{\text{AH}}\), \(\displaystyle 02\)h
\(\displaystyle \textcolor{blue}{\text{INT}}\) \(\displaystyle 21\)h

\(\displaystyle \textcolor{blue}{\text{MOV}}\) \(\displaystyle \textcolor{red}{\text{AH}}\), \(\displaystyle 4\)Ch
\(\displaystyle \textcolor{blue}{\text{INT}}\) \(\displaystyle 21\)h

MAIN \(\displaystyle \textcolor{blue}{\text{ENDP}}\)
\(\displaystyle \textcolor{darkblue}{\text{END}}\) MAIN


\(\displaystyle \huge\textcolor{indigo}{\bold{Sample.}}\)
8086.png
 
Last edited:
Top