From 2339de01f92567eb18a7f1983da75e3718e55134 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 14 Apr 2015 08:23:23 -0700 Subject: [PATCH] More ROM annotations --- .../pc/bios/compaq/deskpro386/1988-01-28.nasm | 397 +++++++++++------- devices/pc/bios/compaq/deskpro386/notes.md | 2 + modules/diskdump/lib/diskdump.js | 4 +- modules/filedump/lib/filedump.js | 4 +- modules/pcjs/lib/chipset.js | 13 +- modules/pcjs/lib/debugger.js | 5 +- 6 files changed, 252 insertions(+), 173 deletions(-) diff --git a/devices/pc/bios/compaq/deskpro386/1988-01-28.nasm b/devices/pc/bios/compaq/deskpro386/1988-01-28.nasm index 5863a787a..fc24aa157 100644 --- a/devices/pc/bios/compaq/deskpro386/1988-01-28.nasm +++ b/devices/pc/bios/compaq/deskpro386/1988-01-28.nasm @@ -97,6 +97,17 @@ x809c: xor ah,ah ; 0000809C 32E4 '2.' pop bx ; 000080A3 5B '[' ret ; 000080A4 C3 '.' + ;* + ; Display (AX) as a 5-digit, zero-padded number in the top-left corner of + ; the display, using (ES) as the segment of the video buffer. + ; + ; The number is followed by " KB OK", for a total of 11 (0x0B) characters. + ; + ; This function works for both Mono and CGA displays because it writes to both + ; video buffers (%B0000 via ES:0000 and %B8000 via ES:8000). + ; + ; Called by CS:DBD6 in the normal case, where CS == 0x30 and ES == 0x40. + ; x80a5: push bx ; 000080A5 53 'S' push cx ; 000080A6 51 'Q' push dx ; 000080A7 52 'R' @@ -374,8 +385,9 @@ x82f5: lodsb ; 000082F5 AC '.' loop x82f5 ; 000082F8 E2FB '..' jz x830a ; 000082FA 740E 't.' mov dx,0x5000 ; 000082FC BA0050 '..P' - mov bx,0xb75a ; 000082FF BB5AB7 '.Z.' - mov cx,0xf ; 00008302 B90F00 '...' + + mov bx,err101 ; 000082FF BB5AB7 '.Z.' + mov cx,err101_len ; 00008302 B90F00 '...' call xc745 ; 00008305 E83D44 '.=D' x8308: jmp short x8308 ; 00008308 EBFE '..' @@ -819,7 +831,8 @@ x86db: mov word [0x50],0xffff ; 000086DB C7065000FFFF '..P...' or al,0x8 ; 00008706 0C08 '..' out 0x61,al ; 00008708 E661 '.a' out 0x84,al ; 0000870A E684 '..' - ; + + ;* ; Read the memory-mapped settings/diagnostic register at 0x80C00000 into BX ; mov bx,[0x0] ; 0000870C 8B1E0000 '....' @@ -2749,8 +2762,9 @@ x99d5: lodsw ; 000099D5 AD '.' mov ds,ax ; 000099E1 8ED8 '..' or byte [0x12],0xff ; 000099E3 800E1200FF '.....' mov dx,0x5000 ; 000099E8 BA0050 '..P' - mov bx,0xb75a ; 000099EB BB5AB7 '.Z.' - mov cx,0xf ; 000099EE B90F00 '...' + + mov bx,err101 ; 000099EB BB5AB7 '.Z.' + mov cx,err101_len ; 000099EE B90F00 '...' call xc745 ; 000099F1 E8512D '.Q-' jmp short x9a09 ; 000099F4 EB13 '..' @@ -2968,7 +2982,7 @@ x9bed: mov al,ah ; 00009BED 8AC4 '..' loop x9bed ; 00009BF6 E2F5 '..' jmp bp ; 00009BF8 FFE5 '..' - ; + ;* ; Clear the screen (DS=F000, BX=BA77 for CGA or BA86 for Mono) ; x9bfa: mov ax,0x720 ; 00009BFA B82007 '. .' @@ -4280,11 +4294,11 @@ xa742: pop es ; 0000A742 07 '.' mov [0x60],cx ; 0000A743 890E6000 '..`.' mov al,[0x49] ; 0000A747 A04900 '.I.' cmp al,0x7 ; 0000A74A 3C07 '<.' - db 0x74,0x07 + jz xa755 ; 0000A74C 7407 cmp al,0x4 ; 0000A74E 3C04 '<.' mov ax,0x0 ; 0000A750 B80000 '...' jnc xa758 ; 0000A753 7303 's.' - mov ax,0x720 ; 0000A755 B82007 '. .' +xa755: mov ax,0x720 ; 0000A755 B82007 '. .' xa758: xor di,di ; 0000A758 33FF '3.' mov cx,0x2000 ; 0000A75A B90020 '.. ' rep stosw ; 0000A75D F3AB '..' @@ -5020,6 +5034,17 @@ xad34: out dx,al ; 0000AD34 EE '.' dec dx ; 0000AD35 4A 'J' jmp bp ; 0000AD36 FFE5 '..' + ;* + ; This prepares a request to performed a copy of 0x21 DWORDs (0x84 bytes) + ; from 0x58:x0F378 (DS:BX) to (ES:DI) for 0x1F0 (DX) times, followed by a + ; final copy of 0x10 DWORDs (0x40 bytes). DI advances, BX does not. + ; + ; Note that 0x84 * 0x1F0 is 0xFFC0, and 0xFFC0 + 0x40 is 0x10000, or exactly + ; 64Kb. Also, DS is pointing to %F0000 and ES is pointing to %FF0000 (the + ; last 64Kb at the top of 16Mb). + ; + ; DS:SI is the hard-coded address of a set of hard-coded values at %FF378. + ; xad38: push ds ; 0000AD38 1E '.' mov ax,0x58 ; 0000AD39 B85800 '.X.' mov ds,ax ; 0000AD3C 8ED8 '..' @@ -5030,6 +5055,10 @@ xad41: mov dx,0x1f0 ; 0000AD41 BAF001 '...' mov bp,0xad4f ; 0000AD49 BD4FAD '.O.' jmp xf68d ; 0000AD4C E93E49 '.>I' + ;* + ; Now that the 64Kb buffer at ES:0 has been prepared, call xe80b to verify the + ; buffer contents. + ; in al,0x61 ; 0000AD4F E461 '.a' or al,0xc ; 0000AD51 0C0C '..' out 0x61,al ; 0000AD53 E661 '.a' @@ -5941,6 +5970,10 @@ xb564: mov sp,bp ; 0000B564 8BE5 '..' xb570: mov al,0x41 ; 0000B570 B041 '.A' out 0x84,al ; 0000B572 E684 '..' + + ;* + ; Verify that RAM refresh is occurring, by confirming that bit 4 (0x10) of port 0x61 is alternating + ; in al,0x61 ; 0000B574 E461 '.a' not al ; 0000B576 F6D0 '..' and al,0x10 ; 0000B578 2410 '$.' @@ -5951,15 +5984,23 @@ xb57f: in al,0x61 ; 0000B57F E461 '.a' cmp al,ah ; 0000B583 3AC4 ':.' jz xb597 ; 0000B585 7410 't.' loop xb57f ; 0000B587 E2F6 '..' - mov bx,0xb68c ; 0000B589 BB8CB6 '...' - mov cx,0x18 ; 0000B58C B91800 '...' + + ;* + ; Verification failed + ; + mov bx,err102 ; 0000B589 BB8CB6 '...' + mov cx,err102_len-2 ; 0000B58C B91800 '...' mov bp,0xb595 ; 0000B58F BD95B5 '...' jmp xc7f7 ; 0000B592 E96212 '.b.' jmp short xb570 ; 0000B595 EBD9 '..' + ;* + ; Checkpoint 0x42: Initialize the first 128Kb of (conventional) RAM + ; xb597: mov al,0x42 ; 0000B597 B042 '.B' out 0x84,al ; 0000B599 E684 '..' + xor ebp,ebp ; 0000B59B 6633ED 'f3.' xb59e: mov dx,0x0 ; 0000B59E BA0000 '...' mov eax,0x1 ; 0000B5A1 66B801000000 'f.....' @@ -6070,7 +6111,12 @@ xb673: mov al,[di+0x32] ; 0000B673 8A4532 '.E2' xb68a: stc ; 0000B68A F9 '.' ret ; 0000B68B C3 '.' - db '102-System Board Failure',0x0D,0x0A + ;* + ; Error messages + ; +err102: db '102-System Board Failure',0x0D,0x0A +err102_len equ $-err102 + db ' 201-Memory Error 203-Memory Address Error 205-Memory Error',0x0D,0x0A db ' 207-Invalid Memory Configuration',0x0A,0x0D,' Base Module',0x00 db ' Module A',0x00 @@ -6080,7 +6126,10 @@ xb68a: stc ; 0000B68A F9 '.' db 'Parity Check 1 ',0x00 db 'Parity Check 2 ',0x00 db '??????',0x00 - db '101-ROM Error',0x0D,0x0A + +err101: db '101-ROM Error',0x0D,0x0A +err101_len equ $-err101 + db ' 402-Monochrome Adapter Failure',0x0D,0x0A db ' 501-Display Adapter Failure',0x0D,0x0A db ' 301-Keyboard Error or Test Fixture Installed',0x0D,0x0A @@ -6106,18 +6155,18 @@ xb68a: stc ; 0000B68A F9 '.' db ' 605-Diskette Drive Type Error-(Run Setup)',0x0D,0x0A db ' Insert DIAGNOSTIC diskette in Drive A:',0x0D,0x0A - ; + ;* ; Video card data ; xba77: dw 0x03D8 ; 0000BA77 D803 ; +0x00: I/O address of Mode Select Register (CGA) db 0xD4,0x29,0xB4,0xF0 ; 0000BA79 D429B4F0 - dw 0xB800 ; 0000BA7D 00B8 ; +0x06: real-mode segment of frame buffer + dw 0xB800 ; 0000BA7D 00B8 ; +0x06: real-mode segment of video buffer db 0x00,0x60,0x8A,0xB7 ; 0000BA7F 00608AB7 db 0x1E,0x00,0x40 ; 0000BA83 1E0040 xba86: dw 0x03B8 ; 0000BA86 B803 ; +0x00: I/O address of Mode Select Register (Mono) db 0xB4,0x29,0xD4,0xF0 ; 0000BA88 B429D4F0 - dw 0xB000 ; 0000BA8C 00B0 ; +0x06: real-mode segment of frame buffer + dw 0xB000 ; 0000BA8C 00B0 ; +0x06: real-mode segment of video buffer db 0x00,0x60,0x69,0xB7 ; 0000BA8E 006069B7 db 0x21,0x00,0x10 ; 0000BA92 210010 @@ -6249,8 +6298,9 @@ xbb95: xor ax,ax ; 0000BB95 33C0 '3.' in al,0x40 ; 0000BBA1 E440 '.@' cmp ax,0x0 ; 0000BBA3 3D0000 '=..' jnz xbbb6 ; 0000BBA6 750E 'u.' - mov bx,0xb68c ; 0000BBA8 BB8CB6 '...' - mov cx,0x18 ; 0000BBAB B91800 '...' + + mov bx,err102 ; 0000BBA8 BB8CB6 '...' + mov cx,err102_len-2 ; 0000BBAB B91800 '...' mov bp,0xbbb4 ; 0000BBAE BDB4BB '...' jmp xc7f7 ; 0000BBB1 E9430C '.C.' @@ -6382,12 +6432,12 @@ xbc71: call xa3e0 ; 0000BC71 E86CE7 '.l.' out 0x84,al ; 0000BCAA E684 '..' call xd6dd ; 0000BCAC E82E1A '...' - ; + ;* ; Enable copy of ROM in "shadow RAM"? ; call xc825 ; 0000BCAF E8730B '.s.' - ; + ;* ; This function loads the GDTR with [00FF0730,0047], but since the previous call ; turned A20 off, the first selector load crashes, because physical address %FF0730 ; requires A20 on. @@ -6956,7 +7006,7 @@ xc19d: mov al,ah ; 0000C19D 8AC4 '..' test byte [0x17],0x4 ; 0000C1B0 F606170004 '.....' jnz xc1f9 ; 0000C1B5 7542 'uB' test byte [0x17],0x3 ; 0000C1B7 F606170003 '.....' - db 0x75,0x32 + jnz xc1f0 ; 0000C1BC 7532 test byte [0x17],0x20 ; 0000C1BE F606170020 '.... ' jnz xc1db ; 0000C1C3 7516 'u.' test byte [0x96],0x2 ; 0000C1C5 F606960002 '.....' @@ -6976,8 +7026,8 @@ xc1db: test byte [0x96],0x2 ; 0000C1DB F606960002 '.....' xc1e9: call xd3b4 ; 0000C1E9 E8C811 '...' xc1ec: xor al,al ; 0000C1EC 32C0 '2.' jmp short xc233 ; 0000C1EE EB43 '.C' - test byte [0x17],0x20 ; 0000C1F0 F606170020 '.... ' +xc1f0: test byte [0x17],0x20 ; 0000C1F0 F606170020 '.... ' jnz xc1cc ; 0000C1F5 75D5 'u.' jmp short xc1db ; 0000C1F7 EBE2 '..' @@ -7649,7 +7699,7 @@ xc704: xchg ch,cl ; 0000C704 86E9 '..' mov cx,0x4 ; 0000C718 B90400 '...' call xc72b ; 0000C71B E80D00 '.',0x0D,'.' mov al,0x20 ; 0000C71E B020 '. ' - call xc7d3 ; 0000C720 E8B000 '...' + call int10_print ; 0000C720 E8B000 '...' pop dx ; 0000C723 5A 'Z' mov cx,0x2 ; 0000C724 B90200 '...' call xc72b ; 0000C727 E80100 '...' @@ -7666,7 +7716,7 @@ xc72c: xchg ax,dx ; 0000C72C 92 '.' push dx ; 0000C739 52 'R' push cx ; 0000C73A 51 'Q' push ax ; 0000C73B 50 'P' - call xc7d3 ; 0000C73C E89400 '...' + call int10_print ; 0000C73C E89400 '...' pop ax ; 0000C73F 58 'X' pop cx ; 0000C740 59 'Y' pop dx ; 0000C741 5A 'Z' @@ -7681,6 +7731,7 @@ xc745: push ds ; 0000C745 1E '.' xc751: push bx ; 0000C751 53 'S' push cx ; 0000C752 51 'Q' + xc753: test dh,0xc0 ; 0000C753 F6C6C0 '...' jz xc760 ; 0000C756 7408 't.' call xc7ab ; 0000C758 E85000 @@ -7695,26 +7746,37 @@ xc760: test dh,0x30 ; 0000C760 F6C630 '..0' xc76d: pop cx ; 0000C76D 59 'Y' pop bx ; 0000C76E 5B '[' + xc76f: mov al,[cs:bx] ; 0000C76F 2E8A07 '...' push bx ; 0000C772 53 'S' - call xc7d3 ; 0000C773 E85D00 '.].' + call int10_print ; 0000C773 E85D00 '.].' pop bx ; 0000C776 5B '[' inc bx ; 0000C777 43 'C' loop xc76f ; 0000C778 E2F5 '..' ret ; 0000C77A C3 '.' -xc77b: mov al,[bx] ; 0000C77B 8A07 '..' + ;** + ; print_str(BX -> string, CX == length) + ; + ; TODO: Is this dead code? + ; +print_str: + mov al,[bx] ; 0000C77B 8A07 '..' push bx ; 0000C77D 53 'S' - call xc7d3 ; 0000C77E E85200 '.R.' + call int10_print ; 0000C77E E85200 '.R.' pop bx ; 0000C781 5B '[' inc bx ; 0000C782 43 'C' - loop xc77b ; 0000C783 E2F6 '..' + loop print_str ; 0000C783 E2F6 '..' ret ; 0000C785 C3 '.' -xc786: mov al,0xd ; 0000C786 B00D '.',0x0D - call xc7d3 ; 0000C788 E84800 '.H.' + ;** + ; print_crlf() + ; +print_crlf: + mov al,0xd ; 0000C786 B00D '.',0x0D + call int10_print ; 0000C788 E84800 '.H.' mov al,0xa ; 0000C78B B00A '.',0x0A - call xc7d3 ; 0000C78D E84300 '.C.' + call int10_print ; 0000C78D E84300 '.C.' ret ; 0000C790 C3 '.' xc791: mov bx,0xfa ; 0000C791 BBFA00 '...' @@ -7748,10 +7810,11 @@ xc7c7: and al,0xf ; 0000C7C7 240F '$.' daa ; 0000C7CB 27 0x27 adc al,0x40 ; 0000C7CC 1440 '.@' daa ; 0000C7CE 27 0x27 - call xc7d3 ; 0000C7CF E80100 '...' + call int10_print ; 0000C7CF E80100 '...' ret ; 0000C7D2 C3 '.' -xc7d3: mov bx,0x7 ; 0000C7D3 BB0700 '...' +int10_print: + mov bx,0x7 ; 0000C7D3 BB0700 '...' mov ah,0xe ; 0000C7D6 B40E '..' int 0x10 ; 0000C7D8 CD10 '..' ret ; 0000C7DA C3 '.' @@ -7797,8 +7860,8 @@ xc817: mov al,[bx] ; 0000C817 8A07 '..' pop es ; 0000C823 07 '.' ret ; 0000C824 C3 '.' - ; - ; Copy ROM into reserved extended RAM? + ;** + ; Copy ROM into reserved RAM? ; ; This function ends by disabling A20 and zeroing all conventional memory. ; @@ -7858,11 +7921,13 @@ xc89d: lidt [cs:0xa151] ; 0000C89D 2E0F011E51A1 '....Q.' mov ds,ax ; 0000C8AA 8ED8 '..' mov ss,[0x69] ; 0000C8AC 8E166900 '..i.' mov sp,[0x67] ; 0000C8B0 8B266700 '.&g.' - ; + + ;* ; Disable A20 ; call xa478 ; 0000C8B4 E8C1DB '...' - ; + + ;* ; Get the (conventional) memory size in Kb from 0x40:0x0013, divide by 64 (0x40) to yield ; the number of 64Kb blocks of RAM below 1Mb, and then zero each 64Kb block with "rep stosd". ; @@ -7896,8 +7961,8 @@ xc8eb: pop es ; 0000C8EB 07 '.' ret ; 0000C8EE C3 '.' xc8ef: mov dx,0x0 ; 0000C8EF BA0000 '...' - mov bx,0xb68c ; 0000C8F2 BB8CB6 '...' - mov cx,0x1a ; 0000C8F5 B91A00 '...' + mov bx,err102 ; 0000C8F2 BB8CB6 '...' + mov cx,err102_len ; 0000C8F5 B91A00 '...' call xc745 ; 0000C8F8 E84AFE '.J.' hlt ; 0000C8FB F4 '.' @@ -8350,8 +8415,9 @@ xcc5f: cs lodsb ; 0000CC5F 2EAC '..' mov al,0x92 ; 0000CC71 B092 '..' out 0x84,al ; 0000CC73 E684 '..' mov dx,0x0 ; 0000CC75 BA0000 '...' - mov bx,0xb68c ; 0000CC78 BB8CB6 '...' - mov cx,0x1a ; 0000CC7B B91A00 '...' + + mov bx,err102 ; 0000CC78 BB8CB6 '...' + mov cx,err102_len ; 0000CC7B B91A00 '...' call xc745 ; 0000CC7E E8C4FA '...' xcc81: jmp short xcc81 ; 0000CC81 EBFE '..' @@ -8452,8 +8518,8 @@ xcd1d: in al,dx ; 0000CD1D EC '.' jmp xcc9c ; 0000CD29 E970FF '.p.' xcd2c: mov dx,0x0 ; 0000CD2C BA0000 '...' - mov bx,0xb68c ; 0000CD2F BB8CB6 '...' - mov cx,0x1a ; 0000CD32 B91A00 '...' + mov bx,err102 ; 0000CD2F BB8CB6 '...' + mov cx,err102_len ; 0000CD32 B91A00 '...' call xc745 ; 0000CD35 E80DFA '.',0x0D,'.' xcd38: jmp short xcd38 ; 0000CD38 EBFE '..' @@ -8577,14 +8643,15 @@ xce0c: push es ; 0000CE0C 06 '.' mov bx,0x3c ; 0000CE2D BB3C00 '.<.' call xc638 ; 0000CE30 E805F8 '...' test byte [0x6b],0x1 ; 0000CE33 F6066B0001 '..k..' - db 0x75,0x0E + jnz xce48 ; 0000CE38 750E + mov dx,0x0 ; 0000CE3A BA0000 '...' - mov bx,0xb68c ; 0000CE3D BB8CB6 '...' - mov cx,0x1a ; 0000CE40 B91A00 '...' + mov bx,err102 ; 0000CE3D BB8CB6 '...' + mov cx,err102_len ; 0000CE40 B91A00 '...' call xc745 ; 0000CE43 E8FFF8 '...' xce46: jmp short xce46 ; 0000CE46 EBFE '..' - mov [es:0x20],bp ; 0000CE48 26892E2000 '&.. .' +xce48: mov [es:0x20],bp ; 0000CE48 26892E2000 '&.. .' and byte [0x6b],0xfe ; 0000CE4D 80266B00FE '.&k..' pop es ; 0000CE52 07 '.' ret ; 0000CE53 C3 '.' @@ -9112,7 +9179,7 @@ xd272: or al,al ; 0000D272 0AC0 0x0A,'.' cmp ah,0x1c ; 0000D280 80FC1C '...' jz xd2e1 ; 0000D283 745C 't\' cmp ah,0x37 ; 0000D285 80FC37 '..7' - db 0x75,0x1A + jnz xd2a4 ; 0000D288 751A test byte [0x96],0x10 ; 0000D28A F606960010 '.....' jz xd2d7 ; 0000D28F 7446 'tF' test byte [0x96],0x2 ; 0000D291 F606960002 '.....' @@ -9122,9 +9189,15 @@ xd272: or al,al ; 0000D272 0AC0 0x0A,'.' xd29d: and byte [0x96],0xfd ; 0000D29D 80269600FD '.&...' jmp short xd2d7 ; 0000D2A2 EB33 '.3' - db '< ~',0x0A,'...' jnz xdb58 ; 0000DB4C 750A 'u',0x0A + + ;* + ; Display the Kb value in (BP) + ; mov ax,0x40 ; 0000DB4E B84000 '.@.' mov es,ax ; 0000DB51 8EC0 '..' mov ax,bp ; 0000DB53 8BC5 '..' call x80a5 ; 0000DB55 E84DA5 '.M.' + xdb58: cmp word [0x82],byte +0x0 ; 0000DB58 833E820000 '.>...' jnz xdb6b ; 0000DB5D 750C 'u.' mov ax,0x0 ; 0000DB5F B80000 '...' mov word [0x84],0x0 ; 0000DB62 C70684000000 '......' jmp xdbf1 ; 0000DB68 E98600 '...' + ;* + ; Test another 64Kb of memory + ; xdb6b: mov al,0x71 ; 0000DB6B B071 '.q' out 0x84,al ; 0000DB6D E684 '..' mov ax,0x48 ; 0000DB6F B84800 '.H.' @@ -10101,10 +10203,15 @@ xdb6b: mov al,0x71 ; 0000DB6B B071 '.q' mov al,[0x8f] ; 0000DB78 A08F00 '...' cmp [0x4c],al ; 0000DB7B 38064C00 '8.L.' ja xdb86 ; 0000DB7F 7705 'w.' + + ;* + ; Test the memory at segment (ES), carry clear if success + ; call xad38 ; 0000DB81 E8B4D1 '...' jmp short xdb89 ; 0000DB84 EB03 '..' xdb86: call x8c7e ; 0000DB86 E8F5B0 '...' + xdb89: pop bp ; 0000DB89 5D ']' pop di ; 0000DB8A 5F '_' pop si ; 0000DB8B 5E '^' @@ -10113,8 +10220,8 @@ xdb89: pop bp ; 0000DB89 5D ']' mov ch,[0x4c] ; 0000DB8F 8A2E4C00 '..L.' mov ax,0x1 ; 0000DB93 B80100 '...' jmp short xdbed ; 0000DB96 EB55 '.U' - nop ; 0000DB98 90 '.' + xdb99: add bx,byte +0x40 ; 0000DB99 83C340 '..@' cld ; 0000DB9C FC '.' push di ; 0000DB9D 57 'W' @@ -10143,7 +10250,15 @@ xdbc2: stosw ; 0000DBC2 AB '.' mov es,ax ; 0000DBD0 8EC0 '..' mov ax,bp ; 0000DBD2 8BC5 '..' add ax,bx ; 0000DBD4 03C3 '..' - call x80a5 ; 0000DBD6 E8CCA4 '...' + + ;* + ; Display (AX) as a 5-digit value in the top-left corner of the screen, followed by " KB OK" + ; + call x80a5 ; 0000DBD6 E8CCA4 + + ;* + ; After displaying "00192 KB OK", BX is 0x40 and [0x82] contains 0x80. + ; xdbd9: cmp [0x82],bx ; 0000DBD9 391E8200 '9...' ja xdbe5 ; 0000DBDD 7706 'w.' mov ax,0x0 ; 0000DBDF B80000 '...' @@ -10153,6 +10268,9 @@ xdbd9: cmp [0x82],bx ; 0000DBD9 391E8200 '9...' xdbe5: add byte [0x4c],0x1 ; 0000DBE5 80064C0001 '..L..' jmp xdb6b ; 0000DBEA E97EFF '.~.' + ;* + ; Now we're on to a new phase, after displaying "00256 KB OK" + ; xdbed: mov [0x84],bx ; 0000DBED 891E8400 '....' xdbf1: push ax ; 0000DBF1 50 'P' mov al,0x73 ; 0000DBF2 B073 '.s' @@ -10688,8 +10806,9 @@ xe137: mov al,bl ; 0000E137 8AC3 '..' out 0x4b,al ; 0000E148 E64B '.K' mov al,0x12 ; 0000E14A B012 '..' out 0x4b,al ; 0000E14C E64B '.K' - mov bx,0xb68c ; 0000E14E BB8CB6 '...' - mov cx,0x18 ; 0000E151 B91800 '...' + + mov bx,err102 ; 0000E14E BB8CB6 '...' + mov cx,err102_len-2 ; 0000E151 B91800 '...' mov bp,0xe15a ; 0000E154 BD5AE1 '.Z.' jmp xc7f7 ; 0000E157 E99DE6 '...' @@ -10885,15 +11004,15 @@ xe2c8: mov al,0xe ; 0000E2C8 B00E '..' or ah,0x20 ; 0000E2D8 80CC20 '.. ' xe2db: mov al,ah ; 0000E2DB 8AC4 '..' test al,0xc0 ; 0000E2DD A8C0 '..' - db 0x74,0x13 + jz xe2f4 ; 0000E2DF 7413 mov dx,0x2000 ; 0000E2E1 BA0020 '.. ' mov bx,0xb8a0 ; 0000E2E4 BBA0B8 '...' mov cx,0x56 ; 0000E2E7 B95600 '.V.' call xc745 ; 0000E2EA E858E4 '.X.' or byte [0x12],0xff ; 0000E2ED 800E1200FF '.....' jmp short xe336 ; 0000E2F2 EB42 '.B' - test al,0x20 ; 0000E2F4 A820 '. ' +xe2f4: test al,0x20 ; 0000E2F4 A820 '. ' jz xe309 ; 0000E2F6 7411 't.' mov dx,0x2000 ; 0000E2F8 BA0020 '.. ' mov bx,0xb8a0 ; 0000E2FB BBA0B8 '...' @@ -11465,7 +11584,7 @@ xe7d0: cld ; 0000E7D0 FC '.' xe7d1: cs lodsb ; 0000E7D1 2EAC '..' cmp al,0x24 ; 0000E7D3 3C24 '<$' jz xe7dc ; 0000E7D5 7405 't.' - call xc7d3 ; 0000E7D7 E8F9DF '...' + call int10_print ; 0000E7D7 E8F9DF '...' jmp short xe7d1 ; 0000E7DA EBF5 '..' xe7dc: ret ; 0000E7DC C3 '.' @@ -11489,6 +11608,9 @@ xe7f0: and ah,0xc0 ; 0000E7F0 80E4C0 '...' call xf30a ; 0000E807 E8000B '...' xe80a: ret ; 0000E80A C3 '.' + ;* + ; Compare DS:BX to ES:DI; return carry CLEAR if success, or carry SET if failure + ; xe80b: mov si,bx ; 0000E80B 8BF3 '..' mov cx,0x21 ; 0000E80D B92100 '.!.' repe cmpsd ; 0000E810 66F3A7 'f..' @@ -11690,10 +11812,10 @@ xe97c: call xec2e_wait_8042_ready ; 0000E97C E8AF02 '...' jz xe9b2 ; 0000E995 741B 't.' in al,0x60 ; 0000E997 E460 '.`' cmp al,0xab ; 0000E999 3CAB '<.' - db 0x75,0x0A + jnz xe9a7 ; 0000E99B 750A or byte [0x96],0x40 ; 0000E99D 800E960040 '....@' and byte [0x96],0x7f ; 0000E9A2 802696007F '.&...' - mov al,0x20 ; 0000E9A7 B020 '. ' +xe9a7: mov al,0x20 ; 0000E9A7 B020 '. ' out 0x20,al ; 0000E9A9 E620 '. ' sti ; 0000E9AB FB '.' mov bp,0xffff ; 0000E9AC BDFFFF '...' @@ -11703,7 +11825,7 @@ xe9b2: test byte [0x96],0x40 ; 0000E9B2 F606960040 '....@' jz xe9fa ; 0000E9B7 7441 'tA' in al,0x60 ; 0000E9B9 E460 '.`' cmp al,0x41 ; 0000E9BB 3C41 '= 0x20 && v < 0x7F && v != 0x3C && v != 0x3E? String.fromCharCode(v) : "."); } @@ -1534,7 +1534,7 @@ DiskDump.prototype.buildFAT = function(abFAT, aFiles, iCluster, cbCluster) while (cFileClusters-- > 0) { var iNextCluster = iCluster + 1; if (!cFileClusters) iNextCluster = 0xFFF; - // if (fDebug) DiskDump.logConsole(aFiles[iFile].FILE_NAME + ": setting cluster entry " + iCluster + " to 0x" + str.toHexWord(iNextCluster)); + // if (fDebug) DiskDump.logConsole(aFiles[iFile].FILE_NAME + ": setting cluster entry " + iCluster + " to " + str.toHexWord(iNextCluster)); this.buildFATEntry(abFAT, iCluster++, iNextCluster); } } diff --git a/modules/filedump/lib/filedump.js b/modules/filedump/lib/filedump.js index ef82eb727..ae35809c2 100644 --- a/modules/filedump/lib/filedump.js +++ b/modules/filedump/lib/filedump.js @@ -388,7 +388,7 @@ FileDump.prototype.dumpBuffer = function(sKey, buf, len, cbItem, offData) this.sKey = sKey; if (this.sFormat != DumpAPI.FORMAT.HEX) { - chOpen = '['; chClose = ']'; chSep = ','; sHexPrefix = "0x"; + chOpen = '['; chClose = ']'; chSep = ','; } var sDump = this.dumpLine(2, (sKey? '"' + sKey + '":' : "") + this.sJSONWhitespace + chOpen); @@ -424,7 +424,7 @@ FileDump.prototype.dumpBuffer = function(sKey, buf, len, cbItem, offData) if (this.fDecimal) { sLine += v; } else { - sLine += sHexPrefix + str.toHexByte(v); + sLine += str.toHexByte(v); } if (!sASCII) sASCII = "0x" + str.toHex(offData + off) + " "; sASCII += (v >= 0x20 && v < 0x7F && v != 0x3C && v != 0x3E? String.fromCharCode(v) : "."); diff --git a/modules/pcjs/lib/chipset.js b/modules/pcjs/lib/chipset.js index cfdc7ab6a..520982a78 100644 --- a/modules/pcjs/lib/chipset.js +++ b/modules/pcjs/lib/chipset.js @@ -736,12 +736,13 @@ ChipSet.KBC = { }, RWREG: { // this.bPPIB (since CLK_TIMER2 and SPK_TIMER2 are in both PPI_B and KBC.RWREG) PORT: 0x61, - CLK_TIMER2: 0x01, // set to enable clock to TIMER2 - SPK_TIMER2: 0x02, // set to connect output of TIMER2 to speaker - DISABLE_CHK: 0x0C, // set these bits to disable I/O and RAM parity checks, clear them to enable checks - REFRESH_BIT: 0x10, // indicates memory refresh - IO_CHK: 0x40, // indicates I/O check - PARITY_CHK: 0x80, // indicates RAM parity check + CLK_TIMER2: 0x01, // set to enable clock to TIMER2 (R/W) + SPK_TIMER2: 0x02, // set to connect output of TIMER2 to speaker (R/W) + DISABLE_CHK: 0x0C, // set to disable I/O and RAM parity checks, clear to enable (R/W) + REFRESH_BIT: 0x10, // 0 if RAM refresh occurring, 1 if RAM not in refresh cycle (R/O) + OUT_TIMER2: 0x20, // state of TIMER2 output signal (R/O, DESKPRO386) + IO_CHK: 0x40, // indicates I/O check (R/O); to reset, pulse bit 3 (0x08) + PARITY_CHK: 0x80, // indicates RAM parity check (R/O); to reset, pulse bit 2 (0x04) PARITY_ERR: 0xC0 }, CMD: { // this.b8042InBuff (on write to port 0x64, interpret this as a CMD) diff --git a/modules/pcjs/lib/debugger.js b/modules/pcjs/lib/debugger.js index 3698aff97..2499a3e3f 100644 --- a/modules/pcjs/lib/debugger.js +++ b/modules/pcjs/lib/debugger.js @@ -2328,7 +2328,10 @@ if (DEBUGGER) { var msTotal = ms - this.msStart; var nCyclesPerSecond = (msTotal > 0? Math.round(this.nCycles * 1000 / msTotal) : 0); sStopped += " ("; - if (this.checksEnabled()) sStopped += this.cInstructions + " ops, "; + if (this.checksEnabled()) { + sStopped += this.cInstructions + " ops, "; + this.cInstructions = 0; // remove this line if you want to maintain a longer total + } sStopped += this.nCycles + " cycles, " + msTotal + " ms, " + nCyclesPerSecond + " hz)"; if (MAXDEBUG && this.chipset) { var i, c, n;