Changeset 242 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
- Timestamp:
- Feb 10, 2012, 3:12:40 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r235 r242 22 22 ePUSH_T ax, ROMVARS.szTitle ; Bios title string 23 23 push cs ; BIOS segment 24 25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 24 25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 26 26 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 27 27 … … 32 32 ; CS:CX: Ptr to "Master" or "Slave" string 33 33 ; CS:BP: Ptr to IDEVARS 34 ; SI: Ptr to template string 34 ; SI: Ptr to template string 35 35 ; Returns: 36 36 ; Nothing … … 44 44 ; DL=COM number character, DH=.bDevice 45 45 46 push bp ; setup stack for call to 46 push bp ; setup stack for call to 47 47 mov bp, sp ; BootMenuPrint_FormatCSSIfromParamsInSSBP 48 48 49 49 push cx ; Push "Master" or "Slave" 50 50 51 51 mov cl, (g_szDetectPort-$$) & 0xff ; Setup print string for standard IDE 52 52 ; Note that we modify only the low order bits of CX a lot here, … … 55 55 ; on the same 256 byte page, which is checked in strings.asm. 56 56 57 cmp dx, DEVICE_SERIAL_PORT << 8 ; Check if this is a serial device, 57 cmp dx, DEVICE_SERIAL_PORT << 8 ; Check if this is a serial device, 58 58 ; And also check if DL is zero, check with the jz below 59 ; This optimization requires that DEVICE_SERIAL_PORT be 59 ; This optimization requires that DEVICE_SERIAL_PORT be 60 60 ; the highest value in the DEVICE_* series, ensuring that 61 61 ; anything less in the high order bits is a different device. 62 62 63 j l.pushAndPrint ; CX = string to print, AX = port address, DX won't be used63 jb .pushAndPrint ; CX = string to print, AX = port address, DX won't be used 64 64 65 65 mov cl, (g_szDetectCOM-$$) & 0xff ; Setup print string for COM ports … … 68 68 69 69 push dx ; Push COM number character 70 ; If the str nig is going to be "Auto", we will push a NULL (zero)71 ; here for the COM port number, which will be eaten by the 72 ; print routine (DisplayPrint_CharacterFromAL), resulting in 70 ; If the string is going to be "Auto", we will push a NULL (zero) 71 ; here for the COM port number, which will be eaten by the 72 ; print routine (DisplayPrint_CharacterFromAL), resulting in 73 73 ; just "COM" being printed without a character after it. 74 74 75 75 mov cl, (g_szDetectCOMAuto-$$) & 0xff ; Setup secondary print string for "Auto" 76 76 77 77 jz .pushAndPrint ; CX = string to print, AX and DX won't be used 78 78 79 79 mov cl, (g_szDetectCOMLarge-$$) & 0xff ; Setup secondary print string for "COMn/xx.yK" 80 80 … … 82 82 cbw ; clear AH, AL will always be less than 128 83 83 xchg si,ax ; move AX to SI for divide 84 mov ax,1152 ; baud rate to displa is 115200/divisor, the "00" is handled84 mov ax,1152 ; baud rate to display is 115200/divisor, the "00" is handled 85 85 ; in the print strings 86 xor dx,dx; clear top 16-bits of dividend86 cwd ; clear top 16-bits of dividend 87 87 div si ; and divide... Now AX = baud rate/100, DX = 0 (always a clean divide) 88 88 89 89 mov si,10 ; Now separate the whole portion from the fractional for "K" display 90 90 div si ; and divide... Now AX = baud rate/1000, DX = low order digit 91 92 cmp ax,si ; < = 10: "2400", "9600", etc.; >10: "19.2K", "38.4K", etc.91 92 cmp ax,si ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc. 93 93 jae .pushAndPrint 94 94 95 95 mov cl, (g_szDetectCOMSmall-$$) & 0xff ; Setup secondary print string for "COMn/XXy00" 96 97 .pushAndPrint: 96 97 .pushAndPrint: 98 98 push cx ; Push print string 99 99 push ax ; Push high order digits, or port address, or N/A … … 102 102 mov si, g_szDetectOuter ; Finally load SI with wrapper string "IDE %s at %s: " 103 103 104 jmp short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 104 jmp short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 105 105 106 106 … … 127 127 ret 128 128 129 130 131
Note:
See TracChangeset
for help on using the changeset viewer.