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,78 @@
/* ARM assembly Raspberry PI */
/* program stringsEx.s */
/* Constantes */
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
/* Initialized data */
.data
szMessString: .asciz "String with final zero \n"
szMessString1: .string "Other string with final zero \n"
sString: .ascii "String without final zero"
.byte 0 @ add final zero for display
sLineSpaces: .byte '>'
.fill 10,1,' ' @ 10 spaces
.asciz "<\n" @ add <, CR and final zero for display
sSpaces1: .space 10,' ' @ other 10 spaces
.byte 0 @ add final zero for display
sCharA: .space 10,'A' @ curious !! 10 A with space instruction
.asciz "\n" @ add CR and final zero for display
cChar1: .byte 'A' @ character A
cChar2: .byte 0x41 @ character A
szCarriageReturn: .asciz "\n"
/* UnInitialized data */
.bss
/* code section */
.text
.global main
main:
ldr r0,iAdrszMessString
bl affichageMess @ display message
ldr r0,iAdrszMessString1
bl affichageMess
ldr r0,iAdrsString
bl affichageMess
ldr r0,iAdrszCarriageReturn
bl affichageMess
ldr r0,iAdrsLineSpaces
bl affichageMess
ldr r0,iAdrsCharA
bl affichageMess
100: @ standard end of the program
mov r0, #0 @ return code
mov r7, #EXIT @ request to exit program
svc 0 @ perform system call
iAdrszMessString: .int szMessString
iAdrszMessString1: .int szMessString1
iAdrsString: .int sString
iAdrsLineSpaces: .int sLineSpaces
iAdrszCarriageReturn: .int szCarriageReturn
iAdrsCharA: .int sCharA
/******************************************************************/
/* display text with size calculation */
/******************************************************************/
/* r0 contains the address of the message */
affichageMess:
push {r0,r1,r2,r7,lr} @ save 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"
svc #0 @ call system
pop {r0,r1,r2,r7,lr} @ restaur registers
bx lr @ return

View file

@ -1,6 +1,3 @@
10 REM Print some quotes
20 PRINT CHR$(34)
30 REM Print some more doublequotes
40 PRINT """"
50 REM Output the word hello enclosed in doublequotes
60 PRINT """Hello"""
100 PRINT CHR$(34)
110 PRINT """"
120 PRINT "This is a ""quoted string""."

View file

@ -0,0 +1,3 @@
print "Hello, World."
print chr(34); "Hello, World." & chr(34)
print "Tom said," + "'The fox ran away.'"

View file

@ -0,0 +1,6 @@
10 REM Print some quotes
20 PRINT CHR$(34)
30 REM Print some more doublequotes
40 PRINT """"
50 REM Output the word hello enclosed in doublequotes
60 PRINT """Hello"""

View file

@ -1,4 +1,5 @@
var c := $65. // character
var s := "some text". // UTF-8 literal
var w := "some wide text"w. // UTF-16 literal
var s2 := "text with ""quotes"" and "$13$10"two lines".
var c := $65; // character
var s := "some text"; // UTF-8 literal
var w := "some wide text"w; // UTF-16 literal
var s2 := "text with ""quotes"" and
two lines";

View file

@ -0,0 +1 @@
CHAR: a

View file

@ -0,0 +1,7 @@
USE: multiline
STRING: random-stuff
ABC
123
"x y z
;
random-stuff print

View file

@ -0,0 +1,15 @@
USING: interpolate locals namespaces ;
"Sally" "name" set
"bicycle"
"home"
[let
"crying" :> a
[I ${name} crashed her ${1}. Her ${1} broke.
${name} ran ${} ${a}.
I]
]

View file

@ -0,0 +1,5 @@
CHAR: x ! 120
CHAR: \u000032 ! 50
CHAR: \u{exclamation-mark} ! 33
CHAR: exclamation-mark ! 33
CHAR: ugaritic-letter-samka ! 66450

View file

@ -0,0 +1 @@
"Hello, world!"

View file

@ -0,0 +1 @@
"Hello, world!" { } like ! { 72 101 108 108 111 44 32 119 111 114 108 100 33 }

View file

@ -0,0 +1 @@
"Line one\nLine two" print

View file

@ -0,0 +1 @@
"\"Hello,\" she said." print

View file

@ -0,0 +1,3 @@
"2\u{superscript-two} = 4
2\u{superscript-three} = 8
2\u{superscript-four} = 16" print

View file

@ -0,0 +1,4 @@
USE: multiline
[[ escape codes \t are literal \\ in here
but newlines \u{plus-minus-sign} are still
inserted " for each line the string \" spans.]] print

View file

@ -0,0 +1,8 @@
USE: multiline
HEREDOC: END
Everything between the line above
and the final line (a user-defined token)
is parsed into a string where whitespace
is significant.
END
print

View file

@ -0,0 +1,5 @@
Print "Hello, World."
Print Chr(34); "Hello, World." & Chr(34)
Print "Tom said, ""The fox ran away."""
Print "Tom said," + "'The fox ran away.'"

View file

@ -1,3 +1,3 @@
a = ' that<nowiki>''</nowiki>s a string
a = ' that''s a string
print,a
;==> that's a string

View file

@ -0,0 +1,3 @@
greet = "Hello"
whom = "world"
greet * ", " * whom * "."

View file

@ -0,0 +1 @@
"$greet, $whom."

View file

@ -0,0 +1 @@
Hello, world.

View file

@ -0,0 +1,5 @@
str = """Hello,
world.
"""
print(str)

View file

@ -0,0 +1,2 @@
Hello,
world.

View file

@ -0,0 +1,4 @@
# {id|
Hello World!
|id} ;;
- : string = "\n Hello World!\n"

View file

@ -1,2 +1,3 @@
'c
"hello, world!"
$c
'hello,_world!
'This_is_'a_string'

View file

@ -0,0 +1,2 @@
Debug.Print "Tom said, ""The fox ran away."""
Debug.Print "Tom said, 'The fox ran away.'"

View file

@ -0,0 +1,2 @@
Dim s As String = "Tom said, ""The fox ran away."""
Result: Tom said, "The fox ran away."