--- np2/romimage/SCSIBIOS.ASM 2004/01/31 20:05:23 1.2 +++ np2/romimage/SCSIBIOS.ASM 2004/03/19 00:30:01 1.3 @@ -1,11 +1,11 @@ -CODE SEGMENT - ASSUME CS:CODE,DS:nothing,ES:nothing,SS:nothing - ORG 0000H + ORG 0 + USE16 + CPU 8086 -FIXCS equ 2eh +segment .scsi start=0x0000 -START: retf ; 00 + retf ; 00 nop nop retf ; 03 @@ -15,16 +15,16 @@ START: retf ; 00 nop nop db 055h, 0aah, 002h ; 09 - jmp short scsi_init1 ; 0c + jmp short init1 ; 0c nop - jmp short scsi_init2 ; 0f + jmp short init2 ; 0f nop retf ; 12 nop nop - jmp short scsi_boot ; 15 + jmp short boot ; 15 nop - jmp short scsi_bios ; 18 + jmp short bios ; 18 nop retf ; 1b nop @@ -48,34 +48,30 @@ START: retf ; 00 nop nop -scsi_init1: mov word ptr [bx], 082c2h +init1: mov word [bx], 0x82c2 retf -scsi_init2: mov ax, cs - mov ds:[04b2h], ah - mov ds:[04bah], ah - mov ds:[04bch], ah - mov ax, 0320h - int 1bh +init2: mov ax, cs + mov [0x04b2], ah + mov [0x04ba], ah + mov [0x04bc], ah + mov ax, 0x0320 + int 0x1b retf -scsi_bios: cld +bios: cld mov dx, cs mov ds, dx mov cx, 8 - mov si, offset scsibiosstr - test byte ptr [bp], 40h - je short scsisend + mov si, scsibiosstr + test byte [bp], 0x40 + je short .send lea si, [si + 8] -scsisend: mov dx, 07efh +.send: mov dx, 0x07ef cli - if 1 -@@: lodsb +.loop: lodsb out dx, al - loop short @b - else - rep outsb - endif + loop .loop sti pop ax pop bx @@ -88,27 +84,26 @@ scsisend: mov dx, 07efh pop ds iret -scsi_boot: cmp al, 0ch - jne short boot_exit - mov ax, 4620h - mov cx, 1fc0h +boot: cmp al, 0x0c + jne short .exit + mov ax, 0x4620 + mov cx, 0x1fc0 mov es, cx - mov bp, bx - mov cx, bx - mov dx, bx - mov bh, 4 - int 1bh - jc short boot_exit - or al, 80h - mov byte ptr ds:[0584h], al - db 9ah ; call far - dw 0 - dw 1fc0h -boot_exit: retf + xor bp, bp + mov bx, 0x400 + xor cx, cx + xor dx, dx + int 0x1b + jc short .exit + or al, 0x80 + mov [0x0584], al + db 0x9a ; call far + dw 0x0000 + dw 0x1fc0 +.exit: retf scsibiosstr db "scsibios" db "scsi_dev" -CODE ENDS - END START + ends