bintest.asm

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

ASM
95
字号
; This is an example of how to
; make a ".BIN" file.

; Directive to create BIN file:
#make_BIN#

; where to load?
#LOAD_SEGMENT=1234#
#LOAD_OFFSET=0000#

; set these values to registers on load:
#AL=12#
#AH=34#
#BH=56#
#BL=78#
#CH=9A#
#CL=BC#
#DH=DE#
#DL=F0#
#DS=DDEE#
#ES=ABCD#
#SI=AAAA#
#DI=CCCC#
#BP=DDDD#
#CS=1234#
#IP=0000#
#SS=3000#
#SP=FFFF#

; When loading "bintest.bin" file in emulator
; it will look for a "bintest.binf" file,
; and load ".BIN" file to location specified
; in that file, registers are also set using
; information in that file (open this file
; in a text editor to edit or investigate).
;
; ".binf" file is created automatically
; by compiler when it processes the above
; directives.



; This sample just prints out a part of
; some ASCII character set, in an eternal
; loop, press [Stop] button or ESC to stop.


start:

MOV     AL, '0'
MOV     AH, 0Eh

print_more:

INT     10h
INC     AL

; keep original AX:
MOV     CX, AX

;============================
; check for ESC key to
;    reboot:

; check for keystroke in
; keyboard buffer:
MOV     AH, 1
INT     16h
JZ      key_processed

; get keystroke from keyboard:
; (remove from the buffer)
MOV     AH, 0 
INT     16h

; press 'ESC' to exit:
CMP     AL, 1Bh
JNZ     key_processed
INT     19h

key_processed:
;============================

; restore original AX:
MOV     AX, CX


CMP     AL, 'z'
JBE     print_more

MOV     AL, '0'
JMP     print_more

END

⌨️ 快捷键说明

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