Skip to content

Commit

Permalink
Apply conversion fixes by neozeed/starfrost
Browse files Browse the repository at this point in the history
  • Loading branch information
lotharsm committed Apr 27, 2024
1 parent 2d04cac commit 04dbaca
Show file tree
Hide file tree
Showing 1,019 changed files with 352,289 additions and 352,284 deletions.
206 changes: 103 additions & 103 deletions v4.0/src/BIOS/BIOSTRUC.INC
Original file line number Diff line number Diff line change
@@ -1,103 +1,103 @@
%OUT BIOSTRUC.INC...
; SCCSID = @(#)BIOSTRUC.INC 1.0 86/09/30
; ROM BIOS CALL PACKET STRUCTURES

;*******************************
;System Service call ( Int 15h )
;*******************************
;Function AH = 0C0h, Return system configuration
;For PC and PCJR on return:
; (AH) = 80h
; (CY) = 1
;For PCXT, PC PORTABLE and PCAT on return:
; (AH) = 86h
; (CY) = 1
;For all others:
; (AH) = 0
; (CY) = 0
; (ES:BX) = pointer to system descriptor vector in ROS
; System descriptor :
; DW xxxx length of descriptor in bytes,
; minimum length = 8
; DB xx model byte
; 0FFh = PC
; 0FEh = PC/XT, Portable
; 0FDh = PC/JR
; 0FCh = PC/AT, 6Mhz PC/AT,
; 6Mhz PC/AT running coprocessor(?),
; PS/2 Model 50, 50 z
; 0FAh = PS/2 Model 25, 30
; 0F9h = PC Convertible
; 0F8h = PS/2 Model 80
; 0F7h = Nova
; 0E0 thru 0EFh = reserved
;
; DB xx secondary model byte
; 000h = PC1
; 000h = PC/XT, Portable
; 000h = PC/JR
; 000h = PC/AT
; 001h = 6Mhz PC/AT
; 003h = 6Mhz PC/AT running coprocessor(?)
; 004h = PS/2 Model 50, 50z
; 001h = PS/2 Model 25
; 000h = PC Convertible
; 000h = PS/2 Model 80
; 000h = Nova
;
; DB xx bios revision level
; 00 for first release, subsequent release
; of code with same model byte and
; secondary model byte require revison level
; to increase by one.
;
; DB xx feature information byte 1
; X0000000 = 1, bios use DMA channel 3
; = 0, DMA channel 3 not used
;
; 0X000000 = 1, 2nd Interrupt chip present
; = 0, 2nd Interrupt chip not present
;
; 00X00000 = 1, Real Time Clock present
; = 0, Real Time Clock not present
;
; 000X0000 = 1, Keyboard escape sequence(INT15h)
; called in keyboard interrupt
; (Int 09h).
; = 0, Keyboard escape sequence not
; called.
; 0000XXXX reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;

BIOS_SYSTEM_DESCRIPTOR struc
bios_SD_leng dw ?
bios_SD_modelbyte db ?
bios_SD_scnd_modelbyte db ?
db ?
bios_SD_featurebyte1 db ?
db 4 dup (?)
BIOS_SYSTEM_DESCRIPTOR ends

;FeatureByte1 bit map equates
DMAchannel3 equ 10000000b
ScndIntController equ 01000000b
RealTimeClock equ 00100000b
KeyEscapeSeq equ 00010000b
;
;Model Byte
MDL_PC1 EQU 0FFH
MDL_XT EQU 0FEH
MDL_JR EQU 0FDH
MDL_AT EQU 0FCH
MDL_CONVERT EQU 0F9H

mdl_ps2_30 equ 0fah
mdl_ps2_80 equ 0f8h
%OUT BIOSTRUC.INC...
; SCCSID = @(#)BIOSTRUC.INC 1.0 86/09/30
; ROM BIOS CALL PACKET STRUCTURES

;*******************************
;System Service call ( Int 15h )
;*******************************
;Function AH = 0C0h, Return system configuration
;For PC and PCJR on return:
; (AH) = 80h
; (CY) = 1
;For PCXT, PC PORTABLE and PCAT on return:
; (AH) = 86h
; (CY) = 1
;For all others:
; (AH) = 0
; (CY) = 0
; (ES:BX) = pointer to system descriptor vector in ROS
; System descriptor :
; DW xxxx length of descriptor in bytes,
; minimum length = 8
; DB xx model byte
; 0FFh = PC
; 0FEh = PC/XT, Portable
; 0FDh = PC/JR
; 0FCh = PC/AT, 6Mhz PC/AT,
; 6Mhz PC/AT running coprocessor(?),
; PS/2 Model 50, 50 z
; 0FAh = PS/2 Model 25, 30
; 0F9h = PC Convertible
; 0F8h = PS/2 Model 80
; 0F7h = Nova
; 0E0 thru 0EFh = reserved
;
; DB xx secondary model byte
; 000h = PC1
; 000h = PC/XT, Portable
; 000h = PC/JR
; 000h = PC/AT
; 001h = 6Mhz PC/AT
; 003h = 6Mhz PC/AT running coprocessor(?)
; 004h = PS/2 Model 50, 50z
; 001h = PS/2 Model 25
; 000h = PC Convertible
; 000h = PS/2 Model 80
; 000h = Nova
;
; DB xx bios revision level
; 00 for first release, subsequent release
; of code with same model byte and
; secondary model byte require revison level
; to increase by one.
;
; DB xx feature information byte 1
; X0000000 = 1, bios use DMA channel 3
; = 0, DMA channel 3 not used
;
; 0X000000 = 1, 2nd Interrupt chip present
; = 0, 2nd Interrupt chip not present
;
; 00X00000 = 1, Real Time Clock present
; = 0, Real Time Clock not present
;
; 000X0000 = 1, Keyboard escape sequence(INT15h)
; called in keyboard interrupt
; (Int 09h).
; = 0, Keyboard escape sequence not
; called.
; 0000XXXX reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;

BIOS_SYSTEM_DESCRIPTOR struc
bios_SD_leng dw ?
bios_SD_modelbyte db ?
bios_SD_scnd_modelbyte db ?
db ?
bios_SD_featurebyte1 db ?
db 4 dup (?)
BIOS_SYSTEM_DESCRIPTOR ends

;FeatureByte1 bit map equates
DMAchannel3 equ 10000000b
ScndIntController equ 01000000b
RealTimeClock equ 00100000b
KeyEscapeSeq equ 00010000b
;
;Model Byte
MDL_PC1 EQU 0FFH
MDL_XT EQU 0FEH
MDL_JR EQU 0FDH
MDL_AT EQU 0FCH
MDL_CONVERT EQU 0F9H

mdl_ps2_30 equ 0fah
mdl_ps2_80 equ 0f8h
156 changes: 78 additions & 78 deletions v4.0/src/BIOS/CLOCKSUB.INC
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
;
; date_verify loosely checks bcd date values to be in range in bin_date_time
;
date_verify: ;
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,20h ; century check
ja date_error ; jmp error
jz century_20 ; jmp in 20th century
cmp byte ptr bin_date_time+0,19h ; century check
jb date_error ; jmp error
cmp byte ptr bin_date_time+1,80h ; year check
jb date_error ; jmp error
century_20: ;
cmp byte ptr bin_date_time+1,99h ; year check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,12h ; month check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,00h ; month check
jbe date_error ; jmp error
cmp byte ptr bin_date_time+3,31h ; day check
ja date_error ; jmp error
cmp byte ptr bin_date_time+3,00h ; day check
jbe date_error ; jmp error
clc ; set success flag
ret ;
date_error: ;
stc ; set error flag
ret ;

;
; time_verify very loosely checks bcd date values to be in range in bin_date_time
;
time_verify:
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,24H
ja time_error
cmp byte ptr bin_date_time+1,59H
ja time_error
cmp byte ptr bin_date_time+2,59H
ja time_error
clc
ret
time_error:
stc
ret

;
; bcd_verify checks values in bin_date_time to be valid
; bcd numerals. carry set if any nibble out of range
;
bcd_verify: ;
assume ds:code,es:nothing
mov cx,4 ; 4 bytes to check
mov bx,offset bin_date_time ;
bv_loop: ;
mov al,[bx] ; get a bcd number (0..99)
mov ah,al ;
and ax,0f00fh ; 10's place in high ah, 1's in al
cmp al,10 ; is 1's place in range?
ja bv_error ; jmp out of range
shr ah,1 ; swap nibbles
shr ah,1 ; ...
shr ah,1 ; ...
shr ah,1 ; ...
and ah,0fh ; get rid of any erroneous bits
cmp ah,10 ; is 10's place in range
ja bv_error ; jmp out of range
inc bx ; next byte
dec cx ;
jnz bv_loop ;
clc ; set success flag
ret ;
bv_error: ;
stc ; set error flag
ret ;
;
; Dos 3.30 - The real time clock structures were moved to msbio2.asm
;
;
; date_verify loosely checks bcd date values to be in range in bin_date_time
;
date_verify: ;
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,20h ; century check
ja date_error ; jmp error
jz century_20 ; jmp in 20th century
cmp byte ptr bin_date_time+0,19h ; century check
jb date_error ; jmp error
cmp byte ptr bin_date_time+1,80h ; year check
jb date_error ; jmp error
century_20: ;
cmp byte ptr bin_date_time+1,99h ; year check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,12h ; month check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,00h ; month check
jbe date_error ; jmp error
cmp byte ptr bin_date_time+3,31h ; day check
ja date_error ; jmp error
cmp byte ptr bin_date_time+3,00h ; day check
jbe date_error ; jmp error
clc ; set success flag
ret ;
date_error: ;
stc ; set error flag
ret ;

;
; time_verify very loosely checks bcd date values to be in range in bin_date_time
;
time_verify:
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,24H
ja time_error
cmp byte ptr bin_date_time+1,59H
ja time_error
cmp byte ptr bin_date_time+2,59H
ja time_error
clc
ret
time_error:
stc
ret

;
; bcd_verify checks values in bin_date_time to be valid
; bcd numerals. carry set if any nibble out of range
;
bcd_verify: ;
assume ds:code,es:nothing
mov cx,4 ; 4 bytes to check
mov bx,offset bin_date_time ;
bv_loop: ;
mov al,[bx] ; get a bcd number (0..99)
mov ah,al ;
and ax,0f00fh ; 10's place in high ah, 1's in al
cmp al,10 ; is 1's place in range?
ja bv_error ; jmp out of range
shr ah,1 ; swap nibbles
shr ah,1 ; ...
shr ah,1 ; ...
shr ah,1 ; ...
and ah,0fh ; get rid of any erroneous bits
cmp ah,10 ; is 10's place in range
ja bv_error ; jmp out of range
inc bx ; next byte
dec cx ;
jnz bv_loop ;
clc ; set success flag
ret ;
bv_error: ;
stc ; set error flag
ret ;
;
; Dos 3.30 - The real time clock structures were moved to msbio2.asm
;
Loading

0 comments on commit 04dbaca

Please sign in to comment.