printerdemo.asm

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

ASM
38
字号
; PrinterDemo.asm - Andrew Nelis 2003
;
; Simple demonstration of the printer.
;
; it is required to start "Printer.exe"
; before running this demonstration
; (select it from "Virtual Devices" menu
;  of the emulator).

#make_COM#

; COM file is loaded at CS:0100h
ORG 100h

lea bx, message
mov cx, 27d	; Length of message
mov ax, 0h	; Ensure top and bottom of
		; ax empty

spit:
mov al, [bx]	; Put char into al
out 130d, al	; push char out port
		; (ie. into printer)

inc bx		; inc pointer

wait:		; Loop to ensure the printer
in al, 130d	; is ready, it clears
or al, 0	; the port when this is true.
jnz wait

loop spit	; Go back and repeat if we're
		; not finished

ret

message db "Hello World!", 10, 13, "------------", 07

⌨️ 快捷键说明

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