vladstamate
Experienced Member
So I working on my emulator trying to get it working with the 5170 BIOS ( and I am stumped at this point):
Now the values for the upper and lower rate are those (very narrow range)
My emulator has problems hitting those but more importantly, doesn't this BIOS make some assumptions about the speed of the 286 CPU? If the 286 CPU is faster (or slower than it expects) the IN/TEST/LOOPZ code will execute at different speed and eventually fail the test and Halt the PC.
The BIOS named "BIOS_5170_15NOV85_U27_61X9266_27256" has the lower and uppser slightly different (therefore allowing for a larger variation) since I assume that by then there were faster 286es around but this still sounds like broken coding from IBM.
How is this correct?
Regards,
Vlad.
Code:
;----- VERIFY SPEED/REFRESH CLOCK RATES ( ERROR = 1 LONG AND 1 SHORT BEEP )
XOR BL,BL ; CLEAR REFRESH CYCLE REPEAT COUNT
XOR CX,CX ; INITIALIZE SPEED RATE REGISTER
EVEN ; PLACE ON EVEN WORD BOUNDARY
C34:
IN AL,PORT_B ; READ REFRESH BIT REGISTER
TEST AL,REFRFSH_BIT ; MASK FOR BIT
LOOPZ C34 ; DECREMENT LOOP COUNTER TILL ON
C35:
IN AL,PORT_B ; READ REFRESH BIT REGISTER
TEST AL,REFRFESH_BIT ; MASK FOR BIT
LOOPNZ C35 ; DECREMENT LOOP COUNTER TILL OFF
DEC BL ; DECREMENT REFRESH CYCLE REPEAT COUNT
JNZ C34 ; REPEAT TILL CYCLE COUNT DONE
CMP CX,RATE_UPPER ; CHECK FOR RATE BELOW UPPER LIMIT
JAE C36 ; SKIP ERROR BEEP IF BELOW MAXIMUM
C36E:
MOV DX,0101H ; GET BEEP COUNTS FOR REFRESH ERROR
CALL ERR_BEEP ; CALL TO POST ERROR BEEP ROUTINES
HLT ; HALT SYSTEM - BAD REFRESH RATE
C36:
CMP CX,RATE_LOWER ; CHECK FOR RATE ABOVE LOWER LIMIT
JA C36E ; GO TO ERROR BEEP IF BELOW MINIMUM
Now the values for the upper and lower rate are those (very narrow range)
Code:
RATE_UPPER EQU 0F8A7H ; 0F952H -10%
RATE_LOWER EQU 0F9F0H ; 0F952H -10%
My emulator has problems hitting those but more importantly, doesn't this BIOS make some assumptions about the speed of the 286 CPU? If the 286 CPU is faster (or slower than it expects) the IN/TEST/LOOPZ code will execute at different speed and eventually fail the test and Halt the PC.
The BIOS named "BIOS_5170_15NOV85_U27_61X9266_27256" has the lower and uppser slightly different (therefore allowing for a larger variation) since I assume that by then there were faster 286es around but this still sounds like broken coding from IBM.
How is this correct?
Regards,
Vlad.