Ok, here are the code changes, plus build fix, plus new regression
test, plus new regression tests results. These code changes are all
against the latest (2006-12-04) source.
I have run all the wasm regression tests, and only one of them had
a difference, and that difference (adding DATA to tiny) was expected,
and I have updated the test results to reflect that.
I am unable to run the wcc regression test cases because I am
unable to build wcc. I am unable to test that the build works,
because I am unable to build the build. Can someone help me
out in doing both of these tasks? I would very much like to get
these changes into 1.6 so that I don't need to maintain separate
source code.
Thanks. Paul.
Index: ow/bld/builder/master.mif
diff -c ow/bld/builder/master.mif:1.1.1.1 ow/bld/builder/master.mif:1.2
*** ow/bld/builder/master.mif:1.1.1.1 Wed Nov 29 12:58:38 2006
--- ow/bld/builder/master.mif Wed Nov 29 13:39:00 2006
***************
*** 47,53 ****
$(cl) $(clflags) $<
!ifndef __$(host_os)__ # Don't copy unless host_os=build_os
!else ifndef __UNIX__ # Avoid "text file busy".
! copy $^. $(%OWBINDIR)\ > nul # MS-influenced command noisy
!endif
!endif
--- 47,53 ----
$(cl) $(clflags) $<
!ifndef __$(host_os)__ # Don't copy unless host_os=build_os
!else ifndef __UNIX__ # Avoid "text file busy".
! copy $^. $(%OWBINDIR) > nul # MS-influenced command noisy
!endif
!endif
***************
*** 57,63 ****
!else ifdef __UNIX__
cp $^. $(%OWBINDIR)/$^& # Remove .exe from working name
!else
! copy $^. $(%OWBINDIR)\ > nul # MS-influenced command noisy
!endif
# runasdos will run itself under dosemu. Copy once for each program that still
--- 57,63 ----
!else ifdef __UNIX__
cp $^. $(%OWBINDIR)/$^& # Remove .exe from working name
!else
! copy $^. $(%OWBINDIR) > nul # MS-influenced command noisy
!endif
# runasdos will run itself under dosemu. Copy once for each program that still
Index: ow/bld/wasm/c/asmline.c
diff -c ow/bld/wasm/c/asmline.c:1.1.1.3 ow/bld/wasm/c/asmline.c:1.7
*** ow/bld/wasm/c/asmline.c:1.1.1.3 Mon Dec 04 19:31:00 2006
--- ow/bld/wasm/c/asmline.c Mon Dec 04 20:22:44 2006
***************
*** 151,157 ****
skip = TRUE;
break;
case '\n':
- #if 0
/* Paul Edwards */
/* if continuation character found, pass over newline */
if( (got_something == TRUE) && (*(ptr - 1) == '\\') ) {
--- 151,156 ----
***************
*** 160,166 ****
LineNumber++;
continue; /* don't store character in string */
}
- #endif
*ptr = '\0';
// fall through
case '\0':
--- 159,164 ----
Index: ow/bld/wasm/c/asmscan.c
diff -c ow/bld/wasm/c/asmscan.c:1.1.1.1 ow/bld/wasm/c/asmscan.c:1.3
*** ow/bld/wasm/c/asmscan.c:1.1.1.1 Wed Nov 29 12:59:14 2006
--- ow/bld/wasm/c/asmscan.c Tue Dec 05 06:21:02 2006
***************
*** 614,620 ****
CurrString = string;
output_ptr = stringbuf;
! for( ptr = string; ; ) {
AsmBuffer[buf_index]->string_ptr = output_ptr;
while( isspace( *ptr ) ) {
--- 614,626 ----
CurrString = string;
output_ptr = stringbuf;
! ptr = string;
! /* skip initial spaces and expansion codes */
! while( isspace( *ptr ) || (*ptr == '%') ) {
! ptr++;
! }
!
! for( ; ; ) {
AsmBuffer[buf_index]->string_ptr = output_ptr;
while( isspace( *ptr ) ) {
Index: ow/bld/wasm/c/direct.c
diff -c ow/bld/wasm/c/direct.c:1.1.1.3 ow/bld/wasm/c/direct.c:1.13
*** ow/bld/wasm/c/direct.c:1.1.1.3 Mon Dec 04 19:31:00 2006
--- ow/bld/wasm/c/direct.c Mon Dec 04 20:25:38 2006
***************
*** 2043,2049 ****
InputQueueLine( get_sim_code_end( buffer, Options.text_seg ) );
/* Generates codes for data segment */
! if( type != MOD_TINY ) {
InputQueueLine( SimCodeBegin[bit][SIM_DATA] );
InputQueueLine( SimCodeEnd[SIM_DATA] );
}
--- 2043,2049 ----
InputQueueLine( get_sim_code_end( buffer, Options.text_seg ) );
/* Generates codes for data segment */
! if( 1 ) { /* type != MOD_TINY */
InputQueueLine( SimCodeBegin[bit][SIM_DATA] );
InputQueueLine( SimCodeEnd[SIM_DATA] );
}
***************
*** 2053,2060 ****
switch( type ) {
case MOD_TINY:
strcat( buffer, Options.text_seg );
! InputQueueLine( buffer );
! break;
case MOD_SMALL:
case MOD_COMPACT:
case MOD_MEDIUM:
--- 2053,2060 ----
switch( type ) {
case MOD_TINY:
strcat( buffer, Options.text_seg );
! strcat( buffer, ", ");
! /* fall through */
case MOD_SMALL:
case MOD_COMPACT:
case MOD_MEDIUM:
***************
*** 2066,2073 ****
}
ModelAssumeInit();
- #if 0
/* Paul Edwards */
{
int modelnum = -1;
/* Fix up PTR size */
--- 2066,2073 ----
}
ModelAssumeInit();
/* Paul Edwards */
+ if (ModuleInfo.init == FALSE)
{
int modelnum = -1;
/* Fix up PTR size */
***************
*** 2136,2142 ****
InputQueueLine( buffer );
}
}
- #endif
}
void ModuleInit( void )
--- 2136,2141 ----
***************
*** 2753,2759 ****
case TOK_PROC_VARARG:
return( 0 );
default:
- #if 0
if ( type == TOK_EXT_PTR ) {
if( ( ModuleInfo.model == MOD_COMPACT )
|| ( ModuleInfo.model == MOD_LARGE )
--- 2752,2757 ----
***************
*** 2762,2768 ****
}
else return ( 2 );
}
- #endif
return( ERROR );
}
}
--- 2760,2765 ----
Index: ow/bld/wasm/h/directd.h
diff -c ow/bld/wasm/h/directd.h:1.1.1.3 ow/bld/wasm/h/directd.h:1.4
*** ow/bld/wasm/h/directd.h:1.1.1.3 Mon Dec 04 19:30:42 2006
--- ow/bld/wasm/h/directd.h Mon Dec 04 20:22:10 2006
***************
*** 62,71 ****
fix( TOK_EXT_SBYTE, "SBYTE", MT_BYTE, 0 ),
fix( TOK_EXT_WORD, "WORD", MT_WORD, 0 ),
fix( TOK_EXT_SWORD, "SWORD", MT_WORD, 0 ),
- #if 0
- /* Paul Edwards */
fix( TOK_EXT_PTR, "PTR", MT_WORD, 0 ),
- #endif
fix( TOK_EXT_DWORD, "DWORD", MT_DWORD, 0 ),
fix( TOK_EXT_SDWORD, "SDWORD", MT_DWORD, 0 ),
fix( TOK_EXT_PWORD, "PWORD", MT_FWORD, 0 ),
--- 62,68 ----
Index: ow/bld/wasm/test/test1/beep.esm
diff -c ow/bld/wasm/test/test1/beep.esm:1.1.1.1 ow/bld/wasm/test/test1/beep.esm:1.2
*** ow/bld/wasm/test/test1/beep.esm:1.1.1.1 Wed Nov 29 12:59:12 2006
--- ow/bld/wasm/test/test1/beep.esm Tue Dec 05 06:26:30 2006
***************
*** 1,13 ****
.387
! DGROUP GROUP _TEXT
_TEXT SEGMENT WORD PUBLIC USE16 'CODE'
ASSUME CS:DGROUP, DS:DGROUP, SS:DGROUP
! mov ah,2
! mov dl,7
! int 21H
! mov ah,2
! mov dl,7
! int 21H
! ret
_TEXT ENDS
END
--- 1,15 ----
.387
! DGROUP GROUP _TEXT,_DATA
_TEXT SEGMENT WORD PUBLIC USE16 'CODE'
ASSUME CS:DGROUP, DS:DGROUP, SS:DGROUP
! mov ah,2
! mov dl,7
! int 21H
! mov ah,2
! mov dl,7
! int 21H
! ret
_TEXT ENDS
+ _DATA SEGMENT WORD PUBLIC USE16 'DATA'
+ _DATA ENDS
END
Index: ow/bld/wasm/test/test3/makefile
diff -c ow/bld/wasm/test/test3/makefile:1.1.1.1 ow/bld/wasm/test/test3/makefile:1.2
*** ow/bld/wasm/test/test3/makefile:1.1.1.1 Wed Nov 29 12:59:12 2006
--- ow/bld/wasm/test/test3/makefile Tue Dec 05 06:47:54 2006
***************
*** 44,49 ****
--- 44,50 ----
sse3 &
struct1 &
structdd &
+ support &
tbyte &
testequ &
tst1
***************
*** 57,61 ****
--- 58,63 ----
asm_flags_callcnv5 = -zcm
asm_flags_jmpshrt = -zcm
asm_flags_retiret = -zcm
+ asm_flags_support = -zcm -Dmemodel=large
!include ../test.mif
Index: ow/bld/wasm/test/test3/support.asm
diff -c /dev/null ow/bld/wasm/test/test3/support.asm:1.1
*** /dev/null Tue Dec 05 08:58:58 2006
--- ow/bld/wasm/test/test3/support.asm Tue Dec 05 06:51:08 2006
***************
*** 0 ****
--- 1,240 ----
+ ; support.asm - assembler support functions for DOS
+ ;
+ ; This program written by Paul Edwards
+ ; Released to the public domain
+
+ % .model memodel, c
+
+ assume cs:_TEXT, ds:DGROUP
+
+ _DATA segment word public 'DATA'
+ _DATA ends
+ _BSS segment word public 'BSS'
+ _BSS ends
+
+ _TEXT segment word public 'CODE'
+
+ public int86
+ int86 proc uses ax bx cx dx si di ds es, \
+ intnum:word, regsin:ptr, regsout:ptr
+
+ if @DataSize
+ lds si, regsin
+ else
+ mov si, regsin
+ endif
+
+ mov ax, word ptr [si + 0]
+ mov bx, word ptr [si + 2]
+ mov cx, word ptr [si + 4]
+ mov dx, word ptr [si + 6]
+ mov di, word ptr [si + 10]
+ mov si, word ptr [si + 8]
+
+ push bp
+
+ cmp intnum, 08h
+ jne not8
+ int 08h
+ jmp fintry
+ not8:
+
+ cmp intnum, 09h
+ jne not9
+ int 09h
+ jmp fintry
+ not9:
+
+ cmp intnum, 010h
+ jne not10
+ int 010h
+ jmp fintry
+ not10:
+
+ cmp intnum, 013h
+ jne not13
+ int 013h
+ jmp fintry
+ not13:
+
+ cmp intnum, 015h
+ jne not15
+ clc ; interrupt doesn't set it it seems
+ int 015h
+ jmp fintry
+ not15:
+
+ cmp intnum, 016h
+ jne not16
+ int 016h
+ jmp fintry
+ not16:
+
+ cmp intnum, 020h
+ jne not20
+ int 020h
+ jmp fintry
+ not20:
+
+ cmp intnum, 021h
+ jne not21
+ int 021h
+ jmp fintry
+ not21:
+
+ fintry:
+
+ pop bp
+ push si
+
+ if @DataSize
+ lds si, regsout
+ else
+ mov si, regsout
+ endif
+
+ mov [si + 0], ax
+ mov [si + 2], bx
+ mov [si + 4], cx
+ mov [si + 6], dx
+ mov [si + 10], di
+ pop ax ; actually si
+ mov [si + 8], ax
+ mov word ptr [si + 12], 0
+ jnc flagclear
+ mov word ptr [si + 12], 1
+ flagclear:
+ pushf
+ pop ax
+ mov word ptr [si + 14], ax
+
+ ret
+ int86 endp
+
+
+
+ public int86x
+ int86x proc uses ax bx cx dx si di ds es, \
+ intnum:word, regsin:ptr, regsout:ptr, sregs:ptr
+
+ push ds; for restoration after interrupt
+
+ if @DataSize
+ lds si, sregs
+ else
+ mov si, sregs
+ endif
+
+ mov es, [si + 6]
+ push es ; new value for ds
+
+ mov es, [si + 0]
+
+ if @DataSize
+ lds si, regsin
+ else
+ mov si, regsin
+ endif
+
+ mov ax, word ptr [si + 0]
+ mov bx, word ptr [si + 2]
+ mov cx, word ptr [si + 4]
+ mov dx, word ptr [si + 6]
+ mov di, word ptr [si + 10]
+ mov si, word ptr [si + 8]
+
+ pop ds; load previously saved value for ds
+
+ cmp intnum, 08h
+ jne xnot8
+ int 08h
+ jmp xfintry
+ xnot8:
+
+ cmp intnum, 09h
+ jne xnot9
+ int 09h
+ jmp xfintry
+ xnot9:
+
+ cmp intnum, 010h
+ jne xnot10
+ int 010h
+ jmp xfintry
+ xnot10:
+
+ cmp intnum, 013h
+ jne xnot13
+ int 013h
+ jmp xfintry
+ xnot13:
+
+ cmp intnum, 015h
+ jne xnot15
+ clc ; interrupt doesn't set it it seems
+ int 015h
+ jmp xfintry
+ xnot15:
+
+ cmp intnum, 016h
+ jne xnot16
+ int 016h
+ jmp xfintry
+ xnot16:
+
+ cmp intnum, 021h
+ jne xnot21
+ int 021h
+ jmp xfintry
+ xnot21:
+
+ xfintry:
+
+ push es
+ push ds
+ push si
+ push ax
+ push bp
+
+ mov bp, sp
+ mov ax, [bp+10]; restore ds immediately, can't move without it
+ pop bp
+ mov ds, ax
+
+ if @DataSize
+ lds si, regsout
+ else
+ mov si, regsout
+ endif
+
+ pop ax
+ mov [si + 0], ax
+ mov [si + 2], bx
+ mov [si + 4], cx
+ mov [si + 6], dx
+ mov [si + 10], di
+ pop ax
+ mov [si + 8], ax ; si
+ mov word ptr [si + 12], 0
+ jnc xflagclear
+ mov word ptr [si + 12], 1
+ xflagclear:
+
+ if @DataSize
+ lds si, sregs
+ else
+ mov si, sregs
+ endif
+
+ pop ax
+ mov [si + 6], ax; restore ds
+ pop ax
+ mov [si + 0], ax ; restore es
+
+ pop ds ; restore value saved over interrupt (but accessed directly already)
+ ret
+ int86x endp
+
+ _TEXT ends
+
+ end
Index: ow/bld/wasm/test/test3/support.esm
diff -c /dev/null ow/bld/wasm/test/test3/support.esm:1.1
*** /dev/null Tue Dec 05 08:58:58 2006
--- ow/bld/wasm/test/test3/support.esm Tue Dec 05 06:46:00 2006
***************
*** 0 ****
--- 1,200 ----
+ .387
+ PUBLIC _int86
+ PUBLIC _int86x
+ DGROUP GROUP _DATA
+ support_TEXT SEGMENT WORD PUBLIC USE16 'CODE'
+ support_TEXT ENDS
+ _DATA SEGMENT WORD PUBLIC USE16 'DATA'
+ _DATA ENDS
+ _BSS SEGMENT WORD PUBLIC USE16 'BSS'
+ _BSS ENDS
+
+ _TEXT SEGMENT WORD PUBLIC USE16 'CODE'
+ ASSUME CS:_TEXT, DS:DGROUP, SS:DGROUP
+ _int86:
+ push bp
+ mov bp,sp
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push ds
+ push es
+ lds si,dword ptr 8[bp]
+ mov ax,word ptr [si]
+ mov bx,word ptr 2[si]
+ mov cx,word ptr 4[si]
+ mov dx,word ptr 6[si]
+ mov di,word ptr 0aH[si]
+ mov si,word ptr 8[si]
+ push bp
+ cmp word ptr 6[bp],8
+ jne L$1
+ int 8
+ jmp L$8
+ L$1:
+ cmp word ptr 6[bp],9
+ jne L$2
+ int 9
+ jmp L$8
+ L$2:
+ cmp word ptr 6[bp],10H
+ jne L$3
+ int 10H
+ jmp L$8
+ L$3:
+ cmp word ptr 6[bp],13H
+ jne L$4
+ int 13H
+ jmp L$8
+ L$4:
+ cmp word ptr 6[bp],15H
+ jne L$5
+ clc
+ int 15H
+ jmp L$8
+ L$5:
+ cmp word ptr 6[bp],16H
+ jne L$6
+ int 16H
+ jmp L$8
+ L$6:
+ cmp word ptr 6[bp],20H
+ jne L$7
+ int 20H
+ jmp L$8
+ L$7:
+ cmp word ptr 6[bp],21H
+ jne L$8
+ int 21H
+ jmp L$8
+ L$8:
+ pop bp
+ push si
+ lds si,dword ptr 0cH[bp]
+ mov word ptr [si],ax
+ mov word ptr 2[si],bx
+ mov word ptr 4[si],cx
+ mov word ptr 6[si],dx
+ mov word ptr 0aH[si],di
+ pop ax
+ mov word ptr 8[si],ax
+ mov word ptr 0cH[si],0
+ jae L$9
+ mov word ptr 0cH[si],1
+ L$9:
+ pushf
+ pop ax
+ mov word ptr 0eH[si],ax
+ pop es
+ pop ds
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ pop bp
+ retf
+ _int86x:
+ push bp
+ mov bp,sp
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push ds
+ push es
+ push ds
+ lds si,dword ptr 10H[bp]
+ mov es,word ptr 6[si]
+ push es
+ mov es,word ptr [si]
+ lds si,dword ptr 8[bp]
+ mov ax,word ptr [si]
+ mov bx,word ptr 2[si]
+ mov cx,word ptr 4[si]
+ mov dx,word ptr 6[si]
+ mov di,word ptr 0aH[si]
+ mov si,word ptr 8[si]
+ pop ds
+ cmp word ptr 6[bp],8
+ jne L$10
+ int 8
+ jmp L$16
+ L$10:
+ cmp word ptr 6[bp],9
+ jne L$11
+ int 9
+ jmp L$16
+ L$11:
+ cmp word ptr 6[bp],10H
+ jne L$12
+ int 10H
+ jmp L$16
+ L$12:
+ cmp word ptr 6[bp],13H
+ jne L$13
+ int 13H
+ jmp L$16
+ L$13:
+ cmp word ptr 6[bp],15H
+ jne L$14
+ clc
+ int 15H
+ jmp L$16
+ L$14:
+ cmp word ptr 6[bp],16H
+ jne L$15
+ int 16H
+ jmp L$16
+ L$15:
+ cmp word ptr 6[bp],21H
+ jne L$16
+ int 21H
+ jmp L$16
+ L$16:
+ push es
+ push ds
+ push si
+ push ax
+ push bp
+ mov bp,sp
+ mov ax,word ptr 0aH[bp]
+ pop bp
+ mov ds,ax
+ lds si,dword ptr 0cH[bp]
+ pop ax
+ mov word ptr [si],ax
+ mov word ptr 2[si],bx
+ mov word ptr 4[si],cx
+ mov word ptr 6[si],dx
+ mov word ptr 0aH[si],di
+ pop ax
+ mov word ptr 8[si],ax
+ mov word ptr 0cH[si],0
+ jae L$17
+ mov word ptr 0cH[si],1
+ L$17:
+ lds si,dword ptr 10H[bp]
+ pop ax
+ mov word ptr 6[si],ax
+ pop ax
+ mov word ptr [si],ax
+ pop ds
+ pop es
+ pop ds
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ pop bp
+ retf
+ _TEXT ENDS
+ END