Terminal control/Inverse video: Difference between revisions

Content added Content deleted
No edit summary
(Added 6502 assembly example)
Line 1: Line 1:
{{task|Terminal control}}[[Category:Terminal control]]
{{task|Terminal control}}[[Category:Terminal control]]
The task is to display a word in inverse video (or reverse video) followed by a word in normal video.
The task is to display a word in inverse video (or reverse video) followed by a word in normal video.

=={{header|6502 Assembly}}==
{{works with|http://vice-emu.sourceforge.net/ VICE}}
This example has been written for the C64 and uses the STROUT BASIC routine.
Compile with the [http://turbo.style64.org/ Turbo Macro Pro cross assembler]:
<pre>
tmpx -i inverse-video.s -o inverse-video.prg
</pre>
Run with:
<pre>
SYS680
</pre>
<lang 6502asm>; C64 - Terminal control: Inverse Video

; *** labels ***

strout = $ab1e

; *** main ***

*=$02a8 ; sys 680
lda #<str ; Address of the message to print - low byte
ldy #>str ; Address high byte
jsr strout ; Print a null terminated string.
rts
; *** data ***

str .byte $12 ; the REVERSE ON control code
; see https://en.wikipedia.org/wiki/PETSCII
.text "reversed"
.byte $92 ; the REVERSE OFF control code
.null " normal" ; null terminated string
</lang>


=={{header|Ada}}==
=={{header|Ada}}==