|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3323 (0xcfb) Types: TextFile Notes: UNIX file Names: »chanint.asm«
└─⟦0cfe73749⟧ Bits:30004154/config.imd SW95707I VP/ix MS-DOS emulator Rel. 1.1 └─⟦0cfe73749⟧ UNIX Filesystem └─⟦this⟧ »vc/new/usr/vpix/src/channels/chanint.asm«
;=============================================================================\r ; Interrupt-handler for channels test program\r ;=============================================================================\r \r \r ;=============================================================================\r ; Declarations\r ;=============================================================================\r \r ; declare the UNIX buffer\r \r extrn _unixbuff:byte ; UNIX->DOS comm buffer\r \r ; definitions for printing the UNIX message\r \r DOS_SYSCALL equ 21H ; DOS syscall interrupt number\r DOS_PUTCHAR equ 2 ; DOS output char syscall code\r CR equ 0DH ; ASCII carriage return\r LF equ 0AH ; ASCII line feed\r \r \r ;=============================================================================\r ; Data\r ;=============================================================================\r \r \r DGROUP group _DATA\r _DATA segment word public 'DATA'\r assume ds:DGROUP\r \r _DATA ends\r \r \r ;=============================================================================\r ; Code\r ;=============================================================================\r \r assume cs:_TEXT\r \r _TEXT segment public byte 'CODE'\r \r \r ;============================================================================\r ; interrupt handler - print the message from the UNIX->DOS buffer\r ;============================================================================\r \r public _inthdl\r \r _inthdl proc far\r \r ; disable interrupts\r \r cli\r \r ; save flags and registers\r \r pushf\r push ax\r push bx\r push cx\r push dx\r push ds\r push es\r push di\r push si\r push bp\r \r ; point DS:SI at the UNIX->DOS communication buffer\r \r mov ax, seg _unixbuff\r mov ds, ax\r mov ax, offset _unixbuff\r mov si, ax\r \r ; print contents of the buffer\r \r cld ; set up for string moves\r print1: lodsb ; get the character\r or al, al ; is it end of string?\r jz done ; yes - exit loop\r cmp al, LF ; is it end of line?\r jne print2 ; no - output character as is\r mov dl, CR ; get carriage return character\r mov ah, DOS_PUTCHAR ; DOS output char system call number\r int DOS_SYSCALL ; DOS system call to output char\r mov al, LF ; set line feed character back in AL\r print2: mov dl, al ; get character\r mov ah, DOS_PUTCHAR ; DOS output char system call number\r int DOS_SYSCALL ; DOS system call to output char\r jmp print1 ; check for more characters\r \r done:\r ; restore registers and flags\r \r pop bp\r pop si\r pop di\r pop es\r pop ds\r pop dx\r pop cx\r pop bx\r pop ax\r popf\r \r ; re-enable interrupts and return\r \r sti\r iret\r \r _inthdl endp\r \r _TEXT ends\r \r end\r \r