First post, by Estece
- Rank
- Newbie
Hi all!
I done real time ray-traced clock with shadows for 386 plus 387 fpu or compatible CPU with VGA card.
Can somebody here check it on real hardware and capture it on video for me to use , please?
Use any assembler that can output plain binary image.
Then use it as boot sector for floppy disk.
db 031h ; Copyright 2020 Estecedb 0C0h ;db 050h ; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followingdb 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 followingdb 0FAh ; disclaimer.db 050h ;db 017h ; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the followingdb 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 AREdb 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 INdb 0CBh ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISdb 000h ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.db 000h ;db 010h ; num-B-in-ator a byte code interpreter by Estece in 512-byte boot sector version 2020 July seconddb 040h ; -----------------------------------------------------------------db 000h ; You need a 386 cpu & 387 coprocessor (FPU) or compatibliledb 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 bydb 0CEh ; both parts (H0h or 0Lh = HLh) will be placed in memory at adress 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 bydb 000h ; both parts (H0h or 0Lh = HLh) will be placed in memory at adress 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 swich to data entry mode reboot or power off your machine. All data will be lost forever!db 000h ; To swich 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 instuructions that num-B-in-ator can execute:db 010h ; 3ch XXh - call procedure at byte code pointer (BCP) plus XXh signed byte offset , no recurse allowed,db 00Eh ; no nesting allowed, no parameters alloweddb 000h ; 41h - return from procedure called by above byte code , no results returneddb 000h ; 36h XXh - jump to byte code pointer plus XXh signed byte offsetdb 0C0h ; 2eh XXh YYh ZZh - jump to byte code pointer plus ZZh signed byte offset IF float at unsigned byte data pointer XXhdb 0A8h ; is above float at unsigned byte data pointer YYh ([XXh]>[YYh] if true then jump BCP+ZZh)db 000h ; 52h WWh XXh YYh ZZh - add an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXh todb 000h ; an unsigned integer (word 16-bit) pointed by unsigned byte data pointer WWh thendb 0DBh ; compare a signed integer (short 16-bit) pointed by unsigned byte data pointer WWh withdb 0E3h ; a signed integer (short 16-bit) pointed by unsigned byte data pointer YYh and ifdb 0B8h ; greater jump to byte code pointer plus ZZh signed byte offsetdb 000h ; ([WWh]=[WWh]+[XXh] then [WWh]>[YYh] if ture then jump BCP+ZZh)db 0A0h ; c6h XXh YYh ZZh - add a float at unsigned byte data pointer XXh to a float at unsigned byte data pointer YYhdb 050h ; then store result in a float at unsigned byte data pointer ZZh ([XXh]+[YYh]=[ZZh])db 00Fh ; 8bh XXh YYh - change sign and store float at unsigned byte data pointer YYh fromdb 0A1h ; a float at unsigned byte data pointer XXh ([YYh]=-[XXh])db 0BBh ; 84h XXh YYh - copy a float at unsigned byte data pointer XXh todb 000h ; a float at unsigned byte data pointer YYh ([YYh]=[XXh])db 080h ;db 031h ;db 0FFh ; 7fh XXh YYh ZZh - divide a float at unsigned byte data pointer XXh by a float at unsigned byte data pointer YYhdb 031h ; and store it at a float at unsigned byte data pointer ZZhdb 0C9h ; no check for zeros at [YYh] ([ZZh]=[XXh]/[YYh]) "crash and burn" if [YYh]=0!
db 0B4h ; 9ah XXh YYh - Square root of a float at unsigned byte data pointer XXh stored indb 010h ; a float at unsigned byte data pointer YYh ([YYh]=sqrt([XXh])db 0CDh ; a3h XXh YYh - Length of a 3D vector (3 floats X,Y,Z) starting at unsigned byte data pointer XXh stored indb 016h ; a float at unsigned byte data pointer YYh ([YYh]=sqrt([XXh]*[XXh]+[XXh+4]*[XXh+4]+[XXh+8]*[XXh+8]))db 0B4h ; b3h XXh YYh ZZh - copy a float at unsigned byte data pointer YYh plus four timesdb 00Eh ; an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXh todb 0CDh ; a float at unsigned byte data pointer ZZh thendb 010h ; decrement by one an unsigned integer (word 16-bit) pointed by unsigned byte data pointer XXhdb 03Ch ; d7h WWh XXh YYh ZZh - signed multipy an unsigned integer (word 16-bit) pointed by unsigned byte data pointer WWh bydb 06Dh ; signed integer (word 16-bit) pointed by unsigned byte data pointer XXh thendb 077h ; substract an unsigned integer (word 16-bit) pointed by unsigned byte data pointer YYh finalydb 0F4h ; store result in unsigned integer (word 16-bit) pointed by unsigned byte data pointer ZZhdb 074h ; ([ZZh]=([WWh]*[XXh])-[YYh])db 00Bh ; 93h XXh YYh ZZh - dot product of 3D vector (3 floats X,Y,Z) pointed by unsigned byte data pointer XXh anddb 03Ch ; 3D vector (3 floats U,V,W) pointed by unsigned byte data pointer YYh storeddb 067h ; at a float at unsigned byte data pointer ZZh ([ZZh]=([XXh]*[YYh]+[XXh+4]*[YYh+4]+[XXh+8]*[YYh+8]))db 074h ; c1h WWh XXh YYh ZZh - signed multipy a float at unsigned byte data pointer WWh by a float at unsigned byte data pointer XXhdb 027h ; then add a float at unsigned byte data pointer YYh and store result indb 03Ch ; a float at unsigned byte data pointer ZZh ([ZZh]=([WWh]*[XXh])+[YYh])db 008h ; 78h WWh XXh YYh ZZh - signed multipy a 3D vector (3 floats X,Y,Z) pointed by unsigned byte data pointer XXh bydb 075h ; a float at unsigned byte data pointer WWh then add adb 007h ; 3D vector (3 floats U,V,W) pointed by unsigned byte data pointer YYh and store result indb 04Fh ; 3D vector (3 floats R,S,T) pointed by unsigned byte data pointer ZZhdb 0EBh ; ([ZZh]=[XXh]*[WWh]+[YYh],[ZZh+4]=[XXh+4]*[WWh]+[YYh+4],[ZZh+8]=[XXh+8]*[WWh]+[YYh+8])db 0E5h ; 21h XXh YYh - put a dot of 1 of 64 grays selected by a float at unsigned byte data pointer XXhdb 0B7h ; converted to short integer on a 320x200 dots screen at point a,b where b is veritical cordinatedb 07Eh ; represented by unsigned byte (8-bit) pointed by unsigned byte data pointer YYh anddb 0EBh ; a is horizontal corrdinate represented by unsigned integer (word 16-bit) pointed by unsigned bytedb 0DFh ; data pointer at YYh-2 ([YYh+2]=shade(int([XXh])) screen[[YYh]*320+[YYh-2]]=[YYh+2])db 02Ch ; d9h XXh YYh ZZh - store a 2D vector (2 floats X,Y) based on a real time clock secondsdb 030h ; at unsigned byte data pointer XXh thendb 078h ; store a 2D vector (2 floats U,V) based on a real time clock minutesdb 0DFh ; at unsigned byte data pointer YYh thendb 03Ch ; store a 2D vector (2 floats S,T) based on a real time clock hoursdb 031h ; at unsigned byte data pointer ZZhdb 072h ;db 002hdb 02Chdb 027hdb 041hdb 083hdb 0E1hdb 001hdb 074hdb 007hdb 0C0hdb 0E0hdb 004hdb 088hdb 001hdb 0EBhdb 0CChdb 008hdb 001hdb 047hdb 0EBhdb 0C7hdb 0B8hdb 013hdb 000hdb 0CDhdb 010hdb 031hdb 0C0hdb 0BAhdb 0C8hdb 003hdb 0EEhdb 042hdb 0EEhdb 0EEhdb 0EEhdb 0FEhdb 0C0hdb 075hdb 0F9hdb 0BDhdb 0AChdb 07Chdb 089hdb 0DAhdb 00Fhdb 0B6hdb 007hdb 0BBhdb 000hdb 07Ehdb 029hdb 0C3hdb 042hdb 0FFhdb 0D3hdb 0EBhdb 0F1hdb 0B9hdb 003hdb 000hdb 0D9hdb 004hdb 0D8hdb 00Dhdb 066hdb 0A7hdb 0E2hdb 0F8hdb 0DEhdb 0C1hdb 0DEhdb 0C1hdb 0C3hdb 089hdb 0D3hdb 00Fhdb 0B6hdb 007hdb 005hdb 000hdb 080hdb 089hdb 0C6hdb 043hdb 0C3hdb 0E8hdb 0F1hdb 0FFhdb 097hdb 0EBhdb 0F0hdb 0E8hdb 0EBhdb 0FFhdb 0D9hdb 004hdb 0C3hdb 0E8hdb 0F7hdb 0FFhdb 0EBhdb 0E5hdb 0E8hdb 0E0hdb 0FFhdb 031hdb 0C0hdb 0A3hdb 019hdb 07Chdb 0B4hdb 002hdb 0CDhdb 01Ahdb 088hdb 0F0hdb 0BAhdb 011hdb 07Chdb 0BFhdb 021hdb 07Chdb 0E8hdb 019hdb 000hdb 0FFhdb 0D5hdb 088hdb 0C8hdb 066hdb 0AFhdb 0E8hdb 010hdb 000hdb 0FFhdb 0D5hdb 088hdb 0E8hdb 03Chdb 012hdb 072hdb 003hdb 02Chdb 012hdb 02Fhdb 0BAhdb 015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db 089hdb 0F5hdb 0B9hdb 003hdb 000hdb 089hdb 0CEhdb 04Ehdb 0C1hdb 0E6hdb 002hdb 089hdb 0C3hdb 0D9hdb 000hdb 0D8hdb 00Dhdb 089hdb 0D3hdb 0D8hdb 000hdb 0D9hdb 01Ahdb 0E2hdb 0EChdb 061hdb 0C3hdb 0E8hdb 005hdb 0FFhdb 08Bhdb 004hdb 001hdb 005hdb 0FFhdb 0D5hdb 08Bhdb 004hdb 039hdb 005hdb 07Fhdb 00Fhdb 043hdb 0C3hdb 08Bhdb 01Ehdb 0FEhdb 07Dhdb 0C3hdb 042hdb 089hdb 016hdb 0FEhdb 07Dhdb 04Ahdb 089hdb 0D3hdb 00Fhdb 0BEhdb 007hdb 001hdb 0C3hdb 0C3hdb 0E8hdb 0EDhdb 0FEhdb 0D8hdb 01Chdb 09Bhdb 0DFhdb 0E0hdb 09Ehdb 077hdb 0EFhdb 043hdb 0C3hdb 0E8hdb 0DAhdb 0FEhdb 0FFhdb 0D5hdb 0DFhdb 05Chdb 002hdb 00Fhdb 0B6hdb 004hdb 0C1hdb 0E0hdb 006hdb 002hdb 024hdb 053hdb 089hdb 0C3hdb 08Ahdb 044hdb 002hdb 08Bhdb 074hdb 0FEhdb 064hdb 088hdb 000hdb 05Bhdb 0C3hdb 0F9hdb 055hdb 0AAh
This is a RT clock to type in after boot.
3f01c700ffff020004000f000100ffff7f4b00007c4200008040000000400000003f000000bfcdcccc3d9a99993e17b7d138cdcc4cbb0ad7a33b0000803f0000803f000080bf00000000000010400000a040000080bd000000000000c03f0000a040000080be00000000000000000000a040000080bf000000000000000000003041000010c200000000000000000000803f657374656365md93a465684228ad7020c6694841e86d7000c669236232ea28e3bc1a21266c621c694c1868e328652920404e9c18a8e368a52940404d736c98486ae848ab2848eb68466ba8466be8466c2848e9e3c75529c666606848ea236be78a6aebaded79c080698b39846f2b39846eeb39846ea7872eaded2a3d2ea7fd2ead27fd6ead67fdaeada843aae843eb28442b684deba84e2be84e6c2842e9e3c2a520c669c068426a236b4842aa293d23ac62ec6660336a7c11ec666caa33ac67fcac6c6c6c6a2a23695840ea6d76666669c93aeaec6d70a0c6698d7080c669ab39846ceb39846f2b39846eeb39846ea7872eabaea93eaaecac1ca1a66ca93eaeaeac6eacecec1c61666eac1eace66ea8beaeac1cacaeaea2eea6607529a0466c0419aeaea2eca66048beaeac6eacaeac1ea2266ea7feac6aa7fceeaea2eea9e03360f2ea6ea03360984eaa6d79a0c669c2eaa9e0336c62ea6aa0336c084aaa6d79a0c669c36b6g
Edited for 386+387 fpu version.
It's benchmarking time?!