flat assembler
Message board for the users of flat assembler.

Index > Main > 512-byte coding contest

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
To celebrate the 20th anniversary of the first official release of fasm, I'm organizing a new 512-byte coding contest, similar to the one we had here years ago.

The contest is going to run from March 15th (the 20th anniversary of first public pre-release of fasm, version 0.9) to June 19th (the 20th anniversary of 1.0 release). You can read the rules at:
https://contest.flatassembler.net/

If you would like to submit an entry, you can simply post it here.
Post 11 Mar 2020, 18:40
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
With many people under social-distancing or even shelter-in-place rules now, perhaps participation in this contest is worth encouraging as a way to spend a lonely time. Especially if you need to distract yourself with something to reduce anxiety. And if you encounter any problems in coding your entry, you can always visit these forums to seek help or advice.

We have the prize pool of 512 EUR (to be split between the top contestants in both categories), courtesy of 2 Ton Digital.
Post 24 Mar 2020, 21:03
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
My BIOS checks for partition table in boot sector, this is the only difference between USB FDD and HDD emulation on my machine, my code should boot on any machine that usually fails under HDD mode.

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.


Last edited by bitshifter on 02 Apr 2020, 19:43; edited 1 time in total
Post 31 Mar 2020, 09:24
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
Instead of replacing MBR and messing with partition table, for HDD boot testing I would recommend simply replacing the boot sector of an active partition. You could even set up a small dummy partition specially for this purpose.

This way it is even possible to test from the same drive where one has an OS, by simply switching the active partition. I had once written a simple boot manager that allowed me to give names to partitions and then easily boot from any of them by typing one of these names within a short time window (otherwise manager would use the one that was active previously).
Post 31 Mar 2020, 12:17
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
ok thanks, i wrote my own after examining yours, it loads first active partition, normal boot code should be there...

Install to MBR of /dev/sdb under linux is easy way.
Make sure disk is not mounted!
We must preserve partition table.
Code:
dd bs=1 count=446 conv=notrunc if=BOOT.BIN of=/dev/sdb
dd bs=1 count=2 conv=notrunc seek=510 skip=510 if=BOOT.BIN of=/dev/sdb    


Also is simple FAT16 partition boot code to test with...
Setup USB flash drive with MBR and partition format fat16.
Install to first partition of /dev/sdb
we must preserve fat16 header.
Code:
dd bs=1 count=3 conv=notrunc if=BOOT2.BIN of=/dev/sdb1
dd bs=1 count=450 conv=notrunc seek=62 skip=62 if=BOOT2.BIN of=/dev/sdb1    


Description: BOOT FAT16 STAGE2
Download
Filename: BOOT2.ASM
Filesize: 1.02 KB
Downloaded: 129 Time(s)

Description: MBR BOOT STAGE1
Download
Filename: BOOT.ASM
Filesize: 1.03 KB
Downloaded: 130 Time(s)


_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 01 Apr 2020, 19:24
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
in Qemu, it seems that A20 line is active by default.
then, i cannot see what version of A20 gate activation is ok for this platform.

on many drives i've got with a regular os installation, the first 32kbytes after mbr are empty.
i wonder if it can be possible to simulate a sort of many boot sectors manager...

https://gitlab.com/fasmstuff/boot
Post 27 Apr 2020, 01:33
View user's profile Send private message Visit poster's website Reply with quote
alexfru



Joined: 23 Mar 2014
Posts: 78
alexfru
edfed wrote:
in Qemu, it seems that A20 line is active by default.
then, i cannot see what version of A20 gate activation is ok for this platform.


If A20 is already enabled (you should test for it), you don't need to enable it again with any method.
Disabling it would be a rather strange thing to do.
Post 27 Apr 2020, 02:43
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
alexfru wrote:
edfed wrote:
in Qemu, it seems that A20 line is active by default.
then, i cannot see what version of A20 gate activation is ok for this platform.


If A20 is already enabled (you should test for it), you don't need to enable it again with any method.
Disabling it would be a rather strange thing to do.

yes, still tested, and yes, it would be strange to enable it again. the A20 activation is mandatory when dealing with the linear adress space, even if Qemu make it by default, it's not the case for other platforms. the point is now, what activation is the more represented, fastA20 or legacy 8042 A20? only the test on a bunch of real pc will give the answer.
Post 27 Apr 2020, 11:50
View user's profile Send private message Visit poster's website Reply with quote
graudeejs



Joined: 19 Apr 2020
Posts: 3
Location: Riga, Latvia
graudeejs
Hello!

I'd like to submit my entry: https://gitlab.com/graudeejs/fasm-mbr-snake

It has two documented bugs, I doubt I will fix them in time.
This was fun project after about 8 years of not writing a single line of assembler.

Updated: Attached preview.gif


Description:
Filesize: 270.29 KB
Viewed: 2236 Time(s)

preview.gif




Last edited by graudeejs on 19 Jun 2020, 15:17; edited 1 time in total
Post 25 May 2020, 18:52
View user's profile Send private message Visit poster's website Reply with quote
mitchbux



Joined: 30 May 2020
Posts: 2
Location: Paris
mitchbux
Hey everyone,


Only a few weeks until contest ends.


You can visit
:::/ http://mitchbux.github.io /:::

X86 BIOS/DOS Resources to build <512 byte DEMO

The DEMO.ASM program provides a small framework (You can optimize further for sure).
In less than 100 bytes the programm chooses the color of every pixel in a 320x200 graphic video mode.
Feel free to choose the right VGA video mode.
To update boudary check etc...
The exemple geometry is a triangle, there is enough room to build a loop and display as many triangles as you need.

In the same page, you will find a link to a VirtualBox Virtual Drive with the same IDE and installed MS-DOS v 6.22.

Attached DEMO.ASM program and compiled code.
_______________________________________________________
Don't hesitate to leave your comments, post issues on github etc.


Description: Compile with FASM for DOS.
It is not a MBR bootable program.

Download
Filename: Demo.Exemple.zip
Filesize: 1.35 KB
Downloaded: 109 Time(s)


_________________
:::: / Mitchbux / ::::
Post 01 Jun 2020, 13:28
View user's profile Send private message Visit poster's website Reply with quote
littleli



Joined: 15 Apr 2020
Posts: 1
Location: Prague, Czechia
littleli
Hi everyone!

I would like to submit my entry for the contest: https://github.com/littleli/boot2plasma

I got interested in trying FASM lately, especially the new FASMG with modern architecture. This contest, plus the COVID19 situation which pinned me on a 2-month home office were a good opportunity to do it.

All details, including build instructions, are in the project README file. The built binary is in Github release section. A video preview is available here: https://vimeo.com/419123046

Let me know how do you like it Smile


Description: small pic
Filesize: 1.17 KB
Viewed: 2316 Time(s)

plasm-c.png


Description: source file
Download
Filename: b2plasma.asm
Filesize: 4.1 KB
Downloaded: 71 Time(s)



Last edited by littleli on 18 Jun 2020, 13:30; edited 1 time in total
Post 03 Jun 2020, 22:55
View user's profile Send private message Visit poster's website Reply with quote
SeproMan



Joined: 11 Oct 2009
Posts: 60
Location: Belgium
SeproMan
This is my entry for the Free form category in the 2020 programming challenge.

Because this program only contains position independent code, it requires none of the usual ORG settings.
You can run this code as a normal DOS application (.COM) or as a bootsector program (.IMG) WITHOUT NEEDING ANY MODIFICATIONS.

The program shows 12 hydraulic cylinders that operate autonomously and simultaneously. In the middle of the playfield there is a brown box that will get pushed around by the extending pistons, so that the box always ends up on exactly one of the 9 tiles in the playfield.

If an extending piston finds an obstacle on its path, it will for safety reasons immediately retract at triple speed. An obstacle in this respect is any of the other pistons or the brown box already owned by one of the other pistons.
If an extending piston touches the brown box while it is still free, the piston swiftly takes ownership of the box. This combo is now 'untouchable'!

The travel of a piston switches between half-stroke (1 tile) and full-stroke (2 tiles). The switch happens as soon as the piston manages to execute its designated stroke.

The user interface uses next keys:

    1. SPC makes all pistons retract at once. Another SPC restarts the action.
    2. '*' toggles between normal speed and high speed (x6).
    3. CTRL-C returns to DOS. (If running as a bootsector program, you would use RESET or power down...)


System requirements: x86 pc (80386 or better) with VGA.

Code:
; Copyright 2020 Seproman

; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:

; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.

; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.

; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
; ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

; ****************************************************************************

; 512-byte contest on FASM website 19/06/2020
; This is x86 code assembled with FASM 1.73.24
; (c) 2019-2020 Seproman

; Because this program only contains position independent code, it requires
; none of the usual ORG settings.
; You can run this code as a normal DOS application (.COM)
; or as a bootsector program (.IMG) WITHOUT NEEDING ANY MODIFICATIONS.

; The program shows 12 hydraulic cylinders that operate autonomously and
; simultaneously. In the middle of the playfield there is a brown box that
; will get pushed around by the extending pistons, so that the box always
; ends up on exactly one of the 9 tiles in the playfield.

; If an extending piston finds an obstacle on its path, it will for safety
; reasons immediately retract at triple speed. An obstacle in this respect is
; any of the other pistons or the brown box already owned by one of the other
; pistons.
; If an extending piston touches the brown box while it is still free, the
; piston swiftly takes ownership of the box. This combo is now 'untouchable'!

; The travel of a piston switches between half-stroke (1 tile) and full-stroke
; (2 tiles). The switch happens as soon as the piston manages to execute its
; designated stroke.

; The user interface uses next keys:
;  SPC makes all pistons retract at once. Another SPC restarts the action.
;  '*' toggles between normal speed and high speed (x6).
;  CTRL-C returns to DOS. (If running as a bootsector program, you would use
;  RESET or power down...)
;
; For every cylinder there is a 4-byte record that holds:
;  byte 0 AnchorX
;  byte 1 AnchorY
;  byte 2 Flags
;  byte 3 Current position/delay

; The flags have the following meaning:
;  bit 7,6 CylinderOrientation  00=West side, extending to the right
;                               01=East side, extending to the left
;                               10=North side, extending downward
;                               11=South side, extending upward
;  bit 5   PistonRetirement     0=No
;                               1=Yes
;  bit 4   OwnershipOfBox       0=No
;                               1=Yes
;  bit 3   Stroke               0=Half
;                               1=Full
;  bit 2   Reserved             Currently a convenient MO overflow bit
;                               and also a tiny wait control
;  bit 1,0 ModeOfOperation      00=Waiting while retracted
;                               01=Extending
;                               10=Waiting while extended
;                               11=Retracting

        cld
        push    cs
        pop     ds                      ; CONST
        push    0A000h
        pop     es                      ; CONST
        xor     cx, cx
        mov     fs, cx                  ; CONST

        mov     ax, 0013h               ; BIOS.SetVideo Graphics 320x200x8
        int     10h

        mov     dx, 0C48h               ; X=72  Y=12
        mov     bx, 0B0B0h              ; W,H=176
        mov     ax, 0800h               ; C=8
        call    Paint
        mov     dx, 4682h               ; X=130 Y=70
        mov     bx, 3C3Ch               ; W,H=60
        mov     ah, 7                   ; C=7
        call    Paint
        mov     dx, 5A96h               ; X=150 Y=90
        mov     bx, 1414h               ; W,H=20
        mov     ah, 6                   ; C=6
        call    Paint

        call    Start                   ; This gives position independent code

.SI:    db       77,  71, 00000011b, 1
        db       77,  91, 00000011b, 1
        db       77, 111, 00000011b, 1
        db      131,  17, 10000011b, 1
        db      151,  17, 10000011b, 1
        db      171,  17, 10000011b, 1
        db      242,  71, 01000011b, 1
        db      242,  91, 01000011b, 1
        db      242, 111, 01000011b, 1
        db      131, 182, 11000011b, 1
        db      151, 182, 11000011b, 1
        db      171, 182, 11000011b, 1
.DI:

Start:  pop     si
        lea     di, [si+48]             ; CONST
        xor     bp, bp                  ; VAR Ownership [-1,0]
        xor     bl, bl                  ; VAR Speed {0,42}
Main:   mov     al, [fs:046Ch]          ; BIOS.Timer {18.2 Hz, 111 Hz}
        cmp     al, dl
        je      Main
        mov     dl, al

        push    si                      ; (1)
.a:     mov     ax, [si+2]
        mov     dh, 21                  ; Half stroke
        test    al, 8
        jz      .b
        mov     dh, 41                  ; Full stroke

.b:     test    al, 2
        jnz     .MO_2_3
.MO_0_1:test    al, 1
        jnz     .MO_1

; Waiting while retracted
.MO_0:  test    al, 32                  ; Retire all ?
        jz      .No
        mov     ah, -2
.No:    inc     ah                      ; [-128,-1] -> [-127,0]
        jmp     .Waited                 ; Maybe go set for Extending (0 -> 1)

; Extending
.MO_1:  test    al, 16                  ; Owner of the box ?
        jnz     .Yes
        call    Inspect                 ; -> ZF CF
        jz      .OK                     ; No obstacles
        jb      .MO_3_                  ; Bump back on BrightWhite obstacle
        test    bp, bp
        jnz     .MO_3_                  ; Bump back on box that has an owner
        or      al, 16                  ; Take ownership and stay put
        dec     bp
        jmp     .Cont
.Yes:   call    Inspect                 ; -> ZF CF
        jnz     .Cont                   ; Obstacle, stay put
; Normal advancing
.OK:    inc     byte [si+3]             ; [0,DH-1] -> [1,DH]
        call    Draw
        inc     ah
        cmp     ah, dh                  ; DH={21,41}
        jne     .Cont
; Now completely extended
        btr     ax, 4                   ; If owner, give up ownership
        adc     bp, 0
        xor     al, 8                   ; Toggle stroke
        jmp     .NxtMO                  ; Start tiny wait (uses overflow bit)

.MO_2_3:test    al, 1
        jnz     .MO_3

; Waiting while extended
.MO_2:  xor     al, 4                   ; Tiny wait using the overflow bit
        test    al, 4
.Waited:jnz     .Cont
        jmp     .NxtMO                  ; Go set for Retracting (2 -> 3)

; Stop extending, immediately bump back
.MO_3_: add     al, 2                   ; Change operational mode (1 -> 3)
        mov     [si+2], al

; Retracting at triple speed
.MO_3:  mov     cl, 3                   ; CH=0
.Loop:  dec     byte [si+3]             ; [1,DH] -> [0,DH-1]
        call    Draw
        dec     ah
        loopne  .Loop
        jnz     .Cont
; Now completely retracted, start a longer wait
        mov     ah, -23

.NxtMO: inc     ax                      ; 'inc al' Set next operational mode
        and     al, 11111011b           ; Clear overflow bit
.Cont:  mov     [si+2], ax

        add     si, 4
        cmp     si, di
        jb      .a
        pop     si                      ; (1)

        mov     ah, 01h                 ; BIOS.TestKey
        int     16h                     ; -> AX ZF
        jz      Again
        mov     ah, 00h                 ; BIOS.GetKey
        int     16h                     ; -> AX
        cmp     al, ' '
        je      Retire
        cmp     al, '*'
        je      Speed
        cmp     al, 3                   ; CTRL-C
        jne     Again

Quit:   cbw                             ; -> AX=0003h BIOS.SetVideo Text 80x25
        int     10h
        mov     bl, 0                   ; Back to 18.2 Hz
SetCTC: mov     al, 34h
        out     43h, al
        mov     al, 0
        out     40h, al
        mov     al, bl                  ; BL={0,42}
        out     40h, al
        ret

Speed:  xor     bl, al                  ; AL=42
        call    SetCTC
        jmp     Again

Retire: push    si                      ; (2)
.xor:   xor     [si+2], al              ; AL=32
        add     si, 4
        cmp     si, di
        jb      .xor
        pop     si                      ; (2)
Again:  jmp     Main
; --------------------------------------
; IN (ax,bx,cx,dx) OUT (ax,bx,cx,dx,si,di)
PrepGfx:xchg    al, ah
        sahf                            ; DX is anchor X,Y
        js      .NS                     ; CX is offset to selected part
.WE:    jnz     .a                      ; BX is size of selected part
        neg     cl                      ; AL is flags, AH is color
        sub     dl, bl                  ; To some virtual upperleft X
        inc     dl
        jmp     .a
.NS:    xchg    bl, bh
        xchg    cl, ch
        jnz     .a
        neg     ch
        sub     dh, bh                  ; To some virtual upperleft Y
        inc     dh
.a:     add     dl, cl                  ; To real upperleft X of selected part
        add     dh, ch                  ; To real upperleft Y of selected part
        movzx   di, dh                  ; -> DI is upperleft Y
        mov     dh, 0                   ; -> DX is upperleft X
        mov     si, 320
        imul    di, si
        add     di, dx                  ; -> DI is upperleft address
        mov     dl, bl                  ; -> DX is width
        sub     si, dx                  ; -> SI is skip to next line
        ret
; --------------------------------------
; IN (si) OUT (ZF,CF)
Inspect:pusha
        lodsw                           ; AL is X, AH is Y
        xchg    dx, ax                  ; 'mov dx, ax'
        lodsw                           ; AL is flags, AH is position
        mov     cx, +0434h
        add     cl, ah
        mov     bx, 0A01h
        test    al, 16
        jz      .a                      ; Not owner of brown box
        add     cx, 0FB14h
        mov     bh, 14h
.a:     call    PrepGfx                 ; -> AX BX CX DX SI DI
        mov     al, 7
.b:     mov     cx, dx                  ; DX=BL
        repe scasb
        jne     .c                      ; ZF=0 CF
        add     di, si
        dec     bh
        jnz     .b
.c:     popa
        ret
; --------------------------------------
; IN (si) OUT ()
Draw:   pusha
        lodsw                           ; AL is X, AH is Y
        xchg    dx, ax                  ; 'mov dx, ax'
        lodsb                           ; AL is flags, [si] is position

        xor     cx, cx
        mov     bx, 1201h
        add     bl, [si]
        mov     ah, 1                   ; Blue
        call    Paint
        mov     cx, +0E06h
        add     cl, [si]
        mov     bx, 042Ah
        sub     bl, [si]
        call    Paint
        mov     ch, +00h
        call    Paint

        mov     ch, 04h
        mov     bx, 0A2Eh
        mov     ah, 15                  ; BrightWhite
        call    Paint
        mov     ch, +00h
        sub     cl, 5
        mov     bx, 1205h
        call    Paint

        add     cx, +0433h
        mov     bx, 0A01h
        mov     ah, 7                   ; White
        test    al, 3
        jnp     .a
        jnz     .b                      ; Currently retracting
.a:     test    al, 16
        jz      .c                      ; Not owner of brown box
        dec     cx
        mov     ch, +0Eh
        mov     bh, 05h
        call    Paint
        mov     ch, +0FFh
        call    Paint
        inc     cx
        mov     bx, 1414h
        dec     ah                      ; White -> Brown
.b:     call    Paint
.c:     popa
        ret
; --------------------------------------
; IN (ax,bx,cx,dx) OUT ()
Paint:  pusha
        call    PrepGfx                 ; -> AX BX CX DX SI DI
.a:     mov     cx, dx                  ; DX=BL
        rep stosb
        add     di, si
        dec     bh
        jnz     .a
        popa
        ret
; --------------------------------------
        dw      0AA55h
; --------------------------------------
    


Description: The program running in DOSBox.
Filesize: 105.41 KB
Viewed: 2734 Time(s)

FunnyOil.jpg



_________________
Real Address Mode.
Post 04 Jun 2020, 15:10
View user's profile Send private message Reply with quote
SeproMan



Joined: 11 Oct 2009
Posts: 60
Location: Belgium
SeproMan
This is my entry for the PC Booter category in the 2020 programming challenge.

Because this program only contains position independent code, it requires none of the usual ORG settings.
You can run this code as a bootsector program (.IMG) or as a normal DOS application (.COM) without needing ANY MODIFICATIONS.

The source assembles identically with FASM 1.73.24 and FASM 1.0. Might sound trivial to you, but it wasn't. FASM has come a long way and to use the old version you have to un-learn a lot...

There's added value for running this code from the bootsector. If you are willing to investigate, you can see just how much DOS changes the BIOS environment and compare how different BIOS manufacturers invoke the code at 7C00h.

The program shows a register dump, a memory dump, and a banner text that goes well with the occasion.

In the register dump you'll find the initial contents of all of the 16-bit registers: AX, BX, CX, DX, SI, DI, BP, SP, CS, DS, ES, SS, IP, and FLAGS.

The memory dump displays 256 bytes at a time, both in hex form and character form. You move through the 1 MB memory by means of the UP and DOWN keys.
On top of the address column there's a small red indicator that tells you by how much the UP/DOWN keys will move BACK/FORWARD through memory.
You control the indicator by means of the LEFT and RIGHT keys. If the indicator is at the far left, the addresses will change 65536 bytes at a time. Going to the right, the change decreases to 4096, 256, and 16.
The dumped bytes are continually refreshed. See this in action by looking at the TimerTick (046Ch) in the BIOS data area; or visit the text mode video memory (B800h) where you locate the program's moving banner.

If you run this code as a bootsector program, you woud use RESET or power down to stop the program, but if you run this code as a DOS application then there's a nice CTRL-C key included to return to DOS.

System requirements: x86 pc (8086 or better) with 80x25 color text display.

Code:
; Copyright 2020 Seproman

; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:

; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.

; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.

; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
; ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

; ****************************************************************************

; 512-byte contest on FASM website 19/06/2020
; This is 8086 code assembled with FASM 1.73.24 and FASM 1.0
; (c) 2019-2020 Seproman

; The source assembles identically with FASM 1.73.24 and FASM 1.0. Might
; sound trivial to you, but it wasn't. FASM has come a long way and to use the
; old version you have to un-learn a lot...
 
; Because this program only contains position independent code, it requires
; none of the usual ORG settings.
; You can run this code as a bootsector program (.IMG) or
; as a normal DOS application (.COM) without needing ANY MODIFICATIONS.

; There's added value for running this code from the bootsector.
; If you are willing to investigate, you can
;  see just how much DOS changes the BIOS environment.
;  compare how different BIOS manufacturers invoke the code at 7C00h.

; The program shows a register dump, a memory dump, and a banner text that goes
; well with the occasion.

; In the register dump you'll find the initial contents of all of the 16-bit
; registers: AX, BX, CX, DX, SI, DI, BP, SP, CS, DS, ES, SS, IP, and FLAGS.

; The memory dump displays 256 bytes at a time, both in hex form and character
; form. You move through the 1 MB memory by means of the UP and DOWN keys.
; On top of the address column there's a small red indicator that tells you by
; how much the UP/DOWN keys will move BACK/FORWARD through memory.
; You control the indicator by means of the LEFT and RIGHT keys.
; If the indicator is at the far left, the addresses will change 65536 bytes
; at a time. Going to the right, the change decreases to 4096, 256, and 16.
; The dumped bytes are continually refreshed. See this in action by looking at
; the TimerTick (046Ch) in the BIOS data area. Or visit the text mode video
; memory (B800h) where you locate the program's moving banner.

; If you run this code as a bootsector program, you woud use RESET or power
; down to stop the program, but if you run this code as a DOS application then
; there's a nice CTRL-C key included to return to DOS.

; System requirements: x86 pc (8086 or better) with 80x25 color text display.


        pushf
        push    ax ax ss es ds cs
        push    ax bp di si dx cx bx ax
        mov     ax, 0003h               ; BIOS.SetVideo Text 80x25
        int     10h
        mov     ax, 0B800h              ; Video buffer
        mov     es, ax                  ; CONST
        push    cs
        pop     ds
        cld

        call    Boxes                   ; This gives position independent code
.SI:    db      218,79,191,0,4,2        ; Box-drawing characters in ASCII form
        db      179,79,179,0            ; because Windows messes these up!
        db      192,79,217,0
        db      218,8,194,26,194,26,194,19,191,0,10,16
        db      179,8,179,26,250,26,179,19,179,0
        db      192,8,193,26,193,26,193,19,217,0
        db      'Celebrating 20 years FASM 1'
        db      'AxBxCxDxSiDiBpSp'
        db      'CsDsEsSsIpFLAGs'
Boxes:  pop     si
        mov     di, (1*80+0)*2          ; Locate (1,0)
        call    Box                     ; -> CH=0 SI DI (AX CL DL)
        call    Box                     ; -> CH=0 SI DI (AX CL DL)
        mov     di, (24*80+0)*2         ; Locate (24,0)
        mov     cl, 53                  ; CH=0
        mov     ax, 7420h               ; RedOnWhite space
        rep stosw
        mov     cl, 27                  ; CH=0
Text:   lodsb
        stosw
        loop    Text

; Show all registers, some with a temporary value
        mov     di, (2*80+2)*2          ; Locate (2,2)
        mov     cl, 14                  ; CH=0
Regs:   mov     ah, 02h                 ; GreenOnBlack
        lodsb
.a:     stosw
        lodsb
        test    al, 20h                 ; LCase signals end of tag
        jz      .a
        and     al, 0DFh                ; UCase
        stosw
        mov     ax, 073Dh               ; WhiteOnBlack "="
        stosw
        pop     ax                      ; Original registers
        call    ToHexW                  ; -> DI (AX)
        inc     di
        inc     di
        cmp     cx, 7
        jne     .b
        add     di, 16*2                ; Move to next row
.b:     loop    Regs
; Show true FLAGS
        mov     di, (3*80+48-1)*2       ; Locate (3,48-1)
        pop     dx                      ; Original flags
        mov     cl, 16                  ; CH=0
.c:     test    cl, 3                   ; Groups of 4 bits are separated
        jnz     .d                      ; for ease of viewing
        inc     di
        inc     di
.d:     mov     ax, 0930h               ; LightBlueOnBlack "0"
        shl     dx, 1
        adc     al, 0                   ; -> {"0","1"}
        stosw
        loop    .c
; Show true IP
        mov     di, (3*80+37)*2         ; Locate (3,37)
        lea     ax, [si-Boxes]
        call    ToHexW                  ; -> DI (AX)
; Show true SP
        mov     di, (2*80+61)*2         ; Locate (2,61)
        mov     ax, sp
        call    ToHexW                  ; -> DI (AX)

        mov     bp, 4                   ; IndicatorPosition {0,2,4,6}
MainZ:  xor     dx, dx
Main:   mov     ds, dx

Input:  mov     dx, 0C04h               ; LightRedOnBlack diamond character
        xchg    [es:(5*80+2)*2+bp], dx  ; Show the indicator
NoKey:  call    Paint                   ; -> (AX BX CX SI DI)
        mov     ah, 01h                 ; BIOS.TestKey
        int     16h                     ; -> AX ZF
        jz      NoKey                   ; Constantly refreshing the data
        mov     [es:(5*80+2)*2+bp], dx  ; Hide the indicator
        mov     ah, 00h                 ; BIOS.GetKey
        int     16h                     ; -> AX
        cmp     al, 3                   ; CTRL-C
        je      Exit
        mov     al, ah                  ; Scancode

        mov     dx, ds                  ; Current MemoryPage
        mov     cx, bp                  ; IndicatorPosition {0,2,4,6}
        mov     si, 4096
        shr     si, cl
        shr     si, cl                  ; -> SI is Granularity {4096,256,16,1}
        cmp     al, 48h                 ; Up
        je      Up
        cmp     al, 50h                 ; Down
        je      Down
        mov     cl, 2                   ; CH=0
        cmp     al, 4Dh                 ; Right
        je      Led
        neg     cx
        cmp     al, 4Bh                 ; Left
        jne     Input
; Change granularity with wraparound
Led:    add     bp, cx                  ; CX={-2,2}
        and     bp, 6                   ; -> {0,2,4,6}
        jmp     Input
; Move up in a granular step
Up:     sub     dx, si
        jnb     Main
        jmp     MainZ
; Move down in a granular step
Down:   add     dx, si
        jc      .a
        cmp     dx, 0FFF0h
        jbe     Main
.a:     mov     dx, 0FFF0h
        jmp     Main
; Returns to DOS only if the code was running as a DOS application!
Exit:   cbw                             ; -> AX=0003h, BIOS.SetVideo Text 80x25
        int     10h
        ret
; --------------------------------------
; IN (si,di) OUT (ch=0,si,di) MOD (ax,cl,dl)
Box:    call    OneRow_                 ; -> SI DI (AX DL)
        lodsw
        xchg    cx, ax                  ; 'mov cx, ax'
.a:     push    si
        mov     dl, ' '
        call    OneRow                  ; -> SI DI (AX)
        pop     si
        dec     ch
        jnz     .a
        add     si, cx                  ; CX={4,10}
; ---   ---   ---   ---   ---   ---   --
; IN (si,di) OUT (si,di) MOD (ax,dl)
OneRow_:mov     dl, 196
; ---   ---   ---   ---   ---   ---   --
; IN (dl,si,di) OUT (si,di) MOD (ax)
OneRow: lodsw
.a:     stosb
        cmp     al, 32
        mov     al, 01h                 ; BlueOnBlack
        jne     .b
        mov     al, 0Fh                 ; BrightWhiteOnBlack
.b:     stosb
        mov     al, dl
        dec     ah
        jg      .a
        sahf
        jns     OneRow
        ret
; --------------------------------------
; IN (ds) OUT () MOD (ax,bx,cx,si,di)
Paint:  mov     di, (6*80+2)*2          ; Locate (6,2)
        xor     si, si
        mov     cx, ds

.a:     mov     ax, cx
        call    ToHexW                  ; -> DI (AX)
        mov     al, '0'
        stosb
        add     di, 7                   ; Move to HexDump at column 10
        lea     bx, [di+(62-10)*2]      ; CharDump is at column 62
.b:     mov     al, [si]
        cmp     al, 32
        jnb     .c
        mov     al, '.'                 ; Replaces non-printable characters
.c:     mov     [es:bx], al
        inc     bx
        inc     bx
        lodsb
        call    ToHexB                  ; -> DI (AL)
        inc     di
        inc     di
        test    si, 7                   ; Groups of 8 bytes are separated
        jnz     .b                      ; for ease of viewing
        add     di, 4
        test    si, 15
        jnz     .b
        add     di, (80-60)*2           ; Go to same start position on next row

        inc     cx
        cmp     si, 256
        jb      .a

        push    ds
        xor     cx, cx
        mov     ds, cx
        test    byte [046Ch], 8         ; BIOS.Timer Banner moves at 2.25 Hz
        pop     ds
        jz      .e                      ; SMC
        call    .d
.d:     pop     si
        xor     byte [cs:si-5], 1       ; SMC Toggles between 'jz' and 'jnz'
        mov     di, (24*80+0)*2         ; Locate (24,0)
        mov     si, di
        lods    word [es:si]
        mov     cl, 79                  ; CH=0
        rep movs word [di], [es:si]
        stosw
.e:     ret
; --------------------------------------
; IN (ax,di) OUT (di) MOD (ax)
ToHexW: xchg    al, ah
        call    ToHexB                  ; -> DI (AL)
        xchg    al, ah
; ---   ---   ---   ---   ---   ---   --
; IN (al,di) OUT (di) MOD (al)
ToHexB: push    ax cx
        mov     cl, 4                   ; 8086
        shr     al, cl                  ; 8086
        call    .stosb
        pop     cx ax
        and     al, 15
.stosb: cmp     al, 10
        sbb     al, 69h
        das
        stosb
        inc     di                      ; Skip attribute byte
        ret
; --------------------------------------
        dw      0AA55h
; --------------------------------------
    


Description: Running as a boot image in DOSBox.
Filesize: 381.3 KB
Viewed: 2482 Time(s)

20years.jpg



_________________
Real Address Mode.
Post 14 Jun 2020, 10:52
View user's profile Send private message Reply with quote
mitchbux



Joined: 30 May 2020
Posts: 2
Location: Paris
mitchbux
Hey,

Just for fun,

Here is my demo submition : 512 byte exactly.
A few visual effects : Circles, menu bars, Mirrors, glowing green lights etc...

https://mitchbux.github.io/DEMO.COM

Feel free to enjoy, modifuy, distribute.


Description: Screen shot
Filesize: 4.59 KB
Viewed: 2398 Time(s)

wos.png


Description: Demo source code
Download
Filename: DEMO.ASM
Filesize: 3.39 KB
Downloaded: 89 Time(s)


_________________
:::: / Mitchbux / ::::
Post 16 Jun 2020, 19:10
View user's profile Send private message Visit poster's website Reply with quote
Estece



Joined: 08 Feb 2017
Posts: 10
Estece
Is 19.06.2020 day included or excluded from deadline?
Post 18 Jun 2020, 20:38
View user's profile Send private message Reply with quote
Estece



Joined: 08 Feb 2017
Posts: 10
Estece
Num-B-in-ator
Program for 512 boot sector category.
Happy typing !
Code:
db 031h ; Copyright 2020 Estece
db 0C0h ;
db 050h ; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
db 01Fh ; conditions are met:
db 050h ; 
db 007h ; 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 
db 0FAh ; disclaimer.
db 050h ;
db 017h ; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
db 050h ; disclaimer in the documentation and/or other materials provided with the distribution.
db 05Ch ; 
db 0FBh ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
db 050h ; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
db 068h ; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
db 02Dh ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
db 07Ch ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
db 0CBh ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
db 000h ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
db 000h ;
db 010h ; num-B-in-ator 2020 June nineteen by Estece for 512-byte sector boot loader
db 040h ; -----------------------------------------------------------------
db 000h ; You need a pentium pro processor or compatible because of line 468-469 
db 000h ; Program starts in data entry mode and You may turn off caps lock then:
db 0C0h ; Press a key 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f to put high 4-bit part (H) of a data byte.
db 03Fh ; Press a key 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f to put low 4-bit part (L) of a data byte, then a byte represented by 
db 0CEh ; both parts (H0h or 0Lh = HLh) will be placed in memory at address 08000h and pointer will be advanced to the next byte.
db 0FAh ; You can decrement pointer by 1 when You press once a backspace key.
db 000h ; To switch to code entry press an 'm' key.
db 000h ; In byte code entry mode You may check if You shift key isn't stuck then :
db 001h ; Press a key 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f to put high 4-bit part (H) of a byte code.
db 000h ; Press a key 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f to put low 4-bit part (L) of a byte code then a byte represented by 
db 000h ; both parts (H0h or 0Lh = HLh) will be placed in memory at address 07E00h and pointer will be advanced to the next byte.
db 000h ; You can decrement pointer by 1 when You press once a backspace key.
db 03Ch ; To switch to data entry mode reboot or power off your machine. All data will be lost forever!
db 000h ; To switch to execution mode press a 'g' key and see if You fingers are numb. 
db 000h ; If You typed correctly num-B-in-ator will execute Yours byte code.
db 000h ; These are byte code instructions that num-B-in-ator can execute:
db 010h ; 40h XXh             - call procedure at byte code pointer (BCP) plus XXh signed byte offset , no recurse allowed,
db 00Eh ;                       no nesting allowed, no parameters allowed
db 000h ; 45h                 - return from procedure called by byte code 40h , no results returned 
db 000h ; 3ah XXh             - jump to byte code pointer plus XXh signed byte offset
db 0C0h ; 32h XXh YYh ZZh     - jump to byte code pointer plus ZZh signed byte offset IF float at unsigned byte data pointer YYh 
db 0A8h ;                       is above float at unsigned byte data pointer XXh ([YYh]>[XXh] if true then jump BCP+ZZh)
db 000h ; 56h WWh XXh YYh ZZh - add an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXh to 
db 000h ;                       an unsigned integer (word 16-bit) pointed by unsigned byte data pointer WWh then
db 0DBh ;                       compare a signed integer (short 16-bit) pointed by unsigned byte data pointer WWh with 
db 0E3h ;                       a signed integer (short 16-bit) pointed by unsigned byte data pointer YYh and if 
db 0B8h ;                       greater jump to byte code pointer plus ZZh signed byte offset 
db 000h ;                       ([WWh]=[WWh]+[XXh] then [WWh]>[YYh] if true then jump BCP+ZZh)
db 0A0h ; cah XXh YYh ZZh     - add a float at unsigned byte data pointer XXh to a float  at unsigned byte data pointer YYh
db 050h ;                       then store result in a float at unsigned byte data pointer ZZh ([XXh]+[YYh]=[ZZh])
db 00Fh ; 8fh XXh YYh         - change sign and store float at unsigned byte data pointer YYh from 
db 0A1h ;                       a float at unsigned byte data pointer XXh ([YYh]=-[XXh])
db 0BBh ; 88h XXh YYh         - copy a float at unsigned byte data pointer XXh to 
db 000h ;                       a float at unsigned byte data pointer YYh ([YYh]=[XXh])
db 080h ; 
db 031h ;
db 0FFh ; 83h XXh YYh ZZh     - divide a float at unsigned byte data pointer XXh by a float at unsigned byte data pointer YYh 
db 031h ;                       and store it at a float at unsigned byte data pointer ZZh 
db 0C9h ;                       no check for zeros at [YYh] ([ZZh]=[XXh]/[YYh]) "crash and burn" if [YYh]=0!
db 0B4h ; 9eh XXh YYh         - Square root of a float at unsigned byte data pointer XXh stored in  
db 010h ;                       a float at unsigned byte data pointer YYh ([YYh]=sqrt([XXh])
db 0CDh ; a7h XXh YYh         - Length of a 3D vector (3 floats X,Y,Z) starting at unsigned byte data pointer XXh stored in 
db 016h ;                       a float at unsigned byte data pointer YYh ([YYh]=sqrt([XXh]*[XXh]+[XXh+4]*[XXh+4]+[XXh+8]*[XXh+8]))
db 0B4h ; b7h XXh YYh ZZh     - copy a float at unsigned byte data pointer YYh plus four times  
db 00Eh ;                       an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXh to
db 0CDh ;                       a float at unsigned byte data pointer ZZh then 
db 010h ;                                         decrement by one an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXh
db 03Ch ; dbh WWh XXh YYh ZZh - signed multiply an unsigned integer (word 16-bit) pointed by unsigned byte data pointer WWh by
db 06Dh ;                       signed integer (word 16-bit) pointed by unsigned byte data pointer XXh then 
db 077h ;                                         subtract an unsigned integer (word 16-bit) pointed by unsigned byte data pointer YYh finally 
db 0F4h ;                       store result in unsigned integer (word 16-bit) pointed by unsigned byte data pointer ZZh
db 074h ;                       ([ZZh]=([WWh]*[XXh])-[YYh])
db 00Bh ; 97h XXh YYh ZZh     - dot product of 3D vector (3 floats X,Y,Z) pointed by unsigned byte data pointer XXh and
db 03Ch ;                       3D vector (3 floats U,V,W) pointed by unsigned byte data pointer YYh stored
db 067h ;                                         at a float at unsigned byte data pointer ZZh ([ZZh]=([XXh]*[YYh]+[XXh+4]*[YYh+4]+[XXh+8]*[YYh+8]))
db 074h ; c5h WWh XXh YYh ZZh - signed multiply a float at unsigned byte data pointer WWh by a float at unsigned byte data pointer XXh
db 027h ;                       then add a float at unsigned byte data pointer YYh and store result in 
db 03Ch ;                       a float at unsigned byte data pointer ZZh ([ZZh]=([WWh]*[XXh])+[YYh])
db 008h ; 7Ch WWh XXh YYh ZZh - signed multiply a 3D vector (3 floats X,Y,Z) pointed by unsigned byte data pointer XXh by
db 075h ;                       a float at unsigned byte data pointer WWh then add a 
db 007h ;                       3D vector (3 floats U,V,W) pointed by unsigned byte data pointer YYh and store result in 
db 04Fh ;                       3D vector (3 floats R,S,T) pointed by unsigned byte data pointer ZZh
db 0EBh ;                       ([ZZh]=[XXh]*[WWh]+[YYh],[ZZh+4]=[XXh+4]*[WWh]+[YYh+4],[ZZh+8]=[XXh+8]*[WWh]+[YYh+8])
db 0E5h ; 25h XXh YYh         - put a dot of 1 of 64 grays selected by a float at unsigned byte data pointer XXh
db 0B7h ;                       converted to short integer on a 320x200 dots screen at point a,b where b is vertical coordinate 
db 07Eh ;                       represented by unsigned byte (8-bit) pointed by unsigned byte data pointer YYh and 
db 0EBh ;                                         a is horizontal coordinate represented by unsigned integer (word 16-bit) pointed by unsigned byte
db 0DFh ;                       data pointer at YYh-2 ([YYh+2]=shade(int([XXh])) screen[[YYh]*320+[YYh-2]]=[YYh+2])
db 02Ch ; ddh XXh YYh ZZh     - store a 2D vector (2 floats X,Y) based on a real time clock seconds 
db 030h ;                                         at unsigned byte data pointer XXh then 
db 078h ;                                         store a 2D vector (2 floats U,V) based on a real time clock minutes 
db 0DFh ;                       at unsigned byte data pointer YYh then 
db 03Ch ;                       store a 2D vector (2 floats S,T) based on a real time clock hours 
db 031h ;                                         at unsigned byte data pointer ZZh
db 072h ;                      
db 002h
db 02Ch
db 027h
db 041h
db 083h
db 0E1h
db 001h
db 074h
db 007h
db 0C0h
db 0E0h
db 004h
db 088h
db 001h
db 0EBh
db 0CCh
db 008h
db 001h
db 047h
db 0EBh
db 0C7h
db 0B8h
db 013h
db 000h
db 0CDh
db 010h
db 031h
db 0C0h
db 0BAh
db 0C8h
db 003h
db 0EEh
db 042h
db 0EEh
db 0EEh
db 0EEh
db 0FEh
db 0C0h
db 075h
db 0F9h
db 0BDh
db 0ACh
db 07Ch
db 089h
db 0DAh
db 00Fh
db 0B6h
db 007h
db 0BBh
db 000h
db 07Eh
db 029h
db 0C3h
db 042h
db 0FFh
db 0D3h
db 0EBh
db 0F1h
db 0B9h
db 003h
db 000h
db 0D9h
db 004h
db 0D8h
db 00Dh
db 066h
db 0A7h
db 0E2h
db 0F8h
db 0DEh
db 0C1h
db 0DEh
db 0C1h
db 0C3h
db 089h
db 0D3h
db 00Fh
db 0B6h
db 007h
db 005h
db 000h
db 080h
db 089h
db 0C6h
db 043h
db 0C3h
db 0E8h
db 0F1h
db 0FFh
db 097h
db 0EBh
db 0F0h
db 0E8h
db 0EBh
db 0FFh
db 0D9h
db 004h
db 0C3h
db 0E8h
db 0F7h
db 0FFh
db 0EBh
db 0E5h
db 0E8h
db 0E0h
db 0FFh
db 031h
db 0C0h
db 0A3h
db 019h
db 07Ch
db 0B4h
db 002h
db 0CDh
db 01Ah
db 088h
db 0F0h
db 0BAh
db 011h
db 07Ch
db 0BFh
db 021h
db 07Ch
db 0E8h
db 019h
db 000h
db 0FFh
db 0D5h
db 088h
db 0C8h
db 066h
db 0AFh
db 0E8h
db 010h
db 000h
db 0FFh
db 0D5h
db 088h
db 0E8h
db 03Ch
db 012h
db 072h
db 003h
db 02Ch
db 012h
db 02Fh
db 0BAh
db 015h
db 07Ch
db 066h
db 0AFh
db 053h
db 0BBh
db 000h
db 081h
db 088h
db 007h
db 0D9h
db 0EBh
db 0D8h
db 0C0h
db 0DFh
db 027h
db 0DAh
db 04Dh
db 0FCh
db 0BBh
db 019h
db 07Ch
db 0DAh
db 007h
db 0DBh
db 017h
db 0DAh
db 035h
db 0DEh
db 0C9h
db 0D9h
db 0FBh
db 089h
db 0D3h
db 0D9h
db 007h
db 0D9h
db 0C0h
db 0DEh
db 0CBh
db 0DEh
db 0C9h
db 0D9h
db 05Ch
db 004h
db 05Bh
db 0EBh
db 023h
db 0EBh
db 0A2h
db 0E8h
db 08Eh
db 0FFh
db 08Bh
db 005h
db 0F7h
db 02Ch
db 097h
db 0FFh
db 0D5h
db 02Bh
db 03Ch
db 0FFh
db 0D5h
db 089h
db 03Ch
db 0C3h
db 0E8h
db 089h
db 0FFh
db 0EBh
db 007h
db 0E8h
db 084h
db 0FFh
db 0D8h
db 00Ch
db 0FFh
db 0D5h
db 0D8h
db 004h
db 0FFh
db 0D5h
db 0D9h
db 01Ch
db 0C3h
db 0E8h
db 06Ah
db 0FFh
db 08Bh
db 005h
db 0FFh
db 00Dh
db 0C1h
db 0E0h
db 002h
db 001h
db 0C6h
db 0D9h
db 004h
db 0EBh
db 0EBh
db 0E8h
db 04Eh
db 0FFh
db 097h
db 0E8h
db 03Ah
db 0FFh
db 0EBh
db 003h
db 0E8h
db 057h
db 0FFh
db 0D9h
db 0FAh
db 0EBh
db 0DBh
db 0E8h
db 04Ah
db 0FFh
db 0E8h
db 02Bh
db 0FFh
db 0EBh
db 0D3h
db 0E8h
db 048h
db 0FFh
db 0D9h
db 0E0h
db 0EBh
db 0CCh
db 0E8h
db 041h
db 0FFh
db 0EBh
db 0C7h
db 0E8h
db 042h
db 0FFh
db 0D8h
db 034h
db 0EBh
db 0C0h
db 0E8h
db 02Fh
db 0FFh
db 056h
db 0FFh
db 0D5h
db 092h
db 0FFh
db 0D5h
db 058h
db 060h
db 089h
db 0F5h
db 0B9h
db 003h
db 000h
db 089h
db 0CEh
db 04Eh
db 0C1h
db 0E6h
db 002h
db 089h
db 0C3h
db 0D9h
db 000h
db 0D8h
db 00Dh
db 089h
db 0D3h
db 0D8h
db 000h
db 0D9h
db 01Ah
db 0E2h
db 0ECh
db 061h
db 0C3h
db 0E8h
db 009h
db 0FFh
db 08Bh
db 004h
db 001h
db 005h
db 0FFh
db 0D5h
db 08Bh
db 004h
db 039h
db 005h
db 07Fh
db 00Fh
db 043h
db 0C3h
db 08Bh
db 01Eh
db 0FEh
db 07Dh
db 0C3h
db 042h
db 089h
db 016h
db 0FEh
db 07Dh
db 04Ah
db 089h
db 0D3h
db 00Fh
db 0BEh
db 007h
db 001h
db 0C3h
db 0C3h
db 0E8h
db 0F1h
db 0FEh
db 0D9h
db 004h
db 0DFh
db 0F1h
db 0DDh
db 0D8h
db 077h
db 0EFh
db 043h
db 0C3h
db 0E8h
db 0DEh
db 0FEh
db 0FFh
db 0D5h
db 0DFh
db 05Ch
db 002h
db 00Fh
db 0B6h
db 004h
db 0C1h
db 0E0h
db 006h
db 002h
db 024h
db 053h
db 089h
db 0C3h
db 08Ah
db 044h
db 002h
db 08Bh
db 074h
db 0FEh
db 064h
db 088h
db 000h
db 05Bh
db 0C3h
db 065h
db 0F9h
db 065h
db 020h
db 020h
db 055h
db 0AAh
    


Last edited by Estece on 19 Jun 2020, 09:03; edited 1 time in total
Post 19 Jun 2020, 07:41
View user's profile Send private message Reply with quote
Estece



Joined: 08 Feb 2017
Posts: 10
Estece
Ray-traced RTC clock from spheres with shadows.
64 shades of gray at 320x200 in num-B-in-ator.
Entry for 'free form category' at exacly 509 bytes.
Happy typing!
Code:
; Copyright 2020 Estece
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
; conditions are met:
; 
; 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 
; disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 
; disclaimer in the documentation and/or other materials provided with the distribution.
; 
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; Ray-traced RTC clock with shadows 2020 June nineteen by Estece for free form category
; -----------------------------------------------------------------
macro dstr val
{
        virtual at 0
        pa = val
        end virtual
        bits = 8
        repeat bits/4
        d = "0" + (pa) shr (bits-%*4) and 0Fh
        if d > "9"
                d = d + "a"-"9"-1
        end if
        display d
        end repeat
}
db      03Fh,001h,0C7h,000h,0FFh,0FFh,002h,000h,004h,000h,00Fh,000h,001h,000h,0FFh,0FFh,07Fh,04Bh,000h,000h,07Ch,042h,000h,000h,080h,040h,000h,000h,000h,040h,000h,000h,000h,03Fh,000h,000h,000h,0BFh,0CDh,0CCh,0CCh,03Dh,09Ah,099h,099h,03Eh,017h,0B7h,0D1h,038h,0CDh,0CCh,04Ch,0BBh,00Ah,0D7h,0A3h,03Bh,000h,000h,080h,03Fh,000h,000h,080h,03Fh,000h,000h,080h,0BFh,000h,000h,000h,000h,000h,000h,010h,040h,000h,000h,0A0h,040h,000h,000h,080h,0BDh,000h,000h,000h,000h,000h,000h,0C0h,03Fh,000h,000h,0A0h,040h,000h,000h,080h,0BEh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0A0h,040h,000h,000h,080h,0BFh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,030h,041h,000h,000h,010h,0C2h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,080h,03Fh,065h,073h,074h,065h,063h,065h
db      0DDh,03Ah,046h,056h,088h,08Eh,08Eh,088h,022h,08Ah,0DBh,002h,00Ch,066h,094h,088h,01Eh,086h,0DBh,000h,00Ch,066h,092h,03Ah,023h,032h,08Eh,0A2h,03Bh,0C5h,0A2h,012h,066h,0C6h,025h,0C6h,094h,0C5h,086h,08Eh,032h,086h,056h,092h,004h,004h,0E9h,0C5h,08Ah,08Eh,036h,08Ah,056h,094h,004h,004h,0D7h,03Ah,0C6h,088h,086h,0AEh,088h,08Ah,0B2h,088h,08Eh,0B6h,088h,066h,0BAh,088h,066h,0BEh,088h,066h,0C2h,088h,08Eh,09Eh,040h,075h,056h,09Ch,066h,066h,006h,088h,08Eh,0A2h,03Ah,0BEh,07Ch,0A6h,0AEh,0BAh,0DEh,0DBh,09Ch,008h,006h,098h,0B7h,098h,046h,0F2h,0B7h,098h,046h,0EEh,0B7h,098h,046h,0EAh,07Ch,072h,0EAh,0DEh,0D2h,0A7h,0D2h,0EAh,083h,0D2h,0EAh,0D2h,083h,0D6h,0EAh,0D6h,083h,0DAh,0EAh,0DAh,088h,03Ah,0AEh,088h,03Eh,0B2h,088h,042h,0B6h,088h,0DEh,0BAh,088h,0E2h,0BEh,088h,0E6h,0C2h,088h,02Eh,09Eh,040h,02Ah,056h,00Ch,066h,09Ch,006h,088h,026h,0A2h,03Ah,0B4h,088h,02Ah,0A2h,097h,0D2h,03Ah,0C6h,032h,066h,0C6h,003h,03Ah,0A7h,0C5h,01Eh,0C6h,066h,0CAh,0A7h,03Ah,0C6h,083h,0CAh,0C6h,0C6h,0CAh,0C6h,0A2h,0A2h,03Ah,095h,088h,00Eh,0A6h,0DBh,066h,066h,066h,09Ch,097h,0AEh,0AEh,0C6h,0DBh,00Ah,00Ch,066h,098h,0DBh,008h,00Ch,066h,09Ah,0B7h,098h,046h,0CEh,0B7h,098h,046h,0F2h,0B7h,098h,046h,0EEh,0B7h,098h,046h,0EAh,07Ch,072h,0EAh,0BAh,0EAh,097h,0EAh,0AEh,0CAh,0C5h,0CAh,01Ah,066h,0CAh,097h,0EAh,0EAh,0EAh,0CAh,0EAh,0CEh,0CEh,0C5h,0C6h,016h,066h,0EAh,0C5h,0EAh,0CEh,066h,0EAh,08Fh,0EAh,0EAh,0C5h,0CAh,0CAh,0EAh,0EAh,032h,066h,0EAh,007h,056h,09Ah,004h,066h,0C0h,045h,09Eh,0EAh,0EAh,032h,066h,0CAh,004h,08Fh,0EAh,0EAh,0CAh,0EAh,0CAh,0EAh,0C5h,0EAh,022h,066h,0EAh,083h,0EAh,0C6h,0AAh,083h,0CEh,0EAh,0EAh,032h,09Eh,0EAh,003h,03Ah,00Fh,032h,0EAh,0A6h,003h,03Ah,009h,088h,0EAh,0A6h,0DBh,09Ah,00Ch,066h,09Ch,032h,09Eh,0AAh,003h,03Ah,0C6h,032h,0AAh,0A6h,003h,03Ah,0C0h,088h,0AAh,0A6h,0DBh,09Ah,00Ch,066h,09Ch,03Ah,0B6h
repeat $-$$
load a byte from $$+%-1
dstr a
if $$+%-1 = 151
display 'm'
end if
end repeat      
display 'g'
    


Description:
Filesize: 30.84 KB
Viewed: 2251 Time(s)

Raytraced Clock with shadows.png


Post 19 Jun 2020, 09:02
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
not really usefull. but at least, my submission is a sort of framework.

3 bootables:
bpm13h
mode13h, then protected mode, and display the ram contents in graphics


bpmtxt
disable cursor, protected mode, display ram content line by line using the keyboard

nightcity
same as bpm13h, but show a zone of ram that gives illusion of a city by night.
explore ram with keyboard.


Description:
Download
Filename: boot.zip
Filesize: 12.06 KB
Downloaded: 64 Time(s)

Post 19 Jun 2020, 21:02
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
Thank you all for the participation! In the next couple of days I'm going to update the website with a sorted list of entries and then we're going to arrange the jury work.
Post 20 Jun 2020, 09:54
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
The jury has decided to award three places in the "PC Booter" category and only two in the "Free form" category (since after a discussion we decided to disqualify one of the entries on the ground of bypassing the rules).

PC Booter category:
  • 1st place - memdump by Seproman
  • 2nd place - boot2plasma by Aleš Najmann
  • 3rd place - MBR Snake by Aldis Berjoza

Free form category:
  • 1st place - funnyoil by Seproman
  • 2nd place - demo by mitchbux


The winners: please contact us either by mail (at contest@flatassembler.net) or by PM to me or redsock on this board, to discuss the options of receiving the award.
Post 18 Aug 2020, 08:19
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.