|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『楼 主』:
[原创]斗地主脚本技术准备-彩色输出 SYBC.com
使用 LLM 解释/回答一下
俺正在努力开发cmd版的斗地主,为此要做很多技术准备.
由于计划使用全彩的游戏界面,所以需要一个小com来输出彩色字符.
最初使用tit.com,然后以此为基础开发了sybc.com
并使用sybc.com编写了一系列示例代码.
目前已经可以用sybc.com实现斗地主的完整界面.
游戏代码以及1.1.11版sybc在6楼
最新1.1.21版在9楼
最新1.1.31版在12楼
征召高手低手一起加盟开发 QQ群:3401238
http://www.cn-dos.net/forum/viewthread.php?tid=50331&fpage=1
Last edited by sl543001 on 2010-4-3 at 03:23 ]
I'm working hard to develop a CMD version of Dou Di Zhu (Chinese poker), and there are many technical preparations to do.
Because I plan to use a full-color game interface, so I need a small COM to output colored characters.
Initially, I used tit.com, and then developed sybc.com based on it.
And used sybc.com to write a series of sample codes.
Currently, the complete interface of Dou Di Zhu can be realized with sybc.com.
The game code and version 1.1.11 of sybc are on floor 6
The latest version 1.1.21 is on floor 9
The latest version 1.1.31 is on floor 12
Recruiting experts and novices to join the development together QQ group: 3401238
http://www.cn-dos.net/forum/viewthread.php?tid=50331&fpage=1
Last edited by sl543001 on 2010-4-3 at 03:23 ]
附件
1: sybc.rar (2010-3-2 17:48, 1.06 KiB,下载次数: 64)
附件
2: sybc参数详解.gif (2010-3-10 12:40, 17.45 KiB,下载次数: 14)
附件
3: ddz59.GIF (2010-3-10 13:38, 23.49 KiB,下载次数: 1)
|

SYBNQQ:354324773
|
|
2010-2-28 18:39 |
|
|
awangwjf
新手上路

积分 7
发帖 3
注册 2010-2-26
状态 离线
|
|
2010-2-28 19:53 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
修改并更新了代码,略微修改了语法,截图改为扑克牌!
Modified and updated the code, slightly modified the grammar, and changed the screenshot to a playing card!
|

SYBNQQ:354324773
|
|
2010-3-1 11:20 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
用于显示1楼截图中的一列扑克牌的cmd部分代码:
set a=a0=$fcA;a1=$fcA;a2=$fc2;a3=$fc3;a4=$fc4;a5=$fc5;a6=$fc6;a7=$fc7;a8=$fc8;a9=$fc9;a10=$fc10;a11=$fcJ;a12=$fcQ;a13=$fcK;a14=$fcS;a15=$fcY;a16=$fcB;a17=$fcN
set p%a:;=&set p%
cls
for /l %%a in (0,1,17) do set /a wz=11800+%%a*4&&(if %%a gtr 2 if %%a lss 8 set /a wz=!wz!-100)&&call :pa !wz! !pa%%a! ◆
pause
exit
:pb
call s7.com %1f1┏━━━━┓;$f1┃╳╳╳╳┃;$f1┃╳SYBN╳┃;$f1┃╳╳╳╳┃;$f1┃╳2010╳┃;$f1┃╳╳╳╳┃;$f1┗━━━━┛
goto :eof
:pa
call s7.com %1f1┏━━━━┓;:┃%2 $f1┃;:┃%3 斗 ┃;:┃ 地 ┃;:┃ 主 %2$f1┃;:┃ %3┃;:┗━━━━┛
goto :eof
The code used to display a column of playing cards in the screenshot of floor 1:
set a=a0=$fcA;a1=$fcA;a2=$fc2;a3=$fc3;a4=$fc4;a5=$fc5;a6=$fc6;a7=$fc7;a8=$fc8;a9=$fc9;a10=$fc10;a11=$fcJ;a12=$fcQ;a13=$fcK;a14=$fcS;a15=$fcY;a16=$fcB;a17=$fcN
set p%a:;=&set p%
cls
for /l %%a in (0,1,17) do set /a wz=11800+%%a*4&&(if %%a gtr 2 if %%a lss 8 set /a wz=!wz!-100)&&call :pa !wz! !pa%%a! ◆
pause
exit
:pb
call s7.com %1f1┏━━━━┓;$f1┃╳╳╳╳┃;$f1┃╳SYBN╳┃;$f1┃╳╳╳╳┃;$f1┃╳2010╳┃;$f1┃╳╳╳╳┃;$f1┗━━━━┛
goto :eof
:pa
call s7.com %1f1┏━━━━┓;:┃%2 $f1┃;:┃%3 斗 ┃;:┃ 地 ┃;:┃ 主 %2$f1┃;:┃ %3┃;:┗━━━━┛
goto :eof
|

SYBNQQ:354324773
|
|
2010-3-1 11:28 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
正在计划修改参数入口和调用方式,突破124参数限制
Is planning to modify the parameter entry and calling method, breaking through the 124 parameter limit
|

SYBNQQ:354324773
|
|
2010-3-2 17:44 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
修改参数入口的计划暂缓到sybn Dll中解决
目前找到了新方法解决问题
在新版sybc中把参数中";:"的意义和";"的意义调换
因为原";:"的使用率比";"多,所以节约了少许代码
刚搞够吧右下角的数字变色
截图中用到的斗地主脚本
只能干看看,还不能玩.
Last edited by sl543001 on 2010-3-4 at 12:18 ]
The plan to modify the parameter entry is postponed to be solved in the sybn Dll. Currently, a new method is found to solve the problem. In the new version of sybc, the meanings of ";:" and ";" in the parameters are swapped. Because the usage rate of the original ";:" is higher than that of ";", so a little code is saved. Just finished changing the color of the number at the lower right corner.
The斗地主 script used in the screenshot
Can only be looked at, still cannot be played.
Last edited by sl543001 on 2010-3-4 at 12:18 ]
附件
1: ddz.rar (2010-3-4 12:18, 1.68 KiB,下载次数: 22)
|

SYBNQQ:354324773
|
|
2010-3-4 12:01 |
|
|
qinchun36
高级用户
    据说是李先生
积分 609
发帖 400
注册 2008-4-23
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
.......
哎呀,隔行如隔山,看不懂,也没机会去学汇编了,只能精神上支持了
.......
Oh, different lines are like different mountains. I don't understand it, and there's no chance to learn assembly anymore. I can only support it spiritually
|

┏━━━━━━┓
┃据说是李先生┃
┠──────┨
┃*ntRSS┃
┗━━━━━━┛ |
|
2010-3-4 14:33 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
不需要会原理,会用就行了.
俺等到sybc开发到一定程度后,就会发布DEBUG版.
到时候就可以实现无3方全彩输出了!
No need to understand the principle, just be able to use it.
I will release the DEBUG version when sybc is developed to a certain extent.
At that time, the full-color output without third parties can be realized!
|

SYBNQQ:354324773
|
|
2010-3-6 09:56 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
新版sybc 1.1.21已经支持choice功能 方法是不加任何参数直接运行
现发布debug版sybc生成代码:
SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
SET V=;RCX;D7;N SYBC.COM;W;Q
(ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
Last edited by sl543001 on 2010-3-6 at 16:40 ]
The new version sybc 1.1.21 already supports the choice function. The method is to run it without adding any parameters.
Now release the debug version of sybc to generate code:
SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
SET V=;RCX;D7;N SYBC.COM;W;Q
(ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
Last edited by sl543001 on 2010-3-6 at 16:40 ]
附件
1: ddz59.GIF (2010-3-6 16:40, 18.95 KiB)
|

SYBNQQ:354324773
|
|
2010-3-6 16:38 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
因为SYBC被设计为内嵌于脚本中,你可以不在磁盘中生成 SYBC.COM文件.
而是直接把他从 脚本中释放到内存,并 在内存中运行.
当然如果你愿意,它也可以像一般三方工具那样被使用.
好吧,大家首先是要 截图和 下载地址,截图就在下边,是cmd脚本的实图哦!
至于下载地址,既然内嵌了,又何须下载?吧下面代码保存为cmd运行即可生成SYBC.com(此代码版本1.1.21 更新日期2010-3-10)
SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
SET V=;RCX;D7;N SYBC.COM;W;Q
if not exist sybc.com (ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
-------------------------------------------------------------------------------
好吧,现在大家手上应该有SYBC.com文件了吧,没有就生成一个.
接下来的问题是 SYBC应该怎么用,SYBC分为 基础与 高级2中语法,(2者仅在速度上有差别,最终效果一至)
可以 以SYBC.com文件形式运行,也可以 直接运行于内存.(后者略快)
-------------------------------------------------------------------------------
使用SYBC之前需要初始化(特别是win2000/XP),
初始化的方法很简单,首先如果你要使用中文,需要在你的代码开头加上 "(CHCP 437 &GRAFTABL 936)>NUL"
然后你需要 运行一次无参数的SYBC,用户按任意键后初始化完成.:[语法图第1例]
(由于没有提示,所以建议大家最好用echo告知用户要按任意键)
-------------------------------------------------------------------------------
基础语法:[语法图第2例]
SYBC 位置颜色内容
SYBC 10303$F1SYBN#s
位置 5位数字第23位为行数第45位为列数
颜色 用$引导的2个16进制数,同color命令
内容 任意字符串 (注意不要使用$#;三个符号以免冲突)
#号 无内容,保留此位置原内容仅改变颜色
$号 允许存在多个$号,分别控制之后的字符颜色
-------------------------------------------------------------------------------
利用 基础语法可以实现SYBC的全部效果,
如果觉得速度不满意,可以使用高级语法,
把多行 基础语法合并成一行 高级语法从而减少调用次数以加速.
不论使用什么语法,没次调用SYBC的时间都约0.01秒,瓶颈在硬盘的响应速度.
另外使用内嵌式调用,跳过磁盘直接运行SYBC可以进一步提高速度,但会牺牲代码可读性.
-------------------------------------------------------------------------------
高级语法:
[语法图第3例]
SYBC 10303$F1SYBN;2010
效果同
SYBC 10303$F1SYBN
SYBC 10403$F12010
分号 是换行符可以再上一行的起点列从启一行继续
如果不使用换行符而写一个很长的字符串,则会像echo那样自然换行.
[语法图第4例]
SYBC 10303$F1SYBN;:10401$F12010
效果同
SYBC 10303$F1SYBN
SYBC 10401$F12010
分号冒号 效果类似于脚本中的&符,可以吧两个SYBC命令连接在一起使用.
这样你几乎就可以吧所有连续出现的sybc命令合并成一行,速度会快很多.
--------------------------------------------------------------------------------
不过大家要注意com程序的参数是有长度限制的.
理论长度为127,实际可用长度为124,超过124则无法执行了!
当然,如果你使用后面的内嵌式调用,则没有这个限制了!
--------------------------------------------------------------------------------
内嵌式调用:
使用DEBUG可以方便的调用com程序,之前生成SYBC.com用的就是DEBUG,
我们是要稍微修改就可以用于内嵌式调用了!
首先,把SYBC.com的代码以16进制的形式保存在变量SYBCOM中 SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
然后把DEBUG指令保存在变量V中 SET V=;A80;DB 10 00 "10303$F1SYBN2010" 0D;;RCX;F0;G;Q
注意10是指参数长度的16进制值,在1.1.21版中它已经没用了,不用管它照着写或写别的16进制值都行.
"10303$F1SYBN2010"就是参数了,记得两边加上冒号,这里的参数长度限制大约为65个字节
最后在调用它们 (ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
---------------------------------------------------------------------------------------------------------
当然你还是没有突破124参数限制,反而限制降低到了约65字节,
如何突破限制呢?修改变量V的值就可以了. SET V=;A80;DB 10 01;; A280;DB 10 00 "10303$F1SYBN";DB "2010-";DB "3-16" 0D;;RCX;F0;G;Q
大家不需要管为啥要这样写,只需要知道你可以吧参数分段,每段少于65字节,写在引号里就好了,
你可以写无限多个DB "XXXXXXXX"注意最后一个要加上0D不要忘记0D前的空格就好.
如有问题联系QQ:354324773
Because SYBC is designed to be embedded in scripts, you can release it from the script to memory directly instead of generating the SYBC.COM file on the disk. It can also be run in memory. Of course, if you want, it can also be used like a general third-party tool.
Well, everyone first needs screenshots and download addresses. The screenshots are below, which are real pictures of the cmd script! As for the download address, since it is embedded, why download it? Just save the following code as a cmd and run it to generate SYBC.com (this code version 1.1.21, update date 2010-3-10)
SET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3
SET V=;RCX;D7;N SYBC.COM;W;Q
if not exist sybc.com (ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL
-------------------------------------------------------------------------------
Well, now everyone should have the SYBC.com file. If not, generate one.
The next question is how to use SYBC. SYBC has two types of grammars: basic and advanced (the two only differ in speed, and the final effects are the same). It can be run in the form of the SYBC.com file or directly in memory (the latter is slightly faster).
-------------------------------------------------------------------------------
Before using SYBC, initialization is required (especially for Win2000/XP).
The initialization method is very simple. First, if you want to use Chinese, you need to add ""(CHCP 437 &GRAFTABL 936)>NUL" at the beginning of your code. Then you need to run SYBC without parameters once, and the initialization is completed after the user presses any key.:
(There is no prompt, so it is recommended that everyone better use echo to inform the user to press any key)
-------------------------------------------------------------------------------
Basic grammar:
SYBC positioncolorcontent
SYBC 10303$F1SYBN#s
Position: 5-digit number, the 2nd and 3rd digits are the row number, and the 4th and 5th digits are the column number
Color: 2 hexadecimal numbers preceded by $, the same as the color command
Content: Any string (note that do not use $#; three symbols to avoid conflicts)
#number: No content, keep the original content of this position and only change the color
$number: Allow multiple $numbers, respectively control the color of the following characters
-------------------------------------------------------------------------------
Using the basic grammar can achieve all the effects of SYBC.
If you feel that the speed is not satisfactory, you can use the advanced grammar, combine multiple lines of basic grammar into one line of advanced grammar to reduce the number of calls to speed up. No matter which grammar is used, the time for each call to SYBC is about 0.01 seconds, and the bottleneck is the response speed of the hard disk. In addition, using the embedded call, skipping the disk and directly running SYBC can further improve the speed, but the code readability will be sacrificed.
-------------------------------------------------------------------------------
Advanced grammar:
[Grammar diagram example 3]
SYBC 10303$F1SYBN;2010
The effect is the same as
SYBC 10303$F1SYBN
SYBC 10403$F12010
Semicolon is a line break character, and you can start a new line from the starting column of the previous line.
If you do not use a line break character and write a very long string, it will naturally wrap like echo.
[Grammar diagram example 4]
SYBC 10303$F1SYBN;:10401$F12010
The effect is the same as
SYBC 10303$F1SYBN
SYBC 10401$F12010
Semicolon colon: The effect is similar to the & symbol in the script, which can connect two SYBC commands together.
In this way, you can almost combine all consecutive SYBC commands into one line, and the speed will be much faster.
--------------------------------------------------------------------------------
However, everyone should pay attention that the parameters of the com program have a length limit.
The theoretical length is 127, and the actual available length is 124. If it exceeds 124, it cannot be executed! Of course, if you use the subsequent embedded call, there is no such limit!
--------------------------------------------------------------------------------
Embedded call:
It is convenient to call the com program using DEBUG. The SYBC.com generated earlier used DEBUG. We just need to modify it slightly to be used for embedded calls.
First, save the code of SYBC.com in the variable SYBCOM in hexadecimal formSET SYBCOM=A100;80BE AC00 23C 5472 3CAC 7501 BE13 282;0EEB 3CAC 743A 3C09 740D 8347 1EE 46EB;E8AC 90 A2E8 3C00 7F18 8837 E8C6 84;96E8 3C00 7F4F 882B B0C2 F602 50E2 A0B0;E6F6 15F 57C7 3CAC 7424 E80A 67 45E8;8800 EBD1 E817 3B D188 10EB B0 16CD;E088 4CB4 21CD 815F A0C7 5700 B850 B800;0750 295A 88F5 ACCA 243C D974 3B3C 9274;0D3C DE74 233C 575 D783 EB01 AA01 D088;EBAA E8E4 1E C387 393C 27E 904 FB80;7E39 8003 9C3 F24 E380 B20F F610 E2;88D8 C3C2 3CAC 7420 3CFB 740D 88A5 ACC3;203C F074 D3C 9A74 87C3 2CC3 8030 30EB;0AB4 E4F6 D800 C3 Then save the DEBUG instructions in the variable VSET V=;A80;DB 10 00 "10303$F1SYBN2010" 0D;;RCX;F0;G;Q Note that 10 refers to the hexadecimal value of the parameter length. In version 1.1.21, it is no longer used, so just write it as it is or write other hexadecimal values.
"10303$F1SYBN2010" is the parameter. Remember to add colons on both sides. The parameter length limit here is about 65 bytes.
Finally, call them(ECHO.%SYBCOM:;=&ECHO.DW %&ECHO.%V:;=&ECHO.%)|DEBUG>NUL ---------------------------------------------------------------------------------------------------------
Of course, you still haven't broken through the 124 parameter limit, but instead the limit is reduced to about 65 bytes.
How to break through the limit? Modify the value of variable V.SET V=;A80;DB 10 01;; A280;DB 10 00 "10303$F1SYBN";DB "2010-";DB "3-16" 0D;;RCX;F0;G;Q You don't need to care why it is written like this. Just know that you can segment the parameters, each segment is less than 65 bytes, and write it in quotes.
You can write infinitely many DB "XXXXXXXX". Note that the last one should be added with 0D, and don't forget the space before 0D.
For problems, contact QQ: 354324773
|

SYBNQQ:354324773
|
|
2010-3-20 15:19 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
最新SYBC 1.1.31支持直接读取内存中的变量作为程序参数
大幅提高使用效率,相同内容显示时间减少三分之一以上
以斗地主为例:刷新时间由48降为27
SYBC 1.1.31正在测试中...
The latest SYBC 1.1.31 supports directly reading variables in memory as program parameters. It greatly improves the usage efficiency, and the display time for the same content is reduced by more than one third. Take斗地主 (Dou Di Zhu, a card game) as an example: the refresh time is reduced from 48 to 27. SYBC 1.1.31 is being tested...
附件
1: ddz61.GIF (2010-3-31 18:50, 20.14 KiB,下载次数: 3)
|

SYBNQQ:354324773
|
|
2010-3-31 18:50 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
1.1.31版 内存调用模块 演示代码
将SYBC之后内容插入脚本,初始化后利用"call :SYBC 参数"即可
参数几乎可以无限长,只要不超过64K(想让参数超过64K也难啊)
@ECHO Off&SETLOCAL ENABLEDELAYEDEXPANSION&SET SYBNV=0.0.2
:SYDLL
call :SYBA
call :SYBC 103003e完全无3方彩色输出示例模块演示代码,以上是效果展示;您看到的所有内容采用完全无3方彩色单行代码输出;大家使用SYBC前需要初始化,执行一次无参数的SYBC,或执行标签SYBA中的代码;标签SYBC与SYBCC需连续放置,不得改变位置关系;大家只要把标签SYBC及其之后的内容插入自己的脚本中;初始化后使用 的形式即可无3方调用SYBC;示例代码的参数极限长度为700字节;如有特殊需求可自行修改变量V扩展参数极限;:10000$f0 :::│$fC积$f9 电脑左 $f00 $f2+0$fC=$f00 $f0│$fC 斗地主 V0.0 $f0│$f0 $f0│ 底 牌 │::: ;:10100$f0 ::│$fC分$f9 电脑右 $f00 $f2+0$fC=$f00 $f0│$f9开发:SYBN NETBENTON PLP $f0│$f9 电脑左 $f0│ │:: ;:10200$f0 :│$fC榜$f9 玩家SYBN $f00 $f2+0$fC=$f00 $f0│$f22010-3-20 按F1查看帮助$f0│$fD 叫分 3分 $f0│ │: ;
pause>nul
exit
:SYBA
(CHCP 437 &GRAFTABL 936)>NUL
ECHO {SYBN DLL %SYBNV% } 内含SYBC 1.1.31 初始化,按任意键继续...
(echo a100&echo db B8 00 00 cd 16 cd 20&echo.&echo.rcx&echo.7&echo.g&echo.q)|DEBUG>NUL
GOTO :EOF
:SYBC
SET SYBCOM=A100`80BE AC00 3C 375 83E9 3C00 ACFF 4275`2CBE AC00 E08A 86AC 50C4 BE1F 0 3CAC`7553 ACFB 593C F675 3CAC 7542 ACF1 433C`EC75 3CAC 7553 ACE7 3D3C E275 14EB 3CAC`743A 3C0F 740D 3C4D 7400 8349 1EE 48EB`54B4 E8AC 93 ADE8 3C00 7F18 8A37 E8F0`87 A1E8 3C00 7F4F 8A2B B0D0 F602 50E2`A0B0 E6F6 35F 57F8 3CAC 7424 E80A 6A`49E8 8A00 EBCA E817 3F CA8A 10EB B0`16CD C48A 4CB4 21CD 815F A0C7 5700 B850`B800 750 2B5A 8AEE ACD1 243C D974 3B3C`8C74 D3C DE74 3C DA74 233C 575 D783`EB01 AA01 C28A EBAA E8E0 1D 3C93 7E39`402 8009 39FB 37E C380 2409 800F FE3`10B2 E2F6 C302 D08A ACC3 203C FB74 D3C`A274 3C 9E74 D88A 3CAC 7420 3CEC 740D`3C93 7400 C38F 2C93 8030 30EB AB4 E4F6`C302 C3`
set SYBCS=%*
SET V=`A80`DB FF``RCX`120`g`Q
(ECHO.%SYBCOM:`=&ECHO.DW %&ECHO.%V:`=&ECHO.%)|DEBUG>nul
goto :EOF
Last edited by sl543001 on 2010-3-31 at 19:00 ]
### Version 1.1.31 Memory Call Module Demo Code
Insert the content after SYBC into the script. After initialization, you can use "call :SYBC parameter"
The parameter can be almost infinitely long, as long as it does not exceed 64K (it's difficult to make the parameter exceed 64K anyway)
@ECHO Off&SETLOCAL ENABLEDELAYEDEXPANSION&SET SYBNV=0.0.2
:SYDLL
call :SYBA
call :SYBC 103003e completely non-third-party color output example module demo code, the above is the effect display; all the content you see is output with completely non-third-party color single-line code; everyone needs to initialize before using SYBC, execute SYBC without parameters once, or execute the code in label SYBA; labels SYBC and SYBCC need to be placed continuously, and the position relationship cannot be changed; everyone just needs to insert the content after label SYBC into their own script; after initialization, use the form to call SYBC without third parties; the parameter limit length of the example code is 700 bytes; if there are special needs, you can modify the variable V to expand the parameter limit; :10000$f0 :::│$fC product$f9 Left of computer $f00 $f2+0$fC=$f00 $f0│$fC Landlord V0.0 $f0│$f0 $f0│ Bottom cards │::: ;:10100$f0 ::│$fC score$f9 Right of computer $f00 $f2+0$fC=$f00 $f0│$f9 Development: SYBN NETBENTON PLP $f0│$f9 Left of computer $f0│ │:: ;:10200$f0 :│$fC ranking$f9 Player SYBN $f00 $f2+0$fC=$f00 $f0│$f22010-3-20 Press F1 to view help$f0│$fD Bid 3 points $f0│ │: ;
pause>nul
exit
:SYBA
(CHCP 437 &GRAFTABL 936)>NUL
ECHO {SYBN DLL %SYBNV% } Contains SYBC 1.1.31 initialization, press any key to continue...
(echo a100&echo db B8 00 00 cd 16 cd 20&echo.&echo.rcx&echo.7&echo.g&echo.q)|DEBUG>NUL
GOTO :EOF
:SYBC
SET SYBCOM=A100`80BE AC00 3C 375 83E9 3C00 ACFF 4275`2CBE AC00 E08A 86AC 50C4 BE1F 0 3CAC`7553 ACFB 593C F675 3CAC 7542 ACF1 433C`EC75 3CAC 7553 ACE7 3D3C E275 14EB 3CAC`743A 3C0F 740D 3C4D 7400 8349 1EE 48EB`54B4 E8AC 93 ADE8 3C00 7F18 8A37 E8F0`87 A1E8 3C00 7F4F 8A2B B0D0 F602 50E2`A0B0 E6F6 35F 57F8 3CAC 7424 E80A 6A`49E8 8A00 EBCA E817 3F CA8A 10EB B0`16CD C48A 4CB4 21CD 815F A0C7 5700 B850`B800 750 2B5A 8AEE ACD1 243C D974 3B3C`8C74 D3C DE74 3C DA74 233C 575 D783`EB01 AA01 C28A EBAA E8E0 1D 3C93 7E39`402 8009 39FB 37E C380 2409 800F FE3`10B2 E2F6 C302 D08A ACC3 203C FB74 D3C`A274 3C 9E74 D88A 3CAC 7420 3CEC 740D`3C93 7400 C38F 2C93 8030 30EB AB4 E4F6`C302 C3`
set SYBCS=%*
SET V=`A80`DB FF``RCX`120`g`Q
(ECHO.%SYBCOM:`=&ECHO.DW %&ECHO.%V:`=&ECHO.%)|DEBUG>nul
goto :EOF
Last edited by sl543001 on 2010-3-31 at 19:00 ]
|

SYBNQQ:354324773
|
|
2010-3-31 18:57 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
1.1.31初步测试未发现BUG,正计划添加新功能:鼠标支持,延时
1.1.31 preliminary test found no BUG, and is planning to add new functions: mouse support, delay
|

SYBNQQ:354324773
|
|
2010-4-3 03:25 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
|
2010-4-18 23:09 |
|
|
sl543001
中级用户
  
积分 499
发帖 225
注册 2008-12-30
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
逐行注释了一部分汇编源代码:
;sybc 基于x86的16位彩色字符输出 v 1.1.32
;参数列表:
;1.无参数
; 示例: sybc
; 调用:当命令行调用时没有附加参数或debug调用时0080数据为"00"时,启用choice功能,
; 作用:暂停命令行并等待用户输入一个键盘按键,对shift等键无效,对esc,f1,空格.回车等键有效
; 技术:在,调用中断15,并使al=ah,退出返回al到erroelrvrer
;2.标准方式
; 示例: sybc 10000$f1sybn$f22010 sybc 10000$f1sybn;$f22010;:10308f4sybn
; set v=`a80`db 10 0d "%sybcc%" 0d``rcx`ff`g`q
; (echo.%sybcom:`=&echo.dw %&echo.%v:`=&echo.%)|debug>nul
; 调用:当命令行调用时加有参数或debug调用时0080不为"00"且0081不为"01"时启用,
; 作用:在一行(无分号)或多行(有分号)或不连续位置(有分号冒号)输出
; 技术:首先读取一个坐标信息读取5字节),
; 然后读取一个颜色信息一个美元符加上2字节颜色信息,这里的美元符可省略
; 然后读取数据并以之前的颜色信息输出到b800显示缓存,从而显示在字符界面上
; 直到遇到控制字符停止,控制字符有:
; {24 "$"}颜色标记符 程序遇到则跳转到,读取2字节颜色信息,仅有紧跟坐标信息的可省略
; {3b ";"}换行标记符 程序遇到则跳转到,则换行,除非跟{3a ":"}连用
; {23 "#"}跳过标记符 程序遇到则给di加1,从而保留一个字符,仅改变颜色,不修改#所在位置的原内容
; {0d " "}结束标记符 程序遇到则结束程序
; {3a ":"}起始标记符 仅限于与连用有效,跳转到,从新读取一个坐标颜色信息执行,可用于连接2个sybc命令
; 注意:理论利用";:"可以无线连接sybc,但参数长度有124限制
;3.debug专有模式
; 示例:set v=`a80`db ff``a282`db "%sybcc:~0,75%"`db "%sybcc:~75,75%"`db "%sybcc:~150,75%"`db "%sybcc:~225,75%"`db 0d``rcx`ff`g`q
; (echo.%sybcom:`=&echo.dw %&echo.%v:`=&echo.%)|debug>nul
; 调用:仅限于debug调用,在0080位置写入ff,在0282位置写入参数,从而跳过124参数极限,示例代码的参数极限被扩展到300
; 技术:在修读取时发现0080=ff则修改参数入口为0282,正常调用时不可能出现0080=ff
; 注意:如有需要可修改示例代码进一步扩展参数极限
mov si,0080 ;设置SI=0080 修改指针地址为0080 参数入口
mov DX,0000 ;设置DX=0000
lodsb ;读取DS:SI指针地址的数据到AL 此时SI=0080
mov ah,al ;设置AH=AL AL=从0080读取到的数据
lodsb ;读取DS:SI指针地址的数据到AL 此时SI=0081
lodsb ;读取DS:SI指针地址的数据到AL 此时SI=0082
mov BL,al ;设置BL=AL AL=从0082读取到的数据
cmp ah,00 ;比较 Ah的值 和 0 此时Ah=0080的值
jz #TOchoice ;相等则跳转到标签TOchoice 用以获取键盘输入
cmp ah,ff ;比较 Ah的值 和 FF 此时Ah=0080的值
mov si,0082 ;修改指针地址为0082 从而跳过0081
jnz #hqzb ;不等则跳转到标签hqzb 获取输出坐标
mov si,002c ;设置SI=0080 修改指针为002c 内存变量段地址
lodsb ;读取DS:SI指针地址的数据到AL 此时SI=002c
mov ah,al ;设置AH=AL AL=读取到的数据
lodsb ;读取DS:SI指针地址的数据到AL 此时SI=002d
xchg al,ah ;交换AL和AH
push ax ;把数据压入堆扎 AX被压入堆扎
pop ds ;把数据压出堆扎 DS=刚才上一行的AX
mov si,0000 ;设置SI=0080 修改指针为0000 因为要从内存变量段的开头搜索变量
#SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,53 ;比较Al和53 53="S"
jnz #SSBL ;不同则跳转到标签SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,59 ;比较Al和59 53="Y"
jnz #SSBL ;不同则跳转到标签SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,42 ;比较Al和42 53="B"
jnz #SSBL ;不同则跳转到标签SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,43 ;比较Al和43 53="C"
jnz #SSBL ;不同则跳转到标签SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,53 ;比较Al和53 53="S"
jnz #SSBL ;不同则跳转到标签SSBL
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,3d ;比较Al和3d 53="="
jnz #SSBL ;不同则跳转到标签SSBL
jmp #hqzb ;无条件跳转到标签hqzb 如果满足以上条件则 获取输出坐标
#TOchoice
JMP #choice ;无条件跳转到标签choice 条件寻址是短寻址,够不到choice只能用JMP中转一下
;读取到分号后的处理
#wz
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,3a ;比较Al和3a 3a=":"
jz #hqzb ;相同则跳转到标签hqzb 为:则读取新坐标
cmp al,0d ;比较Al和0d OD=结束符
jz #quit ;相同则跳转到标签quit 为结束符则结束
cmp al,00 ;比较Al和0 3a=空
jz #quit ;相同则跳转到标签quit 为结束符则结束
sub si,01 ;设置SI减1
jmp #xhn ;无条件跳转到标签XHN 其他则换行继续
;读取坐标信息,存放到di
#hqzb
lodsb ;读取DS:SI指针地址的数据到AL 跳过一个字符
;键将来要在这里添加一些内容
call #DQ2SJ ;调用子程序DQ2SJ 读取2个数据
call #ZH10JZ ;调用子程序ZH10JZ 转换为10进制
cmp al,18 ;比较Al和18 AL是刚获得的行号
jg #quit ;大于则跳转到标签QUIT 行数超过24则结束
mov dh,al ;设置DH=AL 保存行号到DH
call #DQ2SJ ;调用子程序DQ2SJ 读取2个数据
call #ZH10JZ ;调用子程序ZH10JZ 转换为10进制
cmp al,4f ;比较Al和4f AL是刚获得的列号
jg #quit ;大于则跳转到标签QUIT 行数超过80则结束
mov dl,al ;设置DL=AL 保存列号到DL
;把来源于DH和DL的行列坐标转换为内存地址并保存到DI
#ZBZH
mov al,02 ;
mul dl ;
push ax ;
mov al,a0 ;
mul dh ;
pop di ;
add di,ax ;
push di ;
;读取颜色信息
#dcx
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,24
jz #color ;为$则跳过从新读取
call #DQ2SJ0 ;不为$则正常读取
call #dc0
mov cl,dl
jmp #dwz
#color
call #dc
mov cl,dl
jmp #dwz
;choice功能
#choice
mov al,0
int 16
mov al,ah
;退出
#quit
mov ah,4c
int 21
;换行并从原起点继续
#xhn
pop di
add di,a0
push di
;定位字符输出位置
#dwz
push ax
mov ax,b800
push ax
pop es
pop dx
sub bp,si
mov dl,cl
;写入数据
#xr
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,24
jz #color ;为$则读取新的颜色信息
cmp al,3b
jz #wz ;为;则结束,再次从头执行
cmp al,0d
jz #quit ;为结束符则结束
cmp al,0
jz #quit ;为结束符则结束
cmp al,23
jnz #xr2 ;为#则
adc di,1
jmp #xr3
#xr2
stosb ;写入一个数据
#xr3
mov al,dl
stosb ;写入颜色信息
jmp #xr
;读取2个字节的字符内容,转换为颜色信息
#dc
call #DQ2SJ
#dc0
xchg ax,bx
cmp al,39
jle #dc1
add al,9
#dc1
cmp bl,39
jle #dc2
add bl,9
#dc2
and al,0f
and bl,0f
mov dl,10
mul dl
add al,bl
mov dl,al
ret
;读取2个字节的内容
#DQ2SJ
lodsb ;读取DS:SI指针地址的数据到AL
#DQ2SJ0
cmp al,20
jz #DQ2SJ
cmp al,0d
jz #quit ;为结束符则结束
cmp al,0
jz #quit ;为结束符则结束
mov bl,al
#DQ2SJ1
lodsb ;读取DS:SI指针地址的数据到AL
cmp al,20
jz #DQ2SJ
cmp al,0d
jz #quit ;为结束符则结束
cmp al,0
jz #quit ;为结束符则结束
ret
;10进制字符转16进制数字
#ZH10JZ
xchg ax,bx
sub al,30
sub bl,30
mov ah,0a
mul ah
add al,bl
ret
Line-by-line comment on part of the assembly source code:
;sybc 16-bit color character output based on x86 v 1.1.32
;Parameter list:
;1. No parameters
; Example: sybc
; Call: When called from the command line without additional parameters or when the 0080 data is "00" when called by debug, the choice function is enabled.
; Function: Pause the command line and wait for the user to press a keyboard key. It is ineffective for shift and other keys, but effective for keys like esc, f1, space, enter, etc.
; Technology: In the , interrupt 15 is called, and al = ah, and it exits and returns al to erroelrvrer.
;2. Standard mode
; Example: sybc 10000$f1sybn$f22010 sybc 10000$f1sybn;$f22010;:10308f4sybn
; set v=`a80`db 10 0d "%sybcc%" 0d``rcx`ff`g`q
; (echo.%sybcom:`=&echo.dw %&echo.%v:`=&echo.%)|debug>nul
; Call: When called from the command line with parameters or when the 0080 of the debug call is not "00" and 0081 is not "01", it is enabled.
; Function: Output on one line (without semicolon) or multiple lines (with semicolon) or at non-consecutive positions (with semicolon colon).
; Technology: First, read a coordinate information (read 5 bytes),
; Then read a color information a dollar sign plus 2 bytes of color information. Here, the dollar sign can be omitted.
; Then read the data and output it to the b800 display buffer with the previous color information, so as to display it on the character interface.
; Until a control character is encountered. The control characters are:
; {24 "$"} color marker. When the program encounters the , it jumps to , reads 2 bytes of color information. Only the that is immediately followed by the coordinate information can be omitted.
; {3b ";"} line feed marker. When the program encounters the , it jumps to , then line feed, unless used in conjunction with {3a ":"}.
; {23 "#"} skip marker. When the program encounters the , it adds 1 to di, so as to reserve a character, only change the color, and do not modify the original content at the position of #.
; {0d " "} end marker. When the program encounters the , it ends the program.
; {3a ":"} start marker. Only effective when used in conjunction with , jumps to , reads a new coordinate color information to execute, can be used to connect 2 sybc commands.
; Note: In theory, ";:" can connect sybc infinitely, but the parameter length is limited to 124.
;3. Debug exclusive mode
; Example: set v=`a80`db ff``a282`db "%sybcc:~0,75%"`db "%sybcc:~75,75%"`db "%sybcc:~150,75%"`db "%sybcc:~225,75%"`db 0d``rcx`ff`g`q
; (echo.%sybcom:`=&echo.dw %&echo.%v:`=&echo.%)|debug>nul
; Call: Only for debug call, write ff in the 0080 position, and write parameters in the 0282 position, so as to skip the 124 parameter limit. The parameter limit of the example code is extended to 300.
; Technology: When reading, if 0080 = ff, then the parameter entry is modified to 0282. It is impossible to have 0080 = ff in normal call.
; Note: If needed, the example code can be modified to further extend the parameter limit.
mov si,0080 ; Set SI = 0080 Modify pointer address to 0080 Parameter entry
mov DX,0000 ; Set DX = 0000
lodsb ; Read data from DS:SI pointer address to AL At this time, SI = 0080
mov ah,al ; Set AH = AL AL = data read from 0080
lodsb ; Read data from DS:SI pointer address to AL At this time, SI = 0081
lodsb ; Read data from DS:SI pointer address to AL At this time, SI = 0082
mov BL,al ; Set BL = AL AL = data read from 0082
cmp ah,00 ; Compare Ah value and 0 At this time Ah = value of 0080
jz #TOchoice ; Jump to label TOchoice if equal To get keyboard input
cmp ah,ff ; Compare Ah value and FF At this time Ah = value of 0080
mov si,0082 ; Modify pointer address to 0082 Skip 0081
jnz #hqzb ; Jump to label hqzb if not equal Get output coordinates
mov si,002c ; Set SI = 0080 Modify pointer to 002c Memory variable segment address
lodsb ; Read data from DS:SI pointer address to AL At this time, SI = 002c
mov ah,al ; Set AH = AL AL = read data
lodsb ; Read data from DS:SI pointer address to AL At this time, SI = 002d
xchg al,ah ; Exchange AL and AH
push ax ; Push data onto the stack AX is pushed onto the stack
pop ds ; Pop data from the stack DS = AX from the previous line
mov si,0000 ; Set SI = 0080 Modify pointer to 0000 Because we need to search for variables from the beginning of the memory variable segment
#SSBL
lodsb ; Read data from DS:SI pointer address to AL
cmp al,53 ; Compare Al and 53 53 = "S"
jnz #SSBL ; Jump to label SSBL if not equal
lodsb ; Read data from DS:SI pointer address to AL
cmp al,59 ; Compare Al and 59 53 = "Y"
jnz #SSBL ; Jump to label SSBL if not equal
lodsb ; Read data from DS:SI pointer address to AL
cmp al,42 ; Compare Al and 42 53 = "B"
jnz #SSBL ; Jump to label SSBL if not equal
lodsb ; Read data from DS:SI pointer address to AL
cmp al,43 ; Compare Al and 43 53 = "C"
jnz #SSBL ; Jump to label SSBL if not equal
lodsb ; Read data from DS:SI pointer address to AL
cmp al,53 ; Compare Al and 53 53 = "S"
jnz #SSBL ; Jump to label SSBL if not equal
lodsb ; Read data from DS:SI pointer address to AL
cmp al,3d ; Compare Al and 3d 53 = "="
jnz #SSBL ; Jump to label SSBL if not equal
jmp #hqzb ; Jump unconditionally to label hqzb If the above conditions are met, get output coordinates
#TOchoice
JMP #choice ; Jump unconditionally to label choice Conditional addressing is short addressing, can't reach choice, can only use JMP to transfer
;Processing after encountering semicolon
#wz
lodsb ; Read data from DS:SI pointer address to AL
cmp al,3a ; Compare Al and 3a 3a = ":"
jz #hqzb ; Jump to label hqzb if equal For :, read new coordinates
cmp al,0d ; Compare Al and 0d OD = end character
jz #quit ; Jump to label quit if equal For end character, end
cmp al,00 ; Compare Al and 0 3a = empty
jz #quit ; Jump to label quit if equal For end character, end
sub si,01 ; Set SI minus 1
jmp #xhn ; Jump unconditionally to label XHN Others, line feed and continue
;Read coordinate information, store in di
#hqzb
lodsb ; Read data from DS:SI pointer address to AL Skip one character
; Some content will be added here in the future
call #DQ2SJ ; Call subroutine DQ2SJ Read 2 data
call #ZH10JZ ; Call subroutine ZH10JZ Convert to decimal
cmp al,18 ; Compare Al and 18 AL is the just obtained row number
jg #quit ; Jump to label QUIT if greater than If the row number exceeds 24, end
mov dh,al ; Set DH = AL Save row number to DH
call #DQ2SJ ; Call subroutine DQ2SJ Read 2 data
call #ZH10JZ ; Call subroutine ZH10JZ Convert to decimal
cmp al,4f ; Compare Al and 4f AL is the just obtained column number
jg #quit ; Jump to label QUIT if greater than If the row number exceeds 80, end
mov dl,al ; Set DL = AL Save column number to DL
;Convert row and column coordinates from DH and DL to memory address and save to DI
#ZBZH
mov al,02 ;
mul dl ;
push ax ;
mov al,a0 ;
mul dh ;
pop di ;
add di,ax ;
push di ;
;Read color information
#dcx
lodsb ; Read data from DS:SI pointer address to AL
cmp al,24
jz #color ; For $, skip and read again
call #DQ2SJ0 ; If not $, read normally
call #dc0
mov cl,dl
jmp #dwz
#color
call #dc
mov cl,dl
jmp #dwz
;Choice function
#choice
mov al,0
int 16
mov al,ah
;Quit
#quit
mov ah,4c
int 21
;Line feed and continue from original starting point
#xhn
pop di
add di,a0
push di
;Locate character output position
#dwz
push ax
mov ax,b800
push ax
pop es
pop dx
sub bp,si
mov dl,cl
;Write data
#xr
lodsb ; Read data from DS:SI pointer address to AL
cmp al,24
jz #color ; For $, read new color information
cmp al,3b
jz #wz ; For ;, end, execute from the beginning again
cmp al,0d
jz #quit ; For end character, end
cmp al,0
jz #quit ; For end character, end
cmp al,23
jnz #xr2 ; For #, then
adc di,1
jmp #xr3
#xr2
stosb ; Write one data
#xr3
mov al,dl
stosb ; Write color information
jmp #xr
;Read 2 bytes of character content, convert to color information
#dc
call #DQ2SJ
#dc0
xchg ax,bx
cmp al,39
jle #dc1
add al,9
#dc1
cmp bl,39
jle #dc2
add bl,9
#dc2
and al,0f
and bl,0f
mov dl,10
mul dl
add al,bl
mov dl,al
ret
;Read 2 bytes of content
#DQ2SJ
lodsb ; Read data from DS:SI pointer address to AL
#DQ2SJ0
cmp al,20
jz #DQ2SJ
cmp al,0d
jz #quit ; For end character, end
cmp al,0
jz #quit ; For end character, end
mov bl,al
#DQ2SJ1
lodsb ; Read data from DS:SI pointer address to AL
cmp al,20
jz #DQ2SJ
cmp al,0d
jz #quit ; For end character, end
cmp al,0
jz #quit ; For end character, end
ret
;10进制 character to hexadecimal digit
#ZH10JZ
xchg ax,bx
sub al,30
sub bl,30
mov ah,0a
mul ah
add al,bl
ret
|

SYBNQQ:354324773
|
|
2010-4-19 21:28 |
|
|