Terminal control/Ringing the terminal bell: Difference between revisions

alarm in BLC
(alarm in BLC)
 
(31 intermediate revisions by 17 users not shown)
Line 10:
In most terminals, if the &nbsp; [[wp:Bell character|Bell character]] &nbsp; (ASCII code '''7''', &nbsp; <big><code> \a </code></big> in C) &nbsp; is printed by the program, it will cause the terminal to ring its bell. &nbsp; 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.
<br><br>
 
=={{header|11l}}==
<syntaxhighlight lang="11l">print("\a")</syntaxhighlight>
 
=={{header|6800 Assembly}}==
<langsyntaxhighlight lang="m68k"> .cr 6800
.tf bel6800.obj,AP1
.lf bel6800
Line 34 ⟶ 37:
jsr outeee ; and print it
swi ;Return to the monitor
.en</langsyntaxhighlight>
 
=={{header|Ada8086 Assembly}}==
===Using stdout===
{{trans|X86 Assembly}}
This is how it's ''supposed'' to be done:
<syntaxhighlight lang="asm">.model small
.stack 1024
 
.data
<lang ada>with Ada.Text_IO; use Ada.Text_IO;
 
.code
 
start: mov ah, 02h ;character output
mov dl, 07h ;bell code
int 21h ;call MS-DOS
 
mov ax, 4C00h ;exit
int 21h ;return to MS-DOS
end start</syntaxhighlight>
 
But I couldn't hear anything on DOSBox when doing this.
 
===The hard way===
This version takes direct control over the PC's beeper to produce a tone whenever <code>BEL</code> is passed to <code>PrintChar</code>.
<syntaxhighlight lang="asm">.model small
.stack 1024
 
.data
 
.code
 
start:
 
mov al,7
call PrintChar
 
mov ax,4C00h
int 21h ;return to DOS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PrintChar: ;Print AL to screen
push cx
push bx
push ax
cmp al,7
jne skipBEL
call RingBell
jmp done_PrintChar
skipBEL:
mov bl,15 ;text color will be white
mov ah,0Eh
int 10h ;prints ascii code stored in AL to the screen (this is a slightly different putc syscall)
done_PrintChar:
pop ax
pop bx
pop cx
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RingBell:
push ax
push cx
push dx
;if BEL is the argument passed to PrintChar, it will call this function and not actually print anything or advance the cursor
;this uses the built-in beeper to simulate a beep
 
mov al,10110110b ;select counter 2, 16-bit mode
out 43h, al
mov ax,0C00h ;set pitch of beep - this is somewhat high but isn't too annoying. Feel free to adjust this value
out 42h,al
mov al,ah
out 42h,al
 
 
mov al,3
out 61h,al ;enable sound and timer mode
 
mov cx,0FFFFh
mov dx,0Fh ;set up loop counters
beepdelay: ;delay lasts about half a second
loop beepdelay
mov cx,0FFFFh
dec dx
jnz beepdelay
mov al,0 ;mute
out 61h,al ;cut the sound
 
; mov bl,15
; mov ax,0E20h ;print a spacebar to the terminal
; int 10h ;uncomment these 3 lines if you want the BEL to "take up space" in the output stream
pop dx
pop cx
pop ax
ret
 
end start</syntaxhighlight>
 
=={{header|Action!}}==
<syntaxhighlight lang="action!">PROC Wait(BYTE frames)
BYTE RTCLOK=$14
frames==+RTCLOK
WHILE frames#RTCLOK DO OD
RETURN
 
PROC Main()
BYTE
i,n=[3],
CH=$02FC ;Internal hardware value for last key pressed
 
PrintF("Press any key to hear %B bells...",n)
DO UNTIL CH#$FF OD
CH=$FF
 
FOR i=1 TO n
DO
Put(253) ;buzzer
Wait(20)
OD
Wait(100)
RETURN</syntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Ringing_the_terminal_bell.png Screenshot from Atari 8-bit computer]
 
=={{header|Ada}}==
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1;
 
Line 44 ⟶ 169:
begin
Put(Ada.Characters.Latin_1.BEL);
end Bell;</langsyntaxhighlight>
 
=={{header|Applescript}}==
<syntaxhighlight lang ="applescript">beep</langsyntaxhighlight>
 
=={{header|Arturo}}==
<syntaxhighlight lang="rebol">print "\a"</syntaxhighlight>
 
=={{header|Asymptote}}==
<syntaxhighlight lang Asymptote="asymptote">beep()</langsyntaxhighlight>
See [http://asymptote.sourceforge.net/doc/Data-types.html#index-g_t_0040code_007bbeep_007d-287 beep() in the Asymptote manual].
 
=={{header|AutoHotkey}}==
<syntaxhighlight lang="autohotkey">
<lang AutoHotkey>
fileappend, `a, *
</syntaxhighlight>
</lang>
 
This requires that you compile the exe in console mode (see Lexikos script to change this) or pipe the file
Line 62 ⟶ 190:
 
=={{header|AWK}}==
<syntaxhighlight lang="awk">BEGIN {
 
<lang awk>BEGIN {
print "\a" # Ring the bell
}</langsyntaxhighlight>
 
=={{header|BASIC}}==
Line 71 ⟶ 198:
==={{header|Applesoft BASIC}}===
 
<syntaxhighlight lang="applesoft Applesoft BASICbasic"> 10 PRINT CHR$ (7);</langsyntaxhighlight>
 
==={{header|Integer BASIC}}===
 
You can't see it, but the bell character (Control G) is embedded in what looks like an empty string on line 10.
<langsyntaxhighlight Integerlang="integer BASICbasic"> 10 PRINT "";: REM ^G IN QUOTES
20 END</langsyntaxhighlight>
 
==={{header|IS-BASIC}}===
<syntaxhighlight lang IS="is-BASICbasic">PING</langsyntaxhighlight>
 
==={{header|Locomotive Basic}}===
 
<syntaxhighlight lang ="locobasic">10 PRINT CHR$(7)</langsyntaxhighlight>
 
=== {{header|ZX Spectrum Basic}} ===
 
The ZX Spectrum had a speaker, rather than a bell. Here we use middle C as a bell tone, but we could produce a different note by changing the final zero to a different value.
 
<syntaxhighlight lang ="basic">BEEP 0.2,0</langsyntaxhighlight>
 
=={{header|Batch File}}==
Source: [http://www.dostips.com/forum/viewtopic.php?f=3&t=5860 Here]
<langsyntaxhighlight lang="dos">@echo off
for /f %%. in ('forfiles /m "%~nx0" /c "cmd /c echo 0x07"') do set bell=%%.
echo %bell%</langsyntaxhighlight>
 
=={{header|BBC BASIC}}==
Assuming that the platform the program is running on rings the bell when CHR$7 is sent to the VDU driver:
 
<syntaxhighlight lang ="bbcbasic">VDU 7</langsyntaxhighlight>
 
=={{header|Bcbc}}==
<langsyntaxhighlight Bclang="bc">print "\a"</langsyntaxhighlight>
 
=={{header|beeswax}}==
<syntaxhighlight lang="beeswax">_7}</syntaxhighlight>
 
<lang beeswax>_7}</lang>
 
=={{header|Befunge}}==
<syntaxhighlight lang ="befunge">7,@</langsyntaxhighlight>
 
=={{header|Binary Lambda Calculus}}==
 
The 2-byte BLC program <code>20 07</code> in hex outputs ASCII code 7.
 
=={{header|Bracmat}}==
Run Bracmat in interactive mode (start Bracmat without command line arguments) and enter the following after the Bracmat prompt <code>{?}</code>:
<syntaxhighlight lang ="bracmat">\a</langsyntaxhighlight>
Alternatively, run Bracmat non-interactively. In DOS, you write
<pre>bracmat "put$\a"</pre>
Line 124 ⟶ 254:
Assuming the output stream is connected to a TTY, printing BEL should ring its bell.
 
<langsyntaxhighlight lang="brainfuck"> I
+
+ +
+++
+-+-+
.</langsyntaxhighlight>
 
=={{header|C}}==
<syntaxhighlight lang="c">#include <stdio.h>
 
<lang c>#include <stdio.h>
int main() {
printf("\a");
return 0;
}</langsyntaxhighlight>
 
=={{header|C++}}==
<lang cpp>#include <iostream>
 
int main() {
std::cout << "\a";
return 0;
}</lang>
 
=={{header|C sharp|C#}}==
Inside a function:
<langsyntaxhighlight lang="csharp">// the simple version:
System.Console.Write("\a"); // will beep
System.Threading.Thread.Sleep(1000); // will wait for 1 second
Line 157 ⟶ 278:
// System.Console.Beep() also accepts (int)hertz and (int)duration in milliseconds:
System.Console.Beep(440, 2000); // default "concert pitch" for 2 seconds
</syntaxhighlight>
</lang>
 
=={{header|C++}}==
<syntaxhighlight lang="cpp">#include <iostream>
 
int main() {
std::cout << "\a";
return 0;
}</syntaxhighlight>
 
=={{header|Clojure}}==
<syntaxhighlight lang ="clojure">(println (char 7))</langsyntaxhighlight>
 
=={{header|COBOL}}==
Using the standard screen section:
Standard compliant:
{{works with|X/Open COBOL}}
<lang cobol>DISPLAY SPACE WITH BELL</lang>
{{works with|COBOL 2002}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. ring-terminal-bell.
 
DATA DIVISION.
SCREEN SECTION.
01 ringer BELL.
 
PROCEDURE DIVISION.
DISPLAY ringer.
STOP RUN.
 
END PROGRAM ring-terminal-bell.</syntaxhighlight>
 
Using the ASCII code directly:
{{works with|COBOL-85}}
<syntaxhighlight lang="cobol"> *> Tectonics: cobc -xj ring-terminal-bell.cob --std=cobol85
IDENTIFICATION DIVISION.
PROGRAM-ID. ring-ascii-bell.
 
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
OBJECT-COMPUTER.
PROGRAM COLLATING SEQUENCE IS ASCII.
SPECIAL-NAMES.
ALPHABET ASCII IS STANDARD-1.
 
PROCEDURE DIVISION.
DISPLAY FUNCTION CHAR(8) WITH NO ADVANCING.
*> COBOL indexes starting from 1.
STOP RUN.
 
END PROGRAM ring-ascii-bell.</syntaxhighlight>
 
{{works with|Visual COBOL}}
<langsyntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. mf-bell.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 bell-code PIC X USAGE COMP-X VALUE 22.
01 dummy-param PIC X.
 
PROCEDURE DIVISION.
CALL X"AF" USING bell-code, dummy-param
GOBACK.
 
GOBACK
END PROGRAM mf-bell.</langsyntaxhighlight>
 
=={{header|Common Lisp}}==
<langsyntaxhighlight lang="lisp">
(format t "~C" (code-char 7))
</syntaxhighlight>
</lang>
 
=={{header|D}}==
<langsyntaxhighlight lang="d">void main() {
import std.stdio;
writeln('\a');
}</langsyntaxhighlight>
 
=={{header|dc}}==
<syntaxhighlight lang="dc">7P</syntaxhighlight>
 
=={{header|Delphi}}==
<langsyntaxhighlight Delphilang="delphi">program TerminalBell;
 
{$APPTYPE CONSOLE}
Line 199 ⟶ 364:
begin
Writeln(#7);
end.</langsyntaxhighlight>
 
=={{header|E}}==
<langsyntaxhighlight lang="e">print("\u0007")</langsyntaxhighlight>
 
=={{header|Emacs Lisp}}==
<langsyntaxhighlight lang="lisp">(ding) ;; ring the bell
(beep) ;; the same thing</langsyntaxhighlight>
On a tty or in <code>-batch</code> mode this emits a BEL character. In a GUI it does whatever suits the window system. Variables <code>visible-bell</code> and <code>ring-bell-function</code> can control the behaviour.
 
Line 215 ⟶ 380:
 
=={{header|F_Sharp|F#}}==
<langsyntaxhighlight lang="fsharp">open System
 
Console.Beep()</langsyntaxhighlight>
 
=={{header|Factor}}==
<syntaxhighlight lang="factor">USE: io
 
"\u{7}" print</syntaxhighlight>
 
Or:
 
<syntaxhighlight lang="factor">USING: io strings ;
 
7 1string print</syntaxhighlight>
 
=={{header|Forth}}==
<syntaxhighlight lang ="forth">7 emit</langsyntaxhighlight>
 
{{works with|GNU Forth}}
<syntaxhighlight lang="forth">#bell emit</syntaxhighlight>
 
<lang forth>#bell emit</lang>
 
{{works with|iForth}}
<syntaxhighlight lang="forth">^G emit</syntaxhighlight>
 
<lang forth>^G emit</lang>
 
=={{header|FreeBASIC}}==
<langsyntaxhighlight lang="freebasic">' FB 1.05.0 Win64
 
Print !"\a"
Sleep</langsyntaxhighlight>
 
=={{header|gnuplot}}==
<langsyntaxhighlight lang="gnuplot">print "\007"</langsyntaxhighlight>
 
=={{header|Go}}==
<langsyntaxhighlight lang="go">package main
 
import "fmt"
Line 246 ⟶ 420:
func main() {
fmt.Print("\a")
}</langsyntaxhighlight>
 
=={{header|Groovy}}==
<syntaxhighlight lang ="groovy">println '\7'</langsyntaxhighlight>
 
=={{header|Haskell}}==
<langsyntaxhighlight lang="haskell">main = putStr "\a"</langsyntaxhighlight>
 
=={{header|Icon}} and {{header|Unicon}}==
 
Works on both Icon and Unicon.
 
<syntaxhighlight lang="icon">
<lang Icon>
procedure main ()
write ("\7") # ASCII 7 rings the bell under Bash
end
</syntaxhighlight>
</lang>
 
=={{header|J}}==
This j sentence reads "Seven from alphabet."
<langsyntaxhighlight Jlang="j"> 7{a. NB. noun a. is a complete ASCII ordered character vector.</langsyntaxhighlight>
 
=={{header|Java}}==
<langsyntaxhighlight lang="java">public class Bell{
public static void main(String[] args){
java.awt.Toolkit.getDefaultToolkit().beep();
Line 277 ⟶ 450:
System.out.println((char)7);
}
}</langsyntaxhighlight>
 
=={{header|Joy}}==
<syntaxhighlight lang="joy">7 putch.</syntaxhighlight>
 
=={{header|Julia}}==
{{works with|Linux}}
<syntaxhighlight lang="julia">
<lang Julia>
println("This should ring a bell.\a")
</syntaxhighlight>
</lang>
 
{{out}}
Line 294 ⟶ 470:
=={{header|Kotlin}}==
{{works with|Windows|10}}
<langsyntaxhighlight lang="scala">// version 1.1.2
 
fun main(args: Array<String>) {
println("\u0007")
}</langsyntaxhighlight>
 
=={{header|Lang}}==
<syntaxhighlight lang="lang">
fn.println(fn.toChar(7))
</syntaxhighlight>
 
=={{header|Lasso}}==
<syntaxhighlight lang Lasso="lasso">stdoutnl('\a')</langsyntaxhighlight>
 
=={{header|Logo}}==
<syntaxhighlight lang ="logo">type char 7</langsyntaxhighlight>
 
=={{header|Lua}}==
<langsyntaxhighlight lang="lua">print("\a")</langsyntaxhighlight>
 
=={{header|M2000 Interpreter}}==
Line 314 ⟶ 495:
===Using Windows Bell===
Async beep. If another start while beeps (it is a bell), then stop
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
After 300 {beep}
Line 325 ⟶ 506:
}
CheckIt
</syntaxhighlight>
</lang>
 
 
Line 336 ⟶ 517:
</pre>
 
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
After 300 {Tone 200}
Line 347 ⟶ 528:
}
CheckIt
</syntaxhighlight>
</lang>
 
 
Line 358 ⟶ 539:
</pre>
 
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
After 300 {Tune 300, "C3BC#"}
Line 369 ⟶ 550:
}
CheckIt
</syntaxhighlight>
</lang>
 
 
Line 375 ⟶ 556:
Play a score in each of 16 voices (async, programming internal midi, problem with async in Wine Linux). We can make a piano using keyboard and play/score commands.
 
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module CheckIt {
Score 1, 500, "c@2dc @2ef"
Line 389 ⟶ 570:
}
CheckIt
</syntaxhighlight>
</lang>
 
There are other statements like Sound, and Background filename$ to play background music.
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<langsyntaxhighlight Mathematicalang="mathematica">Print["\007"]</langsyntaxhighlight>
 
=={{header|MUMPS}}==
<syntaxhighlight lang="mumps">write $char(7)</syntaxhighlight>
 
=={{header|Nanoquery}}==
<syntaxhighlight lang="nanoquery">print chr(7)</syntaxhighlight>
 
=={{header|Nemerle}}==
<langsyntaxhighlight Nemerlelang="nemerle">using System.Console;
 
module Beep
Line 410 ⟶ 596:
Beep(2600, 1000); // limited OS support
}
}</langsyntaxhighlight>
 
=={{header|NetRexx}}==
<langsyntaxhighlight NetRexxlang="netrexx">/* NetRexx */
options replace format comments java crossref symbols binary
 
Line 434 ⟶ 620:
end
return
</syntaxhighlight>
</lang>
 
=={{header|Nim}}==
<langsyntaxhighlight lang="nim">echo "\a"</langsyntaxhighlight>
 
=={{header|Objeck}}==
<langsyntaxhighlight lang="objeck">7->As(Char)->PrintLine();</langsyntaxhighlight>
 
=={{header|OCaml}}==
<syntaxhighlight lang="ocaml">let () = print_string "\x07"</syntaxhighlight>
 
=={{header|PARI/GP}}==
{{Works with|PARI/GP|2.7.4 and above}}
 
<langsyntaxhighlight lang="parigp">\\ Ringing the terminal bell.
\\ 8/14/2016 aev
Strchr(7) \\ press <Enter></langsyntaxhighlight>
;or:
<langsyntaxhighlight lang="parigp">print(Strchr(7)); \\ press <Enter></langsyntaxhighlight>
 
{{Output}}
Line 464 ⟶ 653:
 
=={{header|Perl}}==
<langsyntaxhighlight lang="perl">print "\a";</langsyntaxhighlight>
 
=={{header|Perl 6}}==
<lang perl6>print 7.chr;</lang>
 
=={{header|Phix}}==
<!--<syntaxhighlight lang="phix">(phixonline)-->
<lang Phix>puts(1,"\x07")</lang>
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"\x07"</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->
Ineffective under pwa/p2js - just displays an unknown character glyph.
 
=={{header|PHP}}==
<langsyntaxhighlight lang="php"><?php
echo "\007";</langsyntaxhighlight>
 
=={{header|PicoLisp}}==
<syntaxhighlight lang PicoLisp="picolisp">(beep)</langsyntaxhighlight>
 
=={{header|PL/I}}==
<langsyntaxhighlight lang="pli"> declare bell character (1);
unspec (bell) = '00000111'b;
put edit (bell) (a);</langsyntaxhighlight>
 
=={{header|PostScript}}==
The following will only work in a PostScript interpreter that sends output to a terminal. It will very likely not make a printer beep.
<syntaxhighlight lang ="postscript">(\007) print</langsyntaxhighlight>
 
=={{header|PowerShell}}==
One can either use the ASCII <code>BEL</code> character which only works in a console (i.e. not in a graphical PowerShell host such as PowerShell ISE):
<langsyntaxhighlight lang="powershell">"`a"</langsyntaxhighlight>
or use the .NET <code>Console</code> class which works independent of the host application:
<syntaxhighlight lang ="powershell">[Console]::Beep()</langsyntaxhighlight>
 
=={{header|PureBasic}}==
<syntaxhighlight lang PureBasic="purebasic">Print(#BEL$)</langsyntaxhighlight>
 
=={{header|Python}}==
In Python 2.7.x:
<langsyntaxhighlight lang="python">print "\a"</langsyntaxhighlight>
In Python 3.x:
<langsyntaxhighlight lang="python">print ("\a")</langsyntaxhighlight>
 
=={{header|Quackery}}==
On some platforms the bell will not ring until the output buffer is flushed e.g. by a cr/lf.
 
<syntaxhighlight lang="quackery">ding</syntaxhighlight>
 
=={{header|R}}==
<syntaxhighlight lang R="r">alarm()</langsyntaxhighlight>
 
=={{header|Racket}}==
<langsyntaxhighlight lang="racket">
#lang racket
(require (planet neil/charterm:3:0))
(with-charterm
(void (charterm-bell)))
</syntaxhighlight>
</lang>
 
=={{header|Raku}}==
(formerly Perl 6)
<syntaxhighlight lang="raku" line>print 7.chr;</syntaxhighlight>
 
=={{header|Retro}}==
<syntaxhighlight lang Retro="retro">7 putc</langsyntaxhighlight>
 
=={{header|REXX}}==
Line 520 ⟶ 719:
 
However, some REXX interpreters have added a non-standard BIF.
<langsyntaxhighlight lang="rexx">/*REXX program illustrates methods to ring the terminal bell or use the PC speaker. */
/*╔═══════════════════════════════════════════════════════════════╗
║ ║
Line 558 ⟶ 757:
call sound freq, secs /* " " " " 3/10 " */
 
/*stick a fork in it, we're done making noises.*/</langsyntaxhighlight>
 
=={{header|Ring}}==
<langsyntaxhighlight lang="ring">
see char(7)
</syntaxhighlight>
</lang>
 
=={{header|Ruby}}==
<langsyntaxhighlight lang="ruby">print "\a"</langsyntaxhighlight>
 
=={{header|Rust}}==
<syntaxhighlight lang="rust">fn main() {
print!("\x07");
}</syntaxhighlight>
 
=={{header|Scala}}==
<langsyntaxhighlight lang="scala">java.awt.Toolkit.getDefaultToolkit().beep()</langsyntaxhighlight>
 
=={{header|Seed7}}==
<langsyntaxhighlight lang="seed7">$ include "seed7_05.s7i";
 
const proc: main is func
begin
write("\a");
end func;</langsyntaxhighlight>
 
=={{header|Sidef}}==
<langsyntaxhighlight lang="ruby">print "\a";</langsyntaxhighlight>
 
=={{header|SNUSP}}==
<syntaxhighlight lang ="snusp">$+++++++.#</langsyntaxhighlight>
 
=={{header|Standard ML}}==
<syntaxhighlight lang="sml">val () = print "\a"</syntaxhighlight>
 
=={{header|Tcl}}==
<langsyntaxhighlight lang="tcl">puts -nonewline "\a";flush stdout</langsyntaxhighlight>
 
=={{header|UNIX Shell}}==
{{works with|Bourne Shell}} {{works with|bash}}
 
<langsyntaxhighlight lang="sh">#!/bin/sh
# Ring the terminal bell
# echo "\a" # does not work in some shells
tput bel</langsyntaxhighlight>
 
=={{header|Wren}}==
<syntaxhighlight lang="wren">System.print("\a")</syntaxhighlight>
 
=={{header|X86 Assembly}}==
<langsyntaxhighlight X86lang="x86 Assemblyassembly">;Assemble with: tasm; tlink /t
.model tiny
.code
Line 604 ⟶ 815:
int 21h ;call MS-DOS
ret ;return to MS-DOS
end start</langsyntaxhighlight>
 
=={{header|XPL0}}==
<langsyntaxhighlight XPL0lang="xpl0">code ChOut=8;
ChOut(0,7)</langsyntaxhighlight>
 
=={{header|zkl}}==
<langsyntaxhighlight lang="zkl">print("\x07");</langsyntaxhighlight>
 
 
56

edits