|
|
| version 1.1, 2004/01/22 01:11:29 | version 1.4, 2004/03/19 00:30:01 |
|---|---|
| Line 1 | Line 1 |
| .186 | |
| CODE SEGMENT | ORG 0 |
| ASSUME CS:CODE,DS:nothing,ES:nothing,SS:nothing | USE16 |
| ORG 0000H | CPU 8086 |
| FIXCS equ 2eh | segment .sasi start=0x0000 |
| START: retf ; 00 | retf ; 00 |
| nop | nop |
| nop | nop |
| retf ; 03 | retf ; 03 |
| Line 16 START: retf ; 00 | Line 15 START: retf ; 00 |
| nop | nop |
| nop | nop |
| db 055h, 0aah, 002h ; 09 | db 055h, 0aah, 002h ; 09 |
| jmp short sasi_init1 ; 0c | jmp short init1 ; 0c |
| nop | nop |
| jmp short sasi_init2 ; 0f | jmp short init2 ; 0f |
| nop | nop |
| retf ; 12 | retf ; 12 |
| nop | nop |
| nop | nop |
| jmp short sasi_boot ; 15 | jmp short boot ; 15 |
| nop | nop |
| jmp short sasi_bios ; 18 | jmp short bios ; 18 |
| nop | nop |
| retf ; 1b | retf ; 1b |
| nop | nop |
| Line 49 START: retf ; 00 | Line 48 START: retf ; 00 |
| nop | nop |
| nop | nop |
| sasi_init1: mov byte ptr [bx], 0d9h | init1: mov byte [bx], 0xd9 |
| retf | retf |
| sasi_init2: mov ax, cs | init2: mov ax, cs |
| mov ds:[04b0h], ah | mov word [0x0044], sasiint |
| mov ds:[04b8h], ah | mov [0x0046], ax |
| mov ax, 0300h | mov [0x04b0], ah |
| int 1bh | mov [0x04b8], ah |
| mov ax, 0x0300 | |
| int 0x1b | |
| retf | retf |
| sasi_bios: cld | bios: cld |
| mov dx, cs | mov dx, cs |
| mov ds, dx | mov ds, dx |
| mov cx, 8 | mov cx, 8 |
| mov si, offset sasibiosstr | mov si, sasibiosstr |
| mov dx, 07efh | mov dx, 0x07ef |
| cli | cli |
| rep outsb | .loop: lodsb |
| out dx, al | |
| loop .loop | |
| sti | sti |
| pop ax | pop ax |
| pop bx | pop bx |
| Line 79 sasi_bios: cld | Line 82 sasi_bios: cld |
| pop ds | pop ds |
| iret | iret |
| sasi_boot: cmp al, 0ah | boot: cmp al, 0x0a |
| je short sasi_boot2 | je short .main |
| cmp al, 0bh | cmp al, 0x0b |
| je short sasi_boot2 | je short .main |
| retf | retf |
| sasi_boot2: sub al, 9 | .main: sub al, 9 |
| mov dl, 0ffh | test [0x055d], al ; sasi |
| test ds:[055dh], al ; sasi | je short .exit |
| je short boot_exit | |
| dec al | dec al |
| mov ah, 06h | mov ah, 0x06 |
| mov cx, 1fc0h | mov cx, 0x1fc0 |
| mov es, cx | mov es, cx |
| mov bp, bx | xor bp, bp |
| mov cx, bx | mov bx, 0x0400 |
| mov dx, bx | xor cx, cx |
| mov bh, 4 | xor dx, dx |
| int 1bh | int 0x1b |
| jc short boot_exit | jc short .exit |
| or al, 80h | or al, 0x80 |
| mov byte ptr ds:[0584h], al | mov [0x0584], al |
| db 9ah ; call far | db 0x9a ; call far |
| dw 0 | dw 0x0000 |
| dw 1fc0h | dw 0x1fc0 |
| boot_exit: retf | .exit: retf |
| ; MS-DOSがこの割り込みを使用する... | |
| sasiint: push ax | |
| in al, 0x82 | |
| and al, 0xfd | |
| cmp al, 0xad | |
| je short .readstat | |
| and al, 0xf9 | |
| cmp al, 0xa1 | |
| jne short .eoi | |
| .readstat: push ds | |
| xor ax, ax | |
| mov ds, ax | |
| or byte [0x055f], 1 | |
| mov al, 0xc0 | |
| out 0x82, al | |
| pop ds | |
| .eoi: mov al, 0x20 | |
| out 0x08, al | |
| mov al, 0x0b | |
| out 0x08, al | |
| in al, 0x08 | |
| test al, al | |
| jne short .exit | |
| mov al, 0x20 | |
| out 0x00, al | |
| .exit: pop ax | |
| iret | |
| sasibiosstr db "scsibios" | sasibiosstr db "sasibios" |
| CODE ENDS | ends |
| END START | |