Terminal control/Ringing the terminal bell: Difference between revisions

Added 6800 Assembly Example
(Added groovy version)
(Added 6800 Assembly Example)
Line 3:
 
In most terminals, if the [[wp:Bell character|Bell character]] (ASCII code 7, <code>\a</code> in C) is printed by the program, it will cause the terminal to ring its bell. This is a function of the terminal, and is independent of the programming language of the program, other than the ability to print a particular character to standard out.
 
=={{header|6800 Assembly}}==
<lang> .cr 6800
.tf bel6800.obj,AP1
.lf bel6800
;=====================================================;
; Ring the Bell for the Motorola 6800 ;
; by barrym 2013-03-31 ;
;-----------------------------------------------------;
; Rings the bell of an ascii terminal (console) ;
; connected to a 1970s vintage SWTPC 6800 system, ;
; which is the target device for this assembly. ;
; Many thanks to: ;
; swtpc.com for hosting Michael Holley's documents! ;
; sbprojects.com for a very nice assembler! ;
; swtpcemu.com for a very capable emulator! ;
; reg a holds the ascii char to be output ;
;-----------------------------------------------------;
outeee = $e1d1 ROM: console putchar routine
.or $0f00
;-----------------------------------------------------;
main ldaa #7 Load the ascii BEL char
jsr outeee and print it
swi Return to the monitor
.en</lang>
 
=={{header|Ada}}==