September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -0,0 +1,64 @@
/* ARM assembly Raspberry PI */
/* program areaString.s */
/* Constantes */
@ The are no TRUE or FALSE constants in ARM Assembly
.equ FALSE, 0 @ or other value
.equ TRUE, 1 @ or other value
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
/* Initialized data */
.data
szMessTrue: .asciz "The value is true.\n"
szMessFalse: .asciz "The value is false.\n"
/* UnInitialized data */
.bss
/* code section */
.text
.global main
main: /* entry of program */
push {fp,lr} /* saves 2 registers */
mov r0,#0
//mov r0,#1 @uncomment pour other test
cmp r0,#TRUE
bne 1f
@ value true
ldr r0,iAdrszMessTrue
bl affichageMess
b 100f
1: @ value False
ldr r0,iAdrszMessFalse
bl affichageMess
100: /* standard end of the program */
mov r0, #0 @ return code
pop {fp,lr} @restaur 2 registers
mov r7, #EXIT @ request to exit program
swi 0 @ perform the system call
iAdrszMessTrue: .int szMessTrue
iAdrszMessFalse: .int szMessFalse
/******************************************************************/
/* display text with size calculation */
/******************************************************************/
/* r0 contains the address of the message */
affichageMess:
push {fp,lr} /* save registres */
push {r0,r1,r2,r7} /* save others registers */
mov r2,#0 /* counter length */
1: /* loop length calculation */
ldrb r1,[r0,r2] /* read octet start position + index */
cmp r1,#0 /* if 0 its over */
addne r2,r2,#1 /* else add 1 in the length */
bne 1b /* and loop */
/* so here r2 contains the length of the message */
mov r1,r0 /* address message in r1 */
mov r0,#STDOUT /* code to write to the standard output Linux */
mov r7, #WRITE /* code call system "write" */
swi #0 /* call systeme */
pop {r0,r1,r2,r7} /* restaur others registers */
pop {fp,lr} /* restaur des 2 registres */
bx lr /* return */

View file

@ -0,0 +1,7 @@
1 > 2 --> false
not false --> true
{true as integer, false as integer, 1 as boolean, 0 as boolean}
--> {1, 0, true, false}
true = 1 --> false

View file

@ -0,0 +1,2 @@
{yes as boolean, no as boolean}
--> {true, false}

View file

@ -0,0 +1 @@
sortItems from L given reversal : true

View file

@ -0,0 +1 @@
sortItems from L with reversal

View file

@ -0,0 +1 @@
sortItems from L given reversal:yes

View file

@ -0,0 +1,19 @@
@echo off
::true
set "a=x"
::false
set "b="
if defined a (
echo a is true
) else (
echo a is false
)
if defined b (
echo b is true
) else (
echo b is false
)
pause>nul

View file

@ -0,0 +1,27 @@
/* boolean values */
$print(true, "\n");
$print(false, "\n");
if 0 {
$print("literal 0 tests true\n");
} else {
$print("literal 0 tests false\n");
}
if 1 {
$print("literal 1 tests true\n");
} else {
$print("literal 1 tests false\n");
}
if $istrue(0) {
$print("$istrue(0) tests true\n");
} else {
$print("$istrue(0) tests false\n");
}
if $istrue(1) {
$print("$istrue(1) tests true\n");
} else {
$print("$istrue(1) tests false\n");
}

View file

@ -0,0 +1,9 @@
Dim a As Integer
Dim b As Boolean
Debug.Print b
a = b
Debug.Print a
b = True
Debug.Print b
a = b
Debug.Print a

View file

@ -0,0 +1,6 @@
a = True
b = False
Randomize Timer
x = Int(Rnd * 2) <> 0
y = Int(Rnd * 2) = 0
MsgBox a & " " & b & " " & x & " " & y