From b21be43535ea073240d9d2d2d3a990958b341328 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 21 Sep 2020 19:23:33 -0400 Subject: [PATCH] Move 8086 assembler from B730 to B30 Also, move doc to doc/asm.txt. Also, fix the pcat recipe which was broken since the overlay change. I hadn't noticed it because I didn't have to rebuild the MBR. --- blk/001 | 5 +++-- blk/030 | 2 ++ blk/{751 => 031} | 0 blk/{752 => 032} | 0 blk/{753 => 033} | 0 blk/{754 => 034} | 0 blk/{755 => 035} | 0 blk/{756 => 036} | 0 blk/{757 => 037} | 0 blk/{758 => 038} | 0 blk/{760 => 040} | 0 blk/{761 => 041} | 0 blk/{762 => 042} | 0 blk/{763 => 043} | 0 blk/280 | 4 ++-- blk/730 | 15 --------------- blk/750 | 1 - doc/asm.txt | 29 +++++++++++++++++++++++++---- recipes/pcat/Makefile | 4 ++-- recipes/pcat/blk/612 | 2 +- recipes/pcat/mbr.fs | 4 ++-- 21 files changed, 37 insertions(+), 29 deletions(-) create mode 100644 blk/030 rename blk/{751 => 031} (100%) rename blk/{752 => 032} (100%) rename blk/{753 => 033} (100%) rename blk/{754 => 034} (100%) rename blk/{755 => 035} (100%) rename blk/{756 => 036} (100%) rename blk/{757 => 037} (100%) rename blk/{758 => 038} (100%) rename blk/{760 => 040} (100%) rename blk/{761 => 041} (100%) rename blk/{762 => 042} (100%) rename blk/{763 => 043} (100%) delete mode 100644 blk/730 delete mode 100644 blk/750 diff --git a/blk/001 b/blk/001 index 7ae197a..495f2a9 100644 --- a/blk/001 +++ b/blk/001 @@ -1,6 +1,7 @@ MASTER INDEX -005 Z80 assembler 30-99 unused +005 Z80 assembler 030 8086 assembler +50-99 unused 100 Block editor 120 Visual Editor 160-259 unused 260 Cross compilation 280 Z80 boot code 350 Core words @@ -8,5 +9,5 @@ MASTER INDEX 440-519 unused 520 Fonts 550-649 unused 650 AVR assembler 690 AVR SPI programmer -700-729 unused 730 8086 assembler +700-799 unused 800 8086 boot code diff --git a/blk/030 b/blk/030 new file mode 100644 index 0000000..56ea9c5 --- /dev/null +++ b/blk/030 @@ -0,0 +1,2 @@ +( 8086 assembler. See doc/asm.txt ) +1 13 LOADR+ diff --git a/blk/751 b/blk/031 similarity index 100% rename from blk/751 rename to blk/031 diff --git a/blk/752 b/blk/032 similarity index 100% rename from blk/752 rename to blk/032 diff --git a/blk/753 b/blk/033 similarity index 100% rename from blk/753 rename to blk/033 diff --git a/blk/754 b/blk/034 similarity index 100% rename from blk/754 rename to blk/034 diff --git a/blk/755 b/blk/035 similarity index 100% rename from blk/755 rename to blk/035 diff --git a/blk/756 b/blk/036 similarity index 100% rename from blk/756 rename to blk/036 diff --git a/blk/757 b/blk/037 similarity index 100% rename from blk/757 rename to blk/037 diff --git a/blk/758 b/blk/038 similarity index 100% rename from blk/758 rename to blk/038 diff --git a/blk/760 b/blk/040 similarity index 100% rename from blk/760 rename to blk/040 diff --git a/blk/761 b/blk/041 similarity index 100% rename from blk/761 rename to blk/041 diff --git a/blk/762 b/blk/042 similarity index 100% rename from blk/762 rename to blk/042 diff --git a/blk/763 b/blk/043 similarity index 100% rename from blk/763 rename to blk/043 diff --git a/blk/280 b/blk/280 index 9892f73..1bc50e8 100644 --- a/blk/280 +++ b/blk/280 @@ -1,8 +1,8 @@ Z80 boot code This assembles the boot binary. It requires the Z80 assembler -(B200) and cross compilation setup (B260). It requires some -constants to be set. See B420 for details. +(B5) and cross compilation setup (B260). It requires some +constants to be set. See doc/bootstrap.txt for details. RESERVED REGISTERS: At all times, IX points to RSP TOS and BC is IP. SP points to PSP TOS, but you can still use the stack diff --git a/blk/730 b/blk/730 deleted file mode 100644 index 0d11a61..0000000 --- a/blk/730 +++ /dev/null @@ -1,15 +0,0 @@ -8086 assembler - -Work in progress. Load with "750 LOAD". - -Mnemonics are followed by argument types. For example, MOVri, -moves 8-bit immediate to 8-bit register. - -'r' = 8-bit register 'x' = 16-bit register -'i' = 8-bit immediate 'I' = 16-bit immediate -'s' = SREG register - -Mnemonics that only have one signature (for example INT,) don't -have operands letters. - -For jumps, it's special. 's' is SHORT, 'n' is NEAR, 'f' is FAR. diff --git a/blk/750 b/blk/750 deleted file mode 100644 index 69e4b00..0000000 --- a/blk/750 +++ /dev/null @@ -1 +0,0 @@ -1 13 LOADR+ diff --git a/doc/asm.txt b/doc/asm.txt index d32ce8c..4e089b3 100644 --- a/doc/asm.txt +++ b/doc/asm.txt @@ -5,10 +5,10 @@ There are sections, below, for each supported architectures, but you should read this first section first to be familiar with those common, basic principles) -Words in the Z80 assembler (B5) allow you to assemble z80 bin- -aries. Being Forth words, opcode assembly is a bit different -than with a typical assembler. For example, what would tradi- -tionally be "ld a, b" would become "A B LDrr,". +Words in the Z80 assembler, loaded with "5 LOAD" allow you to +assemble z80 binaries. Being Forth words, opcode assembly is a +bit different than with a typical assembler. For example, what +would traditionally be "ld a, b" would become "A B LDrr,". Those opcode words, of which there is a complete list below, end with "," to indicate that their effect is to write (,) the cor- @@ -138,3 +138,24 @@ RR RRC SRL RRA RRCA CALL RST DJNZ DI EI EXDEHL EXX HALT NOP RET [,c] RETI RETN SCF + +# 8086 assembler + +Load with "30 LOAD". As with the Z80 assembler, it is incom- +plete. + +Mnemonics are followed by argument types. For example, MOVri, +moves 8-bit immediate to 8-bit register. + +'r' = 8-bit register 'x' = 16-bit register +'i' = 8-bit immediate 'I' = 16-bit immediate +'s' = SREG register + +Mnemonics that only have one signature (for example INT,) don't +have operands letters. + +For jumps, it's special. 's' is SHORT, 'n' is NEAR, 'f' is FAR. + +# 8086 Instructions list + +TODO diff --git a/recipes/pcat/Makefile b/recipes/pcat/Makefile index 66f1509..1740ef9 100644 --- a/recipes/pcat/Makefile +++ b/recipes/pcat/Makefile @@ -18,8 +18,8 @@ blkfs: $(BLKPACK) $(STAGE): $(MAKE) -C $(CDIR) stage -mbr.bin: mbr.fs $(STAGE) - cat mbr.fs | $(STAGE) > $@ +mbr.bin: mbr.fs $(STAGE) blkfs + cat mbr.fs | $(STAGE) blkfs > $@ $(TARGET): mbr.bin os.bin cat mbr.bin os.bin > $@ diff --git a/recipes/pcat/blk/612 b/recipes/pcat/blk/612 index bf847f9..83c2a44 100644 --- a/recipes/pcat/blk/612 +++ b/recipes/pcat/blk/612 @@ -1,7 +1,7 @@ 0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR RS_ADDR 0x80 - CONSTANT SYSVARS -750 LOAD ( 8086 asm ) +30 LOAD ( 8086 asm ) 262 LOAD ( xcomp ) 270 LOAD ( xcomp overrides ) 805 820 LOADR ( 8086 boot code ) 353 LOAD ( xcomp core low ) diff --git a/recipes/pcat/mbr.fs b/recipes/pcat/mbr.fs index a1c67c7..6feec20 100644 --- a/recipes/pcat/mbr.fs +++ b/recipes/pcat/mbr.fs @@ -1,4 +1,4 @@ -750 LOAD -832 LOAD +30 LOAD +602 LOAD ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!