thermometer.asm

来自「介绍用Java解析网络数据的三种特殊方法」· 汇编 代码 · 共 59 行

ASM
59
字号
; This short program for Emu8086 shows
; how to keep constant temperature using
; heater and thermometer (between 60 癈 to 80 癈),
; it is assumed that air temperature is lower 60 癈.

; "Thermometer.exe" should be copied to "DEVICES" folder
; of Emu8086 (to enable running it from the menu).

; WARNING! DO NOT RUN TWO OR MORE INSTANCES OF 
; "Thermometer.exe", THIS WILL CAUSE A DEVICE CONFLICT
; AND HEATER WON'T OPERATE CORRECTLY.

; Temperature rises fast, thus Emulator should be set
; to run at the maximum speed (set "step delay" to zero).

; The code is fully demonstrational, 癈 can be replaced
; by 癋 without any doubt.

; For questions please feel free to e-mail:
;     info@emu8086.com

; You should have Emu8086 to run this code,
; the latest version of Emu8086 can be found here:
;
; http://www.emu8086.com
;


#make_bin#
#CS = 500#
#IP = 0#

; Set Data Segment to Code Segment:
MOV AX, CS
MOV DS, AX

START:

IN AL, 125

CMP AL, 60
JL  low

CMP AL, 80
JLE  ok
JG   high

low:
MOV AL, 1
OUT 127, AL   ; turn heater "on".
JMP ok

high:
MOV AL, 0
OUT 127, AL   ; turn heater "off". 

ok:
JMP START   ; endless loop.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?