-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrinterDemo.asm
54 lines (37 loc) · 1.18 KB
/
PrinterDemo.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
; the printer demonstration.
; this is simplified/ms-dos complatible version.
; this example may not work on Windows XP, however it may work for Windows 95/98:
; http://support.microsoft.com/default.aspx?scid=kb;en-us;Q258878
; the printer device is created by Andrew Nelis.
; the original example that uses i/o ports that are unique to the emulator is located here:
; c:\emu8086\DEVICES\DEVELOPER\sources\Printer_emulation_demo.asm
name "printer"
org 100h
jmp start
msg db "Hello, Printer!", 0Ah, 0Dh
db "***************"
db 13, 9 ; carriage return and vertical tab
db "Have a nice printing day!"
msg_end db 0
msg2 db "press any key to eject the page.$"
start:
mov dl, 12 ; form feed code. new page.
mov ah, 5
int 21h
mov si, offset msg
mov cx, offset msg_end - offset msg
print:
mov dl, [si]
mov ah, 5 ; MS-DOS print function.
int 21h
inc si ; next char.
loop print
mov dx, offset msg2
mov ah, 9
int 21h
mov ax, 0 ; wait for any key...
int 16h
mov dl, 12 ; form feed code. page out!
mov ah, 5
int 21h
ret