;--------------------------------------------------------------------- ; M5SPEC.A86 ; 16-06-88 ; Stephen Hunt ;--------------------------------------------------------------------- ver equ 10 ;--------------------------------------------------------------------- m5_lab_os equ 0400h m5_lab_seg equ 0h hdsk_size equ 10 ;Hard disk: number of sectors/track get_switch equ 30 ;System type switch mc_version equ 31 ;Get hardware firmware & OEM versions ;--------------------------------------------------------------------- bit0 equ 00000001b bit1 equ 00000010b bit2 equ 00000100b bit3 equ 00001000b bit4 equ 00010000b bit5 equ 00100000b bit6 equ 01000000b bit7 equ 10000000b ;--------------------------------------------------------------------- c_write equ 02h c_writestr equ 09h ccpm equ 0e0h cr equ 0dh lf equ 0ah ;--------------------------------------------------------------------- codemacro prom_entry ;callf f800:7ff5 db 09aH dw 07ff5H dw 0f800H endm codemacro aam_10h ;aam with operand of 010h.. db 0d4h ;..instead of default 0ah.. db 010h ;..splits al in ah & al endm ;--------------------------------------------------------------------- ; start of program ;--------------------------------------------------------------------- cseg org 0h ;--------------------------------------------------------------------- ; check that this is an octopus ;--------------------------------------------------------------------- check_octopus: ; push es mov ax,m5_lab_seg mov es,ax mov si,offset m5_label mov di,m5_lab_os mov cx,03h cld rep cmpsw pop es jz print_signon not_octopus: ; mov dx,offset err_unknown call print_string jmp exit print_signon: ; mov dx,offset signon call print_string ;--------------------------------------------------------------------- ; display PROM messages (where fitted) ;--------------------------------------------------------------------- prom_firmware: ; mov dx,offset prom_msg call print_string mov ax,0ff00h ;firmware prom segment addr call print_prom mov ax,0e100h ;network prom segment addr call print_prom mov ax,0e700h ;graphics prom segment addr call print_prom mov ax,0f900h ;diagnostic prom segment addr call print_prom jmp switch_setting print_prom: ; push ds cld mov ds,ax mov si,0fe0h ;offset of prom message cmp byte ptr 0[si],080h ;test first byte of message.. jb print_prom_loop pop ds ret ;..and return if not fitted print_prom_loop: ; lodsb push ax and al,07fh ;mask off bit 7 if set call print_chr pop ax cmp al,080h jb print_prom_loop ;loop if bit 7 not set print_prom_end: ; pop ds mov dx,offset crlf call print_string ret ;--------------------------------------------------------------------- ; get switch settings ;--------------------------------------------------------------------- switch_setting: ; mov al,get_switch prom_entry mov switch,ax bank_1_switch_1: ; test ah,bit0 jz bank_1_switch_2 mov dx,offset b1s1 ;german Language prom call print_string bank_1_switch_2: ; mov ax,switch test ah,bit1 jz bank_1_switch_4 mov dx,offset b1s2 ;panasonic or nec drives call print_string ;bank_1_switch_3 ;not used bank_1_switch_4: ; mov ax,switch test ah,bit3 jz bank_2_switch_1 mov dx,offset b1s4 ;auto boot call print_string bank_2_switch_1: ; mov ax,switch test al,bit0 jz bank_2_switch_2 mov dx,offset b2s1 ;single drive call print_string bank_2_switch_2: ; mov ax,switch test al,bit1 jz bank_2_switch_3 mov dx,offset b2s2 ;twin drive call print_string bank_2_switch_3: ; mov ax,switch mov dx,offset b2s30 ;DD 400k drive(s) test al,bit2 jz bank_2_switch_3a mov dx,offset b2s31 ;QD 800k drive(s) bank_2_switch_3a: ; call print_string mov dx,offset floppy call print_string bank_2_switch_4567: ;winchester type, bits 4 - 7 ; mov dx,offset crlf call print_string mov bx,switch and bx,0000000001111000b ;leave only winchester codes mov cl,3 shr bx,cl ;shift bx right 3 mov hd_code,bx ;store hard drive code add bx,bx ;double bx add bx,offset drv_tbl ;add drive table offset mov dx,[bx] ;dx=offset of drive type call print_string cmp hd_code,0 ;skip hard disk details.. jz bank_2_switch_8 ;if there's no hard disk ;--------------------------------------------------------------------- ; get hard disk configuration details ;--------------------------------------------------------------------- get_hdisk_config: ; mov dx,offset crlf call print_string xor ax,ax ;controller 0, drive 0 push ax mov al,hdsk_size prom_entry mov hd_heads,bl mov hd_cntrl,bh mov hd_sects,cx mov hd_cylnd,si mov hd_totsec+0,ax ;dont bother with these.. mov hd_totsec+2,dx ;..pair of values ;--------------------------------------------------------------------- ; print hard disk configuration details ;--------------------------------------------------------------------- print_hdisk_config: ; mov dx,offset msg_heads call print_string mov al,hd_heads xor ah,ah ;ax holds number call print_as_dec ;print as decimal mov dx,offset msg_cntrl call print_string mov al,hd_cntrl xor ah,ah ;ax hold number call print_as_dec ;print as decimal mov dx,offset msg_sects call print_string mov ax,hd_sects ;ax holds number call print_as_dec ;print as decimal mov dx,offset msg_cylnd call print_string mov ax,hd_cylnd ;ax holds number call print_as_dec ;print as decimal mov dx,offset crlf call print_string ;--------------------------------------------------------------------- ; finaly, print bank 2 switch setting 8 ;--------------------------------------------------------------------- bank_2_switch_8: ; mov ax,switch mov dx,offset b2s80 ;mono monitor test al,bit7 jz bank_2_switch_8a mov dx,offset b2s81 ;colour monitor bank_2_switch_8a: ; call print_string mov dx,offset monitor call print_string jmp exit ;--------------------------------------------------------------------- ; convert hex word to ascii decimal and print at cursor position ;--------------------------------------------------------------------- ; entry : ax = binary number ;--------------------------------------------------------------------- print_as_dec: ; push ax ;save number mov ax,'$$' mov cx,3 mov di,offset decimal cld rep stosw ;init decimal string with '$' pop ax ;restore number hex_to_dec_length: ; mov cx,5 ;5 digits ? cmp ax,10000 jae hex_dec_conv dec cx ;4 digits ? cmp ax,1000 jae hex_dec_conv dec cx cmp ax,100 ;3 digits jae hex_dec_conv dec cx cmp ax,10 ;2 digits jae hex_dec_conv dec cx ;ok then.. 1 digit hex_dec_conv: ; mov si,offset decimal ;point to decimal string buffer add si,cx dec si ;si points to last digit mov bx,10 hex_to_dec_loop: ; sub dx,dx div bx add dl,'0' mov [si],dl dec si loop hex_to_dec_loop mov dx,si inc dx ;dx=offset decimal string ; jmp print_string ;print ascii decimal ;--------------------------------------------------------------------- ; print string at offset dx (terminated by '$') ;--------------------------------------------------------------------- print_string: ; mov cl,c_writestr jmp bdos ;--------------------------------------------------------------------- ; print character in al ;--------------------------------------------------------------------- print_chr: ; mov dl,al mov cl,c_write jmp bdos ;--------------------------------------------------------------------- ; exit back to ccpm ;--------------------------------------------------------------------- exit: ; xor cl,cl ;fall through to bdos ;--------------------------------------------------------------------- ; call bdos, preserve es ;--------------------------------------------------------------------- bdos: ; push es int ccpm pop es ret ;--------------------------------------------------------------------- ; date segment ;--------------------------------------------------------------------- dseg org 0100h signon db cr,lf,'Octopus Specification Utility - Version ' db ver/10+'0','.',ver mod 10+'0' db cr,lf,'--------------------------------------------' crlf db cr,lf,'$' err_unknown db cr,lf,'This program only runs on an LSI Octopus',cr,lf,'$' prom_msg db cr,lf,'Prom Levels :-',cr,lf,lf,'$' b1s1 db cr,lf,'German Language (if prom fitted)$' b1s2 db cr,lf,'Panasonic or NEC floppy drives$' b1s4 db cr,lf,'Autoboot set$' b2s1 db cr,lf,'Single $' b2s2 db cr,lf,'Twin $' b2s30 db 'DD 400k$' b2s31 db 'QD 800k$' b2s80 db cr,lf,'Monochrome$' b2s81 db cr,lf,'Colour$' floppy db ' floppy drive(s)$' monitor db ' monitor$' drv_tbl dw offset X0000,offset Y0001,offset Z0010,offset Z0011 dw offset Z0100,offset Z0101,offset Z0110,offset Y0001 dw offset Z1000,offset Z1001,offset Z1010,offset Y0001 dw offset Z1100,offset Z1101,offset Z1110,offset Y0001 X0000 db 'No Winchester$' Y0001 db 'Unknown Winchester Type !$' Z0010 db '20 MB -- Rodime R0204 90ms -or- Ampex PYXIS 13 90ms$' Z0011 db '40 MB -- Seagate ST251 40ms -or- Miniscribe 3650 61ms$' Z0100 db '10 MB -- Rodime R0202 90ms -or- Ampex PYXIS 13 90ms$' Z0101 db '40 MB -- Priam V150 28ms -or- Miniscribe 6053 28ms$' Z0110 db '40 Mb -- Rodime R0204E 55ms$' Z1000 db '5 MB -- Rodime R0201 90ms -or- Ampex PYXIS 7 90ms$' Z1001 db '20 MB -- Seagate ST225 65ms$' Z1010 db '20 MB -- Rodime R0202E 55ms$' Z1100 db '10 MB -- Rodime R0201E 55ms$' Z1101 db '70 MB -- Priam V185 28ms$' Z1110 db '10 MB -- Seagate ST213$' msg_heads db cr,lf,' Number of heads : $' msg_cntrl db cr,lf,' Controller number : $' msg_sects db cr,lf,' Number of 512 byte sectors/track : $' msg_cylnd db cr,lf,' Number of cylinders : $' decimal db '$$$$$$' switch rw 1 hd_code rw 1 hd_heads rb 1 hd_cntrl rb 1 hd_sects rw 1 hd_cylnd rw 1 hd_totsec rw 2 m5_label db 'Lsi_M5' db 0 end