diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aad9c98 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 + +[*.asm] +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{masm.asm,nasm.asm}] +charset = latin1 +end_of_line = crlf +tab_width = 4 + +[*.gas.asm] +end_of_line = lf +tab_width = 8 diff --git a/.gitignore b/.gitignore index e43b0f9..6ee8459 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ +*.com + +.vs/ +.idea/ + .DS_Store diff --git a/disassembly/README.md b/disassembly/README.md new file mode 100644 index 0000000..9d36a59 --- /dev/null +++ b/disassembly/README.md @@ -0,0 +1,27 @@ +# TECHNO.COM Disassemblies + +The following are full disassemblies of the (Payload isolated) TECHNO.COM MS-DOS binary, and are intended to be +bit-exact with the original. +``` +TECHNO.COM (Payload only) +MD5 = 4CB859537BCD7BFB9FC5BFD6D74F4782 +SHA-1 = A2FB99D873912AC8B7CD05E15659F65DA5D119BF +SHA-256 = BA33A41BA51C3D56B27107A94EF7842235B6D80A3A5B8710AEBDD87EB3A1905C +``` + +### techno.nasm.asm +Netwide Assembler syntax, tested to work under [NASM](https://www.nasm.us/), [FASM](https://flatassembler.net/), and +[YASM](https://yasm.tortall.net/). + +None of these assemblers have the ability to produce the original opcodes from mnemonics, so `db`'s are used where +needed and documented with the actual mnemonic. + +### techno.masm.asm +Microsoft Macro Assembler syntax, tested and works under MASM 6.11, [JWasm v2.11](https://www.japheth.de/JWasm.html), +and Borland Turbo Assembler 5.0 (in MASM mode). + +This [fork](https://github.com/JWasm/JWasm) of JWasm v2.12pre is recommended for assembling on modern platforms. + +### techno.gas.asm +GNU Assembler (AT&T) syntax, tested with [IA-16 DJGPP](https://gitlab.com/tkchia/build-ia16/-/releases), +and i386-elf-binutils. mingw's `as` appears to work too but not its `ld`. diff --git a/disassembly/technog.asm b/disassembly/techno.gas.asm similarity index 97% rename from disassembly/technog.asm rename to disassembly/techno.gas.asm index b3c198b..b4237ec 100644 --- a/disassembly/technog.asm +++ b/disassembly/techno.gas.asm @@ -1,9 +1,9 @@ # TECHNO.COM (payload only) Disassembly by a dinosaur 2022, 2024 (original author unknown) # Binary MD5: 4CB859537BCD7BFB9FC5BFD6D74F4782 # SHA256: BA33A41BA51C3D56B27107A94EF7842235B6D80A3A5B8710AEBDD87EB3A1905C -# Assemble with GAS: as technog.asm -o technog.o -# ld -Ttext 0x100 technog.o -o technog.elf -# objcopy -O binary technog.elf techno.com +# Assemble with GAS: as techno.gas.asm -o techno.gas.o +# ld -Ttext 0x100 techno.gas.o -o techno.elf +# objcopy -O binary techno.elf techno.com .code16 .section .text @@ -62,7 +62,7 @@ plot_char: # fn plot_char(AX, DI): # Arguments: DX = timer2 frequency .global beep beep: - push %ax + push %ax mov $0b10110110, %al # 0 - 16 bit mode # 1-3 - Mode 3 (Square wave generator) # 4-5 - Access mode: lobyte/hibyte diff --git a/disassembly/technom.asm b/disassembly/techno.masm.asm similarity index 93% rename from disassembly/technom.asm rename to disassembly/techno.masm.asm index cf86c13..e262ec1 100644 --- a/disassembly/technom.asm +++ b/disassembly/techno.masm.asm @@ -2,9 +2,9 @@ ; Binary MD5: 4CB859537BCD7BFB9FC5BFD6D74F4782 ; SHA256: BA33A41BA51C3D56B27107A94EF7842235B6D80A3A5B8710AEBDD87EB3A1905C ; -; Assemble with Microsoft Macro Assembler: ml.exe /W3 technom.asm /Fotechno.com -; Assemble with JWasm: jwasm.exe -bin -Fo techno.com technom.asm -; Assemble with Turbo Assembler: tasm.exe technom.asm techno.obj +; Assemble with Microsoft Macro Assembler: ml.exe /W3 techno~1.asm /Fotechno.com +; Assemble with JWasm: jwasmd.exe -bin -Fo techno.com techno~1.asm +; Assemble with Turbo Assembler: tasm.exe techno~1.asm techno.obj ; tlink.exe /t techno.obj, techno.com .model tiny @@ -152,7 +152,7 @@ goto_beep: dec bl ; Phrase uses 1-based indicies because of the 0 terminator ; So we need to convert it to 0-indexed mov bh, 0 ; BX &= 0xFF - shl bl, 1 ; + shl bl, 1 ; mov dx, [freqtbl + bx] ; Store frequency from note index into DX call beep ; Beep with loaded frequency pop bx diff --git a/disassembly/technon.asm b/disassembly/techno.nasm.asm similarity index 93% rename from disassembly/technon.asm rename to disassembly/techno.nasm.asm index 0de83a6..1218bf1 100644 --- a/disassembly/technon.asm +++ b/disassembly/techno.nasm.asm @@ -2,9 +2,9 @@ ; Binary MD5: 4CB859537BCD7BFB9FC5BFD6D74F4782 ; SHA256: BA33A41BA51C3D56B27107A94EF7842235B6D80A3A5B8710AEBDD87EB3A1905C ; -; Assemble with FASM: fasm technon.asm techno.com -; Assemble with NASM: nasm technon.asm -fbin -o techno.com -; Assemble with YASM: yasm -f bin technon.asm -o techno.com +; Assemble with FASM: fasm techno.nasm.asm techno.com +; Assemble with NASM: nasm techno.nasm.asm -fbin -o techno.com +; Assemble with YASM: yasm -f bin techno.nasm.asm -o techno.com use16 org 100h @@ -146,7 +146,7 @@ goto_beep: dec bl ; Phrase uses 1-based indicies because of the 0 terminator ; So we need to convert it to 0-indexed mov bh, 0 ; BX &= 0xFF - shl bl, 1 ; + shl bl, 1 ; mov dx, [freqtbl + bx] ; Store frequency from note index into DX call beep ; Beep with loaded frequency pop bx