Changeset 77 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Libraries
- Timestamp:
- Jan 4, 2011, 10:53:15 PM (14 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Libraries
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Libraries/keys.asm
r3 r77 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/XTIDE_Universal_BIOS/Src/Libraries/math.asm
r3 r77 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/XTIDE_Universal_BIOS/Src/Libraries/menu/menudraw.asm
r10 r77 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/XTIDE_Universal_BIOS/Src/Libraries/print.asm
r3 r77 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 … … 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/XTIDE_Universal_BIOS/Src/Libraries/string.asm
r76 r77 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.