Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PROTEUS SIMULATION WITH SOFTWARE INTERRUPTS 8086

PGL

Newbie
Joined
Nov 29, 2021
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
9
I am new to Proteus simulation and 8086 interfacings, but I tried to create a random password generator using 8086 and LCD interfacing. But when I tried to use INT 1AH to generate random password, my simulation doesn't display any character. Can you tell me how does INT command work in proteus.

This is my assembly code
Code:
DATA SEGMENT
PORTA EQU 00H
PORTB EQU 02H
PORTC EQU 04H
PORT_CON EQU 06H
SIZE EQU 10
DATA ENDS
CODE SEGMENT
MOV AX,DATA
MOV DS, AX

ORG 0000H
START:

MOV DX, PORT_CON
MOV AL, 10000000B
OUT DX, AL


JMP XX

XX:

MOV AL,00H  ;command setting cursor
MOV DX,PORTC
OUT DX,AL
MOV AL, 0EH
MOV DX, PORTA
OUT DX,AL
MOV CX,00FFH; Delay
Delay0:loop Delay0
MOV AL,0FFH
MOV DX,PORTC
OUT DX,AL
MOV CX,00FFH; Delay
Delay1:loop Delay1

MOV AL,00H  ;command setting 8 bit mode
MOV DX,PORTC
OUT DX,AL
MOV AL, 038H
MOV DX, PORTA
OUT DX,AL
MOV CX,00FFH; Delay
Delay2:loop Delay2
MOV AL,0FFH
MOV DX,PORTC
OUT DX,AL
MOV CX,00FFH; Delay
Delay3:loop Delay3




MOV AL,00H  ;command setting 8 bit mode
MOV DX,PORTC
OUT DX,AL
MOV AL,0FH  ;command setting 8 bit mode
MOV DX,PORTB
OUT DX,AL  

JMP  RANDOM

RANDOM: xor ax,ax            ; xor register to itself same as zeroing register
        int 1ah              ; Int 1ah/ah=0 get timer ticks since midnight in CX:DX
        mov ax,dx            ; Use lower 16 bits (in DX) for random value

        xor dx,dx            ; Compute randval(DX) mod 126 to get num
        mov bx,126            ;     between 0 and 125
        div bx               ; Divide dx:ax by bx
        inc dx               ; DX = modulo from division
                             ; Add 1 to give us # between 1 and 126 (not 0 to 125)
                    
        cmp dx, 33           ; If the number (remainder) is below 33, increase it to be between 33 and 126
        jb INCREASE
        jmp DISPLAY

INCREASE:
         add dx, 32       ; We are adding 32 as the lowest value DX can take is 1 and 33 is the least acceptable value
         jmp DISPLAY
   
DISPLAY:
    mov ax,dx            ; Move to AX to print    
    MOV DX, PORTA
    OUT DX,AL
    MOV CX,00FFH; Delay
    Delay4:loop Delay4
    MOV AL,0FFH
    MOV DX,PORTC
    OUT DX,AL
    MOV CX,00FFH; Delay
    Delay5:loop Delay5  
    MOV CX,SIZE
    DEC CX
    MOV SIZE,CX
    CMP CX,00H
    JNE RANDOM           
    HLT

AND THIS IS MY INTERFACING CIRCUIT

1638268459563.png
 
Last edited by a moderator:

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top