|
35 | 35 | ; - Other Clock Types:
|
36 | 36 | ; - MSM-58321: 2C0, 27E, 37E, 02A2-02A3?
|
37 | 37 | ; - INT 1Ah services 6h and 7h (where supported)
|
| 38 | +; - Clean up include/config file structure |
| 39 | +; - Command line build process |
38 | 40 | ;
|
39 | 41 | ; https://bochs.sourceforge.io/techspec/PORTS.LST
|
40 | 42 | ;
|
41 | 43 | ;----------------------------------------------------------------------------;
|
42 | 44 | VER_NAME EQU 'GLaTICK'
|
43 | 45 | VER_NUM EQU '0.8.6' ; (max 6 chars)
|
44 |
| -VER_DATE EQU '08/14/23' ; must be MM/DD/YY format |
| 46 | +VER_DATE EQU '08/18/23' ; must be MM/DD/YY format |
45 | 47 | COPY_YEAR EQU '2023'
|
46 | 48 |
|
47 | 49 | ;----------------------------------------------------------------------------;
|
@@ -736,33 +738,31 @@ TIME_TO_TICKS PROC
|
736 | 738 | ADD AX, CX ; AX = total minutes (hour + min)
|
737 | 739 | MOV CL, 60 ; convert minutes to seconds
|
738 | 740 | MUL CX ; DX:AX = total seconds (hour + min)
|
739 |
| - ADD AX, DI ; add second to sum |
| 741 | + ADD DI, AX ; add second to sum |
740 | 742 | ADC DX, 0 ; carry to high word
|
| 743 | + PUSHF ; ZF if seconds < 65536 |
741 | 744 |
|
742 | 745 | ;----------------------------------------------------------------------------;
|
743 | 746 | ; Convert Ticks = seconds * 1193180 / 65536
|
744 | 747 | ;
|
745 | 748 | ; This is a 21 bit x 17 bit multiply, which can be simplified for 16 bit
|
746 |
| -; operations by adjusting to a 22 x 16 bit multiply using the following: |
747 |
| -; A*B == A/2 * B*2 + B[A is odd] |
748 |
| -; |
749 |
| - SHR DX, 1 ; divide seconds by 2 to fit in word |
750 |
| - RCR AX, 1 ; shift into high bit of low word |
751 |
| - PUSHF ; save CF if odd |
752 |
| - XCHG AX, DI ; DI = low total seconds (hour + min) |
753 |
| - MOV AX, 34DCH * 2 ; low ( 1193180 * 2 ) |
754 |
| - MUL DI ; DX:AX = low ( ticks * 2 ) * sec / 2 |
755 |
| - POPF ; restore CF |
756 |
| - JNC TTT_EVEN_SEC ; skip if even |
757 |
| - ADD AX, 34DCH ; add 1 second of ticks if an odd second |
758 |
| - ADC DX, 12H ; was shifted off |
759 |
| -TTT_EVEN_SEC: |
| 749 | +; operations by using the following: |
| 750 | +; (AX * 1193180) >> 8 + DX * 1193180 |
| 751 | +; |
| 752 | + MOV AX, 34DCH ; low ( 1193180 * 2 ) |
| 753 | + MUL DI ; DX = low ( ticks * sec ) >> 8 |
760 | 754 | MOV CX, DX ; CX:AX = working product
|
761 |
| - MOV AX, 12H * 2 ; high ( 1193180 * 2 ) |
762 |
| - MUL DI ; DX:AX = high ( ticks * 2 ) * sec / 2 |
763 |
| - ADD CX, AX ; add working products |
764 |
| - ADC DX, 0 ; carry to high word |
765 |
| - XCHG DX, CX ; move to CX:DX |
| 755 | + MOV AX, 12H ; high ( 1193180 * 2 ) |
| 756 | + MUL DI ; DX:AX = high ( ticks * sec ) |
| 757 | + ADD AX, CX ; add working products and carry |
| 758 | + ADC DX, 0 ; DX:AX = ( AX * 1193180 ) >> 8 |
| 759 | + POPF ; restore ZF |
| 760 | + JZ TTT_HIGH ; jump if < 65536 |
| 761 | + ADD AX, 34DCH ; add 1 second of ticks to high word |
| 762 | + ADC DX, 12H ; if high bit (17) was 1 |
| 763 | +TTT_HIGH: |
| 764 | + XCHG AX, DX ; move to CX:DX |
| 765 | + XCHG AX, CX |
766 | 766 | POP DI
|
767 | 767 | RET
|
768 | 768 | TIME_TO_TICKS ENDP
|
|
0 commit comments