Re: can anyone tell me why I get an error at line 19 with NASM?



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 ;-)
.



Relevant Pages

  • Re: Questions on GS/OS Icon ($CA) files
    ... this area of IIgs programming) but my functioning IIgs is at work (where ... Most IIgs icon files are created with an icon editor application running ... pixels are encoded. ... palette rather than RGB values. ...
    (comp.sys.apple2)
  • Re: What am I doing wrong here? Trying to draw 10 lines, multiple colors
    ... Therefore you change the color of the palette entry 1 and then plot ... the new pixels with color 1. ... Saves the current video mode, ... the video mode to its original value. ...
    (alt.lang.asm)
  • Re: Problem with ATLs CImage and SetPixelIndexed
    ... OK, thanks Scot. ... experimenting to properly understand. ... a palette entry, which is not the same as an index into the color table. ... pixel bitamp which is 2 pixels by 2 pixels Set a color table ...
    (microsoft.public.vc.atl)
  • Re: creating a .bmp file
    ... ie i have 256 color pallete of RGBquads and array of 8bit pixels, ... but it doesnt seem to let me set the color palette, ... the Microsoft knowledge base includes this suggestion to create a dummy bitmap and grab the palette from that before disposing the dummy bitmap: ... And barring either of those methods working out for you, it's not like it's really all that difficult to write the BMP file from scratch, even if it is annoying. ...
    (microsoft.public.dotnet.languages.csharp)