Re: can anyone tell me why I get an error at line 19 with NASM?
- From: messianic light <damianjohnbrown@xxxxxxxxxxx>
- Date: Sat, 15 Mar 2008 10:12:45 -0700 (PDT)
On 14 Mar, 08:52, Frank Kotler <fbkot...@xxxxxxxxxxx> wrote:
messianic light wrote:
...
the following plots 1 point, and depending on 'cmp cx, ?' plots more
than one point, but they are a space apart
could be 'inc di' followed by 'inc cx' causing this
Shouldn't... I'll look at it more...
I am a lot happier now though, so I can finally go to bed at 7:35am as
it has been light for about an hour now...
I usually find that when the sun rises and the glare makes the monitor
hard to see, it must be bedtime.
There may be a way to configure dosemu so it does graphics... But, just
for you, I rebooted to "real dos", and tested this one. Something for
you to play with once the sun goes down again. Much the same thing as
you're doing - slightly different approach. It displays all the colors
of the default palette (ugly sucker - but in Linux it's worse), in a
sort of "rainbow". Maybe we can alter the palette to something prettier,
next. Or... you're writing an OS... it probably isn't going to run in
mode 13h, right? You may not want to persue this too far... Although
it's probably "good practice"...
Anyway, dream of pretty pixels! :)
Best,
Frank
org 100h
section .text
; switch to mode 13h
mov ax, 13h ; ah=0, al=13h
int 10h
mov ax, 0A000h ; load es with our "graphics screen" seg
mov es, ax
showcolors:
xor di, di ; start at upper left
mov al, 0 ; start with color zero
.drawline:
mov cx, 256
.next_x:
mov [es:di], al ; plot the color
inc al ; next color
inc di ; next "x"
loop .next_x
; after 256 incs, al is color zero again
; mov al, 0 ; so skip this
add di, 320 - 256 ; advance to next line ("y")
cmp di, 320 * 199 + 256 ; repeat until done
jb .drawline
mov ah, 0 ; wait for a key
int 16h
mov ax, 3 ; back to text mode
int 10h
ret ; back to dos
thanks Frank,
I like that the best as it is a screen just like the ZX81 which was my
first computer, but not with so many pixels ;-)
.
- References:
- can anyone tell me why I get an error at line 19 with NASM?
- From: messianic light
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: Frank Kotler
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: messianic light
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: Frank Kotler
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: messianic light
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: Frank Kotler
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: messianic light
- Re: can anyone tell me why I get an error at line 19 with NASM?
- From: Frank Kotler
- can anyone tell me why I get an error at line 19 with NASM?
- Prev by Date: Re: can anyone tell me why I get an error at line 19 with NASM?
- Next by Date: Re: Calculating checksums...
- Previous by thread: Re: can anyone tell me why I get an error at line 19 with NASM?
- Next by thread: Re: Calculating checksums...
- Index(es):
Relevant Pages
|