Changeset 491 in xtideuniversalbios for trunk/Assembly_Library/Src
- Timestamp:
- Dec 15, 2012, 2:46:29 PM (12 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Display/CgaSnow.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing code … … 94 94 ret 95 95 96 %ifdef INCLUDE_MENU_LIBRARY 96 97 97 ;-------------------------------------------------------------------- 98 98 ; CgaSnow_RepMovsb … … 107 107 ; AX, CX, DX 108 108 ;-------------------------------------------------------------------- 109 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 110 %ifdef MODULE_STRINGS_COMPRESSED 111 %define EXCLUDE 112 %endif 113 %ifdef MODULE_BOOT_MENU 114 %undef EXCLUDE 115 %endif 116 %endif 117 118 %ifndef EXCLUDE 109 119 ALIGN DISPLAY_JUMP_ALIGN 110 120 CgaSnow_RepMovsb: … … 123 133 ret 124 134 %endif 135 %undef EXCLUDE 136 125 137 126 138 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing code … … 102 102 103 103 104 %ifdef INCLUDE_MENU_LIBRARY105 106 104 ;-------------------------------------------------------------------- 107 105 ; DisplayContext_Push 106 ; DisplayContext_Pop 108 107 ; Parameters: 109 108 ; Nothing … … 113 112 ; AX, DI 114 113 ;-------------------------------------------------------------------- 114 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 115 %ifndef MODULE_BOOT_MENU 116 %define EXCLUDE 117 %endif 118 %endif 119 120 %ifndef EXCLUDE 115 121 ALIGN DISPLAY_JUMP_ALIGN 116 122 DisplayContext_Push: … … 126 132 %endrep 127 133 %endif 128 134 129 135 mov ds, di ; Restore DS 130 136 jmp ax 131 137 132 ;-------------------------------------------------------------------- 133 ; DisplayContext_Pop 134 ; Parameters: 135 ; Nothing 136 ; Returns: 137 ; Nothing 138 ; Corrupts registers: 139 ; AX, DI 140 ;-------------------------------------------------------------------- 138 141 139 ALIGN DISPLAY_JUMP_ALIGN 142 140 DisplayContext_Pop: … … 145 143 pop ax ; Pop return address 146 144 147 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 145 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 148 146 %assign i DISPLAY_CONTEXT_size-2 149 147 %rep DISPLAY_CONTEXT_size / 2 … … 152 150 %endrep 153 151 %endif 154 152 155 153 push ax ; Push return address 156 154 push dx … … 159 157 mov ds, di ; Restore DS 160 158 ret 161 %endif 159 %endif ; EXCLUDE 160 %undef EXCLUDE 161 162 162 163 163 ;-------------------------------------------------------------------- … … 189 189 pop ds 190 190 ret 191 192 %endif ; INCLUDE_MENU_LIBRARY 191 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 193 192 194 193 … … 231 230 %endif 232 231 233 %ifdef INCLUDE_MENU_LIBRARY 234 232 233 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 234 %ifndef MODULE_BOOT_MENU 235 %define EXCLUDE 236 %endif 237 %endif 235 238 ;-------------------------------------------------------------------- 236 239 ; DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL … … 244 247 ; BL 245 248 ;-------------------------------------------------------------------- 249 %ifndef EXCLUDE ; 1 of 3 246 250 ALIGN DISPLAY_JUMP_ALIGN 247 251 DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL: … … 251 255 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], ax 252 256 ret 257 %endif 253 258 254 259 … … 263 268 ; Nothing 264 269 ;-------------------------------------------------------------------- 270 %ifndef EXCLUDE ; 2 of 3 265 271 ALIGN DISPLAY_JUMP_ALIGN 266 272 DisplayContext_SetCharacterAttributeFromAL: 267 273 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], al 268 274 ret 275 %endif 269 276 270 277 … … 279 286 ; Nothing 280 287 ;-------------------------------------------------------------------- 288 %ifndef EXCLUDE ; 3 of 3 281 289 ALIGN DISPLAY_JUMP_ALIGN 282 290 DisplayContext_SetCharacterOutputParameterFromAX: 283 291 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam], ax 284 292 ret 285 286 %endif ; INCLUDE_MENU_LIBRARY 287 293 %endif 294 295 %undef EXCLUDE 296 297 288 298 ;-------------------------------------------------------------------- 289 299 ; DisplayContext_GetCharacterOutputParameterToDX … … 295 305 ; Nothing 296 306 ;-------------------------------------------------------------------- 297 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG ; This is currently unused (dead code)307 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG 298 308 ALIGN DISPLAY_JUMP_ALIGN 299 309 DisplayContext_GetCharacterOutputParameterToDX: … … 322 332 %endif 323 333 324 334 325 335 ;-------------------------------------------------------------------- 326 336 ; DisplayContext_GetByteOffsetToAXfromCharacterOffsetInAX -
trunk/Assembly_Library/Src/Display/DisplayCursor.asm
r489 r491 37 37 ret 38 38 39 %ifdef INCLUDE_MENU_LIBRARY 39 40 40 ;-------------------------------------------------------------------- 41 41 ; DisplayCursor_SetShapeFromAX … … 48 48 ; Nothing 49 49 ;-------------------------------------------------------------------- 50 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 51 %ifndef MODULE_BOOT_MENU 52 %define EXCLUDE 53 %endif 54 %endif 55 56 %ifndef EXCLUDE 50 57 ALIGN DISPLAY_JUMP_ALIGN 51 58 DisplayCursor_SetShapeFromAX: … … 53 60 ret 54 61 %endif 55 62 %undef EXCLUDE 63 64 56 65 ;-------------------------------------------------------------------- 57 66 ; DisplayCursor_SetCoordinatesFromAX -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing code … … 109 109 110 110 111 %ifndef MODULE_STRINGS_COMPRESSED112 111 ;-------------------------------------------------------------------- 113 112 ; DisplayPrint_WordFromAXWithBaseInBX … … 122 121 ; AX, DX 123 122 ;-------------------------------------------------------------------- 123 %ifndef MODULE_STRINGS_COMPRESSED 124 124 ALIGN DISPLAY_JUMP_ALIGN 125 125 DisplayPrint_WordFromAXWithBaseInBX: … … 152 152 g_rgcDigitToCharacter: db "0123456789ABCDEF" 153 153 154 %endif ; MODULE_STRINGS_COMPRESSED 155 154 156 ;-------------------------------------------------------------------- 155 157 ; DisplayPrint_QWordFromSSBPwithBaseInBX … … 164 166 ; AX, DX, [SS:BP] 165 167 ;-------------------------------------------------------------------- 166 %ifndef EXCLUDE_FROM_XTIDE CFG ; Not used inXTIDECFG168 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG 167 169 ALIGN DISPLAY_JUMP_ALIGN 168 170 DisplayPrint_QWordFromSSBPwithBaseInBX: … … 181 183 mov cx, bx ; Character count to CX 182 184 jmp SHORT PrintAllPushedDigits 183 %endif ; EXCLUDE_FROM_XTIDECFG 184 185 %endif ; MODULE_STRINGS_COMPRESSED 185 %endif 186 186 187 187 … … 220 220 221 221 222 %ifdef INCLUDE_MENU_LIBRARY223 222 ;-------------------------------------------------------------------- 224 223 ; DisplayPrint_ClearScreenWithCharInALandAttributeInAH … … 233 232 ; AX, DX 234 233 ;-------------------------------------------------------------------- 234 %ifdef INCLUDE_MENU_LIBRARY 235 235 ALIGN DISPLAY_JUMP_ALIGN 236 236 DisplayPrint_ClearScreenWithCharInALandAttributeInAH: … … 251 251 ret 252 252 %endif 253 253 254 254 255 ;-------------------------------------------------------------------- 255 256 ; DisplayPrint_ClearAreaWithHeightInAHandWidthInAL -
trunk/Assembly_Library/Src/File/FileIO.asm
r446 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 ; Section containing code … … 37 37 ALIGN JUMP_ALIGN 38 38 FileIO_CreateWithPathInDSSIandAttributesInCX: 39 xchg dx, si ; Path now in DS:DX40 39 mov ah, CREATE_OR_TRUNCATE_FILE 41 jmp SHORT CreateOrOpenFile42 40 SKIP2B bx 41 ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL 43 42 44 43 ;-------------------------------------------------------------------- … … 55 54 ; AX, BX 56 55 ;-------------------------------------------------------------------- 57 ALIGN JUMP_ALIGN58 56 FileIO_OpenWithPathInDSSIandFileAccessInAL: 57 mov ah, OPEN_EXISTING_FILE 59 58 xchg dx, si ; Path now in DS:DX 60 mov ah, OPEN_EXISTING_FILE61 CreateOrOpenFile:62 59 int DOS_INTERRUPT_21h 63 60 xchg si, dx … … 87 84 ret 88 85 89 ;--------------------------------------------------------------------90 ; File position is updated so next read will start where91 ; previous read stopped.92 ;93 ; FileIO_ReadCXbytesToDSSIusingHandleFromBX94 ; Parameters:95 ; BX: File handle96 ; CX: Number of bytes to read97 ; DS:SI: Ptr to destination buffer98 ; Returns:99 ; AX: Number of bytes actually read if successful (0 if at EOF before call)100 ; DOS error code if CF set101 ; CF: Clear if successful102 ; Set if error103 ; Corrupts registers:104 ; Nothing105 ;--------------------------------------------------------------------106 ALIGN JUMP_ALIGN107 FileIO_ReadCXbytesToDSSIusingHandleFromBX:108 xchg dx, si ; DS:DX now points to destination buffer109 mov ah, READ_FROM_FILE_OR_DEVICE110 int DOS_INTERRUPT_21h111 xchg si, dx112 ret113 114 86 115 87 ;-------------------------------------------------------------------- … … 134 106 ret 135 107 108 109 ;-------------------------------------------------------------------- 110 ; File position is updated so next read will start where 111 ; previous read stopped. 112 ; 113 ; FileIO_ReadCXbytesToDSSIusingHandleFromBX 114 ; Parameters: 115 ; BX: File handle 116 ; CX: Number of bytes to read 117 ; DS:SI: Ptr to destination buffer 118 ; Returns: 119 ; AX: Number of bytes actually read if successful (0 if at EOF before call) 120 ; DOS error code if CF set 121 ; CF: Clear if successful 122 ; Set if error 123 ; Corrupts registers: 124 ; Nothing 125 ;-------------------------------------------------------------------- 126 ALIGN JUMP_ALIGN 127 FileIO_ReadCXbytesToDSSIusingHandleFromBX: 128 mov ah, READ_FROM_FILE_OR_DEVICE 129 SKIP2B f 130 ; Fall to FileIO_WriteCXbytesFromDSSIusingHandleFromBX 131 136 132 ;-------------------------------------------------------------------- 137 133 ; File position is updated so next write will start where 138 134 ; previous write stopped. 139 135 ; 140 ; FileIO_WriteCXbytesFromDSSIusingHandleFromBX :136 ; FileIO_WriteCXbytesFromDSSIusingHandleFromBX 141 137 ; Parameters: 142 138 ; BX: File handle … … 151 147 ; Nothing 152 148 ;-------------------------------------------------------------------- 153 ALIGN JUMP_ALIGN154 149 FileIO_WriteCXbytesFromDSSIusingHandleFromBX: 155 xchg dx, si ; DS:DX now points to source buffer156 150 mov ah, WRITE_TO_FILE_OR_DEVICE 151 xchg dx, si ; DS:DX now points to buffer 157 152 int DOS_INTERRUPT_21h 158 153 xchg si, dx … … 232 227 233 228 ;-------------------------------------------------------------------- 234 ; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition :229 ; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition 235 230 ; Parameters: 236 231 ; BX: File handle … … 287 282 288 283 ;-------------------------------------------------------------------- 289 ; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX :284 ; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX 290 285 ; Parameters: 291 286 ; AL: SEEK_FROM.(origin) -
trunk/Assembly_Library/Src/Menu/Dialog/DialogProgress.asm
r376 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 ; Section containing code … … 99 99 mov [si+PROGRESS_DIALOG_IO.wStartTimeTicks], ax 100 100 101 ; 0 = 65536 but it needs to be adjusted to 65535 prevent division by zero101 ; 0 = 65536 but it needs to be adjusted to 65535 to prevent division by zero 102 102 cmp WORD [si+PROGRESS_DIALOG_IO.wMaxProgressValue], BYTE 0 103 103 jne SHORT CalculateProgressNeededBeforeUpdatingCharacter … … 288 288 div cx ; AX = Estimated ticks left 289 289 xchg dx, ax 290 SKIP2B f ; cmp ax, <next instruction>290 SKIP2B ax 291 291 .PreventDivisionByZero: 292 292 xor dx, dx … … 309 309 mov bp, sp 310 310 mov si, g_szTimeFormat 311 call TimerTicks_GetMinutesToAX fromTicksInDX311 call TimerTicks_GetMinutesToAXandRemainderTicksToDXfromTicksInDX 312 312 push ax 313 313 call TimerTicks_GetSecondsToAXfromTicksInDX -
trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
r376 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 ; Section containing code … … 79 79 ; AX: Item line for last thumb character 80 80 ; Corrupts registers: 81 ; CX,DX81 ; DX 82 82 ;-------------------------------------------------------------------- 83 83 ALIGN MENU_JUMP_ALIGN … … 95 95 ; AX: Item line for first thumb character 96 96 ; Corrupts registers: 97 ; CX,DX97 ; DX 98 98 ;-------------------------------------------------------------------- 99 99 ALIGN MENU_JUMP_ALIGN -
trunk/Assembly_Library/Src/Menu/MenuTime.asm
r376 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 ; Section containing code … … 101 101 ; AX: Seconds until timeout 102 102 ; Corrupts registers: 103 ; AX103 ; Nothing 104 104 ;-------------------------------------------------------------------- 105 105 ALIGN MENU_JUMP_ALIGN … … 116 116 xchg dx, ax 117 117 call TimerTicks_GetSecondsToAXfromTicksInDX 118 SKIP2B f ; cmp ax, <next instruction>118 SKIP2B dx 119 119 .TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero: 120 120 xor ax, ax -
trunk/Assembly_Library/Src/Serial/SerialServer.asm
r376 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 %include "SerialServer.inc" … … 75 75 76 76 mov al,83h 77 add dl, Serial_UART_lineControl77 add dl, Serial_UART_lineControl ; Clears CF 78 78 out dx,al 79 79 … … 82 82 out dx,al 83 83 84 %ifdef USE_UNDOC_INTEL 85 eSALC ; Clear AL using CF 86 %else 84 87 xor ax,ax 88 %endif 85 89 inc dx ; divisor high 86 90 push dx … … 103 107 104 108 pop dx ; base, interrupts disabled 109 %ifdef USE_UNDOC_INTEL 110 eSALC ; Clear AL using CF 111 %else 105 112 xor ax,ax 113 %endif 106 114 out dx,al 107 115 -
trunk/Assembly_Library/Src/String/Char.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing code … … 29 29 ; %3: Last accepted value in range 30 30 ; Returns: 31 ; CF: Set if character i srange31 ; CF: Set if character in range 32 32 ; (Jumps to Char_CharIsNotValid if before range) 33 33 ; Corrupts registers: … … 51 51 ; Nothing 52 52 ;-------------------------------------------------------------------- 53 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 54 %ifndef MODULE_HOTKEYS 55 %define EXCLUDE 56 %endif 57 %endif 58 59 %ifndef EXCLUDE 53 60 ALIGN STRING_JUMP_ALIGN 54 61 Char_IsLowerCaseLetterInAL: 55 62 IS_BETWEEN_IMMEDIATES al, 'a', 'z' 56 63 ret 64 %endif 65 %undef EXCLUDE 66 57 67 58 68 ;-------------------------------------------------------------------- … … 72 82 ret 73 83 %endif 84 74 85 75 86 ;-------------------------------------------------------------------- … … 94 105 %endif 95 106 107 96 108 ;-------------------------------------------------------------------- 97 109 ; Char_IsDecimalDigitInAL … … 110 122 ret 111 123 %endif 124 112 125 113 126 ;-------------------------------------------------------------------- … … 141 154 %endif 142 155 156 143 157 ;-------------------------------------------------------------------- 144 158 ; Char_CharIsValid … … 159 173 %endif 160 174 175 176 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 177 %ifndef MODULE_HOTKEYS 178 %define EXCLUDE 179 %endif 180 %ifndef MODULE_STRINGS_COMPRESSED 181 %undef EXCLUDE 182 %endif 183 %endif 184 185 %ifndef EXCLUDE 161 186 ALIGN STRING_JUMP_ALIGN 162 187 Char_CharIsNotValid: 163 188 clc 164 189 ret 190 %endif 191 %undef EXCLUDE 165 192 166 193 … … 181 208 %endif 182 209 183 210 184 211 ;-------------------------------------------------------------------- 185 212 ; Char_ALtoUpperCaseLetter … … 191 218 ; Nothing 192 219 ;-------------------------------------------------------------------- 193 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 220 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 194 221 ALIGN STRING_JUMP_ALIGN 195 222 Char_ALtoUpperCaseLetter: … … 200 227 %endif 201 228 202 229 203 230 ;-------------------------------------------------------------------- 204 231 ; Char_ChangeCaseInAL … … 210 237 ; Nothing 211 238 ;-------------------------------------------------------------------- 239 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 212 240 Char_ChangeCaseInAL: 213 241 xor al, 32 214 242 .Return: 215 243 ret 244 %endif 245 216 246 217 247 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Time/TimerTicks.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 19 20 ; System timer ticks 18.2 times per second = 54.9 ms / tick 21 TICKS_PER_HOUR EQU 65520 18 ; 19 20 ; With a PIT input clock of 1193181.6666... Hz and a maximum 21 ; 16 bit divisor of 65536 (if PIT programmed with 0) we get: 22 ; 23 ; Clock / Divisor = ~18.2065 ticks per second 24 ; Clock * SecondsPerMinute / Divisor = ~1092 ticks per minute 25 ; Clock * SecondsPerHour / Divisor = ~65543 ticks per hour 26 ; 27 ; Since 65543 can't fit in a 16 bit register we use the 28 ; maximum possible instead and disregard the last ~8 ticks. 29 30 TICKS_PER_HOUR EQU 65535 22 31 TICKS_PER_MINUTE EQU 1092 23 32 TICKS_PER_SECOND EQU 18 … … 28 37 29 38 ;-------------------------------------------------------------------- 30 ; TimerTicks_GetHoursToAX fromTicksInDXAX31 ; TimerTicks_GetMinutesToAX fromTicksInDX32 ; TimerTicks_GetSecondsToAX fromTicksInDX39 ; TimerTicks_GetHoursToAXandRemainderTicksToDXfromTicksInDXAX 40 ; TimerTicks_GetMinutesToAXandRemainderTicksToDXfromTicksInDX 41 ; TimerTicks_GetSecondsToAXandRemainderTicksToDXfromTicksInDX 33 42 ; Parameters 34 43 ; DX(:AX): Timer ticks to convert … … 42 51 %ifndef EXCLUDE_FROM_XTIDECFG 43 52 ALIGN JUMP_ALIGN 44 TimerTicks_GetHoursToAX fromTicksInDXAX:53 TimerTicks_GetHoursToAXandRemainderTicksToDXfromTicksInDXAX: 45 54 mov cx, TICKS_PER_HOUR 46 55 div cx ; Divide DX:AX by CX, Hours to AX, remainder ticks to DX … … 49 58 50 59 ALIGN JUMP_ALIGN 51 TimerTicks_GetMinutesToAX fromTicksInDX:60 TimerTicks_GetMinutesToAXandRemainderTicksToDXfromTicksInDX: 52 61 xor ax, ax 53 62 xchg ax, dx ; Ticks now in DX:AX … … 57 66 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 58 67 59 %ifdef INCLUDE_MENU_LIBRARY 60 ALIGN JUMP_ALIGN 61 TimerTicks_GetSecondsToAXfromTicksInDX: 68 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG 69 ALIGN JUMP_ALIGN 70 TimerTicks_GetSecondsToAXandRemainderTicksToDXfromTicksInDX: 71 ; This procedure can handle at most 4607 ticks in DX (almost 256 seconds) 72 ; More than 4607 ticks will generate a divide overflow exception! 62 73 xchg ax, dx ; Ticks now in AX 63 74 mov cl, TICKS_PER_SECOND … … 68 79 %endif 69 80 81 82 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 83 %ifndef MODULE_BOOT_MENU 84 %define EXCLUDE 85 %endif 86 %endif 87 ;-------------------------------------------------------------------- 88 ; TimerTicks_GetSecondsToAXfromTicksInDX 89 ; Parameters 90 ; DX: Timer ticks to convert 91 ; Returns: 92 ; AX: Seconds 93 ; Corrupts registers: 94 ; DX 95 ;-------------------------------------------------------------------- 96 %ifndef EXCLUDE ; 1 of 3 97 ALIGN JUMP_ALIGN 98 TimerTicks_GetSecondsToAXfromTicksInDX: 99 mov ax, 3600 ; Approximately 65536 / (Clock / Divisor) 100 mul dx 101 xchg dx, ax 102 ret 103 %endif 104 105 70 106 ;-------------------------------------------------------------------- 71 107 ; First tick might take 0...54.9 ms and remaining ticks … … 82 118 ; AX 83 119 ;-------------------------------------------------------------------- 84 %if def INCLUDE_MENU_LIBRARY120 %ifndef EXCLUDE ; 2 of 3 85 121 ALIGN JUMP_ALIGN 86 122 TimerTicks_InitializeTimeoutFromAX: … … 90 126 ret 91 127 %endif 128 92 129 93 130 ;-------------------------------------------------------------------- … … 102 139 ; Nothing 103 140 ;-------------------------------------------------------------------- 104 %if def INCLUDE_MENU_LIBRARY141 %ifndef EXCLUDE ; 3 of 3 105 142 ALIGN JUMP_ALIGN 106 143 TimerTicks_GetTimeoutTicksLeftToAXfromDSBX: … … 114 151 %endif 115 152 153 %undef EXCLUDE 154 155 116 156 ;-------------------------------------------------------------------- 117 157 ; TimerTicks_GetElapsedToAXandResetDSBX … … 134 174 %endif 135 175 176 136 177 ;-------------------------------------------------------------------- 137 178 ; TimerTicks_GetElapsedToAXfromDSBX … … 161 202 ; Nothing 162 203 ;-------------------------------------------------------------------- 204 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 205 %ifndef MODULE_BOOT_MENU OR MODULE_HOTKEYS 206 %define EXCLUDE 207 %endif 208 %endif 209 210 %ifndef EXCLUDE 163 211 ALIGN JUMP_ALIGN 164 212 TimerTicks_ReadFromBdaToAX: … … 170 218 pop ds 171 219 ret 220 %endif 221 %undef EXCLUDE -
trunk/Assembly_Library/Src/Util/Registers.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 ; Section containing code 21 21 SECTION .text … … 52 52 ; Nothing 53 53 ;-------------------------------------------------------------------- 54 %ifdef INCLUDE_MENU_LIBRARY 54 55 ALIGN JUMP_ALIGN 55 %ifdef INCLUDE_MENU_LIBRARY56 56 Registers_CopySSBPtoESDI: 57 57 COPY_SSBP_TO_ESDI -
trunk/Assembly_Library/Src/Util/Size.asm
r489 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 %ifdef INCLUDE_MENU_LIBRARY … … 68 68 ; Convert remainder to tenths 69 69 xchg bx, ax ; Store AX 70 mov ax, 10 71 mul cx ; DX:AX = remainder * 10 72 eSHR_IM ax, 10 ; Divide AX by 1024 70 mov ax, 5 71 mul cx ; DX:AX = remainder * (10 / 2) 72 %ifdef USE_186 73 shr ax, 9 ; Divide AX by (1024 / 2) 74 %else 75 shr ax, 1 76 mov al, ah 77 cbw 78 %endif 73 79 xchg cx, ax ; CX = tenths 74 80 xchg ax, bx … … 124 130 ;-------------------------------------------------------------------- 125 131 ALIGN UTIL_SIZE_JUMP_ALIGN 126 Size_ConvertSectorCountInBXDXAXtoKiB: 132 Size_ConvertSectorCountInBXDXAXtoKiB: ; unused entrypoint ok 127 133 Size_DivideBXDXAXbyTwo: 128 134 shr bx, 1 ; Divide sector count by 2...
Note:
See TracChangeset
for help on using the changeset viewer.