Message board for the users of flat assembler.
> DOS > I'm very proud of this program.
2 18 Dec 2006, 05:31
The reason this program is special is because it counts in binary
and it doesn't ever mov to or from a direct memory location!
All the stuff is done by general purpose registers!
org $100 mov ah,2 xor ch,ch p1: mov bh,ch xor cl,cl p0: rol bh,1 mov dl,bh and dl,1 or dl,$30 int $21 inc cl cmp cl,8 jne p0 mov dl,$D int $21 mov dl,$A int $21 inc ch cmp ch,$0 jne p1 ret
I read somebody asking why thw intel has such few registers.
We have 8 general purpose 8 bit registers.
I rarely use the the other kinds of registers as I don't know much about
There are 10 kinds of people in the world.
Those who know binary and those who haven't met me.
|18 Dec 2006, 05:31||
Matrix 20 Dec 2006, 13:46
actually the fastest way is not always using only registers instead of memory,and note often used code memory gets cached. Then counter variables become many GB/s.
i'm sure this will take much time in your program...
|20 Dec 2006, 13:46||
2 26 Dec 2006, 02:28
It may not be the fastest,but it was a funny thing to avoid memory.
It's also possible to write any program without the mov instruction.
It would be stupid,but imaging using AND by 0 to set something to 0 then
OR it with a value. It would take time,but it would be funny to imagine
writing programs without mov just for the fun of it.
|26 Dec 2006, 02:28||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.