Task

Display a word in various colours on the terminal.

The system palette, or colours such as Red, Green, Blue, Magenta, Cyan, and Yellow can be used.



Optionally demonstrate:

 How the system should determine if the terminal supports colour
 Setting of the background colour
 How to cause blinking or flashing (if supported by the terminal)


 
/* ARM assembly AARCH64 Raspberry PI 3B */
/*  program colorterminal64.s   */
 
/*******************************************/
/* Constantes file                         */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
 
/*******************************************/
/* Initialized data                        */
/*******************************************/
.data
szMessStartPgm:            .asciz "Program start \n"
szMessEndPgm:              .asciz "Program normal end.\n"
szMessColorRed:            .asciz "Color red.\n"
szCodeInit:                .asciz "\033[0m"                    //color reinit
szCodeRed:                 .asciz "\033[31m"                   //color red
szMessBlue:                .asciz "\033[34mColor Blue\n"       //color blue
szMessTwoColor:            .asciz "\033[32mColor Green \033[35m Color Velvet\n"
szMessTest:                .asciz "\033[33m\033[1mMessage yellow bold\n"
 
szCarriageReturn:          .asciz "\n"
/*******************************************/
/* UnInitialized data                      */
/*******************************************/
.bss 
/*******************************************/
/*  code section                           */
/*******************************************/
.text
.global main 
main: 
 
    ldr x0,qAdrszMessStartPgm                   //display start message
    bl affichageMess
    ldr x0,qAdrszCodeRed                        //color red
    bl affichageMess
    ldr x0,qAdrszMessColorRed
    bl affichageMess
    ldr x0,qAdrszMessBlue                       //message color blue
    bl affichageMess
    ldr x0,qAdrszMessTwoColor                   //message two colors
    bl affichageMess
    ldr x0,qAdrszMessTest
    bl affichageMess
    ldr x0,qAdrszCodeInit                       //color reinitialize
    bl affichageMess
    ldr x0,qAdrszMessEndPgm                     //display end message
    bl affichageMess
 
100:                                            //standard end of the program
    mov x0,0                                    //return code
    mov x8,EXIT                                 //request to exit program
    svc 0                                       //perform system call
qAdrszMessStartPgm:        .quad szMessStartPgm
qAdrszMessEndPgm:          .quad szMessEndPgm
qAdrszCodeInit:            .quad szCodeInit
qAdrszCodeRed:             .quad szCodeRed
qAdrszMessBlue:            .quad szMessBlue
qAdrszMessColorRed:        .quad szMessColorRed
qAdrszMessTwoColor:        .quad szMessTwoColor
qAdrszMessTest:            .quad szMessTest
qAdrszCarriageReturn:      .quad szCarriageReturn
/********************************************************/
/*        File Include fonctions                        */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
 