flat assembler
Message board for the users of flat assembler.
Index
> DOS > 17 byte demo! Goto page 1, 2, 3 Next |
Author |
|
bitshifter 31 Aug 2008, 08:55
Code: use16 org 0x100 mov ax,0x13 int 0x10 push word 0xA000 pop es paint: adc ax, cx stosb loop paint inc ax jmp paint EDIT by DOS386 2014-May-22 : check out http://board.flatassembler.net/topic.php?t=9174 http://board.flatassembler.net/topic.php?t=16699 too |
|||
31 Aug 2008, 08:55 |
|
Artlav 31 Aug 2008, 12:44
Whoa!
Now that is some self-organizing property. |
|||
31 Aug 2008, 12:44 |
|
bitshifter 31 Aug 2008, 12:58
Think you can shave a few bytes off it
|
|||
31 Aug 2008, 12:58 |
|
vid 31 Aug 2008, 14:26
nice!
|
|||
31 Aug 2008, 14:26 |
|
LocoDelAssembly 31 Aug 2008, 15:43
Well the obvious "mov ax,0x13" > "mov al,0x13" creates a 16-byte executable. But I'm unsure if AX is guaranteed to be zero at entry point though.
|
|||
31 Aug 2008, 15:43 |
|
Alphonso 31 Aug 2008, 20:56
Well if your willing to be dirty, what about
Code: use16 org 0x100 mov al,0x13 int 0x10 les ax,[bx] paint: adc ax, cx stosb loop paint inc ax jmp paint Last edited by Alphonso on 01 Sep 2008, 02:42; edited 1 time in total |
|||
31 Aug 2008, 20:56 |
|
edfed 31 Aug 2008, 21:44
the same, 14 bytes, but moving.
Code: org 100h mov al,13h int 10h les ax,[bx] paint: adc ax, cx stosb loop paint inc ax loop paint [edit], what is very strange is that it will draw perfect circles, into a square dimension."without any sincos". |
|||
31 Aug 2008, 21:44 |
|
bitshifter 01 Sep 2008, 01:51
That's pretty cool edfed!
|
|||
01 Sep 2008, 01:51 |
|
Alphonso 01 Sep 2008, 21:47
12 Bytes, but not as nice looking
Code: org 100h mov al,13h int 10h les ax,[bx] paint: sbb ax,di stosb inc di jmp paint |
|||
01 Sep 2008, 21:47 |
|
edfed 01 Sep 2008, 23:14
Alphonso wrote: 12 Bytes, but not as nice looking but 12 bytes. [edit] just an idea, but what about an executable format with a " stack & registers" header? something to assume value to registers and stack, use less memory than the initialisation code. hte routine thats preload the regs is in the os, while file loading. Code: format as .prexe .eax dd 0 .ebx dd 0 .ecx dd 64000 .edx dd 2008 .edi dd 0 .esi dd mainentry .esp dd 57AC4h .ebp dd 1000h .cs dd 1000h .ds dd 0 .etc etc .exe is still likt this but it don't have general registers init table. |
|||
01 Sep 2008, 23:14 |
|
Madis731 02 Sep 2008, 16:18
Anyone care to explain what it does to a person under 64-bit environment. 16-bit isn't my cup of tea (I imagined simulating it in my head).
|
|||
02 Sep 2008, 16:18 |
|
LocoDelAssembly 02 Sep 2008, 17:33
|
|||
02 Sep 2008, 17:33 |
|
neville 05 Sep 2008, 07:45
Here's a VESA LFB version of bitshifter's 17-byte demo.
It assumes you're in Flat Real mode because in most VESA Bios's the linear buffer maps to the top few MB of the 4GB address space. It also assumes your Bios supports VESA LFB - no checks. I've added exit code so you can run it in pure DOS without crashing. Despite the higher resolution, it runs very fast - so the colours look a bit washed out because they're changing so fast. Code: ;assemble with FASM (66 bytes + 256-byte VESA buffer) ORG 0100H MOV AX,4F01H MOV CX,101H MOV DI,VESABUF INT 10H MOV ECX,[DI+28H] ;save LFB address MOV AX,4F02H MOV BX,4101H ;linear 640x480x8-bit mode INT 10H PUSH 0000 POP DS MOV EBX,ECX ;LFB address PAINT0: XOR ESI,ESI XOR CX,CX PAINT: ADC AX,CX MOV [EBX+ESI],AL ;write pixel INC ESI LOOP PAINT INC AX PUSH AX MOV AH,1 INT 16H POP AX JNZ QUIT CMP ESI,50000H ;>full screen? JZ PAINT0 ; -y, back to top JMP PAINT QUIT: INT 20H VESABUF: ;256 bytes not initialised _________________ FAMOS - the first memory operating system |
|||
05 Sep 2008, 07:45 |
|
asmdude 05 Sep 2008, 19:36
What does this do:
Code: les ax,[bx] ? |
|||
05 Sep 2008, 19:36 |
|
Alphonso 05 Sep 2008, 20:05
loads es:ax from memory location [bx]
So if BX=0 this points to DS:0000 which is the start of the PSP for a .com file. Register AX will get loaded with the first two bytes, normally CD20h Segment register ES will get loaded with the next two bytes which should be the available memory to DOS in paragraphs (1 paragraph = 16 bytes). This will probably be a little under 640k or A000h, ie 9Fxx. |
|||
05 Sep 2008, 20:05 |
|
asmdude 05 Sep 2008, 20:16
Thanks!
|
|||
05 Sep 2008, 20:16 |
|
neville 05 Sep 2008, 20:46
Can anybody write a paged VESA version of my linear VESA code above in less than 66 bytes? I don't expect it to run faster, just smaller code
_________________ FAMOS - the first memory operating system |
|||
05 Sep 2008, 20:46 |
|
Chewie RFC 25 Oct 2008, 07:08
Alphonso wrote: loads es:ax from memory location [bx] But WHY does this work? VGA RAM starts at A000. The segment 9FFF (or whatever it happens to load) is still part of DOS memory. I can't figure out why this is writing pixels to the screen when ES is not pointed to the video RAM. Any help? |
|||
25 Oct 2008, 07:08 |
|
DJ Mauretto 25 Oct 2008, 08:31
Debug with dos debug and you will understand
First you must to be an Hacker ,then programmer _________________ Nil Volentibus Arduum |
|||
25 Oct 2008, 08:31 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.