September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -0,0 +1,26 @@
|
|||
/* ARM assembly Raspberry PI */
|
||||
/* program ending.s */
|
||||
|
||||
/* Constantes */
|
||||
.equ EXIT, 1 @ Linux syscall
|
||||
|
||||
/* Initialized data */
|
||||
.data
|
||||
|
||||
/* code section */
|
||||
.text
|
||||
.global main
|
||||
main: @ entry of program
|
||||
push {fp,lr} @ saves registers
|
||||
|
||||
OK:
|
||||
@ end program OK
|
||||
mov r0, #0 @ return code
|
||||
b 100f
|
||||
NONOK:
|
||||
@ if error detected end program no ok
|
||||
mov r0, #1 @ return code
|
||||
100: @ standard end of the program
|
||||
pop {fp,lr} @restaur registers
|
||||
mov r7, #EXIT @ request to exit program
|
||||
swi 0 @ perform the system call Linux
|
||||
|
|
@ -1 +1 @@
|
|||
10 IF 1 THEN END
|
||||
100 IF CONDITION THEN STOP
|
||||
|
|
|
|||
|
|
@ -1,3 +1 @@
|
|||
10 LET a = 1: LET b = 1
|
||||
20 IF a = b THEN GO TO 9995
|
||||
9995 STOP
|
||||
10 IF 1 THEN END
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
10 LET a = 1: LET b = 1
|
||||
20 IF a = b THEN GO TO 9995
|
||||
9995 STOP
|
||||
10
Task/Program-termination/Neko/program-termination.neko
Normal file
10
Task/Program-termination/Neko/program-termination.neko
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
Program termination, in Neko
|
||||
*/
|
||||
|
||||
var sys_exit = $loader.loadprim("std@sys_exit", 1)
|
||||
|
||||
var return_code = 42
|
||||
if true sys_exit(return_code)
|
||||
|
||||
$print("Control flow does not make it this far")
|
||||
1
Task/Program-termination/Ol/program-termination.ol
Normal file
1
Task/Program-termination/Ol/program-termination.ol
Normal file
|
|
@ -0,0 +1 @@
|
|||
(shutdown 0) ; it can be any exit code instead of provided 0
|
||||
5
Task/Program-termination/VBA/program-termination.vba
Normal file
5
Task/Program-termination/VBA/program-termination.vba
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
'In case of problem this will terminate the program (without cleanup):
|
||||
If problem then End
|
||||
'As VBA is run within an application, such as Excel, a more rigorous way would be:
|
||||
If problem then Application.Quit
|
||||
'This will stop the application, but will prompt you to save work.
|
||||
Loading…
Add table
Add a link
Reference in a new issue