[ASM] Tiny Program :P

Experienced Elementalist
Joined
Apr 12, 2009
Messages
241
Reaction score
32
Here's a 47 byte program that'll show a full-screen design, wait for a keypress, and then exit. (May not work in Vista if Vista doesn't support full screen)

C:\>debug a.com
File not found

-a
0B33:0100 mov ax,13
0B33:0103 int 10
0B33:0105 mov ax,a000
0B33:0108 mov ds,ax
0B33:010A xor di,di
0B33:010C xor ax,ax
0B33:010E xor bx,bx
0B33:0110 mov dx,bx
0B33:0112 and dx,ax
0B33:0114 mov [di],dl
0B33:0116 inc di
0B33:0117 inc bx
0B33:0118 cmp bx,13f
0B33:011C jna 110
0B33:011E inc ax
0B33:011F cmp ax,c7
0B33:0122 jna 10e
0B33:0124 xor ax,ax
0B33:0126 int 16
0B33:0128 mov ax,3
0B33:012B int 10
0B33:012D int 20
0B33:012F
-r cx
CX 0000
:2f
-w
Writing 0002F bytes
-q

C:\>dir a.com
Volume in drive C has no label.
Volume Serial Number is 0000-0000

Directory of C:\

04/13/2009 06:36 PM 47 A.COM
1 File(s) 47 bytes
0 Dir(s) 41,004,052,480 bytes free


(type "a" <enter> to run it :P)

if you beat it, add me [email protected] :P
 
Yum, the wonderful world of 16-bit ASM programming :D, I should continue learning it...especially with all those interrupts, I keep forgetting which is which and their parameters hehe. Beside that, 16-bit is old and it might be better to focus on 32-bit...but it's still fun ;)
 
debug.exe only supports 16 bit :P

---------- Post added at 05:27 PM ---------- Previous post was at 05:20 PM ----------

but as a bonus, here's how to shade it nicely too :P

0BC5:0100 mov ax,13
0BC5:0103 int 10
0BC5:0105 mov ax,a000
0BC5:0108 mov ds,ax
0BC5:010A xor di,di
0BC5:010C xor ax,ax
0BC5:010E xor bx,bx
0BC5:0110 mov dx,bx
0BC5:0112 and dx,ax
0BC5:0114 mov [di],dl
0BC5:0116 inc di
0BC5:0117 inc bx
0BC5:0118 cmp bx,13f
0BC5:011C jna 110
0BC5:011E inc ax
0BC5:011F cmp ax,c7
0BC5:0122 jna 10e
0BC5:0124 xor ax,ax
0BC5:0126 mov dx,3c8
0BC5:0129 out dx,al
0BC5:012A inc dx
0BC5:012B out dx,al
0BC5:012C xor al,ff
0BC5:012E out dx,al
0BC5:012F xor al,ff
0BC5:0131 out dx,al
0BC5:0132 inc al
0BC5:0134 jnz 12b
0BC5:0136 int 16
0BC5:0138 mov ax,3
0BC5:013B int 10
0BC5:013D int 20
0BC5:013F
-r cx
CX 002F
:3f
-w
Writing 0003F bytes

...It's up to 63 bytes tho :)
06/20/2010 05:27 PM 63 A.COM
 
Back