From 0910d7f3bbec1e467593ffec901ff0f1048f95d1 Mon Sep 17 00:00:00 2001 From: "svofski@gmail.com" Date: Tue, 18 Jul 2017 16:13:54 +0300 Subject: [PATCH] Templates, Template menu, More formats The template is selected using a popup menu invoked when the fish is clicked in the text entry box. Added a dedicated format for Partner 01.01 because it seems to want faster recording speed. Hello world templates for RK-like computers added. --- assembler.js | 28 +----------- hello-apogee.asm | 15 +++++++ hello-micro80.asm | 15 +++++++ hello-microsha.asm | 15 +++++++ hello-partner.asm | 15 +++++++ hello-rk.asm | 15 +++++++ hello-spec.asm | 6 +++ hello-v06c.asm | 6 +++ index.html | 4 +- list-online.css | 20 +++++++++ main.js | 106 ++++++++++++++++++++++++++++++++++++++++++++- tape.js | 32 ++++++-------- util.js | 28 ++++++++++++ 13 files changed, 257 insertions(+), 48 deletions(-) create mode 100644 hello-apogee.asm create mode 100644 hello-micro80.asm create mode 100644 hello-microsha.asm create mode 100644 hello-partner.asm create mode 100644 hello-rk.asm create mode 100644 hello-spec.asm create mode 100644 hello-v06c.asm create mode 100644 util.js diff --git a/assembler.js b/assembler.js index 5b53769..d925cfa 100644 --- a/assembler.js +++ b/assembler.js @@ -54,35 +54,9 @@ // importScripts('encodings.js'); +importScripts('util.js'); importScripts('tape.js'); -function Util() { -} - -Util.char8 = function(val) { - if (val > 32 && val < 127) return String.fromCharCode(val); - return '.'; -}; - -Util.hex8 = function(val) { - if (val < 0 || val > 255) return "??"; - - var hexstr = "0123456789ABCDEF"; - return hexstr[(val & 0xf0) >> 4] + hexstr[val & 0x0f]; -}; - -Util.hex16 = function(val) { - return Util.hex8((val & 0xff00) >> 8) + Util.hex8(val & 0x00ff); -}; - -Util.isWhitespace = function(c) { - return c=='\t' || c == ' ';// this is too slow c.match(/\s/); -}; - -Util.toTargetEncoding = function(str, encoding) { - return toEncoding(str, encoding); -}; - function Assembler() { this.debug = false; this.binFileName = 'test.com'; diff --git a/hello-apogee.asm b/hello-apogee.asm new file mode 100644 index 0000000..cdcc481 --- /dev/null +++ b/hello-apogee.asm @@ -0,0 +1,15 @@ + ; 🐟 для Апогея БК-01 + .tape rk-bin + .binfile helloapogee + .org 0 +prompt equ 0F875h +puts equ 0F818h + + lxi hl, msg + call puts + jmp prompt + +msg: + db 1fh,'priwet, mir!',0dh,0ah,0 + + diff --git a/hello-micro80.asm b/hello-micro80.asm new file mode 100644 index 0000000..80af70c --- /dev/null +++ b/hello-micro80.asm @@ -0,0 +1,15 @@ + ; 🐟 для Микро-80 + .tape rk-bin + .binfile hellom80 + .org 0 +prompt equ 0F82Dh +puts equ 0F818h + + lxi hl, msg + call puts + jmp prompt + +msg: + db 1fh,'priwet, mir!',0dh,0ah,0 + + diff --git a/hello-microsha.asm b/hello-microsha.asm new file mode 100644 index 0000000..cafe7e9 --- /dev/null +++ b/hello-microsha.asm @@ -0,0 +1,15 @@ + ; 🐟 для Микроши + .tape microsha-bin + .binfile hellomicrosha + .org 0 +prompt equ 0F89Dh +puts equ 0F818h + + lxi hl, msg + call puts + jmp prompt + +msg: + db 1fh,'priwet, mir!',0dh,0ah,0 + + diff --git a/hello-partner.asm b/hello-partner.asm new file mode 100644 index 0000000..6120711 --- /dev/null +++ b/hello-partner.asm @@ -0,0 +1,15 @@ + ; 🐟 для Партнёра 01.01 + .tape partner-bin + .binfile hellopartner + .org 0 +prompt equ 0F8C9h +puts equ 0F818h + + lxi hl, msg + call puts + jmp prompt + +msg: + db 1fh,'priwet, mir!',0dh,0ah,0 + + diff --git a/hello-rk.asm b/hello-rk.asm new file mode 100644 index 0000000..521d740 --- /dev/null +++ b/hello-rk.asm @@ -0,0 +1,15 @@ + ; 🐟 для Радио-86РК + .tape rk-bin + .binfile hellork + .org 0 +prompt equ 0F86Ch +puts equ 0F818h + + lxi hl, msg + call puts + jmp prompt + +msg: + db 1fh,'priwet, mir!',0dh,0ah,0 + + diff --git a/hello-spec.asm b/hello-spec.asm new file mode 100644 index 0000000..cbcada7 --- /dev/null +++ b/hello-spec.asm @@ -0,0 +1,6 @@ + ; 🐟 для Специалиста + .tape spec-bin + .binfile hellospec + .org 0x100 + db 'wtf' + diff --git a/hello-v06c.asm b/hello-v06c.asm new file mode 100644 index 0000000..0450a05 --- /dev/null +++ b/hello-v06c.asm @@ -0,0 +1,6 @@ + ; 🐟 для Вектора-06ц + .tape v06c-rom + .binfile hellov06c + .org 0x100 + db 'wtf' + diff --git a/index.html b/index.html index 5cbaa81..6dbd9f8 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,7 @@ Pretty 8080 Assembler + @@ -66,6 +67,7 @@