ASM PAINT!

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

ASM PAINT!

Post by bongomeno »

I am learning assembly language and wrote a small little program.
You can draw simple pictures with it. Use the left mouse button to draw and the right button to clear the screen. To exit, simply move the cursor to the origin (0,0) of the screen.

I thought it would be a good example program to post. :)

Code: Select all

;ASM PAINT - By Gemino Smothers
;
;set screen mode
mov ah,00
mov al,0F
int 10
;display cursor
mov ax,01
int 33
;return cursor position and button status
mov ax,03
int 33
;if left buttun down then draw the pixel
cmp bx,01
jne 0123
push cx
push dx
dec cx
dec dx
mov ah,0C
mov al,01
mov bh,00
int 10
pop cx
pop dx
;if right button then reset the screen
cmp bx,02
je 0100
;loop
cmp cx,00
jne 010B
cmp dx,00
jne 010B
;return screen mode
mov ah,00
mov al,02
int 10
;end program
mov ax,00
int 21
Procedural programming FTW!
User avatar
BigBadKing
Veteran
Posts: 83
Joined: Fri Oct 09, 2009 12:39 pm
Location: Space
Contact:

Post by BigBadKing »

I tried your program bongomeno, its not bad. althrough, having something to change the colors may help. you can, for example. make the right button change the color, and the C button on the keyboard to clear the screen. but still... its good for an assembly beginner :mrgreen:
<a href="http://mccorp.orgfree.com">Macselent Corporation Offical Site</a>
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

Post by bongomeno »

Thank you. :D
I will add more to this later.. maby press both buttons to clear and right button to change?
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

neat program

Post by Kiyotewolf »

Wow..

I wish I could grasp 8088(80386) assembly like you do.

The only form of assembly I could understand was 6502 based.

o.o would you take requests to help someone with a problem in assembly?

I have at least 2 projects,.. 1 in QBasic, 1 that could be in both QB & FB..
that need a ASM boost.

kthnx



~Kiyote!
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
TmEE
Veteran
Posts: 97
Joined: Mon Mar 17, 2008 11:14 am
Location: Estonia, Rapla
Contact:

Post by TmEE »

Pretty nice start you have there :D

I hate x86 ASM, I did write a 2000 line library for my QB stuff though :P
Nothing beats 680x0 series when it comes to ASM 8)
Mida sa loed ? Nagunii aru ei saa :P
User avatar
bongomeno
Veteran
Posts: 266
Joined: Wed Dec 10, 2008 9:08 am
Location: Arizona
Contact:

Post by bongomeno »

Thanks!

I would actually prefer to be learning 6502 or z80 asm rather than x86, but it seems easier for now.
Post Reply