Changeset 78 in xtideuniversalbios
- Timestamp:
- Jan 5, 2011, 7:36:41 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Configurator/Src/Libraries
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Configurator/Src/Libraries/keys.asm
r2 r78 2 2 ; Project name : Keyboard library 3 3 ; Created date : 17.11.2009 4 ; Last update : 31.12.2009 5 ; Author : Tomi Tilli 4 ; Last update : 4.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 6 7 ; Description : ASM library to for keyboard related functions. 7 8 … … 311 312 ALIGN JUMP_ALIGN 312 313 Keys_Backspace: 313 push dx314 314 test si, si ; At the beginning? 315 315 jz .Return ; If so, return 316 push dx ; Save DX 316 317 dec si ; Decrement char counter 317 318 dec di ; Decrement offset to buffer … … 322 323 mov dl, BS ; Back again 323 324 PRINT_CHAR 325 pop dx ; Restore DX 324 326 ALIGN JUMP_ALIGN 325 327 .Return: 326 pop dx 327 ret 328 %endif 328 ret 329 %endif -
trunk/Configurator/Src/Libraries/math.asm
r2 r78 2 2 ; Project name : Math library 3 3 ; Created date : 7.10.2009 4 ; Last update : 1.1.2010 5 ; Author : Tomi Tilli 4 ; Last update : 4.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 6 7 ; Description : ASM library to for math related functions. 7 8 … … 122 123 .RetZero: ; Return 0 in DX:AX 123 124 xor ax, ax 124 xor dx, dx125 cwd 125 126 ret 126 127 %endif … … 143 144 ALIGN JUMP_ALIGN 144 145 Math_DivDWbyW: 145 mov bx, ax146 mov ax, dx147 x or dx, dx146 xor bx, bx 147 xchg bx, ax 148 xchg dx, ax 148 149 div cx 149 150 xchg ax, bx … … 171 172 push cx 172 173 push ax 173 mov a x, cx ; Copy divisor to AX174 mov cl, 10 ; Load 10 to CL174 mov al, 10 ; Load 10 to AL 175 xchg cx, ax ; AX = Divisor CL = 10 175 176 div cl ; AL = Divisor divided by 10 176 177 inc ax ; Increment to compensate new remainder -
trunk/Configurator/Src/Libraries/menu/menu.asm
r2 r78 2 2 ; Project name : Menu library 3 3 ; Created date : 9.11.2009 4 ; Last update : 2 0.4.20104 ; Last update : 21.1.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : ASM library to menu system. … … 13 13 %define USE_MENU_DIALOGS ; All dialogs 14 14 ;%define USE_MENU_SETSEL ; Menu_SetSel 15 %define USE_MENU_TOGGLEINFO 15 %define USE_MENU_TOGGLEINFO ; Menu_ToggleInfo 16 16 %define USE_MENU_INVITEMCNT ; Menu_InvItemCnt 17 17 … … 419 419 mov [bp+MENUVARS.wItemTop], ax 420 420 mov cx, -1 ; Invalidate all items 421 or dl, MFL_UPD_ITEM | MFL_UPD_NFO421 or dl, MFL_UPD_ITEM 422 422 %endif 423 423 ALIGN JUMP_ALIGN -
trunk/Configurator/Src/Libraries/menu/menudraw.asm
r9 r78 2 2 ; Project name : Menu library 3 3 ; Created date : 9.11.2009 4 ; Last update : 25.5.2010 5 ; Author : Tomi Tilli 4 ; Last update : 4.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 6 7 ; Description : ASM library to menu system. 7 8 ; Contains menu drawing functions. … … 41 42 mov al, CNT_SCRN_ROW ; Load row count 42 43 mul ah ; AX=Column count * row count 43 mov cx, ax ; Copy char count to CX44 mov cx, 0920h ; Write Char and attr, space char 44 45 mov bx, ATTR_MDA_NORMAL ; Page zero, normal attribute 45 mov ax, 0920h ; Write Char and attr, space char46 xchg cx, ax ; CX=Char count AX=Space char and attr 46 47 int 10h 47 48 ret … … 354 355 ALIGN JUMP_ALIGN 355 356 MenuDraw_TopBorder: 356 mov bh, B_TL 357 mov bl, B_H 357 mov bx, (B_TL << 8) + B_H 358 358 mov dh, B_TR 359 359 jmp SHORT MenuDraw_BorderChars … … 361 361 ALIGN JUMP_ALIGN 362 362 MenuDraw_StringBorder: 363 mov bh, B_V 364 mov bl, ' ' 363 mov bx, (B_V << 8) + ' ' 365 364 mov dh, B_V 366 365 jmp SHORT MenuDraw_BorderChars … … 369 368 MenuDraw_ScrollBorder: 370 369 call MenuDraw_GetScrollChar ; Load scroll char to DH 371 mov bh, B_V 372 mov bl, ' ' 370 mov bx, (B_V << 8) + ' ' 373 371 jmp SHORT MenuDraw_BorderChars 374 372 375 373 ALIGN JUMP_ALIGN 376 374 MenuDraw_MiddleBorder: 377 mov bh, BVL_THR 378 mov bl, T_H 375 mov bx, (BVL_THR << 8) + T_H 379 376 mov dh, THL_BVR 380 377 … … 393 390 ALIGN JUMP_ALIGN 394 391 MenuDraw_BottomBorder: 395 mov bh, B_LL 396 mov bl, B_H 392 mov bx, (B_LL << 8) + B_H 397 393 mov dh, B_LR 398 394 cmp WORD [bp+MENUVARS.wTimeInit], 0 ; Timeout enabled? -
trunk/Configurator/Src/Libraries/print.asm
r2 r78 2 2 ; Project name : Print library 3 3 ; Created date : 6.10.2009 4 ; Last update : 31.12.2009 5 ; Author : Tomi Tilli 6 ; Description : ASM library to for character and string 4 ; Last update : 4.1.2011 5 ; Author : Tomi Tilli, 6 ; : Krister Nordvall (optimizations) 7 ; Description : ASM library for character and string 7 8 ; printing related functions. 8 9 … … 109 110 mov dl, %1 110 111 PRINT_CHAR 111 mov dl, CR112 PRINT_CHAR113 mov dl, LF114 PRINT_CHAR112 ;mov dl, CR 113 ;PRINT_CHAR 114 ;mov dl, LF 115 ;PRINT_CHAR 115 116 pop ax 116 117 pop dx … … 467 468 ALIGN JUMP_ALIGN 468 469 Print_IntSW: 470 test ax, ax ; Positive integer? 471 jns Print_IntUW ; If so, jump to print it 469 472 push di ; Store DI 470 cmp ax, 0 ; Positive integer?471 jge Print_IntUW ; If so, jump to print it472 473 push ax ; Store word 473 474 mov dl, '-' ; Print '-' -
trunk/Configurator/Src/Libraries/prntbios.asm
r2 r78 98 98 cmp al, STOP ; End of string? 99 99 je .Return ; If so, return 100 mov ah, FN_BIOS_WR_CHAR_TEL ; Some BIOSes corrupt AHwhen returning100 mov ah, FN_BIOS_WR_CHAR_TEL ; Some BIOSes corrupts AX when returning 101 101 int 10h 102 102 inc dx ; Increment chars printed -
trunk/Configurator/Src/Libraries/string.asm
r75 r78 2 2 ; Project name : String library 3 3 ; Created date : 7.10.2009 4 ; Last update : 20.12.20094 ; Last update : 4.1.2011 5 5 ; Author : Tomi Tilli, 6 ; : Kri lle(optimizations)6 ; : Krister Nordvall (optimizations) 7 7 ; Description : ASM library to work as Standard C String and Character. 8 8 … … 130 130 String_IsHexDigit: 131 131 call String_IsAlphaNum ; Is alphabetic letter or digit? 132 jc .CheckHex ; If so, jump to check A...F 133 ret 134 .CheckHex: 132 jnc .ExitStrIsHexDigit ; If it is, check A...F. If not, exit 135 133 push ax ; Store character 136 134 call String_ToLower ; Convert to lower case letter 137 135 cmp al, 'f'+1 ; Last valid hex alphanumeric? 138 136 pop ax ; Restore character 137 138 .ExitStrIsHexDigit: 139 139 ret 140 140 … … 165 165 mov ah, al ; Copy char to AH 166 166 call String_IsDigit ; Is '0'...'9'? 167 jc .ConvertDigit ; If so, jump to convert 167 jnc .CheckForAlpha ; If not, check for alphabetic letter 168 sub al, '0' ; Convert char to integer 169 jmp .FinalizeAXAndCheckBase 170 171 .CheckForAlpha: 168 172 call String_IsAlpha ; Is alphabetic letter? 169 jnc . RetFalse ;If not, return FALSE173 jnc .JustRet ; If not, return FALSE 170 174 call String_ToLower ; Convert to lower case 175 sub al, 'a'-10 ; From char to integer: a=10, b=11... 176 177 .FinalizeAXAndCheckBase: 171 178 xchg al, ah ; Converted char to AH 172 sub ah, 'a'-10 ; From char to integer: a=10, b=11...173 179 cmp ah, cl ; Belongs to base? 174 jae .RetFalse ; If not, return FALSE 175 stc ; Set CF since belongs to base 176 ret 177 ALIGN JUMP_ALIGN 178 .ConvertDigit: 179 sub ah, '0' ; Convert char to integer 180 cmp ah, cl ; Belongs to base? 181 jae .RetFalse ; If not, return FALSE 182 stc ; Set CF since belongs to base 183 ret 184 ALIGN JUMP_ALIGN 185 .RetFalse: 186 clc ; Clear CF since char doesn't belong to b 180 181 .JustRet: ; CF now reflects TRUE/FALSE so just return 187 182 ret 188 183 %endif … … 324 319 jnz .CharLoop ; Loop while characters left 325 320 326 mov ax, bx ; Copy loword to AX 321 stc ; Set CF since success 322 .RetFalse: ; If we jumped to here no CLC is needed to reflect a FALSE condition 323 mov ax, bx ; Copy loword to AX (may be incomplete) 327 324 pop bx ; Restore BX 328 325 pop di ; Restore DI 329 326 pop si ; Restore SI 330 327 pop ds ; Restore DS 331 stc ; Set CF since success332 ret333 ALIGN JUMP_ALIGN334 .RetFalse:335 mov ax, bx ; Copy (likely incomplete) loword to AX336 pop bx ; Restore BX337 pop di ; Restore DI338 pop si ; Restore SI339 pop ds ; Restore DS340 clc ; Clear CF since error341 328 ret 342 329 %endif … … 448 435 ALIGN JUMP_ALIGN 449 436 .Str2NotFound: 450 xor bx, bx ; Zero BX 437 xor bx, bx ; Zero BX and clear CF 451 438 pop si ; Restore SI 452 439 pop cx ; Restore CX 453 clc ; Clear CF since str2 was not found454 440 ret 455 441 %endif … … 578 564 ALIGN JUMP_ALIGN 579 565 .ConvComplete: 580 mov ax, bx ; Copy loword to AX 566 stc ; Set CF since success 567 ALIGN JUMP_ALIGN 568 .RetFalse: ; If we jumped to here no CLC is needed to reflect a FALSE condition 569 mov ax, bx ; Copy loword to AX (may be incomplete) 581 570 pop bx ; Restore BX 582 571 pop si ; Restore SI 583 572 pop ds ; Restore DS 584 stc ; Set CF since success585 ret586 ALIGN JUMP_ALIGN587 .RetFalse:588 mov ax, bx ; Copy (likely incomplete) loword to AX589 pop bx ; Restore BX590 pop si ; Restore SI591 pop ds ; Restore DS592 clc ; Clear CF since error593 573 ret 594 574 %endif
Note:
See TracChangeset
for help on using the changeset viewer.