flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 |
Author |
|
catafest 16 Jan 2011, 16:53
Code: use16 org 0x100 mov ah,0x00 mov ax,0x13 int 0x10 push word 0xA000 mov es, ax mov ax,0 mov di,ax mov dl,16 mov[es:di],dl pop es paint: add cx,ax stosd loop paint inc ax jmp paint mov ax,3 int 10h what do think about that ? ![]() |
|||
![]() |
|
Coty 16 Jan 2011, 18:20
Nice
![]() [EDIT2] 20 bytes ![]() Code: use16 org 0x100 mov ax, 0x13 int 0x10 push word 0xA000 xor di, di pop es paint: add cx, ax .loop: stosd loop .loop inc ax jmp paint I honestly like it more with stosw instead of stosd, witch makes it 19 bytes, but it does not look the same as the lines are not as well spaced. [EDIT3] Just realized that you can remove "xor di, di" and it will compile to 17bytes and still work under winXP... Witch makes it a 17byte demo... [EDIT4] If you follow this trick here: http://board.flatassembler.net/topic.php?p=81875#81875 You can get it to 15 bytes and still working... Code: use16 org 0x100 mov ax, 0x0013 int 0x10 les ax, [bx] ; Trick I stoll from this thread... paint: add cx, ax .loop: stosw loop .loop inc ax jmp paint OK ... I'm done... |
|||
![]() |
|
bitshifter 17 Jan 2011, 04:33
Assuming regs are zero'ed at startup, yes.
Just be sure to warn people of this... |
|||
![]() |
|
16bitPM 29 Mar 2012, 19:28
catafest wrote:
Errr? Why the first mov ah,0? Why do you write to an unused area of the interrupt vector table? (ax = 13 ; ax → es ; di=0 so address 130h ?!?) So on my computer you change INT vector 4C from F000:1060 to F000:1016 ![]() Why the exit code after jmp which is never reached? |
|||
![]() |
|
16bitPM 07 Apr 2012, 20:44
Same code with palette reprogramming, in 28 bytes:
Code: mov al,13 int 10 mov dx,03c8h mov al,0 out dx,al inc dx loop1: out dx,al out dx,al out dx,al inc al jnz loop1 les bx,[bx] adc ax,cx stosb loop 114 inc ax jmp 114 |
|||
![]() |
|
Picnic 27 Aug 2012, 13:40
|
|||
![]() |
|
freecrac 29 Aug 2012, 05:35
neville wrote: 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 :!: Example for to set the page with a "call far"-instruction to the vesa routine: Code: mov eax, DWORD PTR[di+0Ch] ; make sure that DS:DI points to the modeinfobuffer before and eax, eax jz ERROR mov DWORD PTR cs:[PAGESET], eax ;-------------------------------------- ;-------------------------------------- cmp dx, bp ; compare pagenumbers jz short NOSET ; same pagenumber? xor bx, bx mov bp, dx ; save the actual number of the page ;-------------------------- DB 9Ah ; CALL FAR: SETPAGE PAGESET DD ? ;-------------------------- NOSET: ; Now we can draw our pixel Dirk |
|||
![]() |
|
Lucy Berie 09 Dec 2012, 03:01
Hey, I have a funny code (Modified a bit)
Code: org 100h mov al,13h int 10h les ax,[bx] paint: sbb ax,di stosb add di,3 jmp paint (Trying implementing some basic assembly calculation commands...) ![]() Or : Code: org 100h mov al,13h int 10h les ax,[bx] paint: sbb ax,di stosb add di,5 jmp paint Code: org 100h mov al,13h int 10h les ax,[bx] paint: sbb ax,di stosb add di,7 jmp paint Looks much nicer... ![]() Ok, Code: mov al,13h int 10h I think these code are used to call graphics... Code: les ax,[bx] ...................... sbb ax,di stosb I don't really understand this... |
|||
![]() |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.