首页
社区
课程
招聘
[求助]怎样用8086汇编语言显示‘刘’字?
发表于: 2009-3-10 12:49 5575

[求助]怎样用8086汇编语言显示‘刘’字?

2009-3-10 12:49
5575
各位大侠,我在csdn看到一个帖子,网址见:
http://topic.csdn.net/u/20081027/10/90612772-08ca-4180-84d1-1ee0597c81f0.html?seed=1611778816

怎样用8086汇编语言显示‘刘’字?

我也姓刘,顶一个。 能移动的‘刘’字
把下面虚线内数据保存为Liu.bat,直接双击即可运行。
--------------------
Goto Liu

E100  0E 1F B8 12 00 CD 10 FC B8 00 A0 8E C0 31 FF 89
E110  FD BE 90 01 B9 10 00 E8 2E 00 A4 A4 83 C7 4E E2
E120  F9 B4 00 CD 16 3C 0D 74 16 89 EF B9 10 00 26 C7
E130  05 00 00 83 C7 50 E2 F6 89 EF 83 C7 50 EB D0 B8
E140  03 00 CD 10 B4 4C CD 21 B4 02 B7 00 BA 20 10 CD
E150  10 B3 24 89 FA 88 F7 E8 0E 00 88 D7 E8 09 00 C3
E160  00 00 00 00 00 00 00 00 88 F8 D0 E8 D0 E8 D0 E8
E170  D0 E8 0C 30 3C 39 76 02 04 07 B4 0E CD 10 88 F8
E180  24 0F 0C 30 3C 39 76 02 04 07 B4 0E CD 10 C3 00
E190  20 04 18 04 09 24 FF A4 02 24 42 24 22 24 14 24
E1A0  14 24 08 24 08 24 14 24 22 04 43 04 81 14 00 08
E1B0  10 00 10 20 10 40 10 84 FD FE 11 04 31 04 39 04
E1C0  55 04 51 FC 91 04 11 04 11 04 11 04 11 FC 11 04
E1D0  00 20 00 F0 0F 00 08 00 08 00 08 10 0F F8 08 40
E1E0  00 00 00 00 FF FE 00 00 04 40 0C 30 10 18 20 08
E1F0  5B 31 66 66 2D 32 35 65 5D 6C 62 62 2E 64 6F 74

g=100

q

:Liu
Debug <Liu.bat  
--------------------
    程序在屏幕左上角写一“刘”字,屏幕中部显示“刘”的位置,
是写屏时的ES:DI值。回车键结束程序,长按其它键,“刘”字逐行
下移。

再顶一个。 能变色的‘刘’字
把下面虚线内数据保存为CaiLiu.bat,直接双击即可运行。
----------------------------------                    
Goto CaiLiu

e100  EB 1E 00 00 00 00 00 00 5C 48 5A 4B 31 36 00 6E
e110  6F 74 20 66 6F 75 6E 64 21 07 0D 0A 24 00 00 00
e120  0E 1F B4 0F CD 10 B4 00 A3 C0 00 B8 12 00 CD 10
e130  B4 0B BB 01 01 CD 10 BB 00 00 CD 10 E8 79 00 BE
e140  FF 01 BF 10 00 B9 02 00 51 8A 1C B9 08 00 51 D0
e150  E3 72 04 B0 00 EB 02 B0 01 89 E9 B4 0C CD 10 45
e160  59 E2 EB 46 59 E2 E1 4F 90 74 06 42 83 ED 10 EB
e170  D4 B4 00 CD 16 3C 0D 75 09 A1 C0 00 CD 10 B4 4C
e180  CD 21 A0 58 01 FE C0 3C FF 74 EE A2 58 01 88 C3
e190  B1 04 D2 E8 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1A0  88 D8 24 0F 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1B0  EB 8A 00 00 00 00 00 00 B4 03 CD 10 B3 08 88 D0
e1C0  F6 E3 89 C5 88 F0 B3 10 F6 E3 89 C2 C3 00 00 00
e1D0  00 00 02 40 02 40 02 40 02 40 02 40 02 40 02 40
e1E0  02 40 02 40 02 40 02 40 02 40 02 40 02 40 00 00
e1F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20
e200  04 18 04 09 24 FF A4 02 24 42 24 22 24 14 24 14
e210  24 08 24 08 24 14 24 22 04 43 04 81 14 00 08 10
e220  00 10 20 10 40 10 84 FD FE 11 04 31 04 39 04 55
e230  04 51 FC 91 04 11 04 11 04 11 04 11 FC 11 04 00
e240  20 00 F0 0F 00 08 00 08 00 08 10 0F F8 08 40 08
e250  40 08 44 FF FE 00 00 04 40 0C 30 10 18 20 08 1A
e260  5B 31 66 66 2D 32 35 65 20 69 73 20 6C 62 62 2E
e270  64 6F 74 2E 5D 00 21 C7 00 00 00 00 00 00 00 00

g=100

q

:CaiLiu
Debug <CaiLiu.bat  

----------------------------------                    
    程序在屏幕左上角写一“刘”字,前面是当前彩色代码号。
回车键结束程序,长按其它键,“刘”字逐字后移。

上面是有个大侠的回答,我测试了,可以显示“刘”字,但是我有个问题:
这个bat文件的代码是如何得来的?要是将“刘”改成“张三”如何改?“刘”字如何修改颜色?字号(9号,16号,36号等)?字形(如仿宋,楷体,黑体等)?

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (13)
雪    币: 2110
活跃值: (21)
能力值: (RANK:260 )
在线值:
发帖
回帖
粉丝
2
这是故弄玄虚。debug的e命令是向内存中写数用的。

整个脚本就是利用debug写一个程序,然后g命令运行。

你用WinHex将那些数写入一个磁盘文件中,然后反汇编就知道程序的内容了。

这就是debug生成的程序,由于我的x64系统无法运行16位程序,所以没测试是否能运行。看起来要用hzk16的点阵来显示汉字的。

liu.zip

要知道它怎么调用字库文件,只要把这个com文件反汇编看一下就知道了。
上传的附件:
2009-3-10 17:01
0
雪    币: 1489
活跃值: (235)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
试试这个,文件内容保存在c:\1.com

Goto CaiLiu

e100  EB 1E 00 00 00 00 00 00 5C 48 5A 4B 31 36 00 6E
e110  6F 74 20 66 6F 75 6E 64 21 07 0D 0A 24 00 00 00
e120  0E 1F B4 0F CD 10 B4 00 A3 C0 00 B8 12 00 CD 10
e130  B4 0B BB 01 01 CD 10 BB 00 00 CD 10 E8 79 00 BE
e140  FF 01 BF 10 00 B9 02 00 51 8A 1C B9 08 00 51 D0
e150  E3 72 04 B0 00 EB 02 B0 01 89 E9 B4 0C CD 10 45
e160  59 E2 EB 46 59 E2 E1 4F 90 74 06 42 83 ED 10 EB
e170  D4 B4 00 CD 16 3C 0D 75 09 A1 C0 00 CD 10 B4 4C
e180  CD 21 A0 58 01 FE C0 3C FF 74 EE A2 58 01 88 C3
e190  B1 04 D2 E8 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1A0  88 D8 24 0F 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1B0  EB 8A 00 00 00 00 00 00 B4 03 CD 10 B3 08 88 D0
e1C0  F6 E3 89 C5 88 F0 B3 10 F6 E3 89 C2 C3 00 00 00
e1D0  00 00 02 40 02 40 02 40 02 40 02 40 02 40 02 40
e1E0  02 40 02 40 02 40 02 40 02 40 02 40 02 40 00 00
e1F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09
e200 00 FD 08 09 08 09 10 09 20 79 40 41 04 47 FE 41
e210 40 79 40 09 20 09 20 09 10 09 4E 51 84 21 00 10
e220  00 10 20 10 40 10 84 FD FE 11 04 31 04 39 04 55
e230  04 51 FC 91 04 11 04 11 04 11 04 11 FC 11 04 00
e240  20 00 F0 0F 00 08 00 08 00 08 10 0F F8 08 40 08
e250  40 08 44 FF FE 00 00 04 40 0C 30 10 18 20 08 1A
e260  5B 31 66 66 2D 32 35 65 20 69 73 20 6C 62 62 2E
e270  64 6F 74 2E 5D 00 21 C7 00 00 00 00 00 00 00 00

r cx
270
n c:\1.com
w

q

:CaiLiu
Debug <CaiLiu.bat
2009-3-10 17:53
0
雪    币: 249
活跃值: (93)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
还可以显示汉字呀
2009-3-10 19:45
0
雪    币: 211
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
;具体看注释和标号命名,HHO

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)

LOOP:                                   ; CODE XREF: start+B0j
    call GetCurPos
    mov si, LBB_DOT
    mov di, 10h

SHOW_WORD:                              ; CODE XREF: start+6Fj
    mov cx, 2

LOOP_Y:                                 ; CODE XREF: start+65j
    push cx
    mov bl, [si]
    mov cx, 8

LOOP_X:                                 ; CODE XREF: start+61j
    push cx
    shl bl, 1
    jb  short SET_COLOR
    mov al, 0
    jmp short SHOW_DOT
; ---------------------------------------------------------------------------

SET_COLOR:                              ; CODE XREF: start+51j
                                        ; DATA XREF: start:CONTIUEr ...
    mov al, 1

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

; ---------------------------------------------------------------------------
    align 8

; =============== 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
2009-3-10 21:19
0
雪    币: 40
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
我下载书哥哥那个liu.zip,在dos下面可以运行,现在有什么快速的办法得到汇编代码?
我使用winhex,将下面的代码复制进去,保存成q.exe,结果运行的时候,只有光标一闪一闪,不管按什么键都没有反应:Goto CaiLiu

e100  EB 1E 00 00 00 00 00 00 5C 48 5A 4B 31 36 00 6E
e110  6F 74 20 66 6F 75 6E 64 21 07 0D 0A 24 00 00 00
e120  0E 1F B4 0F CD 10 B4 00 A3 C0 00 B8 12 00 CD 10
e130  B4 0B BB 01 01 CD 10 BB 00 00 CD 10 E8 79 00 BE
e140  FF 01 BF 10 00 B9 02 00 51 8A 1C B9 08 00 51 D0
e150  E3 72 04 B0 00 EB 02 B0 01 89 E9 B4 0C CD 10 45
e160  59 E2 EB 46 59 E2 E1 4F 90 74 06 42 83 ED 10 EB
e170  D4 B4 00 CD 16 3C 0D 75 09 A1 C0 00 CD 10 B4 4C
e180  CD 21 A0 58 01 FE C0 3C FF 74 EE A2 58 01 88 C3
e190  B1 04 D2 E8 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1A0  88 D8 24 0F 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1B0  EB 8A 00 00 00 00 00 00 B4 03 CD 10 B3 08 88 D0
e1C0  F6 E3 89 C5 88 F0 B3 10 F6 E3 89 C2 C3 00 00 00
e1D0  00 00 02 40 02 40 02 40 02 40 02 40 02 40 02 40
e1E0  02 40 02 40 02 40 02 40 02 40 02 40 02 40 00 00
e1F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09
e200 00 FD 08 09 08 09 10 09 20 79 40 41 04 47 FE 41
e210 40 79 40 09 20 09 20 09 10 09 4E 51 84 21 00 10
e220  00 10 20 10 40 10 84 FD FE 11 04 31 04 39 04 55
e230  04 51 FC 91 04 11 04 11 04 11 04 11 FC 11 04 00
e240  20 00 F0 0F 00 08 00 08 00 08 10 0F F8 08 40 08
e250  40 08 44 FF FE 00 00 04 40 0C 30 10 18 20 08 1A
e260  5B 31 66 66 2D 32 35 65 20 69 73 20 6C 62 62 2E
e270  64 6F 74 2E 5D 00 21 C7 00 00 00 00 00 00 00 00

r cx
270
n c:\1.com
w

q

:CaiLiu
Debug <CaiLiu.bat

不知这样保存的q.exe有没有错误?谢谢先

另外,intelfan大侠那个,我使用记事本,保存成1.com,在dos下:
c:\>1.com(按回车)
c:\>

没有什么输出,直接就返回到c盘
2009-3-10 22:06
0
雪    币: 40
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
TO:百家拳大侠
我使用masmplus1.2建立dos工程编译,提示出错:
正在处理工程文件...
没有设置单独编译/链接的文件...

正在处理工程 ...
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

请问是怎么回事?谢谢先
2009-3-10 22:10
0
雪    币: 1634
活跃值: (1387)
能力值: (RANK:50 )
在线值:
发帖
回帖
粉丝
8
那个代码是楼上给你的分析
2009-3-10 22:56
0
雪    币: 40
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
继续请教第一个帖子的问题:
这个bat文件的代码是如何得来的?要是将“刘”改成“张三”如何改?“刘”字如何修改颜色?字号(9号,16号,36号等)?字形(如仿宋,楷体,黑体等)?
2009-3-11 00:56
0
雪    币: 101
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
貌似你应该去研究一下字库。
5楼的分析给出了“刘”字的点阵(LBB_DOT),而且这个程序使用的是汉字16点阵字库HZK16。
2009-3-11 01:03
0
雪    币: 40
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
5楼大侠的代码,不知如何才能调试通过?
也不懂那个点阵是怎么来的
那个代码要一个字库文件,但是我贴出来的好像没有那个字库文件?

请教请教,谢谢先!
2009-3-11 01:31
0
雪    币: 1270
活跃值: (109)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
12
如果真的要研究DOS下显示编程,建议还是先看看相关书籍,一些细节的东西单靠看别人程序没什么效果。
点阵可以自己画出来,如果你不怕麻烦的话。当然,现在已经有相关的软件可以直接输出汉字点阵数据供程序使用。
字库文件,记得上次我已经给你提供了。
楼上的程序都只是把汉字的点阵直接放在程序里面了,因此只能显示一个汉字,也没有字库文件附带,想变成其他汉字,就要自己把该汉字点阵得到并替换掉那个“刘”,至于字号,只有靠其他软件来提取点阵实现了,一般字库并没有各类字体的;颜色倒很简单,这与DOS显示编程有关,楼上程序中有注释到的。
2009-3-11 09:02
0
雪    币: 211
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
我的代码就是从你给出的16进制里来的,你复制你的所有代码,然后在debug环境下用e命令,粘贴过去,然后r设置cx,n起名字,w存盘,q退出,IDA打开阅读。你贴出来的里面就有一个刘字的点阵。
2009-3-11 13:23
0
雪    币: 1489
活跃值: (235)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
横线里的内容保存成文本文件,改名成CaiLiu.bat
运行CaiLiu.bat,会在C盘生成1.com,可以用IDA等工具分析。
------------------------------------
Goto CaiLiu

e100  EB 1E 00 00 00 00 00 00 5C 48 5A 4B 31 36 00 6E
e110  6F 74 20 66 6F 75 6E 64 21 07 0D 0A 24 00 00 00
e120  0E 1F B4 0F CD 10 B4 00 A3 C0 00 B8 12 00 CD 10
e130  B4 0B BB 01 01 CD 10 BB 00 00 CD 10 E8 79 00 BE
e140  FF 01 BF 10 00 B9 02 00 51 8A 1C B9 08 00 51 D0
e150  E3 72 04 B0 00 EB 02 B0 01 89 E9 B4 0C CD 10 45
e160  59 E2 EB 46 59 E2 E1 4F 90 74 06 42 83 ED 10 EB
e170  D4 B4 00 CD 16 3C 0D 75 09 A1 C0 00 CD 10 B4 4C
e180  CD 21 A0 58 01 FE C0 3C FF 74 EE A2 58 01 88 C3
e190  B1 04 D2 E8 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1A0  88 D8 24 0F 0C 30 3C 39 76 02 04 07 B4 0E CD 10
e1B0  EB 8A 00 00 00 00 00 00 B4 03 CD 10 B3 08 88 D0
e1C0  F6 E3 89 C5 88 F0 B3 10 F6 E3 89 C2 C3 00 00 00
e1D0  00 00 02 40 02 40 02 40 02 40 02 40 02 40 02 40
e1E0  02 40 02 40 02 40 02 40 02 40 02 40 02 40 00 00
e1F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09
e200 00 FD 08 09 08 09 10 09 20 79 40 41 04 47 FE 41
e210 40 79 40 09 20 09 20 09 10 09 4E 51 84 21 00 10
e220  00 10 20 10 40 10 84 FD FE 11 04 31 04 39 04 55
e230  04 51 FC 91 04 11 04 11 04 11 04 11 FC 11 04 00
e240  20 00 F0 0F 00 08 00 08 00 08 10 0F F8 08 40 08
e250  40 08 44 FF FE 00 00 04 40 0C 30 10 18 20 08 1A
e260  5B 31 66 66 2D 32 35 65 20 69 73 20 6C 62 62 2E
e270  64 6F 74 2E 5D 00 21 C7 00 00 00 00 00 00 00 00

r cx
270
n c:\1.com
w

q

:CaiLiu
Debug <CaiLiu.bat
------------------------------------
2009-3-11 17:34
0
游客
登录 | 注册 方可回帖
返回
//