Практические задания на экзамен по дисциплине "Цифровые и микропроцессорные устройства", страница 5

                              push PSW;                         и сохраняем обратно в стек

skip:

                              inx H;                                 смещаем указатель чтения

                              dcr B;                                  уменьшаем счетчик цикла

                              jnz loop;                             повторяем пока он не обнулится             

                              pop PSW;                           восстанавливаем счетчик наших чисел

                              sta COUNT;                       сохраняем его в COUNT

                              mov A,D;                           далее сохраняем максимальное и минимальные числа

                              sta COUNT+1;

                              mov A,E;

                              sta COUNT+2;

Нечет.

$ALLPUBLIC

$TITLE(TITLE   'LAB-RAB6. I8085 2009 =L_04.A85')

;--------------------------------------------------------------

;

;       LAB_04.A85

;

; РАЗДЕЛ 8 ПО ЛАБОРАТОНОМУ ПРАКТИКУМУ

;--------------------------------------------------------------

;       NO ERRORS

; INPUT - INTERRUPT CODING MESSAGE:

;       DATA - STROBED INPUT INTO THE PORT B 8155,

;       STROBE - TO THE PIN PORTC.5 -B STB

;       8085 INTERRUPT - FROM PIN PORTC.3 TO RST7.5

;

; OUTPUT - DECOGING MESSAGE FROM THE PORT A 8155

;

; FILES:

; INPUT FILE WORK\DEMO.MSG, WORK\DEMO2.MSG

; INTERRUPT FILE WORK\STB.MSG

; OUTPUT FILE WORK\OUT2.MSG

; COMAND FILE WORK\LAB_RAB2.ZGR

;--------------------------------------------------------------

RAM     EQU     0800H

ROM     EQU     0000H

LEN_RAM EQU     0800H

;       DATA BUFFERS

TEXTSIZE        EQU     20H

MASS1      EQU          0883H

ADDR1     EQU          0950H

ADDR2     EQU          0970H

N                 EQU          0018H

        DEFSEG  RAM_BUF1,CLASS=DATA,START=RAM

        SEG     RAM_BUF1

BUF1    DS      TEXTSIZE

        DEFSEG  RAM_BUF2,CLASS=DATA,START=RAM+TEXTSIZE

        SEG     RAM_BUF2

BUF2    DS      TEXTSIZE

        DEFSEG  RAM_BUF3,CLASS=DATA,START=RAM+TEXTSIZE*2

        SEG     RAM_BUF3

BUF3    DS      TEXTSIZE

                    ORG          MASS1

MASS        DS              064H

                    ORG          ADDR1

ADDR        DS              20H

                    DEFSEG  FORZAD7,CLASS=DATA,START=0A00H

        SEG     FORZAD7

RAMPAGE                 DS      256

                    DEFSEG  FORZAD11,CLASS=DATA,START=0B00H

        SEG     FORZAD7

BUF11      DS      256

                    DEFSEG  FORZAD13,CLASS=DATA,START=0C00H

        SEG     FORZAD7

BUF13      DS      180H

Нечет.

        ;STACK

STACKSIZE               EQU          32

        DEFSEG  STACK,CLASS=DATA,START=RAM+LEN_RAM-STACKSIZE

        SEG     STACK

STACKR  DS      STACKSIZE

STPOINT EQU     $               ;

;

                    ;MASKS FOR 2EXAPLES

MASK11  EQU          00000011B                  ;

MASK12  EQU          01010000B                  ;

                    ;FLAGS

        DEFSEG  RAM_VARI,CLASS=DATA,START=RAM+0C0H

        SEG     RAM_VARI

PASS1   DS      1

FLGZGR  DS      1       ;1=LOAD BUFFER, 0=MASK INTERRUPT

MIN           DS              2

MAX         DS              2

REZULT  DS              1

                    ;

                    ;MACROCOMMAND

INIT1        %MACRO                   BU,SIM,SZ

        %LOCAL LOOP_INIT

        LXI    H,BU

                    MVI           B,SZ

LOOP_INIT:

                    MVI           M,SIM

                    INX            H

                    DCR           B

                    JNZ           LOOP_INIT

        %ENDM

                    SEG           IOSPACE,START=0

CS8155                         DS              1                 ; COMMAND/STATUS REG OF 8155 IN I/O SPACE

PA8155                        DS              1                 ; PORT A OF 8155 IN I/O SPACE

PB8155                        DS              1

PC8155                        DS              1                 ; PORT C OF 8155 IN I/O SPACE

TL8155                        DS              1                 ; TIMER LOW PART OF 8155 IN I/O SPACE