flat assembler
Message board for the users of flat assembler.

Index > DOS > I have seen 1 problem with my previous programs.

Thread Post new topic Reply to topic

Joined: 26 Sep 2006
Posts: 92
I called the DOS interrupt so many times that it was slowing it down.

I wrote a new binary counting program that is far faster than anything else I've made.

It does call 9 int $21 only once in the program.
Everything else automatically loads bytes into memory
so it prints them all at once!

This has a good and bad side.

The good news is,it's faster than my other programs at printing this.
The bad news is that it consumes a lot more memory.
Because of the 64KB limit,I wouldn't be able to do this very far.
My other program that writes to a file is probably better since
it can actually write to files and is only limited by hard disk space.

However,this is purely meant for speed!

org $100
mov bx,b
xor al,al
xor cl,cl
rol al,1
mov byte[bx],al
and byte[bx],1
or  byte[bx],$30
inc bx
inc cl
cmp cl,8
jne p0
mov byte[bx],$D
inc bx
mov byte[bx],$A
inc bx
inc al
cmp al,0
jne p1
mov byte[bx],$24
mov ah,9
mov dx,b
int $21
b rb $A01

There are 10 kinds of people in the world.
Those who know binary and those who haven't met me.
Post 28 Dec 2006, 20:51
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.