Homebrew 8088 Arduino

 info@homebrew8088.com 
                    Home    8088 Programming    80x86 Assembly    8088 opcodes    Arduino    Troubleshoot 


Wire an 8088 to an Arduino Nano:    


The Project:

    The concept is to use a Arduino Nano to run a 8088. 
    The Arduino provides the 5v, Ground, CLK, Ready, Reset, and Hold lines to the 8088. 
    The Arduino has access to read and write to the one megabyte of RAM used by the 8088 while operating.


The boot-up sequence is:

    Power on, 5v to the system.
    Arduino holds 8088.
    Arduino copies "ROM" to the RAM. 
    Arduino releases Hold and Resets 8088.
 

Parts list:
    1 x Arduino Nano
    1 x 8088
    7 x 74LS373
    2 x 74LS245
    1 x 74LS138
    1 x 74LS04P
    1 x RAM 512K 
  

Schematics: 

    Arduino connected to it's address and data latches. The 8088 has it's own address and data latches (schematic to follow). The only thing that is shared it the memory. 


Library:

    Include my Intel8088 library  Intel8088.zip 
    The library  makes it easy to just wire up your 8088 and go with out a lot of programming of the Arduino.
    The byte arrays hold the 8088 opcodes that you want to load in memory.

Arduino Source Code:

#include <Intel8088.h>

Intel8088 my8088;
byte Jump[] = {0xEA, 0x00, 0x10, 0x00, 0x00}; //JMP FAR 0000:1000 
byte Code[] = {
    0xB8, 0x00, 0x10,         //MOV AX, 0x1000
    0x8E, 0xD8,               //MOV DS, AX
    0x8E, 0xD0,               //MOV SS, AX    
    0xBC, 0x00, 0x00,         //MOV SP, 0x0000
    
    0xB0, 0x80,               //MOV AL, 0x80  ;Set AL 10000000 = Port active \ A,B,C Outputs and mode 0.
    0xE6, 0x03,               //OUT 0x03, AL  ;Store the value in the Control Port 8255
    
    0xB8, 0x00, 0x00,         //MOV AX, 0x0000  ; Turn on screen.
    0xCD, 0x10,               //INT 0x10
    
    0xB8, 0x41, 0x0E,         //MOV AX, 0x0E41
    0xCD, 0x10,               //INT 0x10

    0xF4                      //HLT
};

byte IVT[] = {
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,

    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,

    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00,
    
    0x00, 0x00, 0x00, 0xE0
  };

byte ISR10[] = {  
    0x80, 0xFC, 0x00,          //CMP AH, 0x00                ;Check the AH to determine what function is being called.
    0x74, 0x0A,                //JZ 0x0A                     ;Jump if 0x00
    0x80, 0xFC, 0x0E,           //CMP AH, 0x0E,               ;
    0x74, 0x39,                //JZ 0x53,                    ;Jump if 0x0E   
    0x80, 0xFC, 0xC1,          //CMP AH, 0xC1,               ;   
    0x74, 0x53,                //JZ 0x68,                    ;Jump if 0xC1

                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                               ///;Set Video MODE AH=00  (turn the screen on)   
                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    0xB0, 0x01,                //MOV AL, 0x01
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                ;Set LCD controls  - control port.
    
    0xB9, 0xFF, 0xFF,          //MOV CX, 0x00FF              ;LOOP HOLD FOR A BIT'
    0xE2, 0xFE,                //LOOP 0xFE
    
    0xB0, 0x38,                //MOV AL, 0x38                ;Set 8 bit mode, 2 lines, 5x7 dots.
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL                ;
    0xE8, 0x16, 0x00,           //CALL 0x0016
    
    0xB0, 0x06,                //MOV AL, 0x06                 ;Entry mode
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL                ; 
    0xE8, 0x0F, 0x00,           //CALL 0x000F

    0xB0, 0x0F,                //MOV AL, 0x0F                ;Display on cursor blinking
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL                ;  
    0xE8, 0x08, 0x00,           //CALL 0x0008
    
    0xB0, 0x01,                //MOV AL, 0x01                ; 01 Clears the screen
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL                ;                   
    0xE8, 0x01, 0x00,           //CALL 0x0001

    0xCF,                      //IRET    
    
    0xB0, 0x00,                //MOV AL, 0x00              
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                ;Enable LCD Write
    0xB9, 0xFF, 0xFF,          //MOV CX, 0x00FF              ;LOOP HOLD FOR A BIT'
    0xE2, 0xFE,                //LOOP 0xFE
    0xB0, 0x01,                //MOV AL, 0x01
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                 ;Disable LCD Write
    
    0xC3,                      //RET
    
                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                               // ;Teletype output AH=0E, AL="Letter"                                  
                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    
    0x88, 0xC4,                //MOV AH, AL               ;Store the Letter

    0xB0, 0x05,                //MOV AL, 0x05
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL             ;Set LCD controls to write mode and data port.       

    0x88, 0xE0,                //MOV AL, AH                ;Get the  Letter
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL               ;Put the letter on the data port

    0xB0, 0x04,                //MOV AL, 0x04
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL             ;Enable Write    
    0xB9, 0xFF, 0x00,          //MOV CX, 0x00FF              ;LOOP HOLD FOR A BIT'
    0xE2, 0xFE,                //LOOP 0xFE
    0xB0, 0x05,                //MOV AL, 0x05
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL             ;Disable Write
    0xB5, 0x0E,                //MOV AH, 0x0E               ;(For Repeat Typing)

    0xCF,                      //IRET
    
                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
                               // ;CLEAR AH=C1   
                               // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;                                    
    0xB0, 0x01,                //MOV AL, 0x01
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                ;Set LCD controls  - control port.
    
    0xB0, 0x01,                //MOV AL, 0x01                ; 01 Clears the screen
    //CHECK PORT LCD DATA//
    0xE6, 0x01,                //OUT 0x01, AL                ;    
    0xB0, 0x00,                //MOV AL, 0x00              
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                ;Enable LCD Write
    0xB9, 0xFF, 0xFF,          //MOV CX, 0x00FF              ;LOOP HOLD FOR A BIT'
    0xE2, 0xFE,                //LOOP 0xFE
    0xB0, 0x01,                //MOV AL, 0x01
    //CHECK PORT LCD CONTROL//
    0xE6, 0x02,                //OUT 0x02, AL                 ;Disable LCD Write

    0xCF                      //IRET
};

void setup()
{ 
    my8088.Start(mHz_8); //Start 8088 at 8 mHz 
    
    my8088.WriteByteArray(0x01000, Code, sizeof(Code));  
    my8088.WriteByteArray(0xFFFF0, Jump, sizeof(Jump));   
    my8088.WriteByteArray(0xE0000, ISR10, sizeof(ISR10)); 
    my8088.WriteByteArray(0x00000, IVT, sizeof(IVT)); 
   
    my8088.Reset(); 
       
}
void loop() 
{

}