Facebook
From hjvhbj, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 528
  1. PRESSURE_PORT EQU 0FF8H
  2. DATA SEGMENT
  3.     PRESSURES DW 100 DUP(0)
  4.     MBR_OF_SAMPLES EQU (($-PRESSURES)/2)
  5. DATA ENDS
  6.  
  7. STACK_SEG SEGMENT
  8.     DW 40 DUP(0)
  9.     STACK_TOP LABEL WORD
  10.     STACK_SEG ENDS
  11. CODE SEGMENT
  12.     ASSUME CS:CODE,DS:DATA,SS:STACK_SEG
  13. START:
  14.      MOV AX,DATA
  15.      MOV DS,AX
  16.      MOV AX,STACK_SEG
  17.      MOV SS,AX
  18.      MOV SP,OFFSET STACK_TOP
  19.      
  20.      LEA SI,PRESSURES
  21.      MOV BX,MBR_OF_SAMPLES
  22.      MOV DX,PRESSURE_PORT
  23. NEXT_VALUE:
  24.          IN AX,DX
  25.          AND AX,0FFFH
  26.          MOV [SI],AX
  27.          CALL WAIT_1MS
  28.          INC SI
  29.          INC SI
  30.          DEC BX
  31.          JNZ NEXT_VALUE
  32. STOP:
  33.     NOP
  34.  
  35. WAIT_1MS PROC NEAR
  36.     MOV CX,23F2H
  37. HERE:
  38.     LOOP HERE
  39.     RET
  40. WAIT_1MS ENDP
  41.  
  42. CODE ENDS
  43.   END
  44.   END
  45.  
  46.