5 subtype Codes is Morse_Str ( Length ) - using the current ITU standard with 5 signs - only alphanumeric characters are taken into consideration type Codings is record L : Length Code : Codes end record Table : constant array ( Reschars ) of Codings := (' A ' => ( 2, ".- " ), ' B ' => ( 4, ". ' Z ' - restricted set of characters from 16#20# to 16#60# subtype Length is Natural range 1. Package Morse is type Symbols is ( Nul, '-', '.', ' ' ) - Nul is the letter separator, space the word separator Dash : constant Symbols := '-' Dot : constant Symbols := '.' type Morse_Str is array ( Positive range ) of Symbols pragma Pack ( Morse_Str ) function Convert ( Input : String ) return Morse_Str procedure Morsebeep ( Input : Morse_Str ) private subtype Reschars is Character range ' '. PROC ProcessSound(CHAR ARRAY s BYTE last) IntraGapDuration,letterGapDuration,wordGapDuration text org 100 h Set up the PIT to generate a 'C' note cli mov al ,( 2 ? db. Ĝontrol bits SPKR: equ 3 Lower two bits of KBB determine speaker on/off CTR: equ 6 Counter select offset in PIT control byte CBITS: equ 4 Size select offset in PIT control byte B16: equ 3 16-bit mode for the PIT counter MODE: equ 1 Offset of mode in PIT control byte SQWV: equ 3 Square wave mode Software interrupts CLOCK: equ 1 Ah BIOS clock function interrupt DOS: equ 21 h MS-DOS syscall interrupt MS-DOS syscalls read: equ 3 Fh Read from file section. Cpu 8086 bits 16 I/O ports KBB: equ 61 h Keyboard controller port B (also controls speaker) PITC2: equ 42 h Programmable Interrupt Timer, channel 2 (frequency) PITCTL: equ 43 h PIT control port.
0 Comments
Leave a Reply. |