WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Simple Line Repeat Draw Program, DOS 16-bit Line Draw Program using INT 10h

Treymac
Quote Post


New Member
*

Group: Members
Posts: 9
Member No.: 5798
Joined: 5-March 08


Hey guys. I'm adapting a simple program from my text just to try the concept that I will use in another way. Any ways, what I'm trying to do now is make a line repeat. My book has the program drawing the line once. So here is what I've done.



CODE

MOV AX,0600H                 ;scroll the screen
MOV BH,07                    ;normal attribute
MOV CX,0000                  ;from row=00,column=00
MOV DX,184FH                 ;to row=18H,column=4FH
INT 10H                      ;invoke interrupt to clear screen

MOV AH,00                    ;set mode
MOV AL,06                    ;mode = 06 (CGA high resolution)
INT 10H                      ;invoke interrupt to change mode

MOV CX,100                   ;start line at column = 100
MOV DX,50                    ;and row = 50

JMP LOC                      ;jump to LOC

BACK: MOV AH,0CH                   ;AH=0CH to draw line
MOV AL,01                    ;pixels = white
INT 10H                      ;invoke interrupt to draw a line
INC CX                       ;increment horizontal position
CMP CX,200                   ;draw line until column=200
JNZ BACK                     ;if not equal, jump to BACK
JMP LOC                      ;else, jump to LOC

LOC: MOV CX,100              ;set column back to 100
DEC DX                       ;decrement row
JMP BACK                     ;jump to back


I think it should work, I have no idea why it doesn't. Can anybody help me out here?
Thanks a lot.

PMEmail Poster
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
Member No.: 1464
Joined: 2-September 05


Hi and welcome to the forums! wink.gif

Its been a long time since I did any DOS programming, and just tried looking up the functions with my "PC Programmer's Source Book - 2nd Edition, M$ Press"

Are you sure you typed the example in correctly? Have you thought about 32-bit Windows programming yet?

Paging Professor Shoorick.... laugh.gif
PM
Top
Treymac
Quote Post


New Member
*

Group: Members
Posts: 9
Member No.: 5798
Joined: 5-March 08


Hey, thanks for the reply. This is the code that I've modified, but the starting code is correct from the book, I just double checked. We aren't programming in 32-bit yet, were starting off with the real old style of 16 bit registers.
PMEmail Poster
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
Member No.: 1464
Joined: 2-September 05


Hehe... starting out in the stone age eh'?

Sure you can't be nudged into 32-bit coding?

It is easier to code with and you can still write DOS style console programs!

Have a look through the examples in the Msm32 package. There are several to choose from to give you ideas and a feel for writing DOS style console applications vs. Windows GUI based apps.


QUOTE
Paging Professsor Shoorick... Please report to the Newbies area. Your expertise with 16-bit linear assembly has been requested.... laugh.gif



Here is a quick example I pulled up. wink.gif

Attached File ( Number of downloads: 23 )
 Login or Register to download
PM
Top
Treymac
Quote Post


New Member
*

Group: Members
Posts: 9
Member No.: 5798
Joined: 5-March 08


hah, I just found out my problem. Apparently notepad in windows 98 doesn't have ctrl+s to save, so I wasn't saving my work unsure.gif But that example looks interesting. After my course I'm going to try to get up to date with assembly.

PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google