flat assembler
Message board for the users of flat assembler.

Index > Main > graphics?

Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
Hello, i have my own operating system up and running!
I pieced it together from ideas i seen on the web.
Its only 16 bit real mode but plenty of memory for now.
It has some basic keyboard input routines and screen output routines.
As of now i have been putting characters on the screen and am quite bored with it.
I am wondering whats involved to put a colored pixel on the screen.
My asm experience is limited so you will have to talk to me like im 3 years old.
If you need more info on my OS, just ask, i am not sure what you need to know in order to provide help.
Maybe you can post a little code snippet to get me started?
If possible, 16 bit instructions please.
Ok, thanks for your time...
Post 26 Aug 2008, 07:38
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Try this
Code:
;******************************
; puts a pixel on screen
; using direct memory
;
; Dex.
; c:\fasm pixel.asm pixel.com
;******************************
org 0x100
use16
start:
        mov     al,0x13       ; this is for seting graphic mode (32x200 256 color)
        int     0x10

        push    word 0xA000   ; set the address up
        pop     es
        push    cs
        pop     ds
        mov     di,0          ; when this is 0 we are at the top left hand corner
                              ; eg replace the 0 with 320*100 will put the pixel
                              ; 1/2 way down the screen.

        mov     al,0xf        ; this is the color of pixel
        stosb                 ; this mov a byte from al to [es:di]

        xor     ax,ax         ; wait for a a keypress
        int     0x16

        mov     ax,0x0003     ; back to text mode
        int     0x10

        ret                   ; exit.    

You can modd this code to run in your OS, also you should use bootprog as that lets you boot a com or mz exe http://alexfru.chat.ru/epm.html#bootprog
Also see MiniDos as example of basic 16-bit OS http://board.flatassembler.net/topic.php?t=5275&start=0
Also see here:
http://www.dex4u.com/ASMcompo512b
In there you will find boot sector OS's including a bootable tetrs game by Tomasz Grysztar and graphi demos
Post 26 Aug 2008, 15:18
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
Ahhh..
That's perfect, just what i was looking for!
I knew interrupt 0x10 could do it but i was unsure how.
Thanks for the post!
Post 27 Aug 2008, 01:59
View user's profile Send private message Reply with quote
ChrisLeslie



Joined: 04 Jun 2006
Posts: 50
Location: Australia
ChrisLeslie
Thats fine if you want horrible chunky looking low-resolution graphics.... Rolling Eyes
Post 27 Aug 2008, 05:05
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
ChrisLeslie wrote:
Thats fine if you want horrible chunky looking low-resolution graphics.... Rolling Eyes

In the ASMcompo512b link is a simple high res demo called "CdPod" including a 32-bit, pmode basic GUI in vesa 640*480 32 bpp mode, along with built in cdplayer, all in less than 512bytes and fits in boot sector.
Post 27 Aug 2008, 14:10
View user's profile Send private message Reply with quote
myothant



Joined: 31 Oct 2008
Posts: 2
Location: in yangon
myothant
hello,

I am beginner of flat assembler
how to make to boot up computer system

bye
Post 31 Oct 2008, 09:00
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman
Post 31 Oct 2008, 14:53
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
Hi bitshifter

I agree that Vmode 13 is too low-res and chunky, so for 256 colours or more you really need to use one of the VESA graphics modes.

If you can put up with only 16 colours, Vmode 12 can produce some good results, as I hope the attached demo illustrates - with a Christmas theme! (DOS binary + fasm source)

I couldn't believe how difficult it was to produce colour graphics in 16-bit asm code when I first tried to do it about 4 years ago. After a lot of work I finally succeeded in producing a recogniseable bitmap image, but the colours were all wrong. Then it took a lot more work to get the colours right! I hope the attached fully-commented source will save you some of this work. Although it runs in DOS there are no INT 21h DOS calls so it will be easy to port to another OS, like yours!

P.S. What are the objectives of your OS?


Description: Displays 16-colour Windows bitmap in legacy video mode 12
Download
Filename: VM12DEMO.ZIP
Filesize: 15.54 KB
Downloaded: 151 Time(s)


_________________
FAMOS - the first memory operating system
Post 31 Oct 2008, 19:53
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
maybe it's time to test my advancement in pmode with vesa...
Post 01 Nov 2008, 01:16
View user's profile Send private message Visit poster's website 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 YouTube, Twitter.

Website powered by rwasa.