VOGONS


First post, by Estece

User metadata
Rank Newbie
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 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 a byte code interpreter by Estece in 512-byte boot sector version 2020 July second
db 040h ; -----------------------------------------------------------------
db 000h ; You need a 386 cpu & 387 coprocessor (FPU) or compatiblile
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 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 by
db 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 allowed
db 000h ; 41h - return from procedure called by above byte code , no results returned
db 000h ; 36h XXh - jump to byte code pointer plus XXh signed byte offset
db 0C0h ; 2eh XXh YYh ZZh - jump to byte code pointer plus ZZh signed byte offset IF float at unsigned byte data pointer XXh
db 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 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 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 YYh
db 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 from
db 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 to
db 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 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!
Show last 453 lines
db 0B4h ; 9ah 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 ; a3h 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 ; b3h 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 ; d7h WWh XXh YYh ZZh - signed multipy 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 ; substract an unsigned integer (word 16-bit) pointed by unsigned byte data pointer YYh finaly
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 ; 93h 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 ; c1h WWh XXh YYh ZZh - signed multipy 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 ; 78h WWh XXh YYh ZZh - signed multipy 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 ; 21h 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 veritical cordinate
db 07Eh ; represented by unsigned byte (8-bit) pointed by unsigned byte data pointer YYh and
db 0EBh ; a is horizontal corrdinate 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 ; d9h 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 0D9h
db 0EEh
db 0DFh
db 037h
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 09Eh
db 0E8h
db 08Ah
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 085h
db 0FFh
db 0EBh
db 007h
db 0E8h
db 080h
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 066h
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 04Ah
db 0FFh
db 097h
db 0E8h
db 036h
db 0FFh
db 0EBh
db 003h
db 0E8h
db 053h
db 0FFh
db 0D9h
db 0FAh
db 0EBh
db 0DBh
db 0E8h
db 046h
db 0FFh
db 0E8h
db 027h
db 0FFh
db 0EBh
db 0D3h
db 0E8h
db 044h
db 0FFh
db 0D9h
db 0E0h
db 0EBh
db 0CCh
db 0E8h
db 03Dh
db 0FFh
db 0EBh
db 0C7h
db 0E8h
db 03Eh
db 0FFh
db 0D8h
db 034h
db 0EBh
db 0C0h
db 0E8h
db 02Bh
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 005h
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 0EDh
db 0FEh
db 0D8h
db 01Ch
db 09Bh
db 0DFh
db 0E0h
db 09Eh
db 077h
db 0EFh
db 043h
db 0C3h
db 0E8h
db 0DAh
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 0F9h
db 055h
db 0AAh

This is a RT clock to type in after boot.

3f01c700ffff020004000f000100ffff7f4b00007c4200008040000000400000003f000000bfcdcccc3d9a99993e17b7d138cdcc4cbb0ad7a33b0000803f0000803f000080bf00000000000010400000a040000080bd000000000000c03f0000a040000080be00000000000000000000a040000080bf000000000000000000003041000010c200000000000000000000803f657374656365md93a465684228ad7020c6694841e86d7000c669236232ea28e3bc1a21266c621c694c1868e328652920404e9c18a8e368a52940404d736c98486ae848ab2848eb68466ba8466be8466c2848e9e3c75529c666606848ea236be78a6aebaded79c080698b39846f2b39846eeb39846ea7872eaded2a3d2ea7fd2ead27fd6ead67fdaeada843aae843eb28442b684deba84e2be84e6c2842e9e3c2a520c669c068426a236b4842aa293d23ac62ec6660336a7c11ec666caa33ac67fcac6c6c6c6a2a23695840ea6d76666669c93aeaec6d70a0c6698d7080c669ab39846ceb39846f2b39846eeb39846ea7872eabaea93eaaecac1ca1a66ca93eaeaeac6eacecec1c61666eac1eace66ea8beaeac1cacaeaea2eea6607529a0466c0419aeaea2eca66048beaeac6eacaeac1ea2266ea7feac6aa7fceeaea2eea9e03360f2ea6ea03360984eaa6d79a0c669c2eaa9e0336c62ea6aa0336c084aaa6d79a0c669c36b6g

Edited for 386+387 fpu version.
It's benchmarking time?!

Attachments

Last edited by Estece on 2020-07-08, 12:00. Edited 3 times in total.

Reply 1 of 5, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hello Estece and welcome to vogons!
Your work looks very pretty and interesting, I think.

I'd like to help, but currently, I have no vintage PC with 686+ CPU at hand,
since I pretty much limit myself on XT-586 due to space limitations. 😅

Anyway, I'm sure other vogons members may wish to try this.
If a 1,44MB disk image is available, even more so. 😉

Good luck! 😀

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 5, by Estece

User metadata
Rank Newbie
Rank
Newbie

Thank You!
I can try to make it below 686, but i think there is very little space to make it compatible in 512 bytes.
You can try to write other programs in Num-B-in-ator.
To create a floppy disk and attach it, this forum don't have BSD 2.0 license option.
I don't know with license to use.
You can create bootable floppy disk yourself.
Compile first file with assembler of Your choice.

assembler_of_your_choice.exe first_listing.asm

You will get a file 512-bytes long witch is a boot sector(first_listing or first_listing.bin).
Then You can take a blank.ima (a blank floppy image without dos, not formatted) and trim first 512 bytes from front (attached zip).
To attach boot sector to trimmed image do (in windows cmd prompt or dos?):

copy /b bootsector+noboot.ima floppy_with_Num_B_in_ator.ima

Now You should have a bootable floppy disk image.
I want to find any bugs on real hardware.
I will update this program to fix it.
The goal is to have this simulated animation show on real screen.

Attachments

  • Filename
    noboot.zip
    File size
    1.59 KiB
    Downloads
    50 downloads
    File license
    Public domain

Reply 4 of 5, by Cosmic

User metadata
Rank Member
Rank
Member

Hi Estece!

I would really like to try this. I created a bootable image using some PowerShell + nasm below, which is original & free to use.

In your post you mention three modes:

  1. data entry mode which inserts data at 08000h, the default mode. To switch back, reboot and start all over. 😁
  2. code entry mode after pressing 'm', which inserts data at 07E00h.
  3. execute mode after pressing 'g'.

Then you gave the code for the RT clock. Is this all code? Or does one need to switch from data to code ('m' key) at some point during entry? I split it apart into bytes to make it more readable:

3f 01 c7 00 ff ff 02 00 04 00 0f 00 01 00 ff ff 7f 4b 00 00 7c 42 00 00 80 40 00 00 00 40 00 00 00 3f 00 00 00 bf cd cc cc 3d 9a 99 99 3e 17 b7 d1 38 cd cc 4c bb 0a d7 a3 3b 00 00 80 3f 00 00 80 3f 00 00 80 bf 00 00 00 00 00 00 10 40 00 00 a0 40 00 00 80 bd 00 00 00 00 00 00 c0 3f 00 00 a0 40 00 00 80 be 00 00 00 00 00 00 00 00 00 00 a0 40 00 00 80 bf 00 00 00 00 00 00 00 00 00 00 30 41 00 00 10 c2 00 00 00 00 00 00 00 00 00 00 80 3f 65 73 74 65 63 65 md 93 a4 65 68 42 28 ad 70 20 c6 69 48 41 e8 6d 70 00 c6 69 23 62 32 ea 28 e3 bc 1a 21 26 6c 62 1c 69 4c 18 68 e3 28 65 29 20 40 4e 9c 18 a8 e3 68 a5 29 40 40 4d 73 6c 98 48 6a e8 48 ab 28 48 eb 68 46 6b a8 46 6b e8 46 6c 28 48 e9 e3 c7 55 29 c6 66 60 68 48 ea 23 6b e7 8a 6a eb ad ed 79 c0 80 69 8b 39 84 6f 2b 39 84 6e eb 39 84 6e a7 87 2e ad ed 2a 3d 2e a7 fd 2e ad 27 fd 6e ad 67 fd ae ad a8 43 aa e8 43 eb 28 44 2b 68 4d eb a8 4e 2b e8 4e 6c 28 42 e9 e3 c2 a5 20 c6 69 c0 68 42 6a 23 6b 48 42 aa 29 3d 23 ac 62 ec 66 60 33 6a 7c 11 ec 66 6c aa 33 ac 67 fc ac 6c 6c 6c 6a 2a 23 69 58 40 ea 6d 76 66 66 69 c9 3a ea ec 6d 70 a0 c6 69 8d 70 80 c6 69 ab 39 84 6c eb 39 84 6f 2b 39 84 6e eb 39 84 6e a7 87 2e ab ae a9 3e aa ec ac 1c a1 a6 6c a9 3e ae ae ac 6e ac ec ec 1c 61 66 6e ac 1e ac e6 6e a8 be ae ac 1c ac ae ae a2 ee a6 60 75 29 a0 46 6c 04 19 ae ae a2 ec a6 60 48 be ae ac 6e ac ae ac 1e a2 26 6e a7 fe ac 6a a7 fc ee ae a2 ee a9 e0 33 60 f2 ea 6e a0 33 60 98 4e aa 6d 79 a0 c6 69 c2 ea a9 e0 33 6c 62 ea 6a a0 33 6c 08 4a aa 6d 79 a0 c6 69 c3 6b 6g

Here is my PS assembler helper:

# Compile ASM and write to a floppy image, by Cosmic

Set-StrictMode -Version Latest

# Setup
$ROOT = $PSScriptRoot
$NASM = "$ROOT\nasm.exe"
# Get nasm here: https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
If (-Not (Test-Path $NASM)) { Throw 'Cannot find nasm.' }

# Define a floppy disk, evaluates to 1474560 if you want to take the fun out of it
$BYTES_PER_SECTOR = 512
$SECTORS_PER_TRACK = 18
$TRACKS_PER_SIDE = 80
$SIDES_PER_DISK = 2
$BYTES_PER_DISK = $BYTES_PER_SECTOR *
$SECTORS_PER_TRACK *
$TRACKS_PER_SIDE *
$SIDES_PER_DISK

'Assembling'
& $NASM "$ROOT\source.asm" -o "$ROOT\boot.bin" -I "$ROOT"

If (-Not (Test-Path "$ROOT\blank.img")) {
'Creating new blank.img'
New-Object Byte[] $BYTES_PER_DISK |
Set-Content -Encoding Byte "$ROOT\blank.img"
}

'Writing boot.bin to boot.img'
$Bin = [System.IO.File]::ReadAllBytes("$ROOT\boot.bin")
$Image = [System.IO.File]::ReadAllBytes("$ROOT\blank.img")
'boot.bin is {0} bytes' -f $Bin.Length
'boot.img is {0} bytes' -f $Image.Length
For ($i = 0; $i -lt $Bin.Length; $i++) {
$Image[$i] = $Bin[$i]
}
[System.IO.File]::WriteAllBytes("$ROOT\boot.img", $Image)
'OK'

# Show completed MD5, I get 52316E015F1CC5E43865F4B9A761D8B9 as of 2021/10/12.
(Get-FileHash -Algorithm MD5 "$ROOT\boot.img").Hash

Reply 5 of 5, by Estece

User metadata
Rank Newbie
Rank
Newbie

Thanks for asking!
I'm happy that i can help 😀
The code is more readable but You have in 4 row 5 column a md byte 😉 with not a byte in hex.
This is the 'm' switch.
The same is on the end aka 6g in not a byte in hex.
This is the 'g' switch.
You have to input with no spaces and when You type m or g there is no going back.You can't switch modes.
MD5 IMA image floppy disk (not img) :
779d5ab4f93e91a2090a4d5fc5044951