Changeset 107
- Timestamp:
- Apr 8, 2017, 12:27:04 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/debug.asm
r94 r107 435 435 436 436 DEBUG_DumpRegisters Proc 437 pushf 438 pusha 439 440 ; Safe flags so they can be printed later 441 pushf 442 443 ; Save value in SI so it can be printed later 437 438 ; Save state of caller 439 pushf 440 pusha 441 442 ; Save flags so they can be printed later 443 pushf 444 445 ; Push the registers to print on the stack (SP is bogus) 446 .386 447 push gs 448 push fs 449 .286 450 push bp 451 push sp 452 push ss 453 push es 454 push ds 455 push cs 456 push di 444 457 push si 458 push dx 459 push cx 460 push bx 461 push ax 445 462 446 463 ; Base of registers string 447 464 mov si, offset [regAX] 448 465 449 ; AX 466 ; Print AX BX CX DX SI DI 467 mov cx, 6 468 @@: 469 pop ax 450 470 call AuxIO_Print 451 471 call AuxIO_TeletypeHexWord 452 453 ; BX 454 call AuxIO_Print 455 mov ax,bx 472 loop @B 473 474 ; 1st row printed 475 call AuxIO_TeletypeNL 476 477 ; Print CS DS ES SS SP BP 478 mov cx, 6 479 @@: 480 pop ax 481 call AuxIO_Print 456 482 call AuxIO_TeletypeHexWord 457 458 ; CX 459 call AuxIO_Print 460 mov ax,cx 483 loop @B 484 485 ; 2nd row printed 486 call AuxIO_TeletypeNL 487 488 ; Print FS GS 489 mov cx, 2 490 @@: 491 pop ax 492 call AuxIO_Print 461 493 call AuxIO_TeletypeHexWord 462 463 ; DX 464 call AuxIO_Print 465 mov ax,dx 466 call AuxIO_TeletypeHexWord 467 468 ; SI 469 call AuxIO_Print 470 pop ax 471 call AuxIO_TeletypeHexWord 472 473 ; DI 474 call AuxIO_Print 475 mov ax,di 476 call AuxIO_TeletypeHexWord 477 478 ; 1st row printed 479 call AuxIO_TeletypeNL 480 481 ; CS 482 call AuxIO_Print 483 mov ax,cs 484 call AuxIO_TeletypeHexWord 485 486 ; DS 487 call AuxIO_Print 488 mov ax,ds 489 call AuxIO_TeletypeHexWord 490 491 ; ES 492 call AuxIO_Print 493 mov ax,es 494 call AuxIO_TeletypeHexWord 495 496 ; SS 497 call AuxIO_Print 498 mov ax,ss 499 call AuxIO_TeletypeHexWord 500 501 ; SP 502 call AuxIO_Print 503 mov ax,sp 504 call AuxIO_TeletypeHexWord 505 506 ; BP 507 call AuxIO_Print 508 mov ax,bp 509 call AuxIO_TeletypeHexWord 510 511 ; 2nd row printed 512 call AuxIO_TeletypeNL 513 .386 514 ; FS 515 call AuxIO_Print 516 mov ax,fs 517 call AuxIO_TeletypeHexWord 518 519 ; GS 520 call AuxIO_Print 521 mov ax,gs 522 call AuxIO_TeletypeHexWord 523 ;~ call AuxIO_TeletypeNL 524 .286 494 loop @B 495 525 496 ; Restore the flags 526 497 popf … … 532 503 ;~ mov si, offset [flagsSF] 533 504 534 ; SF505 ; Print SF 535 506 call AuxIO_Print 536 507 mov al, ah … … 540 511 call AuxIO_Teletype 541 512 542 ; ZF513 ; Print ZF 543 514 call AuxIO_Print 544 515 mov al, ah … … 548 519 call AuxIO_Teletype 549 520 550 ; AF521 ; Print AF 551 522 call AuxIO_Print 552 523 mov al, ah … … 556 527 call AuxIO_Teletype 557 528 558 ; P F529 ; Print PF 559 530 call AuxIO_Print 560 531 mov al, ah … … 564 535 call AuxIO_Teletype 565 536 566 ; CF537 ; Print CF 567 538 call AuxIO_Print 568 539 mov al, ah … … 574 545 call AuxIO_TeletypeNL 575 546 576 popa 577 popf 547 ; Restore caller state 548 popa 549 popf 550 578 551 ret 579 552 DEBUG_DumpRegisters EndP
Note:
See TracChangeset
for help on using the changeset viewer.