Pārlūkot izejas kodu

Run "all" tests under the 8086 emulator

master
Virgil Dupras pirms 3 gadiem
vecāks
revīzija
c912158744
5 mainītis faili ar 28 papildinājumiem un 3 dzēšanām
  1. +1
    -1
      blk/458
  2. +18
    -2
      emul/8086/forth.c
  3. +3
    -0
      emul/8086/xcomp.fs
  4. +1
    -0
      tests/Makefile
  5. +5
    -0
      tests/all/runtests.sh

+ 1
- 1
blk/458 Parādīt failu

@@ -1,4 +1,4 @@
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
CODE BYE HLT, BEGIN, JMPs, AGAIN, ;CODE
CODE S= 2 chkPS,
SI POPx, DI POPx, CH CH XORrr, CL [SI] MOVr[],
CL [DI] CMPr[],


+ 18
- 2
emul/8086/forth.c Parādīt failu

@@ -28,6 +28,7 @@ INT 2: KEY. AL = char read
INT 3: AT-XY. AL = x, BL = y
INT 4: BLKREAD. AX = blkid, BX = dest addr
INT 5: BLKWRITE. AX = blkid, BX = src addr
INT 6: RETCODE. AX = retcode.
*/

void int1() {
@@ -45,7 +46,17 @@ void int1() {
}

void int2() {
regs.byteregs[regal] = getchar();
int c;
if (fp != NULL) {
c = getc(fp);
} else {
// debug_panel();
c = wgetch(w);
}
if (c == EOF) {
c = 4; // ASCII EOT
}
regs.byteregs[regal] = c;
}

void int3() {
@@ -70,6 +81,10 @@ void int5() {
}
}

void int6() {
retcode = getreg16(regax);
}

int main(int argc, char *argv[])
{
INTHOOKS[1] = int1;
@@ -77,6 +92,7 @@ int main(int argc, char *argv[])
INTHOOKS[3] = int3;
INTHOOKS[4] = int4;
INTHOOKS[5] = int5;
INTHOOKS[6] = int6;
reset86();
fprintf(stderr, "Using blkfs %s\n", BLKFS_PATH);
blkfp = fopen(BLKFS_PATH, "r+");
@@ -131,5 +147,5 @@ int main(int argc, char *argv[])
//emul_printdebug();
}

return 0;
return retcode;
}

+ 3
- 0
emul/8086/xcomp.fs Parādīt failu

@@ -13,6 +13,9 @@ CODE _ BX POPx, AX POPx, 4 INT, ;CODE
: EFS@ BLK( _ ;
CODE _ BX POPx, AX POPx, 5 INT, ;CODE
: EFS! BLK( _ ;
( 8086 port doesn't define PC@ and PC!, but test harness uses
it. Our forth binary uses INT 6 for retcode. )
CODE PC! AX POPx, ( discard ) AX POPx, 6 INT, ;CODE
380 LOAD ( xcomp core high )
(entry) _ ( Update LATEST ) PC ORG @ 8 + !
," BLK$ "


+ 1
- 0
tests/Makefile Parādīt failu

@@ -2,5 +2,6 @@
run:
$(MAKE) -C ../cvm all
$(MAKE) -C ../emul/z80 all
$(MAKE) -C ../emul/8086 all
cd all && ./runtests.sh
cd z80 && ./runtests.sh

+ 5
- 0
tests/all/runtests.sh Parādīt failu

@@ -3,6 +3,7 @@
BASE=../..
CVM="${BASE}/cvm/forth"
Z80="${BASE}/emul/z80/forth"
I8086="${BASE}/emul/8086/forth"
TMP=$(mktemp)

chk() {
@@ -15,6 +16,10 @@ chk() {
if ! ${Z80} ${TMP}; then
exit 1
fi
echo "Running test $1 under 8086"
if ! ${I8086} ${TMP}; then
exit 1
fi
}

if [ ! -z $1 ]; then


Notiek ielāde…
Atcelt
Saglabāt