虚拟实现汉字系统----VVDOS -- 源码 -- 保护模式程序 - 2

2024-04-26 17:08

本文主要是介绍虚拟实现汉字系统----VVDOS -- 源码 -- 保护模式程序 - 2,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

虚拟实现汉字系统----VVDOS -- 源码 -- 保护模式程序 - 2

1、HZ27.INC
; HZ27.inc
;
;
;
;
;
;
;
os32_code segment use32 public
assume cs:os32_code,ds:data
BeginPut proc near
mov dx,3ceh
mov al,5   ; write 0
out dx,al
inc dx
mov al,0
out dx,al
mov dx,3ceh
mov al,1   ; enable set /reset register
out dx,al
inc dx
mov al,0fh
out dx,al
ret
BeginPut endp
EndPut proc near
mov dx,3ceh
mov al,0   ; default set/reset value
out dx,al
inc dx
out dx,al
dec dx
mov al,1   ; default enable set/reset value
out dx,al
inc dx
mov al,0
out dx,al
dec dx
mov al,8   ;default bit mask value
out dx,al
inc dx
mov al,0ffh
out dx,al
ret
EndPut endp
; seg:   ds=OS32DataSel,es=User32DataSel
;par
;edi: GraphOffset
;ch: color
;cl:   bitmask   can put 8 points to screen
PutPixel macro
mov dx,3ceh
mov al,0   ; set /reset register
out dx,al
inc dx
mov al,ch   ; color only 8 bits
out dx,al
dec dx
mov al,8   ; bit mask register
out dx,al
inc dx
mov al,cl
out dx,al
or byte ptr es:[edi],al ; update the pixel
endm
;para
;edi: first offset
;ax: ah:attrib,al:8bits
Put8Pixel proc near
push eax
mov ch,ah
and ch,0fh ; fore color
mov cl,al
  ;call PutPixel
PutPixel
pop eax
mov ch,ah
and ch,0f0h
shr ecx,4
not al
mov cl,al
  ;call PutPixel
PutPixel
ret
Put8Pixel endp
;para al:char,ah:attr
;edi: graphoffset
PutChar proc near
mov tmpcolor,ah
call GetTextCodeAddress ; get esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
add edi,(640/8)
mov loopvar,16
tloopcont:
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
inc esi
add edi,(640/8)
dec loopvar
cmp loopvar,0
ja tloopcont
dec esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
ret
PutChar endp

;para al: char code
;RET esi: first offset
GetTextCodeAddress proc near
and eax,0ffh   ; only low 8 bits
sal eax,4
add eax,TextCodeAddress
mov esi,eax
ret
GetTextCodeAddress endp
;para ax:char,bl:color
;edi:offset
PutHZ proc near
push eax
mov tmpcolor,bl
mov tmpoffset,edi
call GetHZCodeAddress
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
add edi,(640/8)
mov loopvar,16
htloopcont:
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
inc esi
inc esi
add edi,640/8
dec loopvar
cmp loopvar,0
ja htloopcont
dec esi
dec esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
pop eax
call GetHZCodeAddress
mov edi,tmpoffset
inc edi
inc esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
add edi,640/8
dec esi
mov loopvar,16
htloopcont2:
inc esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
inc esi
add edi,640/8
dec loopvar
cmp loopvar,0
ja htloopcont2
dec esi
mov al,es:[esi]
mov ah,tmpcolor
call Put8Pixel
ret
PutHZ endp

;para ax: ax: al,first code ah: second code
;RET esi: 32 bits abs Address
GetHZCodeAddress proc near
xor ebx,ebx
mov ecx,ebx
sub al,0ah
sub ah,0ah
and ax,7f7fh
cmp al,24
jae goto
sub ah,23
mov cl,ah
xor eax,eax
mov al,cl
sal eax,5
sub eax,127*32
add eax,HZCodeAddress
mov esi,eax
ret

goto:
sub al,23
sub ah,23
mov cx,ax
xor eax,eax
mov al,cl
mov bl,94
mul bl       ;   ☆★
mov cl,ch
xor ch,ch
add ax,cx
sub ax,7fh   ; think it
sal eax,5
add eax,HZCodeAddress
mov esi,eax
ret
GetHZCodeAddress endp
GetXY proc near
mov dl,BIOSCurX
mov dh,BIOSCurY
mov ch,7   ; first line
mov cl,9           ; last line
ret
GetXY endp
GotoXY proc near
mov BIOSCurX,dl
mov BIOSCurY,dh
ret
GotoXY endp
os32_code ends
data segment use16 public
textWidth dd 79
textHigh dd 24
GraphWidth dd 640
GraphHigh dd 480
GraphTextWidth dd 8
GraphTextHigh dd 16
data ends

data segment use16 public
Int8IsRun dd 0
Int8IsRun1 dd 0
error_code dd 0
curx dd 0
cury dd 0
oldx db 0
oldy db 0
loopvar   dd 0
tmpcolor   db 0
entervar dd 0
tmpoffset dd 0
tmpsave   dw 0
tmpcurline db 0
data ends
data segment use16 public
TextCodeAddress dd 811934 ; rom 8*16 bits char code
ScreenBufBase dd 0b8000h
GraphDataBase dd 0a0000h ;may movable
PageA0000HBase dd ?
PageB8000HBase dd ?
PageE0000HBase dd ?

HZCodeAddress dd 0     ; HZ16 address
CodeAddress dd 0         ; 64k free memory,4k size
VirtualPageAddress dd 0 ; in CodeAddress
TextBufAddress dd 0
VirtualPage2Address dd 0
NowCodeAddress dd 0
HZExample   db '王',0,0,0
data ends
os32_code segment use32 public
assume cs:os32_code,ds:data
CompScreenAndTextBuf proc near
mov cury,0
call BeginPut
NextLine:
mov esi,VirtualPageAddress ;ScreenBufBase
mov edi,TextBufAddress
mov curx,0
mov eax,cury
mov edx,160
mul edx
add esi,eax
add edi,eax
NextChar:
mov eax,es:[esi]
cmp curx,79
je ascChar
call IsTableChar
jc ascChar
  cmp eax,es:[edi]
  je DoneThisHZ
  mov es:[edi],eax
  pushad
  call GetGraphAbsOffset
  mov ax,es:[esi]
  mov bl,ah
  mov ah,es:[esi]+2
  call PutHZ
  popad
DoneThisHZ:
  inc esi
  inc esi
  inc edi
  inc edi
  inc curx
  jmp DoneThisChar
ascChar:
  cmp ax,es:[edi]
  je DoneThisChar
  mov es:[edi],ax
  pushad
  call GetGraphAbsOffset
  mov ax,es:[esi]
  call PutChar
  popad
DoneThisChar:
inc esi
inc esi
inc edi
inc edi
inc curx
cmp curx,80
jb NextChar
inc cury
cmp cury,25
jb NextLine
call EndPut
ret
CompScreenAndTextBuf endp
GetSameChar proc near ;   cl: char :ch
push ebx
xor ecx,ecx
mov edx,ecx
sub ebx,6
cmp al,es:[ebx]
jne same_1
inc cl
same_1:
add ebx,2
cmp al,es:[ebx]
jne same_2
inc cl
same_2:
add ebx,2
cmp al,es:[ebx]
jne same_3
inc cl
inc dl
same_3:
add ebx,4
cmp al,es:[ebx]
jne same_4
inc dl
inc ch
same_4:
add ebx,2
cmp al,es:[ebx]
jne same_5
inc ch
same_5:
add ebx,2
cmp al,es:[ebx]
jne same_6
inc ch
same_6:
sub ebx,6
sub ebx,480
cmp al,es:[ebx]
jne same_7
inc dl
same_7:
add ebx,160
cmp al,es:[ebx]
jne same_71
inc dl
same_71:
add ebx,160
cmp al,es:[ebx]
jne same_8
inc dl
same_8:
add ebx,320
cmp al,es:[ebx]
jne same_9
inc dh
same_9:
add ebx,160
cmp al,es:[ebx]
jne same_10
inc dh
same_10:
add ebx,160
cmp al,es:[ebx]
jne same_101
inc dh
same_101:
pop ebx
ret
GetSameChar endp
GetNextChar proc near
push ebx
inc ebx
inc ebx
mov dx,es:[ebx]
pop ebx
ret
GetNextChar endp
GetLastChar proc near
push ebx
dec ebx
dec ebx
mov dx,es:[ebx]
pop ebx
ret
GetLastChar endp
GetUpChar proc near
push ebx
sub ebx,160
mov dx,es:[ebx]
pop ebx
ret
GetUpChar endp
GetDownChar proc near
push ebx
add ebx,160
mov dx,es:[ebx]
pop ebx
ret
GetDownChar endp
GetNextNextChar proc near
push ebx
inc ebx
inc ebx
inc ebx
inc ebx
mov dx,es:[ebx]
pop ebx
ret
GetNextNextChar endp
GetLastLastChar proc near
push ebx
dec ebx
dec ebx
dec ebx
dec ebx
mov dx,es:[ebx]
pop ebx
ret
GetLastLastChar endp
GetUpUpChar proc near
push ebx
sub ebx,320
mov dx,es:[ebx]
pop ebx
ret
GetUpUpChar endp
GetDownDownChar proc near
push ebx
add ebx,320
mov dx,es:[ebx]
pop ebx
ret
GetDownDownChar endp

IsTableChar proc near
mov ebx,esi
cmp al,176
je isBlockChar
cmp al,177
je isBlockChar
cmp al,178
je isBlockChar
cmp al,219
je isHalfBlockChar
cmp al,220
je isAscTableChar
cmp al,221
je isAscTableChar
cmp al,222
je isHZCodeChar
cmp al,223
je isAscTableChar
cmp al,196
je isLine196Char
cmp al,205
je isLine205Char
cmp al,179
je isLine179Char
cmp al,186
je isLine186Char
cmp al,218
je isLine218Char
cmp al,195
je isLine195Char
cmp al,192
je isLine192Char
cmp al,194
je isLine194Char
cmp al,197
je isLine197Char
cmp al,193
je isLine193Char
cmp al,191
je isLine191Char
cmp al,180
je isLine180Char
cmp al,217
je isLine217Char
cmp al,201
je isLine201Char
cmp al,204
je isLine204Char
cmp al,200
je isLine200Char
cmp al,203
je isLine203Char
cmp al,206
je isLine206Char
cmp al,202
je isLine202Char
cmp al,187
je isLine187Char
cmp al,185
je isLine185Char
cmp al,188
je isLine188Char

jmp isHZCodeChar
isBlockChar:
  call GetSameChar
  cmp cl,3
  jae isAscTableChar
  cmp ch,3
  jae isAscTableChar
  cmp dl,3
  jae isAscTableChar
  cmp dh,3
  jae isAscTableChar
  jmp isHZCodeChar
isHalfBlockChar:
  call GetSameChar
  cmp cl,3
  jae isAscTableChar
  cmp ch,3
  jae isAscTableChar
  cmp dl,3
  jae isAscTableChar
  cmp dh,3
  jae isAscTableChar
  jmp isHZCodeChar
isLine196Char:
  call GetLastChar
  cmp dl,196
  je isChar196Cont1
  call GetNextChar
  cmp dl,196
  je isChar196Cont2
  jmp isHZCodeChar
isChar196Cont1:
  call GetNextChar
  cmp dl,196
  je isChar196Cont1_1
  cmp dl,194
  je isChar196Cont1_1
  cmp dl,197
  je isChar196Cont1_1
  cmp dl,193
  je isChar196Cont1_1
  cmp dl,191
  je isChar196Cont1_1
  cmp dl,180
  je isChar196Cont1_1
  cmp dl,217
  je isChar196Cont1_1
  jmp isHZCodeChar
isChar196Cont1_1:
  call GetLastLastChar
  cmp dl,196
  je isChar196Cont1_2
  cmp dl,218
  je isChar196Cont1_2
  cmp dl,195
  je isChar196Cont1_2
  cmp dl,192
  je isChar196Cont1_2
  cmp dl,194
  je isChar196Cont1_2
  cmp dl,197
  je isChar196Cont1_2
  cmp dl,193
  je isChar196Cont1_2
  jmp isHZCodeChar
isChar196Cont1_2:
  jmp isAscTableChar
isChar196Cont2:
  call GetLastChar
  cmp dl,218
  je isChar196Cont2_1
  cmp dl,195
  je isChar196Cont2_1
  cmp dl,192
  je isChar196Cont2_1
  cmp dl,194
  je isChar196Cont2_1
  cmp dl,197
  je isChar196Cont2_1
  cmp dl,193
  je isChar196Cont2_1
  jmp isHZCodeChar
isChar196Cont2_1:
  call GetNextNextChar
  cmp dl,196
  je isChar196Cont2_2
  cmp dl,194
  je isChar196Cont2_2
  cmp dl,197
  je isChar196Cont2_2
  cmp dl,193
  je isChar196Cont2_2
  cmp dl,191
  je isChar196Cont2_2
  cmp dl,180
  je isChar196Cont2_2
  cmp dl,217
  je isChar196Cont2_2
  jmp isHZCodeChar
isChar196Cont2_2:
  jmp isAscTableChar
isLine205Char:
  call GetLastChar
  cmp dl,205
  je isChar205Cont1
  call GetNextChar
  cmp dl,205
  je isChar205Cont2
  jmp isHZCodeChar
isChar205Cont1:
  call GetNextChar
  cmp dl,205
  je isAscTableChar
  cmp dl,203
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,202
  je isAscTableChar
  cmp dl,187
  je isAscTableChar
  cmp dl,185
  je isAscTableChar
  cmp dl,188
  je isAscTableChar
  jmp isHZCodeChar
isChar205Cont2:
  call GetLastChar
  cmp dl,205
  je isAscTableChar
  cmp dl,203
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,202
  je isAscTableChar
  cmp dl,201
  je isAscTableChar
  cmp dl,204
  je isAscTableChar
  cmp dl,200
  je isAscTableChar
  jmp isHZCodeChar
isLine179Char:
  call GetUpChar
  cmp dl,179
  je isChar179Cont1
  call GetDownChar
  cmp dl,179
  je isChar179Cont2
  jmp isHZCodeChar
isChar179Cont1:
  call GetDownChar
  cmp dl,179
  je isChar179Cont1_1
  cmp dl,195
  je isChar179Cont1_2
  cmp dl,197
  je isChar179Cont1_2
  cmp dl,180
  je isChar179Cont1_2
  cmp dl,192
  je isChar179Cont1_2
  cmp dl,193
  je isChar179Cont1_2
  cmp dl,217
  je isChar179Cont1_2
  jmp isHZCodeChar
isChar179Cont1_1:
  call GetDownDownChar
  cmp dl,179
  je isAscTableChar
  cmp dl,195
  je isAscTableChar
  cmp dl,197
  je isAscTableChar
  cmp dl,180
  je isAscTableChar
  cmp dl,192
  je isAscTableChar
  cmp dl,193
  je isAscTableChar
  cmp dl,217
  je isAscTableChar
  jmp isHZCodeChar
isChar179Cont1_2:
  call GetUpUpChar
  cmp dl,179
  je isAscTableChar
  cmp dl,195
  je isAscTableChar
  cmp dl,197
  je isAscTableChar
  cmp dl,180
  je isAscTableChar
  cmp dl,218
  je isAscTableChar
  cmp dl,194
  je isAscTableChar
  cmp dl,191
  je isAscTableChar
  jmp isHZCodeChar

isChar179Cont2:
  call GetDownDownChar
  cmp dl,179
  je isChar179Cont2_1
  cmp dl,195
  je isChar179Cont2_1
  cmp dl,197
  je isChar179Cont2_1
  cmp dl,180
  je isChar179Cont2_1
  cmp dl,192
  je isChar179Cont2_1
  cmp dl,193
  je isChar179Cont2_1
  cmp dl,217
  je isChar179Cont2_1
  jmp isHZCodeChar
isChar179Cont2_1:
  call GetUpChar
  cmp dl,179
  je isAscTableChar
  cmp dl,195
  je isAscTableChar
  cmp dl,197
  je isAscTableChar
  cmp dl,180
  je isAscTableChar
  cmp dl,218
  je isAscTableChar
  cmp dl,194
  je isAscTableChar
  cmp dl,191
  je isAscTableChar
  jmp isHZCodeChar
isLine186Char:
  call GetSameChar
  add dh,dl
  cmp dh,3
  jb isHZCodeChar
  call GetUpChar
  cmp dl,186
  je isChar186Cont1
  call GetDownChar
  cmp dl,186
  je isChar186Cont2
  jmp isHZCodeChar
isChar186Cont1:
  call GetUpUpChar
  cmp dl,186
  je isChar186Cont1_1
  cmp dl,204
  je isChar186Cont1_1
  cmp dl,206
  je isChar186Cont1_1
  cmp dl,185
  je isChar186Cont1_1
  cmp dl,201
  je isChar186Cont1_1
  cmp dl,203
  je isChar186Cont1_1
  cmp dl,187
  je isChar186Cont1_1
  jmp isHZCodeChar
isChar186Cont1_1:
  call GetDownChar
  cmp dl,186
  je isChar186Cont1_2
  cmp dl,204
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,185
  je isAscTableChar
  cmp dl,200
  je isAscTableChar
  cmp dl,202
  je isAscTableChar
  cmp dl,188
  je isAscTableChar
  jmp isHZCodeChar
isChar186Cont1_2:
  call GetDownDownChar
  cmp dl,186
  je isAscTableChar
  cmp dl,204
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,185
  je isAscTableChar
  cmp dl,200
  je isAscTableChar
  cmp dl,202
  je isAscTableChar
  cmp dl,188
  je isAscTableChar
  jmp isHZCodeChar
isChar186Cont2:
  call GetDownDownChar
  cmp dl,186
  je isChar186Cont2_1
  cmp dl,204
  je isChar186Cont2_1
  cmp dl,206
  je isChar186Cont2_1
  cmp dl,185
  je isChar186Cont2_1
  cmp dl,200
  je isChar186Cont2_1
  cmp dl,202
  je isChar186Cont2_1
  cmp dl,188
  je isChar186Cont2_1
  jmp isHZCodeChar
isChar186Cont2_1:
  call GetUpChar
  cmp dl,186
  je isChar186Cont2_2
  cmp dl,204
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,185
  je isAscTableChar
  cmp dl,201
  je isAscTableChar
  cmp dl,203
  je isAscTableChar
  cmp dl,187
  je isAscTableChar
  jmp isHZCodeChar
isChar186Cont2_2:
  call GetUpChar
  cmp dl,186
  je isAscTableChar
  cmp dl,204
  je isAscTableChar
  cmp dl,206
  je isAscTableChar
  cmp dl,185
  je isAscTableChar
  cmp dl,201
  je isAscTableChar
  cmp dl,203
  je isAscTableChar
  cmp dl,187
  je isAscTableChar
  jmp isHZCodeChar
;Single line
isLine218Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine195Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
;   call GetUpUpChar
;   cmp dl,179
;   jne isHZCodeChar
;   call GetDownDownChar
;   cmp dl,179
;   jne isHZCodeChar
  jmp isAscTableChar
isLine192Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
;   call GetUpUpChar
;   cmp dl,179
;   jne isHZCodeChar
  jmp isAscTableChar
isLine194Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine197Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine193Char:
  call GetNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,196
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine191Char:
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine180Char:
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetDownChar
  cmp dl,179
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
isLine217Char:
  call GetLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpChar
  cmp dl,179
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,196
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,179
  jne isHZCodeChar
  jmp isAscTableChar
; Double Line
isLine201Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine204Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine200Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine203Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine206Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine202Char:
  call GetNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetNextNextChar
  cmp dl,205
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine187Char:
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine185Char:
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownChar
  cmp dl,186
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetDownDownChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
isLine188Char:
  call GetLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpChar
  cmp dl,186
  jne isHZCodeChar
  call GetLastLastChar
  cmp dl,205
  jne isHZCodeChar
  call GetUpUpChar
  cmp dl,186
  jne isHZCodeChar
  jmp isAscTableChar
jmp isHZCodeChar
isAscTableChar:
stc
ret
isHZCodeChar:
cmp byte ptr es:[ebx],161
jb isAscTableChar
cmp byte ptr es:[ebx]+2,161
jb isAscTableChar
isRealHZCodeChar:
clc
ret
IsTableChar endp

;para
;ecx:line,edx,col
GetGraphAbsOffset proc near
mov eax,cury
mov edx,1440 ; a line byte size 18*80
mul edx
add eax,curx
add eax,GraphDataBase
mov edi,eax
ret
GetGraphAbsOffset endp
; ret eax:number
GetNumber proc near   ;y*160+x*2
push edx
xor eax,eax
mov al,BIOSCurY
mov dl,160
mul dl
xor edx,edx
mov dl,BIOSCurX
sal edx,1
add eax,edx
pop edx
ret
GetNumber endp

;ret al:char,ah:attrib
GetCharAndAttrib proc near
xor eax,eax
mov al,oldy
mov dl,160
mul dl
xor edx,edx
mov dl,oldx
sal edx,1
add eax,edx
mov esi,TextBufAddress
add esi,eax
mov ax,es:[esi]
ret
GetCharAndAttrib endp
; para oldx,oldy
GetTextAbsOffset proc near
mov dh,oldy
mov dl,oldx
xor eax,eax
mov al,dh
mov bl,dl
mov edx,1440 ; a line byte size 18*80
mul edx
xor edx,edx
mov dl,bl
add eax,edx
add eax,GraphDataBase
mov edi,eax
ret
GetTextAbsOffset endp
DrawLineArrow proc near
mov tmpsave,ax
xor eax,eax
mov edx,eax
mov eax,(640/8)*16
add edi,eax
call BeginPut
mov ax,tmpsave
call Put8Pixel
add edi,640/8
mov ax,tmpsave
call Put8Pixel
call EndPut
ret
DrawLineArrow endp
DrawArrow proc near
cmp CurFirstLine,0fh
ja nodraw
call GetTextAbsOffset
call GetCharAndAttrib
mov al,0ffh
call DrawLineArrow
nodraw:
ret
DrawArrow endp
ClrArrow proc near
call GetTextAbsOffset
call GetCharAndAttrib
mov al,0
call DrawLineArrow
ret
ClrArrow endp
Arrow proc near
inc isArrow
cmp isArrow,2
je DrawIt
cmp isArrow,4
je nodrawIt
jmp endArrow
noDrawIt:
call ClrArrow
mov isArrow,0
jmp endArrow
drawIt:
call ClrArrow
call GetXY
mov oldx,dl
mov oldy,dh
call DrawArrow
endArrow:
ret
Arrow endp
os32_code ends
data segment use16 public
promptX db 0
promptY   db 25
promptLen   db 96/2 ; only 96 char from 4096 bytes.(48 HZ)
promptBuf   dd 0
data ends
os32_code segment use32 public
assume cs:os32_code,ds:data
os32_code ends

这篇关于虚拟实现汉字系统----VVDOS -- 源码 -- 保护模式程序 - 2的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/938153

相关文章

C++使用栈实现括号匹配的代码详解

《C++使用栈实现括号匹配的代码详解》在编程中,括号匹配是一个常见问题,尤其是在处理数学表达式、编译器解析等任务时,栈是一种非常适合处理此类问题的数据结构,能够精确地管理括号的匹配问题,本文将通过C+... 目录引言问题描述代码讲解代码解析栈的状态表示测试总结引言在编程中,括号匹配是一个常见问题,尤其是在

Java实现检查多个时间段是否有重合

《Java实现检查多个时间段是否有重合》这篇文章主要为大家详细介绍了如何使用Java实现检查多个时间段是否有重合,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录流程概述步骤详解China编程步骤1:定义时间段类步骤2:添加时间段步骤3:检查时间段是否有重合步骤4:输出结果示例代码结语作

使用C++实现链表元素的反转

《使用C++实现链表元素的反转》反转链表是链表操作中一个经典的问题,也是面试中常见的考题,本文将从思路到实现一步步地讲解如何实现链表的反转,帮助初学者理解这一操作,我们将使用C++代码演示具体实现,同... 目录问题定义思路分析代码实现带头节点的链表代码讲解其他实现方式时间和空间复杂度分析总结问题定义给定

Java覆盖第三方jar包中的某一个类的实现方法

《Java覆盖第三方jar包中的某一个类的实现方法》在我们日常的开发中,经常需要使用第三方的jar包,有时候我们会发现第三方的jar包中的某一个类有问题,或者我们需要定制化修改其中的逻辑,那么应该如何... 目录一、需求描述二、示例描述三、操作步骤四、验证结果五、实现原理一、需求描述需求描述如下:需要在

如何使用Java实现请求deepseek

《如何使用Java实现请求deepseek》这篇文章主要为大家详细介绍了如何使用Java实现请求deepseek功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1.deepseek的api创建2.Java实现请求deepseek2.1 pom文件2.2 json转化文件2.2

python使用fastapi实现多语言国际化的操作指南

《python使用fastapi实现多语言国际化的操作指南》本文介绍了使用Python和FastAPI实现多语言国际化的操作指南,包括多语言架构技术栈、翻译管理、前端本地化、语言切换机制以及常见陷阱和... 目录多语言国际化实现指南项目多语言架构技术栈目录结构翻译工作流1. 翻译数据存储2. 翻译生成脚本

如何通过Python实现一个消息队列

《如何通过Python实现一个消息队列》这篇文章主要为大家详细介绍了如何通过Python实现一个简单的消息队列,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录如何通过 python 实现消息队列如何把 http 请求放在队列中执行1. 使用 queue.Queue 和 reque

Python如何实现PDF隐私信息检测

《Python如何实现PDF隐私信息检测》随着越来越多的个人信息以电子形式存储和传输,确保这些信息的安全至关重要,本文将介绍如何使用Python检测PDF文件中的隐私信息,需要的可以参考下... 目录项目背景技术栈代码解析功能说明运行结php果在当今,数据隐私保护变得尤为重要。随着越来越多的个人信息以电子形

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

使用Python快速实现链接转word文档

《使用Python快速实现链接转word文档》这篇文章主要为大家详细介绍了如何使用Python快速实现链接转word文档功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 演示代码展示from newspaper import Articlefrom docx import