VS程序发给别人,exe窗口可以打开,但是另一个窗口打不开

 

 图1是自己运行,图二是发给别人运行

棋盘那个窗口一直处于最小状态,无法显示出来

求解

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
好的,以下是一个基本的示例程序,它可以在显示屏中央打开一个大小可调节的窗口。 ``` ; 8086 Assembly program to create a resizable window in the center of the screen .model small .stack 100h .data rows dw 10 ; default number of rows cols dw 20 ; default number of columns x dw ? y dw ? width dw ? height dw ? buffer db 32000 dup (?) ; video buffer window db 100 dup (?) ; window buffer .code main proc mov ax, @data mov ds, ax ; Get the screen mode mov ah, 0fh int 10h mov x, ax ; Calculate the position and size of the window mov ah, 0 mov al, x mul cols mov width, ax mov ah, 1 mov al, x mul rows mov height, ax sub height, 2 ; account for title bar and border mov x, (80 - width) / 2 mov y, (25 - height) / 2 ; Draw the window mov si, offset window mov cx, cols mov dx, rows mov ah, 6 mov bh, 0 mov bl, 15h ; white on black mov bp, si int 10h ; Wait for a key press mov ah, 0 int 16h ; Resize the window mov ah, 0fh int 10h mov x, ax mov ah, 0 mov al, x div cols mov rows, ax mov cols, dl ; Calculate the new position and size of the window mov ah, 0 mov al, x mul cols mov width, ax mov ah, 1 mov al, x mul rows mov height, ax sub height, 2 ; account for title bar and border mov x, (80 - width) / 2 mov y, (25 - height) / 2 ; Clear the old window mov si, offset window mov cx, cols mov dx, rows mov ah, 6 mov bh, 0 mov bl, 0 ; black on black mov bp, si int 10h ; Draw the new window mov si, offset window mov cx, cols mov dx, rows mov ah, 6 mov bh, 0 mov bl, 15h ; white on black mov bp, si int 10h ; Wait for a key press mov ah, 0 int 16h mov ah, 4ch int 21h main endp end main ``` 以上代码使用了BIOS中断来显示窗口,具体实现如下: 1. 首先使用中断10h的0fh功能来获取当前的屏幕模式,并通过模式和列数计算窗口的宽度。然后通过模式和行数计算窗口的高度,并减去标题栏和边框的高度。 2. 计算窗口的位置,使其在屏幕中央居中。 3. 使用中断10h的6号功能来在屏幕上绘制一个矩形,代表窗口。在这里,我们使用一个大小为100的缓冲区来存储窗口,然后将其传递给中断10h来绘制。 4. 等待用户按下一个键。 5. 获取窗口的新大小,即行数和列数。 6. 重新计算窗口的位置和大小。 7. 使用中断10h的6号功能来清除旧窗口。 8. 使用中断10h的6号功能来绘制新窗口。 9. 等待用户按下一个键。 10. 退出程序。 请注意,以上代码仅仅是一个示例,还有很多改进的余地。如果您想更深入地了解8086汇编语言或BIOS中断的使用,可以参考相关的书籍和文档。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值