; Lark peripheral initialization ; Personalized for TeleLoad ; L. Stewart, January 4, 1982 8:13 PM C←CODE SEGMENT SPIN EQU 3FF0H C←DATA SEGMENT ←mstate LABEL BYTE rax DW ? rbx DW ? rcx DW ? rdx DW ? rsp DW ? rbp DW ? rsi DW ? rdi DW ? rcs DW ? rds DW ? rss DW ? res DW ? rip DW ? rfl DW ? C←DATA ENDS EXTRN ←main:NEAR ASSUME CS:C←CODE, DS:C←DATA ←cstart: MOV AX,SPIN MOV SP,AX MOV AX,CS MOV SS,AX MOV ES,AX MOV DS,AX CALL ←main JMP DWORD PTR JHUNK JHUNK DW 00H DW 0FFFFH ; The format of this stuff is <port address><byte count><bytes> ; port FF terminates the list ; first set up the 8255 and reset all its outputs ←IRESET LABEL BYTE DB 0D3H DB 1 DB 088H ; Port A, B C[0..3] output, C[4..7] input DB 0D0H DB 1 DB 000H DB 0D1H DB 1 DB 000H DB 0D2H DB 1 DB 000H ; reset both DMA controllers DB 04FH DB 1 DB 00FH DB 01FH DB 1 DB 00FH DB 04DH DB 1 DB 000H DB 01DH DB 1 DB 000H ; Set up SLC controller only DB 048H DB 1 DB 020H DB 04BH DB 1 DB 0C1H DB 04FH DB 1 DB 00DH DB 0FFH ;portstr(p) ; char *p; ; { ; int port; ; int count; ; while(*p != 0x00ff) { ; port = *p++; ; count = *p++; ; while (count--) { ; outbyte(port, *p++); ; }; ; }; ; }; ; enters with BX pointer to port string ←portstr LABEL NEAR XOR AH,AH CLD MOV SI,BX X16: LODSB CMP AL,0FFH JNE X17 RET X17: MOV DX,AX LODSB MOV CX,AX X18: LODSB OUT DX,AL LOOP X18 JMP X16 ←startm LABEL NEAR MOV AX,rss MOV SS,AX MOV AX,rsp MOV SP,AX PUSH rfl PUSH rcs PUSH rip MOV BX,rbx MOV CX,rcx MOV DX,rdx MOV SI,rsi MOV DI,rdi MOV BP,rbp MOV AX,rax PUSH res PUSH rds POP DS POP ES IRET PUBLIC ←IRESET PUBLIC ←portstr PUBLIC ←mstate PUBLIC ←startm C←CODE ENDS END