Task

Clear the terminal window.




 
/* ARM assembly AARCH64 Raspberry PI 3B */
/*  program clearScreen.s   */
 
/*******************************************/
/* Constantes file                         */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
 
.equ BUFFERSIZE,          100
/*******************************************/
/* Initialized data                        */
/*******************************************/
.data
szMessStartPgm:            .asciz "Program start \n"
szMessEndPgm:              .asciz "Program normal end.\n"
szClear:                   .asciz "\33[2J"     // console clear (id language C)
szClear1:                  .byte 0x1B 
                           .byte 'c'           // other console clear
                           .byte 0
szCarriageReturn:          .asciz "\n"
/*******************************************/ 
/* UnInitialized data                      */
/*******************************************/
.bss 
/*******************************************/
/*  code section                           */
/*******************************************/
.text
.global main 
main: 
 
    ldr x0,qAdrszMessStartPgm                   // display start message
    bl affichageMess
    //ldr x0,qAdrszClear                        // clear screen
    ldr x0,qAdrszClear1                         // change for other clear screen
    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
qAdrszClear:              .quad szClear
qAdrszClear1:             .quad szClear1
qAdrszCarriageReturn:     .quad szCarriageReturn
/********************************************************/
/*        File Include fonctions                        */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
 