linux build fixes

This commit is contained in:
David Lee 2024-07-05 14:18:32 -07:00
parent 11799f7f20
commit 4eb1c56e0d
4 changed files with 147 additions and 2 deletions

View File

@ -1,8 +1,8 @@
str=$(tr '[a-z]' '[A-Z]' <<< $1) str=$(tr '[a-z]' '[A-Z]' <<< $1)
rem -h flag is required for pas2 and generated apps so the top of ram is on a 64k-1 boundary # -h flag is required for pas2 and generated apps so the top of ram is on a 64k-1 boundary
rem due to bugs in the apps that try to copy 64k-1 bytes of ram and wrap. # due to bugs in the apps that try to copy 64k-1 bytes of ram and wrap.
rm $str.EXE 2>/dev/null rm $str.EXE 2>/dev/null
rm $str.COD 2>/dev/null rm $str.COD 2>/dev/null

View File

@ -0,0 +1,121 @@
; utility functions for calling into DOS from Microsoft Pascal v1 through v4
;
; function dostime : word; External;
; var startTicks: word;
; startTicks := dostime;
;
; function getpsp : word; External;
; var psp : word;
; psp := getpsp;
;
; function pspbyte( offset : word ) : integer; External;
; var result : integer;
; result := pspbyte( 80 ); { get command tail length }
;
.model large
code segment
assume cs:code
; returns a count of hundredths of a second in ax
; only uses hs, seconds, and the low digit of minutes since that's all that fits in two bytes
; 54000 = 9 * 60 * 100
; + 5900 = 59 * 100
; + 99
; --------
; 59999
public getticks
getticks PROC FAR
push bx
push cx
push dx
push di
push si
mov ah, 2ch
int 21h
push dx
mov ah, 0
mov al, dh
mov bx, 100
mul bx
pop dx
mov dh, 0
add ax, dx
push ax
mov ax, cx
and ax, 0ffh
mov cx, 10
mov dx, 0
div cx
mov ax, dx
mov cx, 6000
mul cx
pop bx
add ax, bx
pop si
pop di
pop dx
pop cx
pop bx
ret
getticks ENDP
public getpsp
getpsp PROC FAR
push bx
push cx
push dx
push di
push si
mov ah, 062h
int 21h
mov ax, bx
pop si
pop di
pop dx
pop cx
pop bx
ret
getpsp ENDP
public pspbyte
pspbyte PROC FAR
push bx
push cx
push dx
push di
push si
push es
push bp
mov bp, sp
mov ah, 062h
int 21h
mov es, bx
; the argument is here. 7 pushes above + 2 for the return address = 9 * 2 = 18.
mov bx, word ptr[ bp + 18 ]
xor ah, ah
mov al, byte ptr es: [ bx ]
pop bp
pop es
pop si
pop di
pop dx
pop cx
pop bx
ret
pspbyte ENDP
code ends
end

24
Microsoft Pascal v2/m.sh Normal file
View File

@ -0,0 +1,24 @@
str=$(tr '[a-z]' '[A-Z]' <<< $1)
# -h flag is required for pas2 and generated apps so the top of ram is on a 64k-1 boundary
# due to bugs in the apps that try to copy 64k-1 bytes of ram and wrap.
rm $str.EXE 2>/dev/null
rm $str.COD 2>/dev/null
rm $str.LST 2>/dev/null
rm $str.MAP 2>/dev/null
rm $str.OBJ 2>/dev/null
ntvdm -r:. -u -c pas1 $str,$str,$str,$str
rm CON.LST 2>/dev/null
ntvdm -r:. -u -h -c pas2
ntvdm -r:. -u -c link $str djldos,,,,
rm $str.COD 2>/dev/null
rm $str.LST 2>/dev/null
rm $str.MAP 2>/dev/null
rm $str.OBJ 2>/dev/null
ntvdm -h -p $str