![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-18 09:47 |
47,814 topics / 349,907 posts / today 0 new / 48,259 members |
| DOS开发编程 & 发展交流 (开发室) » A program that draws a small window on the DOS screen |
| Printable Version 2,022 / 3 |
| Floor1 kickout | Posted 2002-10-28 00:00 |
| 高级用户 Posts 135 Credits 667 | |
|
These were all things I wrote myself for fun back when I was practicing.
============== dseg segment cury db 0 curx db 0 luy db 10 lux db 30 rdy db 15 rdx db 40 cont db 5 dseg ends clear macro mov ah ,6 mov al ,0 mov ch ,0 mov cl,0 mov dh,24 mov dl,79 mov bh,7 int 10 endm scroll macro mov h,6 mov al,cont mov ch,luy mov cl,lux mov dh,rdy mov dl,rdx mov bh,70h int 10h endm postc macro mov ah,2 mov dh,cury mov dl,curx mov bh,0 int 10 endm ;-------------------------------- cseg segment assume cs:cseg,ds:dseg main proc far push ds sub ax,ax push ax mov ax,dseg mov ds,ax clear scroll cont postc input: mov ah,0 int 16 cmp ah,abh jnz no_left cmp curx,0 jnz l1 cmp cury,0 jnz l3 jmp input l1: dec curx jmp l5 l3: dec cury mov curx,79 l5: postc jmp input no_left: cmp ah,4dh jnz no_right cmp curx,79 jnz r1 cmp cury,24 jnz r3 jmp input r1: inc curx jmp r5 r3: inc cury mov curx,0 r5: postc jmp input no_right: cmp ah,48h jnz no_up cmp cury,0 jz up1 dec cury postc up1: jmp input no_up: cmp ah,50h jnz no_down cmp cury,24 jz d1 inc cury postc d1: jmp input no_down: cmp ah,4fh jz setxy cmp ah,01 jnz disp ret disp: mov ah,0ah mov bh,0 mov cx,1 int 10h inc curx mov al,curx cmp al,rdx jl next scroll 1 mov al,lux mov curx,al next: postc jmp input setxy: mov al,cury mov bl,curx cmp al,luy jl s1 cmp bl,lux jl s2 mov rdy,al mov rdx,bl jmp new s1: cmp bl,rdx jle s3 jmp input s2: cmp al,rdy jg s5 s3: mov luy,al mov lux,bl new: mov al,rdy sub al,luy inc al mov cont ,al clear scroll cont s5: jmp input main endp ;----------------------------- cseg ends end main ================ So many years have passed, I’ve forgotten it all too. Compile it yourself and give it a try, and you’ll know. |
|
| Floor2 kickout | Posted 2002-10-28 00:00 |
| 高级用户 Posts 135 Credits 667 | |
|
This is about the same as the one above, but I’m sure there are still differences. Compile it and compare them, and you’ll know
===================== dseg segment cury db 0 curx db 0 luy db 10 lux db 30 rdy db 15 rdx db 40 cont db 5 dseg ends stack segment para stack'stack' db 64 dup(?) stack ends clear macro mov ah ,6 mov al ,18h mov ch ,0 mov cl,0 mov dh,24 mov dl,79 mov bh,7 int 10h endm scroll macro cont mov ah,6 mov al,cont mov ch,luy mov cl,lux mov dh,rdy mov dl,rdx mov bh,00011111b int 10h endm postc macro mov ah,2 mov dh,cury mov dl,curx mov bh,0 int 10h endm ;-------------------------------- cseg segment assume cs:cseg,ds:dseg main proc far push ds sub ax,ax push ax mov ax,dseg mov ds,ax clear scroll cont postc input: mov ah,0 int 16h cmp ah,4bh jnz no_left cmp curx,0 jnz l1 cmp cury,0 jnz l3 jmp input l1: dec curx jmp l5 l3: dec cury mov curx,79 l5: postc jmp input no_left: cmp ah,4dh jnz no_right cmp curx,79 jnz r1 cmp cury,24 jnz r3 jmp input r1: inc curx jmp r5 r3: inc cury mov curx,0 r5: postc jmp input no_right: cmp ah,48h jnz no_up cmp cury,0 jz up1 dec cury postc up1: jmp input no_up: cmp ah,50h jnz no_down cmp cury,24 jz d1 inc cury postc d1: jmp input no_down: cmp ah,4fh jz sxy cmp ah,01h jz edd cmp al,0dh jnz eed neew: inc cury mov ah,cury cmp ah,rdy jle no_change scroll 1 dec cury mov ah,cury no_change: dec lux mov al,lux mov curx,al inc lux eed: jmp disp edd: ret sxy: jmp setxy disp: mov ah,0ah mov bh,0 mov cx,1 int 10h inc curx mov al,curx cmp al,rdx jng next scroll 1 mov al,lux mov curx,al next: postc jmp input setxy: mov al,cury mov bl,curx cmp al,luy jl s1 cmp bl,lux jl s2 mov rdy,al mov rdx,bl jmp new s1: cmp bl,rdx jle s3 jmp input s2: cmp al,rdy jg s5 s3: mov luy,al mov lux,bl new: mov al,rdy sub al,luy inc al mov cont ,al clear scroll cont s5: jmp input main endp ;----------------------------- cseg ends end main ===================== |
|
| Floor3 随风顺 | Posted 2002-10-28 00:00 |
| 初级用户 Posts 35 Credits 196 | |
|
I skimmed through the code
It seems the first one is graphics mode, and the second one is text mode But in the first program scroll macro mov h,6 that part seems to have a bit of a problem, Should it be changed to: scroll macro cont mov ah,6 I’ve just been preparing for the assembly language semester exam recently, and the BIOS interrupt part is really giving me a headache I don’t know whether kickout is familiar with this part, but the program seems to use quite a lot of it Help me out more, hehe. If I pass this exam smoothly, I’ll treat you |
|
| Floor4 柳飘逸 | Posted 2002-12-14 00:00 |
| 初级用户 Posts 11 Credits 119 | |
|
I’ll try the code first
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |