Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,99 @@
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program Strip comments from a string */
/*******************************************/
/* Constantes */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
/*******************************************/
/* macros */
/*******************************************/
//.include "../../ficmacros64.inc" // for developper debugging
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessDebutPgm: .asciz "Program 64 bits start. \n"
szCarriageReturn: .asciz "\n"
szMessFinOK: .asciz "Program normal end. \n"
szString1: .asciz "apples, pears # and bananas"
szString2: .asciz "apples, pears ; and bananas"
.align 4
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
.align 4
/*********************************/
/* code section */
/*********************************/
.text
.global main
main:
ldr x0,qAdrszMessDebutPgm
bl affichageMess // start message
ldr x0,qAdrszString1
mov x1,#'#'
bl suppComment
ldr x0,qAdrszString1
bl affichageMess
ldr x0,qAdrszCarriageReturn
bl affichageMess
ldr x0,qAdrszString2
mov x1,#';'
bl suppComment
ldr x0,qAdrszString1
bl affichageMess
ldr x0,qAdrszCarriageReturn
bl affichageMess
ldr x0,qAdrszMessFinOK
bl affichageMess
100:
mov x8,EXIT
svc #0 // system call
qAdrszMessDebutPgm: .quad szMessDebutPgm
qAdrszMessFinOK: .quad szMessFinOK
qAdrszCarriageReturn: .quad szCarriageReturn
qAdrszString1: .quad szString1
qAdrszString2: .quad szString2
/******************************************************************/
/* strip comment string */
/******************************************************************/
/* x0 contains string address */
/* x1 contains comment markers */
/* x0 returns length of string */
suppComment:
stp x1,lr,[sp,-16]!
stp x2,x3,[sp,-16]!
mov x2,#0 // indice string
1:
ldrb w3,[x0,x2]
cmp x3,#0 // end string
csel x0,x2,x0,eq
beq 100f
cmp x3,x1
cinc x2,x2,ne
bne 1b
mov x3,#0
strb w3,[x0,x2]
mov x0,x2
100:
ldp x2,x3,[sp],16
ldp x1,lr,[sp],16
ret
/***************************************************/
/* ROUTINES INCLUDE */
/***************************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeARM64.inc"

View file

@ -0,0 +1,99 @@
/* ARM assembly Raspberry PI */
/* program Strip comments from a string */
/* REMARK 1 : this program use routines in a include file
see task Include a file language arm assembly
for the routine affichageMess conversion10
see at end of this program the instruction include */
/*******************************************/
/* Constantes */
/*******************************************/
.include "../constantes.inc"
/*******************************************/
/* macros */
/*******************************************/
//.include "../../ficmacros32.inc" @ for developper debugging
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessDebutPgm: .asciz "Program 32 bits start. \n"
szCarriageReturn: .asciz "\n"
szMessFinOK: .asciz "Program normal end. \n"
szString1: .asciz "apples, pears # and bananas"
szString2: .asciz "apples, pears ; and bananas"
.align 4
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
.align 4
/*********************************/
/* code section */
/*********************************/
.text
.global main
main:
ldr r0,iAdrszMessDebutPgm
bl affichageMess @ start message
ldr r0,iAdrszString1
mov r1,#'#'
bl suppComment
ldr r0,iAdrszString1
bl affichageMess
ldr r0,iAdrszCarriageReturn
bl affichageMess
ldr r0,iAdrszString2
mov r1,#';'
bl suppComment
ldr r0,iAdrszString1
bl affichageMess
ldr r0,iAdrszCarriageReturn
bl affichageMess
ldr r0,iAdrszMessFinOK
bl affichageMess
100:
mov r7,#EXIT @ program end
svc #0 @ system call
iAdrszMessDebutPgm: .int szMessDebutPgm
iAdrszMessFinOK: .int szMessFinOK
iAdrszCarriageReturn: .int szCarriageReturn
iAdrszString1: .int szString1
iAdrszString2: .int szString2
/******************************************************************/
/* strip comment string */
/******************************************************************/
/* r0 contains string address */
/* r1 contains comment markers */
/* r0 returns length of string */
suppComment:
push {r1-r3,lr} @ save registers
mov r2,#0 @ indice string
1:
ldrb r3,[r0,r2]
cmp r3,#0 @ end string
moveq r0,r2
beq 100f
cmp r3,r1
addne r2,r2,#1
bne 1b
mov r3,#0
strb r3,[r0,r2]
mov r0,r2
100:
pop {r1-r3,pc}
/***************************************************/
/* ROUTINES INCLUDE */
/***************************************************/
.include "../affichage.inc"

View file

@ -0,0 +1,12 @@
# by Artyom Bologov
H
,p
# Remove the empty/spaced lines after comments
g/^.[[:space:]]*$/s///
# Remove comments
g/\(.\)\(.*\)\1.*/s//\2/
# Strip spaces off
g/^[[:space:]]\{1,\}\(.*\)/s//\1/
g/\(.*\)[[:space:]]\{1,\}$/s//\1/
,p
Q