start proc near
jmp short Init
; ---------------------------------------------------------------------------
align 8
aHzk16 db '\HZK16',0
aNotFound db 'not found!',7,0Dh,0Ah
db '$',0
align 4
Init: ; CODE XREF: startj
push cs
pop ds
mov ah, 0Fh
int 10h ; - VIDEO - GET CURRENT VIDEO MODE
; Return: AH = number of columns on screen
; AL = current video mode
; BH = current active display page
mov ah, 0
mov ds:0C0h, ax
mov ax, 12h
int 10h ; - VIDEO - SET VIDEO MODE
; AL = mode
mov ah, 0Bh
mov bx, 101h
int 10h ; - VIDEO - SET COLOR PALETTE
; BH = 00h, BL = border color
; BH = 01h, BL = palette (0-3)
mov bx, 0
int 10h ; - VIDEO - SET COLOR PALETTE
; BH = 00h, BL = border color
; BH = 01h, BL = palette (0-3)
SHOW_DOT: ; CODE XREF: start+55j
mov cx, bp
mov ah, 0Ch
int 10h ; - VIDEO - WRITE DOT ON SCREEN
; AL = color of dot, BH = display page
; CX = column, DX = row
inc bp
pop cx
loop LOOP_X
inc si
pop cx
loop LOOP_Y
dec di
nop
jz short GET_SCANCODE
inc dx
sub bp, 10h
jmp short SHOW_WORD
; ---------------------------------------------------------------------------
GET_SCANCODE: ; CODE XREF: start+69j
mov ah, 0
int 16h ; KEYBOARD - READ CHAR FROM BUFFER, WAIT IF EMPTY
; Return: AH = scan code, AL = character
cmp al, 0Dh
jnz short CONTIUE
EXIT: ; CODE XREF: start+89j
mov ax, ds:0C0h
int 10h ; - VIDEO -
mov ah, 4Ch
int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
; AL = exit code
; ---------------------------------------------------------------------------
CONTIUE: ; CODE XREF: start+77j
mov al, byte ptr SET_COLOR+1
inc al
cmp al, 0FFh
jz short EXIT
mov byte ptr SET_COLOR+1, al
mov bl, al
mov cl, 4
shr al, cl
or al, 30h
cmp al, 39h
jbe short SHOW_HEX_H
add al, 7
SHOW_HEX_H: ; CODE XREF: start+98j
mov ah, 0Eh
int 10h ; - VIDEO - WRITE CHARACTER AND ADVANCE CURSOR (TTY WRITE)
; AL = character, BH = display page (alpha modes)
; BL = foreground color (graphics modes)
mov al, bl
and al, 0Fh
or al, 30h
cmp al, 39h
jbe short SHOW_HEX_L
add al, 7
SHOW_HEX_L: ; CODE XREF: start+A8j
mov ah, 0Eh
int 10h ; - VIDEO - WRITE CHARACTER AND ADVANCE CURSOR (TTY WRITE)
; AL = character, BH = display page (alpha modes)
; BL = foreground color (graphics modes)
jmp short LOOP
start endp
; =============== S U B R O U T I N E =======================================
GetCurPos proc near ; CODE XREF: start:LOOPp
mov ah, 3
int 10h ; - VIDEO - READ CURSOR POSITION
; BH = page number
; Return: DH,DL = row,column, CH = cursor start line, CL = cursor end line
mov bl, 8
mov al, dl
mul bl
mov bp, ax
mov al, dh
mov bl, 10h
mul bl
mov dx, ax
retn
GetCurPos endp
; ---------------------------------------------------------------------------
Data db 5 dup(0),2,40h,2,40h,2,40h,2,40h,2,40h,2,40h,2,40h
db 2,40h,2,40h,2,40h,2,40h,2,40h,2,40h,2,40h,11h dup(0)
;8 * 16
LBB_DOT db 9,0,0FDh,8,9,8,9,10h,9,20h,79h,40h,41h,4,47h
db 0FEh,41h,40h,79h,40h,9,20h,9,20h,9,10h,9,4Eh,51h,84h
db 21h,0,10h,0,10h,20h,10h,40h,10h,84h,0FDh,0FEh,11h,4,31h
db 4,39h,4,55h,4,51h,0FCh,91h,4,11h,4,11h,4,11h,4
db 11h,0FCh,11h,4,0,20h,0,0F0h,0Fh,0,8,0,8,0,8
db 10h,0Fh,0F8h,8,40h,8,40h,8,44h,0FFh,0FEh,2 dup(0),4,40h,0Ch
db 30h,10h,18h,20h,8,1Ah
db '[1ff-25e is lbb.dot.]',0
dd 0C721h
正在处理工程 ...
ml.exe /Zm /c /nologo /Fo"DOS.obj" "D:\MASMPlus\Project\DOS20\DOS.asm"
Assembling: D:\MASMPlus\Project\DOS20\DOS.asm
D:\MASMPlus\Project\DOS20\DOS.asm(2) : error A2034: must be in segment block : start
D:\MASMPlus\Project\DOS20\DOS.asm(3) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(5) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(6) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(7) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(8) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(9) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(11) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(12) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(13) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(14) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(15) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(19) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(20) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(21) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(22) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(24) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(25) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(26) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(29) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(30) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(34) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(35) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(36) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(37) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(39) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(40) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(42) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(43) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(44) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(45) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(47) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(48) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(49) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(50) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(51) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(52) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(55) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(57) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(59) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(60) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(61) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(62) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(65) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(66) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(67) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(68) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(69) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(70) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(71) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(72) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(73) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(74) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(75) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(76) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(79) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(80) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(81) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(83) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(84) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(86) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(87) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(88) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(89) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(90) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(94) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(95) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(96) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(97) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(98) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(99) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(100) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(101) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(102) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(103) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(104) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(105) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(106) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(108) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(109) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(110) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(113) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(114) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(115) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(116) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(117) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(118) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(120) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(121) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(122) : error A2034: must be in segment block
D:\MASMPlus\Project\DOS20\DOS.asm(125) : error A2008: syntax error : LOOP
D:\MASMPlus\Project\DOS20\DOS.asm(126) : fatal error A1010: unmatched block nesting : start