flat assembler
Message board for the users of flat assembler.

Index > DOS > TEXTMODE code snipplets for newbies

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 13 Nov 2004, 13:36
Here's my complete set of textfunctions, for my os, BOS..
Scrolls the window, can change cursor attributes, getcursor, setcursor, print with new line feature etc..


Description: Text function
Download
Filename: text.inc
Filesize: 7.84 KB
Downloaded: 562 Time(s)


_________________
BOS homepage: http://bos.asmhackers.net/


Last edited by bubach on 13 Feb 2012, 15:01; edited 1 time in total
Post 13 Nov 2004, 13:36
View user's profile Send private message Reply with quote
pierre



Joined: 07 Nov 2004
Posts: 10
pierre 13 Nov 2004, 19:12
Matrix :
Nice functions, I'm sorry to nitpick, but for a monochrome screen isn't it B000 instead of B800.
Granted, of course nobody has a mono Hercules adapter anymore.


Wouldn't it be nice to have a big library with all those usefull functions ?
A bit like the old Fidonet Snippets, but with name/register conventions and organised in categories :
- Portable
- Dos
- Win32
....

Nobody should have to reinvent the wheel each time.
Post 13 Nov 2004, 19:12
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 13 Nov 2004, 19:40
yeah, sorry for the long thread, i was thinking about people don't like to download if they only wanna take a look, but i guess i will make all as an attachment, my structure is currently: direct.inc bios.inc dos.inc
my only problem with libraries is i can't include a large library in all my files, maeby i'm lazy to copy my procs to my code? well ... Smile
so you think they whould be better if i make it a zip in an attachment?
Post 13 Nov 2004, 19:40
View user's profile Send private message Visit poster's website Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea 02 May 2005, 21:17
Smile, I have one,

Code:

hexBuffer db 0,0,0,0,  0



Start_Ax2Eax:
Ax2Eax:
        ; push cx
        push bx

        mov bx, ax
        and ax, 0xf0f0
        and bx, 0x0f0f
        shr ax, 4
        bswap eax
        mov ax, bx

        ;mov cl, 8
        mov bx, 4
        .again:
                ;cmp al, "9"
                ;jna .nadd
                ;       add al, "A"-"9"
                ;.nadd
                ;add al, "0"
                cmp al,10
                sbb al,69h
                das
                rol eax, 8 ; cl
                dec bx
                jnz .again
        rol eax, 8 ; cl
        xchg ah, al
        bswap eax ; comment this out if you prefer read it in Big-Endian way ¿?¿?¿? .. LOL

        mov [hexBuffer], eax
        pop bx
        ; pop cx
        ret
End_Ax2Eax
%assign Ax2Eax_size End_Ax2Eax-Start_Ax2Eax
%error The size of Ax2Eax is Ax2Eax_size
    


In that way are 48 bytes of function plus 5 bytes for the buffer, the previous one that I have was with the comments that are now comments.. (uh?), if you delete the preservation of bx and the store to memory the function will be 42 bytes, or the last bswap deleted and you get 39, tought bswap is for convert litle to big and viceversa.. then if you dont mind about.. ¿?.

Hope this help Smile.
Post 02 May 2005, 21:17
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 29 Oct 2005, 01:44
sorry for long thread, im going to make library and delete them
Post 29 Oct 2005, 01:44
View user's profile Send private message Visit poster's website Reply with quote
relsoft



Joined: 03 Apr 2006
Posts: 29
relsoft 04 Apr 2006, 00:33
Matrix wrote:
sorry for long thread, im going to make library and delete them

Why would you? I find these snippets especially useful.

_________________
Hello
Post 04 Apr 2006, 00:33
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.