📄 dos.asm
字号:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Project : FDOS 0.0.7
;; Author : Stefan Tappertzhofen (tappertzhofen@t-online.de)
;; Webpage : http://www.visual-opal.de
;; Date : 2. September 2003
;; Info : DOS Interrupt
;; Filename : dos.asm
;; Compile Syntax : nasm dos.asm -f bin -o dos.sys
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
POP DS ; Get Program Data Segment back
POP ES ; Get Program Special Segment back
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Get Function Reference Number stored in AH
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CMP AH, 0h
JE NEAR int_dos_0h ; Shut down application
CMP AH, 1h
JE NEAR int_dos_2h ; Get Char
CMP AH, 2h
JE NEAR int_dos_2h ; Print Char on screen
CMP AH, 3h
JE NEAR int_dos_3h ; Get Char from AUX
CMP AH, 4h
JE NEAR int_dos_4h ; Send Char to AUX
CMP AH, 5h
JE NEAR int_dos_5h ; Print Char with Printer
CMP AH, 9h
JE NEAR int_dos_9h ; ASCI-$ String
CMP AH, 4Ch
JE NEAR int_dos_4Ch ; Shut down application
IRET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Interrupt Functions
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 0h
;;
;; Input: AH = 0
;; Output: n/a
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_0h:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
CLC
IRET
.hang:
JMP SHORT .hang
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 1h
;;
;; Input: AH = 1h
;; Output: AL = Char
;; Info: Get Char by keyboard
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_1h:
PUSH BX
PUSH DX
XOR AH, AH ; Wait for Key Press
INT 16h ; BIOS Interrupt 16h
CMP AL, 0
POP DX
POP BX
IRET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 2h
;;
;; Input: AH = 0
;; Output: n/a
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_2h:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
IRET
.hang:
JMP SHORT .hang
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 0h
;;
;; Input: AH = 0
;; Output: n/a
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_3h:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
IRET
.hang:
JMP SHORT .hang
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 0h
;;
;; Input: AH = 0
;; Output: n/a
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_4h:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
IRET
.hang:
JMP SHORT .hang
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 0h
;;
;; Input: AH = 0
;; Output: n/a
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_5h:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
IRET
.hang:
JMP SHORT .hang
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; DOS Int 21h, Function 9h
;;
;; Input: AH = 9h
;; Output: screen
;; Info: Shut down the application and get the FDOS Interrupt back
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
int_dos_9h:
PUSHA ; Register sichern
CLD
int_dos_9h_loop:
LODSB ; SI nach AL und SI + 1
CMP AL, '$' ; AL = $?
JE SHORT int_dos_9h_done ; Wenn ja dann Sprung
MOV AH, 0x0E ; Bildschirmausgabe
MOV BH, 0
MOV BL, 7
INT 10h ; mit Int 10h
JMP SHORT int_dos_9h_loop ; Neuer Durchlauf
int_dos_9h_done:
POPA ; Alle Register zur點k
IRET
int_dos_4Ch:
PUSH ES
PUSH DS
MOV AX, 6620h
MOV ES, AX
MOV DS, AX
XOR AX, AX
MOV DI, AX
STOSW
STOSW
POP DS
POP ES
IRET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -