Compare commits

..

1 commit

Author SHA1 Message Date
Ingy döt Net
92294cf885 Try removing ':' from paths manually 2024-05-06 18:30:33 -04:00
34286 changed files with 125393 additions and 481522 deletions

6
.gitignore vendored
View file

@ -1,9 +1,3 @@
/*.ys
/Cache/ /Cache/
/Meta/ /Meta/
/rosettacode.log /rosettacode.log
/entry
/pick
/random-clojure-task
/.clj-kondo/
/.lsp/

View file

@ -4,7 +4,6 @@
360 Assembly: '.360' 360 Assembly: '.360'
4D: .4d 4D: .4d
4DOS Batch: .4dos 4DOS Batch: .4dos
4ME: .4me
6502 Assembly: '.6502' 6502 Assembly: '.6502'
68000 Assembly: '.68000' 68000 Assembly: '.68000'
6800 Assembly: '.6800' 6800 Assembly: '.6800'
@ -23,19 +22,17 @@ Acornsoft Lisp: .lisp
Action!: .action Action!: .action
ActionScript: .as ActionScript: .as
Acurity Architect: .acurity Acurity Architect: .acurity
Ada: .adb Ada: .ada
Adina: .adina
Agda2: .agda2
Agda: .agda Agda: .agda
Agda2: .agda2
Agena: .agena Agena: .agena
AHDL: .ahdl AHDL: .ahdl
AIDED NATURAL LANGUAGE: .aided
Aikido: .aikido Aikido: .aikido
Aime: .aime Aime: .aime
Algae: .algae Algae: .algae
ALGOL: .alg
ALGOL 60: .alg ALGOL 60: .alg
ALGOL 68: .alg ALGOL 68: .alg
ALGOL: .alg
ALGOL-M: .alg ALGOL-M: .alg
ALGOL W: .alg ALGOL W: .alg
Alice ML: .alice Alice ML: .alice
@ -53,7 +50,6 @@ Anyways: .anyways
Apex: .apex Apex: .apex
APL: .apl APL: .apl
App Inventor: .app App Inventor: .app
Apple: .apple
AppleScript: .applescript AppleScript: .applescript
Applesoft BASIC: .basic Applesoft BASIC: .basic
Application Master: .app Application Master: .app
@ -63,8 +59,6 @@ Arbre: .arbre
Arc: .arc Arc: .arc
Arendelle: .arendelle Arendelle: .arendelle
Argile: .argile Argile: .argile
Aria: .aria
ArkScript: .ark
ARM Assembly: .arm ARM Assembly: .arm
ArnoldC: .arnoldc ArnoldC: .arnoldc
Arturo: .arturo Arturo: .arturo
@ -74,7 +68,7 @@ ASP: .asp
AspectC++: .acpp AspectC++: .acpp
AspectJ: .aspectj AspectJ: .aspectj
ASP.Net: .asp ASP.Net: .asp
Assembly: .asm Assembly: .as
AssemblyScript: .asmscript AssemblyScript: .asmscript
Astro: .astro Astro: .astro
Asymptote: .asymptote Asymptote: .asymptote
@ -83,14 +77,15 @@ ATS: .ats
AutoHotkey: .ahk AutoHotkey: .ahk
Autohotkey V2: .ahk Autohotkey V2: .ahk
AutoHotKey V2: .ahk AutoHotKey V2: .ahk
AutoIt: .au3 AutoIt: .autoit
AutoLISP: .lsp AutoLISP: .l
Avail: .avail Avail: .avail
AWK: .awk AWK: .awk
Axe: .axe Axe: .axe
Axiom: .axiom Axiom: .axiom
Axum: .axum Axum: .axum
Ayrch: .ayrch Ayrch: .ayrch
B: .b
B4J: .b4j B4J: .b4j
B4X: .b4x B4X: .b4x
Babel: .pb Babel: .pb
@ -99,13 +94,12 @@ BaCon: .bacon
Bait: .bait Bait: .bait
Ballerina: .ballerina Ballerina: .ballerina
Bas: .bas Bas: .bas
BASIC: .basic
Basic09: .basic Basic09: .basic
BASIC256: .basic BASIC256: .basic
BASIC: .basic
Batari Basic: .basic Batari Basic: .basic
Batch File: .bat Batch File: .bat
Battlestar: .battlestar Battlestar: .battlestar
B: .b
BBC BASIC: .basic BBC BASIC: .basic
Bc: .bc Bc: .bc
BCPL: .bcpl BCPL: .bcpl
@ -113,7 +107,6 @@ Beads: .beads
Beef: .beef Beef: .beef
Beeswax: .beeswax Beeswax: .beeswax
Befunge: .bf Befunge: .bf
Berkeley Logo: .logo
Beta: .beta Beta: .beta
Biferno: .biferno Biferno: .biferno
Binary Lambda Calculus: .blc Binary Lambda Calculus: .blc
@ -137,26 +130,23 @@ Brat: .brat
Brlcad: .brlcad Brlcad: .brlcad
Bruijn: .bruijn Bruijn: .bruijn
Burlesque: .blq Burlesque: .blq
C++: .cpp
C: .c
C0H: .c0h C0H: .c0h
C1R: .c1r C1R: .c1r
C2: .c2 C2: .c2
C3: .c3 C3: .c3
CafeOBJ: .cafeobj CafeOBJ: .cafeobj
Calc: .calc
Calcscript: .calc
Caml: .caml Caml: .caml
Casio BASIC: .basic Casio BASIC: .basic
Cat: .cat Cat: .cat
CB80: .cb80 CB80: .cb80
CBASIC: .basic
C: .c
C++/CLI: .cpp C++/CLI: .cpp
C++: .cpp
Cduce: .cduce Cduce: .cduce
Cecil: .cecil Cecil: .cecil
Ceylon: .ceylon Ceylon: .ceylon
CFEngine: .cfengine CFEngine: .cfengine
Chapel: .chpl Chapel: .chapel
Chef: .chef Chef: .chef
Cherrycake: .cherrycake Cherrycake: .cherrycake
Chipmunk Basic: .basic Chipmunk Basic: .basic
@ -165,7 +155,6 @@ ChucK: .chuck
Cilk++: .cilk++ Cilk++: .cilk++
Cilk: .cilk Cilk: .cilk
Cind: .cind Cind: .cind
CJam: .cjam
Clarion: .clarion Clarion: .clarion
Clay: .clay Clay: .clay
Clean: .clean Clean: .clean
@ -176,7 +165,7 @@ CLIPS: .clips
Clojure: .clj Clojure: .clj
CLU: .clu CLU: .clu
CMake: .cmake CMake: .cmake
COBOL: .cob COBOL: .cobol
Cobra: .cobra Cobra: .cobra
Coco: .coco Coco: .coco
Coconut: .coconut Coconut: .coconut
@ -189,19 +178,19 @@ Common Lisp: .lisp
Component Pascal: .pas Component Pascal: .pas
Computer/zero Assembly: .0asm Computer/zero Assembly: .0asm
ContextFree: .cf ContextFree: .cf
Convex: .convex
Coq: .coq Coq: .coq
Corescript: .core Corescript: .core
Cowgol: .cowgol Cowgol: .cowgol
Crack: .crack Crack: .crack
Craft Basic: .basic Craft Basic: .basic
Creative Basic: .basic Creative Basic: .basic
Crystal: .cr Curto: .curto
Crystal: .crystal
C sharp: .cs C sharp: .cs
C Shell: .csh C Shell: .csh
Cubescript: .cube Cubescript: .cube
Curry: .curry Curry: .curry
Curto: .curto D: .d
Dafny: .dafny Dafny: .dafny
Dao: .dao Dao: .dao
Dart: .dart Dart: .dart
@ -210,9 +199,8 @@ DataWeave: .dw
DBL: .dbl DBL: .dbl
Dc: .dc Dc: .dc
DCL: .dcl DCL: .dcl
D: .d
DDNC: .ddnc DDNC: .ddnc
Delphi: .pas Delphi: .delphi
Deluge: .deluge Deluge: .deluge
DeviousYarn: .dy DeviousYarn: .dy
DIBOL-11: .dibol-11 DIBOL-11: .dibol-11
@ -224,23 +212,20 @@ DMS: .dms
Dodo0: .dodo0 Dodo0: .dodo0
Draco: .draco Draco: .draco
Dragon: .dragon Dragon: .dragon
Dragonstone: .dragonstone
DreamBerd: .dreamberd DreamBerd: .dreamberd
Dt: .dt Dt: .dt
DuckDB: .duckdb
DUP: .dup DUP: .dup
DWScript: .dw DWScript: .dw
Dyalect: .dyalect Dyalect: .dyalect
Dylan: .dylan Dylan: .dylan
Dylan.NET: .dylan Dylan.NET: .dylan
E: .e
EasyLang: .easy EasyLang: .easy
EC: .ec EC: .ec
EchoLisp: .l EchoLisp: .l
ECL: .ecl ECL: .ecl
Ecstasy: .ecstasy Ecstasy: .ecstasy
Ed: .ed
EDSAC order code: .edsac EDSAC order code: .edsac
E: .e
Eero: .eero Eero: .eero
Efene: .efene Efene: .efene
Egel: .egel Egel: .egel
@ -253,10 +238,10 @@ Elan: .elan
ElastiC: .elastic ElastiC: .elastic
Elena: .elena Elena: .elena
Elisa: .elisa Elisa: .elisa
Elixir: .ex Elixir: .elixir
ELLA: .ella ELLA: .ella
Elm: .elm Elm: .elm
Emacs Lisp: .el Emacs Lisp: .l
EMal: .emal EMal: .emal
Emojicode: .emojicode Emojicode: .emojicode
Enguage: .enguage Enguage: .enguage
@ -267,29 +252,28 @@ ERRE: .erre
Es: .es Es: .es
ESQL: .esql ESQL: .esql
Euler: .euler Euler: .euler
Euphoria: .eu Euphoria: .euphoria
Evaldraw: .evaldraw Evaldraw: .evaldraw
Excel: .excel Excel: .excel
Explore: .explore Explore: .explore
Extended BrainF***: .ebf Extended BrainF***: .ebf
Extended Color BASIC: .basic
Ezhil: .ezhil Ezhil: .ezhil
F: .f
Factor: .factor Factor: .factor
Falcon: .falcon Falcon: .falcon
'FALSE': .false 'FALSE': .false
Fancy: .fancy
Fan: .fan Fan: .fan
Fancy: .fancy
Fantom: .fantom Fantom: .fantom
FAUST: .faust FAUST: .faust
FBSL: .fbsl FBSL: .fbsl
FeatureC++: .cpp
Fe: .fe Fe: .fe
FeatureC++: .cpp
Felix: .felix Felix: .felix
Fennel: .fennel Fennel: .fennel
Ferite: .ferite Ferite: .ferite
Fermat: .fermat Fermat: .fermat
Fexl: .fexl Fexl: .fexl
F: .f
Fhidwfe: .fhidwfe Fhidwfe: .fhidwfe
Fish: .fish Fish: .fish
FLORA-2: .flora2 FLORA-2: .flora2
@ -310,7 +294,6 @@ Frink: .frink
FRISC Assembly: .frisc FRISC Assembly: .frisc
F Sharp: .fs F Sharp: .fs
FTCBASIC: .basic FTCBASIC: .basic
FuncSug: .funcsug
FunL: .funl FunL: .funl
Furor: .furor Furor: .furor
FurryScript: .furryscript FurryScript: .furryscript
@ -340,10 +323,9 @@ GlovePIE: .glovepie
GLSL: .glsl GLSL: .glsl
GML: .gml GML: .gml
Gnuplot: .gnuplot Gnuplot: .gnuplot
Goaldi: .goaldi
Goboscript: .gobo
Go!: .go Go!: .go
Go: .go Go: .go
Goaldi: .goaldi
Golfscript: .golf Golfscript: .golf
Golo: .golo Golo: .golo
Goo: .goo Goo: .goo
@ -360,7 +342,7 @@ Halon: .halon
Harbour: .harbour Harbour: .harbour
Hare: .hare Hare: .hare
Haskell: .hs Haskell: .hs
Haxe: .hx Haxe: .haxe
Heron: .heron Heron: .heron
Hexiscript: .hexi Hexiscript: .hexi
HicEst: .hicest HicEst: .hicest
@ -374,11 +356,10 @@ HQ9+: .hq9+
Huginn: .huginn Huginn: .huginn
Hy: .hy Hy: .hy
HyperTalk: .ht HyperTalk: .ht
I: .i
Icon: .icon Icon: .icon
IDL: .idl IDL: .idl
Idris: .idris Idris: .idris
I: .i
Imp77: .imp77
Inform 6: '.inf' Inform 6: '.inf'
Inform 7: '.inf' Inform 7: '.inf'
Informix 4GL: .4gl Informix 4GL: .4gl
@ -393,19 +374,18 @@ Iptscrae: .iptscrae
Isabelle: .isabelle Isabelle: .isabelle
IS-BASIC: .basic IS-BASIC: .basic
IWBASIC: .basic IWBASIC: .basic
J: .j
Jabaco: .jabaco Jabaco: .jabaco
Jack: .jack Jack: .jack
Jacquard Loom: .jacquard Jacquard Loom: .jacquard
Jactl: .jactl
Jakt: .jakt Jakt: .jakt
JAMES II/Rule-based Cellular Automata: .james JAMES II/Rule-based Cellular Automata: .james
Janet: .janet Janet: .janet
JavaFX Script: .javafx
Java: .java Java: .java
JavaFX Script: .javafx
JavaScript: .js JavaScript: .js
JCL: .jcl JCL: .jcl
Jinja: .jinja Jinja: .jinja
J: .j
JoCaml: .jocaml JoCaml: .jocaml
JOVIAL: .jovial JOVIAL: .jovial
Joy: .joy Joy: .joy
@ -414,34 +394,31 @@ JScript.NET: .jscript
JSE: .jse JSE: .jse
Jsish: .jsish Jsish: .jsish
JudoScript: .judo JudoScript: .judo
Julia: .jl Julia: .julia
K: .k
Kabap: .kabap Kabap: .kabap
Kamailio Script: .kamailio Kamailio Script: .kamailio
Kantalo: .kantalo
KAP: .kap KAP: .kap
Kaya: .kaya Kaya: .kaya
Keg: .keg Keg: .keg
KeyList Databasing: .keylist KeyList Databasing: .keylist
Kite: .kite Kite: .kite
Kitten: .kitten Kitten: .kitten
K: .k
KL1: .kl1 KL1: .kl1
Klingphix: .klingphix Klingphix: .klingphix
Klong: .klong Klong: .klong
Koka: .koka Koka: .koka
Komodo: .komodo
KonsolScript: .konsol KonsolScript: .konsol
Kotlin: .kts Kotlin: .kotlin
KQL: .kql KQL: .kql
Ksh: .ksh Ksh: .ksh
L++: .l++
LabVIEW: .labview LabVIEW: .labview
Labyrinth: .labyrinth
Lambda Prolog: .pro Lambda Prolog: .pro
Lambdatalk: .lambdatalk Lambdatalk: .lambdatalk
Lang5: .lang5
Lang: .lang Lang: .lang
Lang5: .lang5
Langur: .langur Langur: .langur
Lapyst: .lapyst
Lasso: .lasso Lasso: .lasso
LAST: .last LAST: .last
LaTeX: .tex LaTeX: .tex
@ -467,7 +444,6 @@ Little: .little
Little Man Computer: .lmc Little Man Computer: .lmc
LiveCode: .livecode LiveCode: .livecode
LiveScript: .live LiveScript: .live
L++: .l++
LLP: .llp LLP: .llp
LLVM: .llvm LLVM: .llvm
Lobster: .lobster Lobster: .lobster
@ -480,8 +456,8 @@ Lolli: .lolli
Lotus 123 Macro Scripting: .lotus123 Lotus 123 Macro Scripting: .lotus123
LotusScript: .lotus LotusScript: .lotus
Lout: .lout Lout: .lout
LSE64: .lse64
LSE: .lse LSE: .lse
LSE64: .lse64
LSL: .lsl LSL: .lsl
LSTS: .lsts LSTS: .lsts
Lua: .lua Lua: .lua
@ -502,8 +478,6 @@ Malbolge: .malbolge
MANOOL: .manool MANOOL: .manool
Maple: .maple Maple: .maple
MAPPER: .mapper MAPPER: .mapper
MariaDB: .sql
Mastermind: .mastermind
Mathcad: .mathcad Mathcad: .mathcad
MathCortex: .mathcortex MathCortex: .mathcortex
Mathematica: .math Mathematica: .math
@ -523,21 +497,20 @@ Metapost: .metapost
MGS: .mgs MGS: .mgs
Mia: .mia Mia: .mia
Microsoft Small Basic: .basic Microsoft Small Basic: .basic
Min: .min
MINIL: .minil MINIL: .minil
Minimal BASIC: .basic Minimal BASIC: .basic
MiniScript: .mini MiniScript: .mini
MiniZinc: .minizinc MiniZinc: .minizinc
Min: .min
MIPS Assembly: .mips MIPS Assembly: .mips
Mirah: .mirah Mirah: .mirah
Miranda: .miranda Miranda: .miranda
MIRC Scripting Language: .mirc MIRC Scripting Language: .mirc
Mirelle: .mirelle Mirelle: .mirelle
ML: .ml
ML/I: .mli ML/I: .mli
MLite: .mlite MLite: .mlite
ML: .ml
MMIX: .mmix MMIX: .mmix
Mn: .mn
Modula-2: .mod2 Modula-2: .mod2
Modula-3: .mod3 Modula-3: .mod3
Mojo: .mojo Mojo: .mojo
@ -547,8 +520,6 @@ Monkey: .monkey
Monte: .monte Monte: .monte
MontiLang: .monti MontiLang: .monti
MOO: .moo MOO: .moo
MoonBit: .moonbit
MoonRock: .moonrock
MoonScript: .moon MoonScript: .moon
Morfa: .morfa Morfa: .morfa
Mosaic: .mosaic Mosaic: .mosaic
@ -587,7 +558,6 @@ Nit: .nit
Niue: .niue Niue: .niue
Nix: .nix Nix: .nix
NLP++: .nlp++ NLP++: .nlp++
Nom: .num
NOWUT: .nowut NOWUT: .nowut
NQP: .nqp NQP: .nqp
NS-HUBASIC: .basic NS-HUBASIC: .basic
@ -596,27 +566,24 @@ N/t/roff: .ntroff
Nu: .nu Nu: .nu
Nutt: .nutt Nutt: .nutt
Nyquist: .nyquist Nyquist: .nyquist
OASYS Assembler: .oasys
OASYS: .oasys OASYS: .oasys
Oberon-07: .oberon OASYS Assembler: .oasys
Oberon: .oberon Oberon: .oberon
Objeck: .objeck Objeck: .objeck
ObjectIcon: .oi ObjectIcon: .oi
Objective-C: .m Objective-C: .m
Object Pascal Implementations: .pas
Object Pascal: .pas Object Pascal: .pas
OCaml: .ml OCaml: .ocaml
Occam: .occam Occam: .occam
Octave: .octave Octave: .octave
Odin: .odin Odin: .odin
Oforth: .fth Oforth: .fth
Ol: .ol Ol: .ol
Omega: .omega Omega: .omega
OmniMark: .xom
Onyx: .onyx Onyx: .onyx
Onyx (wasm): .onyx Onyx (wasm): .onyx
OOCalc: .oocalc
OOC: .ooc OOC: .ooc
OOCalc: .oocalc
OoRexx: .rexx OoRexx: .rexx
Opa: .opa Opa: .opa
OpenC++: .openc++ OpenC++: .openc++
@ -635,9 +602,8 @@ Panoramic: .panoramic
ParaCL: .paracl ParaCL: .paracl
Pare: .pare Pare: .pare
PARI/GP: .parigp PARI/GP: .parigp
PascalABC.NET: .pas
Pascal: .pas Pascal: .pas
Pascal-P: .pas PascalABC.NET: .pas
PASM: .pasm PASM: .pasm
PDP-11 Assembly: .pdp11 PDP-11 Assembly: .pdp11
Pebble: .pebble Pebble: .pebble
@ -646,16 +612,15 @@ Pentium Assembly: .pentium
PeopleCode: .peoplecode PeopleCode: .peoplecode
PepsiScript: .pepsi PepsiScript: .pepsi
Peri: .peri Peri: .peri
Perl: .pl
Perl5i: .p5i Perl5i: .p5i
Perl 6: .pl6 Perl 6: .pl6
Perl: .pl
Peylang: .peylang Peylang: .peylang
Phixmonti: .phixmonti
Phix: .phix Phix: .phix
Phixmonti: .phixmonti
PHL: .phl PHL: .phl
PHP: .php PHP: .php
Picat: .picat Picat: .picat
Pico-8: .pico8
PicoLisp: .l PicoLisp: .l
Pict: .pict Pict: .pict
Piet: .piet Piet: .piet
@ -668,13 +633,12 @@ Plain English: .plain
PlainTeX: .tex PlainTeX: .tex
Plan: .plan Plan: .plan
PL/B: .plb PL/B: .plb
PL/I-80: .pli
PL/I: .pli PL/I: .pli
PL/I-80: .pli
PL/M: .plm PL/M: .plm
PL/pgSQL: .sql PL/pgSQL: .sql
PL/SQL: .sql PL/SQL: .sql
PLUS: .plus PLUS: .plus
Pluto: .pluto
PLZ/SYS: .plz PLZ/SYS: .plz
Pointless: .pointless Pointless: .pointless
Polyglot: .polyglot Polyglot: .polyglot
@ -687,58 +651,56 @@ POV-Ray: .povray
PowerBASIC: .basic PowerBASIC: .basic
Powerbuilder: .powerbuilder Powerbuilder: .powerbuilder
PowerPC Assembly: .ppc PowerPC Assembly: .ppc
PowerShell: .ps1 PowerShell: .psh
PPL: .ppl PPL: .ppl
Processing: .processing Processing: .processing
Processing Python mode: .processing-py Processing Python mode: .processing-py
Processing.R: .processing-r Processing.R: .processing-r
ProDOS: .dos ProDOS: .dos
Prog8: .prog8 Prog8: .prog8
ProgressBASIC: .basic
Prolog: .pro Prolog: .pro
PROMAL: .promal PROMAL: .promal
PSQL: .psql PSQL: .psql
Pure: .pure
PureBasic: .basic PureBasic: .basic
Pure Data: .puredata Pure Data: .puredata
Pure: .pure
Purity: .purity Purity: .purity
Pyret: .arr Pyret: .pyret
Python: .py Python: .py
Q: .q
QB64: .qb64 QB64: .qb64
QBasic: .basic QBasic: .basic
Qi: .qi Qi: .qi
.QL: .ql .QL: .ql
QL SuperBASIC: .basic QL SuperBASIC: .basic
Qore: .qore Qore: .qore
Q: .q
Quackery: .quackery Quackery: .quackery
QuakeC: .c QuakeC: .c
QuickBASIC: .basic QuickBASIC: .basic
Quill: .quill Quill: .quill
Quite BASIC: .basic Quite BASIC: .basic
Quorum: .quorum Quorum: .quorum
R: .r
Ra: .ra
Racket: .rkt Racket: .rkt
Raku: .raku Raku: .raku
RapidQ: .rapidq RapidQ: .rapidq
Rapira: .rapira Rapira: .rapira
Ra: .ra
Rascal: .rascal Rascal: .rascal
RASEL: .rasel RASEL: .rasel
RATFOR: .ratfor RATFOR: .ratfor
Raven: .raven Raven: .raven
REALbasic: .basic REALbasic: .basic
Reason: .re Reason: .reason
Rebol: .rebol
REBOL: .rebol REBOL: .rebol
Red: .red Red: .red
Reduce: .reduce Reduce: .reduce
Refal: .refal Refal: .refal
Relation: .relation Relation: .relation
ReScript: .res ReScript: .re
Retro: .retro Retro: .retro
Revolution: .rev Revolution: .rev
REXX: .rexx REXX: .rexx
Rhombus: .rhombus
Rhope: .rhope Rhope: .rhope
Rhovas: .rhovas Rhovas: .rhovas
Ring: .ring Ring: .ring
@ -746,31 +708,28 @@ RISC-V Assembly: .asm
RLaB: .rlab RLaB: .rlab
RLSL: .rlsl RLSL: .rlsl
Robotic: .robotic Robotic: .robotic
Rockstar: .rockstar
Rocq: .rocq
Roc: .roc Roc: .roc
RPGIV: .rpgiv Rockstar: .rockstar
RPG: .rpg RPG: .rpg
RPL/2: .rpl2 RPGIV: .rpgiv
RPL: .rpl RPL: .rpl
R: .r RPL/2: .rpl2
RTL/2: .rtl2 RTL/2: .rtl2
RTSL: .rtsl RTSL: .rtsl
Rubylog: .rubylog Rubylog: .rubylog
Ruby: .rb Ruby: .rb
Run BASIC: .basic Run BASIC: .basic
Rust: .rs Rust: .rust
Rye: .rye S++: .s++
Sage: .sage Sage: .sage
Salmon: .salmon Salmon: .salmon
SapbotVM: .sapbot
SASL: .sasl
SAS: .sas SAS: .sas
SASL: .sasl
Sass/SCSS: .sass Sass/SCSS: .sass
Sather: .sa Sather: .sa
S-BASIC: .basic S-BASIC: .basic
Scala: .scala Scala: .scala
Scheme: .scm Scheme: .ss
Scilab: .scilab Scilab: .scilab
Scratch: .scratch Scratch: .scratch
ScratchScript: .scratch ScratchScript: .scratch
@ -782,15 +741,14 @@ Seed7: .seed7
Self: .self Self: .self
SenseTalk: .sensetalk SenseTalk: .sensetalk
SequenceL: .sequencel SequenceL: .sequencel
SETL: .setl
Setl4: .setl4 Setl4: .setl4
Set lang: .set Set lang: .set
SETL: .setl
Shale: .shale Shale: .shale
SheerPower 4GL: .4gl SheerPower 4GL: .4gl
Shen: .shen Shen: .shen
Shiny: .shiny Shiny: .shiny
Sidef: .sidef Sidef: .sidef
SIL: .sil
SimpleCode: .simplecode SimpleCode: .simplecode
SimpleLang: .simple SimpleLang: .simple
SIMPOL: .simpol SIMPOL: .simpol
@ -807,8 +765,8 @@ Smalltalk: .st
Smart BASIC: .basic Smart BASIC: .basic
SMEQL: .smeql SMEQL: .smeql
SmileBASIC: .basic SmileBASIC: .basic
SNOBOL4: .sno
Snobol: .sno Snobol: .sno
SNOBOL4: .sno
SNUSP: .snusp SNUSP: .snusp
Soar: .soar Soar: .soar
Soda: .soda Soda: .soda
@ -816,15 +774,14 @@ SoneKing Assembly: .soneking
SPAD: .spad SPAD: .spad
SPARC Assembly: .sparc SPARC Assembly: .sparc
SparForte: .sparforte SparForte: .sparforte
Sparkling: .sparkling
SPARK: .spark SPARK: .spark
Sparkling: .sparkling
Spin: .spin Spin: .spin
SPL: .spl SPL: .spl
SPSS: .spss SPSS: .spss
SQL PL: .sql
SQL: .sql SQL: .sql
SQL PL: .sql
Squirrel: .nut Squirrel: .nut
S++: .s++
SSEM: .ssem SSEM: .ssem
Standard ML: .ml Standard ML: .ml
Star: .star Star: .star
@ -845,23 +802,22 @@ SystemVerilog: .v
TailDot: .taildot TailDot: .taildot
Tailspin: .tailspin Tailspin: .tailspin
TAL: .tal TAL: .tal
TAV: .tav
Tbas: .tbas Tbas: .tbas
Tcl: .tcl Tcl: .tcl
TechBASIC: .basic TechBASIC: .basic
Teco: .teco Teco: .teco
TeLa: .tela TeLa: .tela
Tern: .tern Tern: .tern
Terraform: .terraform
Terra: .terra Terra: .terra
Terraform: .terraform
TestML: .tml TestML: .tml
Thistle: .thistle Thistle: .thistle
Thyrd: .thyrd Thyrd: .thyrd
TI BASIC: .basic
TI-57: .ti57 TI-57: .ti57
TI-83 BASIC: .basic TI-83 BASIC: .basic
TI-83 Hex Assembly: .asm TI-83 Hex Assembly: .asm
TI-89 BASIC: .basic TI-89 BASIC: .basic
TI BASIC: .basic
Tiny BASIC: .basic Tiny BASIC: .basic
Tiny Craft Basic: .basic Tiny Craft Basic: .basic
TIS-100: .tis100 TIS-100: .tis100
@ -894,30 +850,31 @@ Uiua: .uiua
Ultimate++: .ultimate++ Ultimate++: .ultimate++
Unicon: .unicon Unicon: .unicon
Uniface: .uniface Uniface: .uniface
Unison: .u Unison: .unison
UnixPipes: .up UnixPipes: .up
UNIX Shell: .sh UNIX Shell: .sh
Unlambda: .unlambda Unlambda: .unlambda
Ursalang: .ursa
Ursala: .ursala
Ursa: .ursa Ursa: .ursa
Ursala: .ursala
Ursalang: .ursa
UScript: .u UScript: .u
UserRPL: .rpl UserRPL: .rpl
UTFool: .utfool UTFool: .utfool
Uxntal: .uxnatl Uxntal: .uxnatl
V: .v
Vala: .vala Vala: .vala
Vale: .vale Vale: .vale
VAX Assembly: .vax VAX Assembly: .vax
VB6: .vb6 VB6: .vb6
VBA: .vba VBA: .vba
VBScript: .vbs VBScript: .vb
Vedit macro language: .vedit Vedit macro language: .vedit
Verbexx: .verbexx Verbexx: .verbexx
Verilog: .v Verilog: .v
VHDL: .vhd VHDL: .vhdl
Vim Script: .vim Vim Script: .vim
Visual Basic .NET: .vb
Visual Basic: .vb Visual Basic: .vb
Visual Basic .NET: .vb
Visual FoxPro: .fvp Visual FoxPro: .fvp
Visual Objects: .vobj Visual Objects: .vobj
Visual Prolog: .pro Visual Prolog: .pro
@ -926,10 +883,7 @@ Vorpal: .vorpal
Vox: .vox Vox: .vox
VRML: .vrml VRML: .vrml
VTL-2: .vtl-2 VTL-2: .vtl-2
V: .v
V (Vlang): .v V (Vlang): .v
Vyxal: .vyxal
Waduzitdo: .waduzitdo
Wart: .wart Wart: .wart
WDTE: .wdte WDTE: .wdte
WebAssembly: .wasm WebAssembly: .wasm
@ -951,32 +905,31 @@ XBase: .xbase
XBasic: .basic XBasic: .basic
XBS: .xbs XBS: .xbs
XEec: .xeec XEec: .xeec
XLISP: .l
XL: .xl XL: .xl
XLISP: .l
Xojo: .xojo Xojo: .xojo
XPath 2.0: .xpath XPath 2.0: .xpath
XPL0: .xpl0 XPL0: .xpl0
XProc: .xproc XProc: .xproc
XProfan: .xprofan XProfan: .xprofan
XQuery: .xquery XQuery: .xquery
X-script: .x XS: .xs
XSLT: .xslt
XSLT 1.0: .xslt XSLT 1.0: .xslt
XSLT 2.0: .xslt XSLT 2.0: .xslt
XSLT: .xslt
XS: .xs
XTalk: .xtalk XTalk: .xtalk
XUL: .xul XUL: .xul
Ya: .ya
Yabasic: .basic Yabasic: .basic
Yacas: .yacas Yacas: .yacas
YAMLScript: .ys YAMLScript: .ys
Ya: .ya
Yorick: .yorick Yorick: .yorick
Z80 Assembly: .z80 Z80 Assembly: .z80
ZED: .zed ZED: .zed
Zig: .zig Zig: .zig
Zkl: .zkl Zkl: .zkl
Zoea Visual: .zoea
Zoea: .zoea Zoea: .zoea
Zoea Visual: .zoea
Zonnon: .zonnon Zonnon: .zonnon
Zoomscript: .zoom Zoomscript: .zoom
ZPL: .zpl ZPL: .zpl

View file

@ -0,0 +1 @@
../../Task/Bioinformatics-base-count/11l

View file

@ -0,0 +1 @@
../../Task/Meissel-Mertens-constant/11l

View file

@ -0,0 +1 @@
../../Task/Miller-Rabin-primality-test/11l

View file

@ -0,0 +1 @@
../../Task/Sorting-Algorithms-Circle-Sort/11l

View file

@ -1,6 +1,3 @@
{{stub}} {{stub}}{{language|4D}}{{IDE}}'''4D''' (or '''4th Dimension''') is a database management system and [[:Category:Integrated Development Environments|integrated development environment]] authored by Laurent Ribardière in 1984.
{{language|4D
|site=https://us.4d.com/
}}{{IDE}}'''4D''' (or '''4th Dimension''') is a database management system and [[:Category:Integrated Development Environments|integrated development environment]] authored by Laurent Ribardière in 1984.
==Citations== ==Citations==
*[[wp:4th_Dimension_%28Software%29|Wikipedia:4th Dimension (Software)]] *[[wp:4th_Dimension_%28Software%29|Wikipedia:4th Dimension (Software)]]

View file

@ -1,7 +0,0 @@
{{language|4ME
|site=https://thevitebsk.github.io/4ME.by/}}
4ME is a programing language created by [[User:Gaham]] implemented in 04.07.2024 MSK
==See Also==
* [https://esolangs.org/wiki/4ME 4ME in Esolangs.org]
* [https://github.com/Thevitebsk/4me/ Github repo]
[[Category:Programming paradigm/Concatenative]]

View file

@ -1,2 +0,0 @@
---
from: http://rosettacode.org/wiki/Category:4ME

View file

@ -131,29 +131,6 @@ This flag is set if the <code>BRK</code> command was executed. The BRK basically
* Set with: <code>BRK</code> * Set with: <code>BRK</code>
* Cleared with: <code>RTI</code> * Cleared with: <code>RTI</code>
* There are no branches associated with this command. * There are no branches associated with this command.
This flag is used only for differentiating a <code>BRK</code> from an hardware <code>IRQ</code>
<syntaxhighlight lang="6502asm">IRQ:
STA saveAccumulator ; save accumulator
PLA ; get flags
STA saveFlags ; save flags
AND #$10 ; check "break" flag
BNE IRQ_fromBreak ; if(break flag set){ goto IRQ_fromBreak; }
JMP IRQ_fromHardware ; else{ goto IRQ_fromInterrupt; }
IRQ_fromBreak:
LDA saveFlags ; load flags from temp address
PHA ; restore flags to stack
LDA saveAccumulator ; restore accumulator
;...
RTI ; return from interrupt
IRQ_fromInterrupt:
LDA saveFlags ; load flags from temp address
PHA ; restore flags to stack
LDA saveAccumulator ; restore accumulator
;...
RTI ; return from interrupt
</syntaxhighlight>
<br><br> <br><br>
===Decimal=== ===Decimal===

View file

@ -3,36 +3,31 @@
{{language}} {{language}}
68000 assembly is the assembly language used for the Motorola 68000, or commonly known as the 68K. It should not be confused with the 6800 (which predates it). The Motorola 68000 is a big-endian processor with full 32-bit capabilities (despite most systems that use it being considered 16-bit.) It was used in many computers such as the Amiga or the Canon Cat, as well as game consoles such as the Sega Genesis and Neo Geo. 68000 assembly is the assembly language used for the Motorola 68000, or commonly known as the 68K. It should not be confused with the 6800 (which predates it). The Motorola 68000 is a big-endian processor with full 32-bit capabilities (despite most systems that use it being considered 16-bit.) It was used in many computers such as the Amiga or the Canon Cat, as well as game consoles such as the Sega Genesis and Neo Geo.
==Architecture Overview== ==Architecture Overview==
===Big-Endian=== ===Big-Endian===
The 68000, unlike most processors of its era, is big-endian. This means that bytes are stored from left to right. The example below illustrates this concept: The 68000, unlike most processors of its era, is big-endian. This means that bytes are stored from left to right. The example below illustrates this concept:
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.L #$12345678,$100000 ;store the hexadecimal numeral #$12345678 at memory address $100000
MOVE.L #$12345678,$100000 ;store the hexadecimal numeral #$12345678 at memory address $100000
</syntaxhighlight>
<pre>
;hexdump of $100000: ;hexdump of $100000:
;$100000 = $12 ;$100000 = $12
;$100001 = $34 ;$100001 = $34
;$100002 = $56 ;$100002 = $56
;$100003 = $78 ;$100003 = $78</lang>
</pre>
On a little-endian processor such as in [[x86 Assembly]], the order of the bytes would be reversed, i.e.: On a little-endian processor such as in [[x86 Assembly]], the order of the bytes would be reversed, i.e.:
<pre> <lang asm>;hexdump of $100000
;hexdump of $100000
;$100000 = $78 ;$100000 = $78
;$100001 = $56 ;$100001 = $56
;$100002 = $34 ;$100002 = $34
;$100003 = $12 ;$100003 = $12</lang>
</pre>
The main difference is that if you wanted to access this value as a byte or word it would be at a different address, whereas with a little endian architecture it is at the same address. This difference isn't usually relevant in the majority of situations, so don't concern yourself too much. It's much more important when doing [[6502 Assembly]] where registers are smaller than the address space.
===Notation Conventions=== ===Notation Conventions===
How you write the source code depends on your assembler and the syntax it uses. This page is written using Motorola syntax but there is also Milo syntax which has different conventions. How you write the source code depends on your assembler and the syntax it uses. This page is written using Motorola syntax but there is also Milo syntax which has different conventions.
How you go about defining numbers or text in your code varies wildly between assemblers. How you go about defining numbers or text in your code varies wildly between assemblers. I'm using VASM and these are the rules I have to follow, but your assembler may be different.
* A number with a # in front represents a constant, literal value. For example, the 3 in <code>MOVE.B #3,D0</code> represents the number 3. * A number with a # in front represents a constant, literal value. For example, the 3 in <code>MOVE.B #3,D0</code> represents the number 3.
@ -50,88 +45,72 @@ How you go about defining numbers or text in your code varies wildly between ass
* The operand before the comma is the "source", and the operand after is the "destination." For example, <code>MOVE.L D3,D2</code> takes the value in D3 and stores it into D2, not the other way around. This is the opposite of x86 and ARM, which have the source on the right and the destination on the left. * The operand before the comma is the "source", and the operand after is the "destination." For example, <code>MOVE.L D3,D2</code> takes the value in D3 and stores it into D2, not the other way around. This is the opposite of x86 and ARM, which have the source on the right and the destination on the left.
Data blocks, on the other hand, begin with <code>DC.B</code>, <code>DC.W</code>, or <code>DC.L</code> and each represents a constant numeric value. You do NOT prefix these with # to signify them as constants (doing so will cause an error on most assemblers). However, you can use the $ or % modifiers to denote hexadecimal or binary.
Data blocks, on the other hand, begin with <code>DC.B</code>, <code>DC.W</code>, or <code>DC.L</code> and each represents a constant numeric value. Strangely, you do NOT prefix these with # to signify them as constants (doing so will cause an error on most assemblers). However, you can use the $ or % modifiers to denote hexadecimal or binary.
Keep in mind that there is no requirement to use hexadecimal, decimal, or binary in your source code. It all gets converted to binary anyway. However, it is recommended to use the notation that is appropriate for how your data is meant to be interpreted, for readability purposes. Keep in mind that there is no requirement to use hexadecimal, decimal, or binary in your source code. It all gets converted to binary anyway. However, it is recommended to use the notation that is appropriate for how your data is meant to be interpreted, for readability purposes.
===Data Registers=== ===Data Registers===
There are eight 32-bit data registers on the 68000, numbered D0-D7. As the name implies, these are designed to hold data. Much like in [[ARM Assembly]], each one is identical in terms of which commands it can use. A command that can be used for D0 can be used for any other D-register. There are eight 32-bit data registers on the 68000, numbered D0-D7. As the name implies, these are designed to hold data. Much like in [[ARM Assembly]], each one is identical in terms of which commands it can use. A command that can be used for D0 can be used for any other D-register.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.B #$FF,D0 ;move the hexadecimal value 0xFF into the bottom byte of D0.
MOVE.B #$FF,D0 ;move the hexadecimal value 0xFF into the bottom byte of D0. ADD.W #$8000,D4 ;add hexadecimal 0x8000 to the value stored in D4.</lang>
ADD.W #$8000,D4 ;add hexadecimal 0x8000 to the value stored in D4.
</syntaxhighlight>
===Address Registers=== ===Address Registers===
There are eight of these as well, numbered A0-A7. A7 is reserved as the stack pointer, and is commonly referenced as SP in assemblers. The others are free to use for any purpose. Although these registers are 32-bit, the 68000's address space is 24-bit (ranges from 0x000000 to 0xFFFFFF), so the leftmost byte is ignored. You can do simple math involving these registers but more complicated commands like multiply or divide can only be used with data registers. Address registers are used to contain addresses and extract the values stored within. There are eight of these as well, numbered A0-A7. A7 is reserved as the stack pointer, and is commonly referenced as SP in assemblers. The others are free to use for any purpose. Although these registers are 32-bit, the 68000's address space is 24-bit (ranges from 0x000000 to 0xFFFFFF), so the leftmost byte is ignored. You can do simple math involving these registers but more complicated commands like multiply or divide can only be used with data registers. Address registers are used to contain addresses and extract the values stored within.
====Loading From Memory==== ====Loading From Memory====
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVEA.L #$200000,A2 ;usually these are loaded from a label.
MOVEA.L #$200000,A2 ;usually these are loaded from a label.
;The hex dump of address $200000: 44 55 66 77 ;The hex dump of address $200000: 44 55 66 77
MOVE.L #$00000000,D0 MOVE.L #$00000000,D0
MOVE.B (A2),D0 ;load the byte stored at $200000 into D0. D0 = #$00000044 MOVE.B (A2),D0 ;load the byte stored at $200000 into D0. D0 = #$00000044
MOVE.W (A2),D0 ;load the word stored at $200000 into D0. D0 = #$00004455 MOVE.W (A2),D0 ;load the word stored at $200000 into D0. D0 = #$00004455
MOVE.L (A2),D0 ;load the long stored at $200000 into D0. D0 = #$44556677 MOVE.L (A2),D0 ;load the long stored at $200000 into D0. D0 = #$44556677
MOVE.L D2,(A5) ;store the contents of D2 into the memory address pointed to by A5. MOVE.L D2,(A5) ;store the contents of D2 into the memory address pointed to by A5.</lang>
</syntaxhighlight>
Note that it's also possible to transfer values to/from memory directly, without involving address registers at all. For constant memory locations, this is fine. However, the real strength of the address registers is in their pre-decrement and post-increment modes, which constant memory locations cannot use. Note that it's also possible to transfer values to/from memory directly, without involving address registers at all. For constant memory locations, this is fine. However, the real strength of the address registers is in their pre-decrement and post-increment modes, which constant memory locations cannot use.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.L ($00FF0000),D0
MOVE.L ($00FF0000),D0
MOVE.W D1,($00FFFFFE) MOVE.W D1,($00FFFFFE)
MOVE.W ($00FF0000),($00FF1000) MOVE.W ($00FF0000),($00FF1000)</lang>
</syntaxhighlight>
The use of parentheses is not required on most assemblers, but can be used as a reminder to someone reading your code that these represent the values stored at the specified memory locations rather than literal numbers. The use of parentheses is not required on most assemblers, but can be used as a reminder to someone reading your code that these represent the values stored at the specified memory locations rather than literal numbers.
====Post-Increment==== ====Post-Increment====
The post-increment mode is specified by adding a + to the end of parentheses. This means that after the command is done, the address stored in the <b>address register</b> (not the value stored at that address) is increased by the byte length of the command (1 for <code>.B</code>, 2 for <code>.W</code>, 4 for <code>.L</code>). The post-increment mode is specified by adding a + to the end of parentheses. This means that after the command is done, the address stored in the <b>address register</b> (not the value stored at that address) is increased by the byte length of the command (1 for <code>.B</code>, 2 for <code>.W</code>, 4 for <code>.L</code>).
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVEA.L #$00240000,A4 ;load the address $240000 into A4
MOVEA.L #$00240000,A4 ;load the address $240000 into A4
MOVE.W (A4)+,D0 ;move the word stored at $240000 into D0, then increment to #$240002 MOVE.W (A4)+,D0 ;move the word stored at $240000 into D0, then increment to #$240002
MOVE.L (A4)+,D1 ;move the long stored at $240000 into D1, then increment to #$240006 MOVE.L (A4)+,D1 ;move the long stored at $240000 into D1, then increment to #$240006
MOVE.L (SP)+,D3 ;pop the top value of the stack into D3 MOVE.L (SP)+,D3 ;pop the top value of the stack into D3</lang>
</syntaxhighlight>
====Pre-Decrement==== ====Pre-Decrement====
The pre-decrement mode is specified by typing a - before the parentheses. This means that before the command is done, the address stored in the address register is decreased by the byte length of the command. The pre-decrement mode is specified by typing a - before the parentheses. This means that before the command is done, the address stored in the address register is decreased by the byte length of the command.
<syntaxhighlight lang="68000devpac">MOVEA.L #$0024000A,A4 ;load the address $24000A into A4 <lang 68000devpac>MOVEA.L #$0024000A,A4 ;load the address $24000A into A4
MOVE.W -(A4),D0 ;move the word stored at $240008 into D0 MOVE.W -(A4),D0 ;move the word stored at $240008 into D0
MOVE.L -(A4),D1 ;move the long stored at $240004 into D1 MOVE.L -(A4),D1 ;move the long stored at $240004 into D1
MOVE.L D2,-(SP) ;push the contents of D2 onto the stack</syntaxhighlight> MOVE.L D2,-(SP) ;push the contents of D2 onto the stack</lang>
====Address Offsets==== ====Address Offsets====
A memory address can be offset by a data register, an immediate value, or both. If a data register is used, only the bottom 2 bytes are considered. In either case, the contents of the data register and/or the immediate value are added to the value stored in the address register, and the value is read from that address at the specified length. The offsets are applied during the calculation only; the actual contents in the address register after the move are unchanged. Using a post-increment or pre-decrement with this addressing mode will only update the address by the specified length, not by the offsets. A memory address can be offset by a data register, an immediate value, or both. If a data register is used, only the bottom 2 bytes are considered. In either case, the contents of the data register and/or the immediate value are added to the value stored in the address register, and the value is read from that address at the specified length. The offsets are applied during the calculation only; the actual contents in the address register after the move are unchanged. Using a post-increment or pre-decrement with this addressing mode will only update the address by the specified length, not by the offsets.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.B (4,A0,D0),D1 ;The byte at A0+D0+4 is loaded into D1.</lang>
MOVE.B (4,A0,D0),D1 ;The byte at A0+D0+4 is loaded into D1.
</syntaxhighlight>
It's possible to use the same data register as the offset and the destination. This does not cause any problems whatsoever, as the data register offset is "locked in" before the move, and is only updated after the command fully executes. Using the same command again immediately afterwards will offset based on the new value of that register. It's possible to use the same data register as the offset and the destination. This does not cause any problems whatsoever, as the data register offset is "locked in" before the move, and is only updated after the command fully executes. Using the same command again immediately afterwards will offset based on the new value of that register.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.W (6,A0,D0),D0 ;The word at A0+D0+6 is read, then loaded into D0.</lang>
MOVE.W (6,A0,D0),D0 ;The word at A0+D0+6 is read, then loaded into D0.
</syntaxhighlight>
A very important note is that when using this method with words and longs, the resulting address <b><i>must be even!</i></b> Otherwise the CPU will crash. For <code>MOVE.B</code> it doesn't matter. A very important note is that when using this method with words and longs, the resulting address <b><i>must be even!</i></b> Otherwise the CPU will crash. For <code>MOVE.B</code> it doesn't matter.
====Effective Address==== ====Effective Address====
A calculated offset can be saved to an address register with the <code>LEA</code> command, which stands for "Load Effective Address." [[x86 Assembly]] also has this command, and it serves the same purpose. The syntax for it can be a bit misleading depending on your assembler. A calculated offset can be saved to an address register with the <code>LEA</code> command, which stands for "Load Effective Address." [[x86 Assembly]] also has this command, and it serves the same purpose. The syntax for it can be a bit misleading depending on your assembler.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>LEA myData,A0 ;load the effective address of myData into A0
LEA myData,A0 ;load the effective address of myData into A0
LEA (4,A0),A1 ;load into A1 the effective address A0+4. This looks like a dereference operation but it is not! LEA (4,A0),A1 ;load into A1 the effective address A0+4. This looks like a dereference operation but it is not!
MOVE.W (A1),D1 ;dereference A1, loading the value it points to into D1. MOVE.W (A1),D1 ;dereference A1, loading the value it points to into D1.</lang>
</syntaxhighlight>
This can get confusing, especially if you have tables of pointers. Just remember that <code>LEA</code> cannot dereference an address. This can get confusing, especially if you have tables of pointers. Just remember that <code>LEA</code> cannot dereference an address.
If you don't want to store the effective address in an address register, you can use <code>PEA</code> (push effective address) to put it onto the stack instead. If you don't want to store the effective address in an address register, you can use <code>PEA</code> (push effective address) to put it onto the stack instead.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>LEA myData,A0 ;load the effective address of myData into A0
LEA myData,A0 ;load the effective address of myData into A0 PEA (4,A0) ;store the effective address of A0+4 onto the stack.</lang>
PEA (4,A0) ;store the effective address of A0+4 onto the stack.
</syntaxhighlight>
====The Stack==== ====The Stack====
The 68000's stack is commonly referred to as <code>SP</code> but it is also address register <code>A7</code>. This register is handled differently than the other address registers when pushing bytes onto the stack. A byte value pushed onto the stack will be padded to the <b>right</b>. The stack needs to pad byte-length data so that it can stay word-aligned at all times. Otherwise the CPU would crash as soon as you tried to use the stack for anything other than a byte! The 68000's stack is commonly referred to as <code>SP</code> but it is also address register <code>A7</code>. This register is handled differently than the other address registers when pushing bytes onto the stack. A byte value pushed onto the stack will be padded to the <b>right</b>. The stack needs to pad byte-length data so that it can stay word-aligned at all times. Otherwise the CPU would crash as soon as you tried to use the stack for anything other than a byte!
@ -145,48 +124,48 @@ The 68000 can work with 8-bit, 16-bit, or 32-bit values. Some commands only work
If you don't specify a length with your command, it usually defaults to word length, but ultimately it depends on the command you are using. (Some commands cannot be used at word length.) If you don't specify a length with your command, it usually defaults to word length, but ultimately it depends on the command you are using. (Some commands cannot be used at word length.)
Bytes and words moved into a register are always stored on the right-hand side. For example: Bytes and words moved into a register are always stored on the right-hand side. For example:
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.L #$FFFFFFFF,D7
MOVE.L #$FFFFFFFF,D7
MOVE.B #$00,D7 ;D7 contains #$FFFFFF00 MOVE.B #$00,D7 ;D7 contains #$FFFFFF00
MOVE.W #$2222,D7 ;D7 contains #$FFFF2222 MOVE.W #$2222,D7 ;D7 contains #$FFFF2222</lang>
</syntaxhighlight>
As you can see, the rest of the register is unchanged. (On the ARM, it would turn to zeroes.) This is very important to remember. If your code is doing something unexpected it might be due to the "old" value of the register corrupting another function. As you can see, the rest of the register is unchanged. (On the ARM, it would turn to zeroes.) This is very important to remember. If your code is doing something unexpected it might be due to the "old" value of the register corrupting another function.
If the given constant is smaller than the length provided, the value is padded to the left with zeroes. If the given constant is smaller than the length provided, the value is padded to the left with zeroes.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVE.W #$FF,D3 ;D3 = #$xxxx00FF, where x is the previous value of D3.
MOVE.W #$FF,D3 ;D3 = #$xxxx00FF, where x is the previous value of D3. MOVE.L #0,D3 ;D3 = #$00000000</lang>
MOVE.L #0,D3 ;D3 = #$00000000
</syntaxhighlight>
Loading immediate values into address registers is different. You can only move words or longer into address registers, and if you move a word, the value is sign-extended. This means that if the top nibble of the word is 8 or greater, the value gets padded to the left with Fs, and is padded with zeroes if the top nibble is 7 or less. If you're adding a constant value less than 7FFF to an address, it's usually safe to use the word length operation, which takes less bytes to encode than the long length version. Loading immediate values into address registers is different. You can only move words or longer into address registers, and if you move a word, the value is sign-extended. This means that if the top nibble of the word is 8 or greater, the value gets padded to the left with Fs, and is padded with zeroes if the top nibble is 7 or less. If you're adding a constant value less than 7FFF to an address, it's usually safe to use the word length operation, which takes less bytes to encode than the long length version.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MOVEA.W #$8000,A4 ;A4 = #$FFFF8000. Remember the top byte is ignored so this is the same as #$00FF8000.
MOVEA.W #$8000,A4 ;A4 = #$FFFF8000. Remember the top byte is ignored so this is the same as #$00FF8000. MOVEA.W #$7FFF,A3 ;A3 = #$00007FFF</lang>
MOVEA.W #$7FFF,A3 ;A3 = #$00007FFF
</syntaxhighlight>
==The Flags== ==The Flags==
The flags are stored in the Condition Code Register, also known as the <code>CCR</code>. The 68000 has no built-in commands like <code>CLC</code> for clearing/setting individual flags. Rather, you can alter them directly with <code>MOVE</code>,<code>AND</code>,<code>OR</code>, and <code>EOR</code>. Unfortunately, this means you'll have to remember which bits represent which flags. Or, if your assembler supports macros, you can define a macro that handles this for you. The flags are stored in the Condition Code Register, also known as the <code>CCR</code>. The 68000 has no built-in commands like <code>CLC</code> for clearing/setting individual flags. Rather, you can alter them directly with <code>MOVE</code>,<code>AND</code>,<code>OR</code>, and <code>EOR</code>. Unfortunately, this means you'll have to remember which bits represent which flags. Or, if your assembler supports macros, you can define a macro that handles this for you.
The flags update automatically after most operations, and take into consideration the operand sizes when doing so. Check out this example: The flags update automatically after most operations, and take into consideration the operand sizes when doing so. Check out this example:
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>
MOVE.L #$12FF,D0 MOVE.L #$12FF,D0
ADD.B #1,D0 ADD.B #1,D0
</syntaxhighlight> </lang>
Since we used <code>ADD.B</code>, D0 now contains $1200, and the extend, carry, and zero flags are all set. Had we done <code>ADD.W</code>, we would get $1300 in D0 with none of those flags set. The flags are based on what the actual instruction "sees", not the entire register at all times. Since we used <code>ADD.B</code>, D0 now contains $1200, and the extend, carry, and zero flags are all set. Had we done <code>ADD.W</code>, we would get $1300 in D0 with none of those flags set. The flags are based on what the actual instruction "sees", not the entire register at all times.
* X: The eXtend flag is bit 4 of the CCR, and is similar to the carry flag. It gets set and cleared often for the same reasons and is used with the <code>ADDX</code>, <code>SUBX</code>, <code>NEGX</code>, <code>ROXL</code>, and <code>ROXR</code> commands. Why the 68000 has both this and the carry flag, I still don't know. * X: The eXtend flag is bit 4 of the CCR, and is similar to the carry flag. It gets set and cleared often for the same reasons and is used with the <code>ADDX</code>, <code>SUBX</code>, <code>NEGX</code>, <code>ROXL</code>, and <code>ROXR</code> commands. Why the 68000 has both this and the carry flag, I still don't know.
* N: The negative flag is bit 3 of the CCR, and is set when the last operation resulted in a "negative" value. What constitutes a negative value depends on the size of the last operation - for <code>.B</code> instructions, $80-$FF. For <code>.W</code> instructions, $8000-$FFFF, and for <code>.L</code> instructions, $80000000-$FFFFFFFF. * N: The negative flag is bit 3 of the CCR, and is set when the last operation resulted in a "negative" value. What constitutes a negative value depends on the size of the last operation - for <code>.B</code> instructions, $80-$FF. For <code>.W</code> instructions, $8000-$FFFF, and for <code>.L</code> instructions, $80000000-$FFFFFFFF.
* Z: The zero flag is bit 2 of the CCR and works like you would expect - it's set whenever an operation results in zero. Unlike x86 Assembly, this also includes moving 0 directly into a register, clearing a register <b>or memory</b> with <code>CLR</code>, etc. * Z: The zero flag is bit 2 of the CCR and works like you would expect - it's set whenever an operation results in zero. Unlike x86 Assembly, this also includes moving 0 directly into a register, clearing a register <b>or memory</b> with <code>CLR</code>, etc.
* V: The overflow flag is bit 1 of the CCR. It is set whenever a math operation results in a value crossing the $7F-$80 boundary. (Wraparound from 00 to FF doesn't count as overflow, but it does set the carry flag.) * V: The overflow flag is bit 1 of the CCR. It is set whenever a math operation results in a value crossing the $7F-$80 boundary. (Wraparound from 00 to FF doesn't count as overflow, but it does set the carry flag.)
* C: The carry flag is bit 0 of the CCR. It is set when a math operation results in a carry or borrow. Rolling over from FF to 00, or a 1 getting "pushed out" via a bit shift or rotate, set the carry flag. When using <code>CMP</code>, the carry flag determines the unsigned magnitude comparison. Carry set is less than, carry clear is greater than or equal. * C: The carry flag is bit 0 of the CCR. It is set when a math operation results in a carry or borrow. Rolling over from FF to 00, or a 1 getting "pushed out" via a bit shift or rotate, set the carry flag. When using <code>CMP</code>, the carry flag determines the unsigned magnitude comparison. Carry set is less than, carry clear is greater than or equal.
In truth, the flags are a 16-bit register, of which the CCR is just the "low half". The SR (status register) is the full 16-bit register. In truth, the flags are a 16-bit register, of which the CCR is just the "low half". The SR (status register) is the full 16-bit register.
There are a few additional flags in the upper half, which are used by the operating system. You can read these but for the most part you won't need to write to them. There are a few additional flags in the upper half, which are used by the operating system. You can read these but for the most part you won't need to write to them.
@ -210,15 +189,13 @@ The 68000 supports 7 different interrupts, often called IRQs or Interrupt Reques
==Alignment== ==Alignment==
The 68000 can only read or write words and longs at even addresses. Doing so at an odd address will result in the CPU crashing. (Note that reading byte data will not cause a crash regardless of whether it's located at an odd or even address.) This isn't usually a problem, but it can be if the programmer is not careful with the way their data is organized. Consider the following example: The 68000 can only read or write words and longs at even addresses. Doing so at an odd address will result in the CPU crashing. (Note that reading byte data will not cause a crash regardless of whether it's located at an odd or even address.) This isn't usually a problem, but it can be if the programmer is not careful with the way their data is organized. Consider the following example:
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>TestData:
TestData:
DC.B $02 DC.B $02
DC.W $0345 DC.W $0345
LEA TestData,A0 ;load effective address of TestData into A0. LEA TestData,A0 ;load effective address of TestData into A0.
MOVE.B (A0)+,D0 ;load $02 into D0, increment A0 by 1 MOVE.B (A0)+,D0 ;load $02 into D0, increment A0 by 1
MOVE.W (A0)+,D1 ;this crashes the CPU since A0 is now odd MOVE.W (A0)+,D1 ;this crashes the CPU since A0 is now odd</lang>
</syntaxhighlight>
How was it known that the address was odd at the second instruction? Simple. All instructions take an even number of bytes to encode. So there are only a few ways improper alignment can occur: How was it known that the address was odd at the second instruction? Simple. All instructions take an even number of bytes to encode. So there are only a few ways improper alignment can occur:
* An odd value is loaded into an address register. * An odd value is loaded into an address register.
@ -228,23 +205,18 @@ How was it known that the address was odd at the second instruction? Simple. All
If the programmer is smart with the way they encode byte-length data they can avoid this problem entirely with little effort. If the programmer is smart with the way they encode byte-length data they can avoid this problem entirely with little effort.
One way is to separate byte-length data into its own table. One way is to separate byte-length data into its own table.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>ByteData:
ByteData:
DC.B $20,$40,$60,$80 DC.B $20,$40,$60,$80
WordData: WordData:
DC.W $1000,$2000,$3000,$4000 DC.W $1000,$2000,$3000,$4000</lang>
</syntaxhighlight>
Another way is to pad the data with an extra byte, so that there is an even number of entries in the table. This becomes impractical with large data tables, so the <code>EVEN</code> directive can be placed after a series of bytes. If the byte count is odd, <code>EVEN</code> will pad the data with an extra byte. If it's already even, the <code>EVEN</code> command is ignored. This saves you the trouble of having to count a long series of bytes without worrying about wasting space. Another way is to pad the data with an extra byte, so that there is an even number of entries in the table. This becomes impractical with large data tables, so the <code>EVEN</code> directive can be placed after a series of bytes. If the byte count is odd, <code>EVEN</code> will pad the data with an extra byte. If it's already even, the <code>EVEN</code> command is ignored. This saves you the trouble of having to count a long series of bytes without worrying about wasting space.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>MyString: DC.B "HELLO WORLD 12345678900000",0
MyString: DC.B "HELLO WORLD 12345678900000",0 EVEN ;some assemblers require this to be on its own line</lang>
EVEN ;some assemblers require this to be on its own line
</syntaxhighlight>
A third way is to perform a "dummy read." This is when a value is read from an address using pre-decrement or post-increment, with the sole purpose of moving the pointer, and the value being read is of zero interest. This method lets you work with mixed data types in the same table, but it requires the programmer to know in advance where the byte-length data begins and ends. A third way is to perform a "dummy read." This is when a value is read from an address using pre-decrement or post-increment, with the sole purpose of moving the pointer, and the value being read is of zero interest. This method lets you work with mixed data types in the same table, but it requires the programmer to know in advance where the byte-length data begins and ends.
<syntaxhighlight lang="68000devpac"> <lang 68000devpac>TestData:
TestData:
DC.B $02,$03,$04 DC.B $02,$03,$04
DC.W $0345 DC.W $0345
@ -255,8 +227,7 @@ MOVE.B (A0)+,(A1)+ ;copy $04 to a new memory location
;if we did MOVE.W (A0)+,(A1)+ now we'd crash. First we need to adjust the pointers. ;if we did MOVE.W (A0)+,(A1)+ now we'd crash. First we need to adjust the pointers.
MOVE.B (A0)+,D7 ;dummy read to D7. Now A0 is word aligned. MOVE.B (A0)+,D7 ;dummy read to D7. Now A0 is word aligned.
MOVE.B (A1)+,D7 ;dummy read to D7. Now A1 is word aligned. MOVE.B (A1)+,D7 ;dummy read to D7. Now A1 is word aligned.
MOVE.W (A0)+,(A1)+ ;copy $0345 to a new memory location MOVE.W (A0)+,(A1)+ ;copy $0345 to a new memory location</lang>
</syntaxhighlight>
Using <code>ADDA.L #1,A0</code> and <code>ADDA.L #1,A1</code> would have worked also, instead of the dummy read. The 68000 gives the programmer a lot of different ways to do a task. Using <code>ADDA.L #1,A0</code> and <code>ADDA.L #1,A1</code> would have worked also, instead of the dummy read. The 68000 gives the programmer a lot of different ways to do a task.

View file

@ -1 +0,0 @@
../../Task/Musical-scale/68000-Assembly

View file

@ -1 +0,0 @@
../../Task/Align-columns/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Display-a-linear-combination/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Integer-comparison/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Loops-Infinite/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Ordered-words/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Run-length-encoding/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Sieve-of-Eratosthenes/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Square-but-not-cube/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Twos-complement/8080-Assembly

View file

@ -1 +0,0 @@
../../Task/Zeckendorf-number-representation/8080-Assembly

View file

@ -4,13 +4,13 @@
===Segmented Memory=== ===Segmented Memory===
The 8086 uses a segmented memory model, similar to the Super Nintendo Entertainment System. Unlike banked memory models used in the Commodore 64 and late NES games, segment addresses are held in <i>segment registers</i>. These segment registers are 16 bit and get left-shifted by 4 and added to the pointer register of interest to determine the memory address to look up. The 8086 has four in total, but only the <code>DS</code> and <code>ES</code> registers can be used by the programmer. (The other two work with the stack pointer and instruction pointer, and are loaded for you.) On the 8086, you can only load segment registers with the value in a data register, or with the <code>POP</code> command. So first you must load a segment into a data register, THEN into a segment register. The 8086 uses a segmented memory model, similar to the Super Nintendo Entertainment System. Unlike banked memory models used in the Commodore 64 and late NES games, segment addresses are held in <i>segment registers</i>. These segment registers are 16 bit and get left-shifted by 4 and added to the pointer register of interest to determine the memory address to look up. The 8086 has four in total, but only the <code>DS</code> and <code>ES</code> registers can be used by the programmer. (The other two work with the stack pointer and instruction pointer, and are loaded for you.) On the 8086, you can only load segment registers with the value in a data register, or with the <code>POP</code> command. So first you must load a segment into a data register, THEN into a segment register.
<syntaxhighlight lang="asm">;This is NOT valid code! <lang asm>;This is NOT valid code!
mov ds, @data ;you're trying to move the data segment location directly into DS. You can't! mov ds, @data ;you're trying to move the data segment location directly into DS. You can't!
;This is the proper way: ;This is the proper way:
mov ax, @data ;I chose AX but I could have used BX, CX, or DX. mov ax, @data ;I chose AX but I could have used BX, CX, or DX.
mov ds, ax ;load DS with the data segment.</syntaxhighlight> mov ds, ax ;load DS with the data segment.</lang>
It's important to remember the subtle distinction between a ''segment'' and a ''segment register.'' Your program might have labeled ''segments'' such as <code>.data</code> and <code>.code</code>, but in order to properly read from/write to these sections you'll need to load their memory locations into ''segment registers.'' It's important to remember the subtle distinction between a ''segment'' and a ''segment register.'' Your program might have labeled ''segments'' such as <code>.data</code> and <code>.code</code>, but in order to properly read from/write to these sections you'll need to load their memory locations into ''segment registers.''
@ -18,17 +18,17 @@ It's important to remember the subtle distinction between a ''segment'' and a ''
There are four data registers: <code>AX</code>, <code>BX</code>, <code>CX</code>, and <code>DX</code>. While most commands can use any of them, some only work with particular data registers. System calls in particular are very specific about which registers can be used for what. On [[MS-DOS]], the <code>AX</code> register is used for selecting the desired interrupt to use with the <code>INT</code> command. There are four data registers: <code>AX</code>, <code>BX</code>, <code>CX</code>, and <code>DX</code>. While most commands can use any of them, some only work with particular data registers. System calls in particular are very specific about which registers can be used for what. On [[MS-DOS]], the <code>AX</code> register is used for selecting the desired interrupt to use with the <code>INT</code> command.
Each data register is 16-bit, but has two eight bit halves ending in H or L, e.g. <code>AH, AL</code>. Instructions can be executed using the whole register or just half of it. Each data register is 16-bit, but has two eight bit halves ending in H or L, e.g. <code>AH, AL</code>. Instructions can be executed using the whole register or just half of it.
<syntaxhighlight lang="asm">mov ax, 1000h ;move 1000h into AX, or equivalently, move 10h into AH and 00h into AL.</syntaxhighlight> <lang asm>mov ax, 1000h ;move 1000h into AX, or equivalently, move 10h into AH and 00h into AL.</lang>
Moving a value smaller than 16 bits into <code>?X</code> is the same as moving it into <code>?L</code>, and moving 0 into <code>?H</code>. (? represents the data register of your choice. They are all the same in this regard.) Moving a value smaller than 16 bits into <code>?X</code> is the same as moving it into <code>?L</code>, and moving 0 into <code>?H</code>. (? represents the data register of your choice. They are all the same in this regard.)
<syntaxhighlight lang="asm">mov ax,0030h <lang asm>mov ax,0030h
;is the same as: ;is the same as:
mov al, 30h mov al, 30h
mov ah, 0h</syntaxhighlight> mov ah, 0h</lang>
Commands that alter the contents of a single register will not affect the other half. Commands that alter the contents of a single register will not affect the other half.
<syntaxhighlight lang="asm">mov ax,00FFh <lang asm>mov ax,00FFh
inc al</syntaxhighlight> inc al</lang>
If we had executed <code>INC AX</code>, then <code>AX</code> would have been incremented to 0x100. Since we only incremented <code>AL</code>, only <code>AL</code> was incremented in this case, and <code>AH</code> '''still equals 0x00!''' If we had executed <code>INC AX</code>, then <code>AX</code> would have been incremented to 0x100. Since we only incremented <code>AL</code>, only <code>AL</code> was incremented in this case, and <code>AH</code> '''still equals 0x00!'''
Generally speaking, the 8086's registers serve the following purposes: Generally speaking, the 8086's registers serve the following purposes:
@ -42,24 +42,24 @@ When writing to or reading from consecutive sections of memory, it is helpful to
The syntax for offsetting an index register will vary depending on your assembler. Many assemblers will often accept multiple different ways of writing it, and it comes down to personal preference. The syntax for offsetting an index register will vary depending on your assembler. Many assemblers will often accept multiple different ways of writing it, and it comes down to personal preference.
<syntaxhighlight lang="asm">mov si, offset MyArray <lang asm>mov si, offset MyArray
mov bx,2 mov bx,2
mov al,[bx+si] ;loads decimal 30 into AL mov al,[bx+si] ;loads decimal 30 into AL
MyArray: MyArray:
byte 10,20,30,40,50</syntaxhighlight> byte 10,20,30,40,50</lang>
===The Stack=== ===The Stack===
As with [[Z80 Assembly]], you can't push 8-bit registers onto the stack. For data registers, you have to push/pop both halves. As with [[Z80 Assembly]], you can't push 8-bit registers onto the stack. For data registers, you have to push/pop both halves.
<syntaxhighlight lang="asm">;This is valid code. <lang asm>;This is valid code.
push ax push ax
push bx push bx
pop bx pop bx
pop ax</lang> pop ax</lang>
<syntaxhighlight lang="asm">;This is NOT valid code. <lang asm>;This is NOT valid code.
push ah push ah
push al push al
push bh push bh
@ -69,14 +69,14 @@ push bl
pop bl pop bl
pop bh pop bh
pop al pop al
pop ah</syntaxhighlight> pop ah</lang>
As with all processors that use a stack, if you push one or more registers and want to restore the backed-up values correctly, you must pop them in the reverse order. You can pop them out of order on purpose to swap registers around. In fact, this is a quick way to move the segment from <code>DS</code> into <code>ES</code>, or vice-versa: As with all processors that use a stack, if you push one or more registers and want to restore the backed-up values correctly, you must pop them in the reverse order. You can pop them out of order on purpose to swap registers around. In fact, this is a quick way to move the segment from <code>DS</code> into <code>ES</code>, or vice-versa:
<syntaxhighlight lang="asm">push DS <lang asm>push DS
pop ES ;you can't do "mov es, ds" but you can do this!</syntaxhighlight> pop ES ;you can't do "mov es, ds" but you can do this!</lang>
The proper way to use the stack to preserve registers: The proper way to use the stack to preserve registers:
<syntaxhighlight lang="asm"> <lang asm>
call foo call foo
mov ax,4C00h mov ax,4C00h
@ -91,7 +91,7 @@ push cx
pop cx pop cx
pop bx pop bx
pop ax pop ax
ret</syntaxhighlight> ret</lang>
If one of the push/pop commands in the routine above were missing, the <code>RET</code> instruction would not properly return to where it came from. As long as you pop at the end the same number of registers you pushed at the start, the stack is "balanced" and your return instruction will return correctly. This is because <code>RET</code> is actually <code>POP IP</code> (<code>IP</code> being the instruction pointer, which you can think of as what "line" of code the CPU is on.) The CPU assumes the top of the stack is the correct place to return to, but has no way of actually verifying it. If the function you just wrote causes the CPU to crash or jump to a completely different part of the code, there's a good chance you might have forgotten to balance the stack properly. If one of the push/pop commands in the routine above were missing, the <code>RET</code> instruction would not properly return to where it came from. As long as you pop at the end the same number of registers you pushed at the start, the stack is "balanced" and your return instruction will return correctly. This is because <code>RET</code> is actually <code>POP IP</code> (<code>IP</code> being the instruction pointer, which you can think of as what "line" of code the CPU is on.) The CPU assumes the top of the stack is the correct place to return to, but has no way of actually verifying it. If the function you just wrote causes the CPU to crash or jump to a completely different part of the code, there's a good chance you might have forgotten to balance the stack properly.
@ -107,40 +107,40 @@ One other caveat to mention: On early IBM PCs and compatibles, the 8087 was not
===Looping Constructs=== ===Looping Constructs===
The 8086 has a lot more of these than most CPUs. The most obvious one is <code>LOOP</code>, which will subtract 1 from <code>CX</code>, then jump back to a specified label if <code>CX</code> is nonzero after the subtraction. If <code>CX</code> becomes zero after subtracting 1, then no jump will occur and the instruction pointer simply moves to the next instruction. The 8086 has a lot more of these than most CPUs. The most obvious one is <code>LOOP</code>, which will subtract 1 from <code>CX</code>, then jump back to a specified label if <code>CX</code> is nonzero after the subtraction. If <code>CX</code> becomes zero after subtracting 1, then no jump will occur and the instruction pointer simply moves to the next instruction.
<syntaxhighlight lang="asm">mov cx,0100h ;set the loop counter's starting value. This must be outside the loop, otherwise you'll loop forever! <lang asm>mov cx,0100h ;set the loop counter's starting value. This must be outside the loop, otherwise you'll loop forever!
foo: foo:
;; your code that you want to loop goes here ;; your code that you want to loop goes here
loop foo </syntaxhighlight> loop foo </lang>
It's important not to alter <code>CX</code> inside the loop. It's easy to make a mistake like this if you're in a hurry: It's important not to alter <code>CX</code> inside the loop. It's easy to make a mistake like this if you're in a hurry:
<syntaxhighlight lang="asm">foobar: <lang asm>foobar:
mov cx,1000h mov cx,1000h
;your code goes here ;your code goes here
loop foobar</syntaxhighlight> loop foobar</lang>
It may not be obvious at first but the above loop will never end. <code>CX</code> decrements to 0x0FFF with the <code>LOOP</code> instruction but the <code>mov cx,1000h</code> was mistakenly placed ''inside'' the loop, resetting the loop counter back to 0x1000, which means no progress is really being made. The correct way to do this is to set the starting loop counter '''outside''' the loop, like so: It may not be obvious at first but the above loop will never end. <code>CX</code> decrements to 0x0FFF with the <code>LOOP</code> instruction but the <code>mov cx,1000h</code> was mistakenly placed ''inside'' the loop, resetting the loop counter back to 0x1000, which means no progress is really being made. The correct way to do this is to set the starting loop counter '''outside''' the loop, like so:
<syntaxhighlight lang="asm">mov cx,1000h <lang asm>mov cx,1000h
foobar: foobar:
;your code goes here ;your code goes here
loop foobar</syntaxhighlight> loop foobar</lang>
Sometimes you'll have to change <code>CX</code> during a loop, like if you want to do bit shifts with a shift amount other than 1, for example. There's a simple fix - use the stack to stash and retrieve the loop counter. Sometimes you'll have to change <code>CX</code> during a loop, like if you want to do bit shifts with a shift amount other than 1, for example. There's a simple fix - use the stack to stash and retrieve the loop counter.
<syntaxhighlight lang="asm">mov cx,0100h <lang asm>mov cx,0100h
foo: foo:
push cx push cx
mov cl,2 mov cl,2
ror ax,cl ;starting with the 80186 you don't need CL for bit shifting. ror ax,cl ;starting with the 80186 you don't need CL for bit shifting.
pop cx pop cx
loop foo</syntaxhighlight> loop foo</lang>
By using <code>PUSH CX</code> and <code>POP CX</code>, you can temporarily use <code>CX</code> for something else, as long as you restore it before the <code>LOOP</code> instruction. By using <code>PUSH CX</code> and <code>POP CX</code>, you can temporarily use <code>CX</code> for something else, as long as you restore it before the <code>LOOP</code> instruction.
You can use other registers as loop counters as well, but not with the <code>LOOP</code> instruction - it's hardcoded to only work with <code>CX</code>. But you can do this: You can use other registers as loop counters as well, but not with the <code>LOOP</code> instruction - it's hardcoded to only work with <code>CX</code>. But you can do this:
<syntaxhighlight lang="asm">mov dx,0100h <lang asm>mov dx,0100h
baz: baz:
;your code goes here ;your code goes here
dec dx dec dx
@ -148,7 +148,7 @@ jnz baz
; A minor note for advanced programmers: ; A minor note for advanced programmers:
; If you're expecting the flags to be in a particular state based on the loop body, tough luck! ; If you're expecting the flags to be in a particular state based on the loop body, tough luck!
; They'll only reflect the decrement of DX from 1 to 0 at this point in the code. ; They'll only reflect the decrement of DX from 1 to 0 at this point in the code.
; LOOP doesn't change the flags, which makes it more useful for loops meant to compare things.</syntaxhighlight> ; LOOP doesn't change the flags, which makes it more useful for loops meant to compare things.</lang>
Another frequently used looping construct is <code>REP</code>. <code>REP</code> can be combined with certain instructions to repeat that instruction until <code>CX</code> equals zero. However, unlike <code>LOOP</code>, which can be used to repeat a block of instructions, <code>REP</code> can only repeat one. It doesn't work on all instructions, only the "string" instructions which operate on a block of memory. Typically these include <code>MOVSB</code>, <code>LODSB</code>, <code>STOSB</code>, <code>CMPSB</code>, and <code>SCASB</code> (each has a variant that ends in W instead of B, for 16-bit data.) There are also <code>REPZ</code> and <code>REPNZ</code>, which stand for "Repeat if Zero" and "Repeat if Nonzero" respectively. These two only work properly with <code>CMPSB</code> and <code>SCASB</code>, as <code>MOVSB</code>, <code>LODSB</code>, <code>STOSB</code> do not affect the flags. (The CPU doesn't detect whether <code>CX</code> equals zero using the flags, as the flags never reflect this equality to zero like you would expect.) Another frequently used looping construct is <code>REP</code>. <code>REP</code> can be combined with certain instructions to repeat that instruction until <code>CX</code> equals zero. However, unlike <code>LOOP</code>, which can be used to repeat a block of instructions, <code>REP</code> can only repeat one. It doesn't work on all instructions, only the "string" instructions which operate on a block of memory. Typically these include <code>MOVSB</code>, <code>LODSB</code>, <code>STOSB</code>, <code>CMPSB</code>, and <code>SCASB</code> (each has a variant that ends in W instead of B, for 16-bit data.) There are also <code>REPZ</code> and <code>REPNZ</code>, which stand for "Repeat if Zero" and "Repeat if Nonzero" respectively. These two only work properly with <code>CMPSB</code> and <code>SCASB</code>, as <code>MOVSB</code>, <code>LODSB</code>, <code>STOSB</code> do not affect the flags. (The CPU doesn't detect whether <code>CX</code> equals zero using the flags, as the flags never reflect this equality to zero like you would expect.)

View file

@ -1 +0,0 @@
../../Task/Angle-difference-between-two-bearings/8th

View file

@ -1 +0,0 @@
../../Task/Environment-variables/8th

View file

@ -1 +0,0 @@
../../Task/Factorial/8th

View file

@ -1 +0,0 @@
../../Task/Bifid-cipher/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Binary-strings/AArch64-Assembly

View file

@ -0,0 +1 @@
../../Task/Bioinformatics-base-count/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Calculating-the-value-of-e/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Comma-quibbling/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Compound-data-type/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Conways-Game-of-Life/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Create-an-HTML-table/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Determine-sentence-type/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Environment-variables/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Fibonacci-n-step-number-sequences/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Fibonacci-sequence/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Halt-and-catch-fire/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Hash-from-two-arrays/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Hofstadter-Q-sequence/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Keyboard-input-Obtain-a-Y-or-N-response/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Leonardo-numbers/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Logical-operations/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Machine-code/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Magic-8-ball/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Mandelbrot-set/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Menu/AArch64-Assembly

View file

@ -0,0 +1 @@
../../Task/Miller-Rabin-primality-test/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Phrase-reversals/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Pi/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Read-a-configuration-file/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Repeat-a-string/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Reverse-words-in-a-string/AArch64-Assembly

View file

@ -0,0 +1 @@
../../Task/Sorting-Algorithms-Circle-Sort/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Strip-block-comments/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Strip-comments-from-a-string/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Strip-whitespace-from-a-string-Top-and-tail/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Twos-complement/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Update-a-configuration-file/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Vigen-re-cipher/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Vigen-re-cipher-Cryptanalysis/AArch64-Assembly

View file

@ -1 +0,0 @@
../../Task/Visualize-a-tree/AArch64-Assembly

View file

@ -1,14 +1,2 @@
{{stub}}{{language {{stub}}{{language|site=http://www.sdn.sap.com/irj/sdn/abap}}
|site=http://www.sdn.sap.com/irj/sdn/abap ABAP (Advanced Business Application Programming) is a programming language developed by the german software vendor SAP. It is mainly used to build high performance business applications.
|safety=safe
|strength=strong
|compat=nominative
|checking=static
|tags=abap}}
ABAP (Advanced Business Application Programming) is a programming language developed by the german software vendor SAP. It is mainly used to build high performance business applications.
==Citation==
*[https://en.wikipedia.org/wiki/ABAP]
[[Category:Programming paradigm/Object-oriented]]
[[Category:Programming paradigm/Imperative]]

View file

@ -1 +0,0 @@
../../Task/Arithmetic-derivative/ABC

View file

@ -1 +0,0 @@
../../Task/Look-and-say-sequence/ABC

View file

@ -1 +0,0 @@
../../Task/Population-count/ABC

View file

@ -1 +0,0 @@
../../Task/Square-but-not-cube/ABC

View file

@ -1 +0,0 @@
../../Task/Zeckendorf-number-representation/ABC

View file

@ -1 +0,0 @@
{{stub}}{{language|Ayrch}}

View file

@ -1,2 +0,0 @@
---
from: http://rosettacode.org/wiki/Category:AIDED_NATURAL_LANGUAGE

View file

@ -16,9 +16,4 @@ gcc hello.c -lalgol -lm -o hello
*[[wp:ALGOL 60|ALGOL 60 on Wikipedia]] *[[wp:ALGOL 60|ALGOL 60 on Wikipedia]]
*[[ALGOL 68]] *[[ALGOL 68]]
*[[ALGOL W]] *[[ALGOL W]]
*[[Simula]] *[[Simula]]
==External links==
* [http://algol60.org algol60.org]
* [https://softwarepreservation.computerhistory.org/ALGOL/ History of ALGOL] Includes links to documentation (e.g. reports)
* [https://www.masswerk.at/algol60/report.htm Revised Report on the Algorithmic Language Algol 60] (HTML)

View file

@ -1 +0,0 @@
../../Task/Additive-primes/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Anti-primes/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Even-or-odd/ALGOL-60

1
Lang/ALGOL-60/Factorial Symbolic link
View file

@ -0,0 +1 @@
../../Task/Factorial/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Harmonic-series/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Horners-rule-for-polynomial-evaluation/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Integer-comparison/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Largest-proper-divisor-of-n/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Loops-Increment-loop-index-within-loop-body/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Nth-root/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Prime-decomposition/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Proper-divisors/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Semiprime/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Sequence-of-primes-by-trial-division/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Square-free-integers/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Sum-of-a-series/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Tau-function/ALGOL-60

View file

@ -1 +0,0 @@
../../Task/Tau-number/ALGOL-60

View file

@ -41,7 +41,7 @@ A syntax chart is available [http://www.softwarepreservation.org/projects/ALGOL/
* [http://www.linkedin.com/groups/Algol68-2333923 Algol68 group at linkedin] - includes various famous compiler composers. * [http://www.linkedin.com/groups/Algol68-2333923 Algol68 group at linkedin] - includes various famous compiler composers.
<br> <br>
'''Books available online''': '''Books available online''':
* [https://algol68genie.nl/ Algol 68G Manual - By Marcel van der Veer] Includes the Revised Report * [http://jmvdveer.home.xs4all.nl/en.algol-68-genie.html Algol 68G Manual - By Marcel van der Veer] Includes the Revised Report
* [http://www.softwarepreservation.org/projects/ALGOL/book/pame.2008.a4.pdf/view Programming Algol 68 Made Easy - by Sian Mountbatten (on softwarepreservation.org)] * [http://www.softwarepreservation.org/projects/ALGOL/book/pame.2008.a4.pdf/view Programming Algol 68 Made Easy - by Sian Mountbatten (on softwarepreservation.org)]
* [http://www.softwarepreservation.org/projects/ALGOL/book/Lindsey_van_der_Meulen-IItA68-Revised.pdf/view Informal Introduction to Algol 68 - by C. H. Lindsey & S. V. Van der Meulen (on softwarepreservation.org)] - if you prefer (and find) a hardcopy, be sure to get the 1977 edition. Highly recomended! * [http://www.softwarepreservation.org/projects/ALGOL/book/Lindsey_van_der_Meulen-IItA68-Revised.pdf/view Informal Introduction to Algol 68 - by C. H. Lindsey & S. V. Van der Meulen (on softwarepreservation.org)] - if you prefer (and find) a hardcopy, be sure to get the 1977 edition. Highly recomended!
@ -59,7 +59,7 @@ A syntax chart is available [http://www.softwarepreservation.org/projects/ALGOL/
** AND 50th Birthday '''ALGOL 58'''. ** AND 50th Birthday '''ALGOL 58'''.
* 23rd August 2009 - [http://sourceforge.net/projects/algol68/files/ algol68g-1.18.0-9h] released * 23rd August 2009 - [http://sourceforge.net/projects/algol68/files/ algol68g-1.18.0-9h] released
* 20th December 2009 - Happy 51st/41st Birthdays with [[Hamming_numbers#ALGOL_68|Hamming numbers]] - the 200th '''ALGOL 68''' code contribution on rosettacode.org! * 20th December 2009 - Happy 51st/41st Birthdays with [[Hamming_numbers#ALGOL_68|Hamming numbers]] - the 200th '''ALGOL 68''' code contribution on rosettacode.org!
** This time code was by [[User:Algol68g|Marcel van der Veer]], author of [https://algol68genie.nl Algol 68 Genie] ** This time code was by [[User:Algol68g|Marcel van der Veer]], author of [http://www.xs4all.nl/~jmvdveer/algol.html Algol 68 Genie]
* 25th October 2011 - [[User:Jejones3141|Jejones3141]] added [[Soundex#ALGOL_68|Soundex]] - the 300th '''ALGOL 68''' code specimen. * 25th October 2011 - [[User:Jejones3141|Jejones3141]] added [[Soundex#ALGOL_68|Soundex]] - the 300th '''ALGOL 68''' code specimen.
== Revisions == == Revisions ==
@ -67,12 +67,203 @@ A syntax chart is available [http://www.softwarepreservation.org/projects/ALGOL/
*Oct. 1968: Penultimate Draft Report on the Algorithmic Language ALGOL 68 - Chapters 1-9 - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck and C.H.A. Koster. *Oct. 1968: Penultimate Draft Report on the Algorithmic Language ALGOL 68 - Chapters 1-9 - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck and C.H.A. Koster.
*Dec. 1968: Report on the Algorithmic Language ALGOL 68 - Offprint from Numerische Mathematik, 14, 79-218 (1969); Springer-Verlag. - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck and C.H.A. Koster. *Dec. 1968: Report on the Algorithmic Language ALGOL 68 - Offprint from Numerische Mathematik, 14, 79-218 (1969); Springer-Verlag. - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck and C.H.A. Koster.
*Sep 1973: Revised Report on the Algorithmic Language Algol 68 - Springer-Verlag 1976 - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck, C.H.A. Koster, M. Sintzoff, C.H. Lindsey, L.G.L.T. Meertens and R.G. Fisker. *Sep 1973: Revised Report on the Algorithmic Language Algol 68 - Springer-Verlag 1976 - Edited by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck, C.H.A. Koster, M. Sintzoff, C.H. Lindsey, L.G.L.T. Meertens and R.G. Fisker.
==Coding style of samples, alphabets and stropping== ==Coding style of samples==
See [[ALGOL 68 Representation]]. Click "Expand" for more details.
<div class="mw-collapsible mw-collapsed" style="width:880px; overflow:auto; background-color:parent;">
<div class="mw-collapsible-content" style="padding-left:2em;">
Many of the code samples provided here have a leading <code>main:(</code> and a matching <code>)</code> at the end. These are not actually required in the language, but are included so as to highlight the main routine.
On some compilers, it may be necessary to include appropriate "job cards"
or preludes in order for the programs to compile successfully. Hopefully
not too much else is required. Examples:
{|border="1" style="border-collapse: collapse; border: 5px double grey;" align="center"
|| Brief Algol68
|| Algol68 as in rosettacode
|| Actual ELLA Algol 68RS code
|-
||
print(("Hello, world!",new line))
||
main:(
print(("Hello, world!",new line))
)
||
PROGRAM helloworld CONTEXT VOID
USE standard
BEGIN
print(("Hello, world!", new line))
END
FINISH
|}
<br><br>'''Examples of different program representations'''
<br><br>
At the time when ALGOL 68 was defined some predominant computers had
24 or 36 bit words, with 6 bit character sets. Hence it was desirable that
ALGOL 68 should be able to run on machines with only uppercase.
The official spec provided for different representations of the same
program. Quote stropping (enclosing the bold words in single quotes)
and Point stropping (preceeding the bold words with a dot)
were used. A variant of Point stropping called RES stropping was also defined.
In RES stropping some language-defined bold words are not preceded by a dot.
A pragmatic comment may have been required to indicate which
stropping convention was to be used, as in some of the examples below.
Upper stropping (representing the bold words by upper case and
non-bold words in lower case) was introduced by Algol 68R. Upper stropping
is used by Algol 68RS and is one of the options for Algol 68G.
Rutgers ALGOL 68 uses quote stropping. Most of the samples
on Rosetta Code use Upper stropping.
Examples (pragmatic comments to set the stropping regime not shown):
{|border="1" style="border-collapse: collapse; border: 2px double grey;" align="left"
|| Algol68 as typically published
'''mode''' '''xint''' = '''int''';
'''xint''' sum sq:=0;
'''for''' i '''while'''
sum sq≠70&times;70
'''do'''
sum sq+:=i↑2
'''od'''
|| QUOTE stropping (similar to wiki)
'mode' 'xint' = 'int';
'xint' sum sq:=0;
'for' i 'while'
sum sq≠70&times;70
'do'
sum sq+:=i↑2
'od'
|| POINT stropping
.MODE .XINT = .INT;
.XINT SUM SQ:=0;
.FOR I .WHILE
SUM SQ .NE 70*70
.DO
SUM SQ .PLUSAB I .UP 2
.OD
|| RES stropping
mode .xint = int;
.xint sum sq:=0;
for i while
sum sq≠70&times;70
do
sum sq+:=i↑2
od
|| Upper stropping
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
sum sq /= 70*70
DO
sum sq PLUSAB i UP 2
OD
|}
</div></div>
== Coercion (casting) == == Coercion (casting) ==
ALGOL 68 has a hierarchy of contexts which determine which kind of coercions are available at a particular point in the program.<br/> ALGOL 68 has a hierarchy of contexts which determine which kind of coercions are available at a particular point in the program.
See [[:Category:ALGOL_68_Coercions|ALGOL 68 Coercions]] for more details. <br>
Click "Expand" for more details.
<div class="mw-collapsible mw-collapsed" style="width:880px; overflow:auto; background-color:parent;">
<div class="mw-collapsible-content" style="padding-left:2em;">
These contexts are:
{|class="wikitable"
!rowspan=2| N<br>
a<br>
m<br>
e
!rowspan=2| Context location
!colspan=5| Coercions available in this context
!rowspan=2| Coercion examples
|-
|bgcolor=aaaaff|Soft
|bgcolor=aaeeaa|Weak
|bgcolor=ffee99|Meek
|bgcolor=ffcc99|Firm
|bgcolor=ffcccc|Strong
|-
!S<br>
t<br>
r<br>
o<br>
n<br>
g
||Right hand side of:
* Identity-declarations, as "~" in: <syntaxhighlight algol68>REAL x = ~</syntaxhighlight>
* Initialisations, as "~" in: <syntaxhighlight algol68>REAL x := ~</syntaxhighlight>
Also:
* Actual-parameters of calls, as "~" in:<syntaxhighlight algol68>PROC: sin(~)</syntaxhighlight>
* Enclosed clauses of casts, as "~" in: <syntaxhighlight algol68>REAL(~)</syntaxhighlight>
* Units of routine-texts
* Statements yielding VOID
* All parts (but one) of a balanced clause
* One side of an identity relation, as "~" in: <syntaxhighlight algol68> ~ IS ~</syntaxhighlight>
|bgcolor=aaaaff rowspan=4 width="50px"| deproc- eduring
|bgcolor=aaeeaa rowspan=3 width="50px"| all '''soft''' then weak deref- erencing
|bgcolor=ffee99 rowspan=2 width="50px"| all '''weak''' then deref- erencing
|bgcolor=ffcc99 rowspan=1 width="50px"| all '''meek''' then uniting
|bgcolor=ffcccc width="50px"| all '''firm''' then widening, rowing and voiding
|colspan=1 bgcolor=ffcccc|
Widening occurs if there is no loss of precision. For example: An INT will be coerced to a REAL, and a REAL will be coerced to a LONG REAL. But not vice-versa. Examples:
<syntaxhighlight algol68>INT to LONG INT
INT to REAL
REAL to COMPL
BITS to []BOOL
BYTES to STRING</syntaxhighlight>
A variable can also be coerced (rowed) to an array of length 1.
For example:
<syntaxhighlight algol68>INT to [1]INT
REAL to [1]REAL</syntaxhighlight> etc
|-
!F<br>
i<br>
r<br>
m
||
*Operands of formulas as "~" in:<syntaxhighlight algol68>OP: ~ * ~</syntaxhighlight>
*Parameters of transput calls
|colspan=3 bgcolor=ffcc99| Example:
<syntaxhighlight algol68>UNION(INT,REAL) var := 1</syntaxhighlight>
|-
!M<br>
e<br>
e<br>
k
||
* Trimscripts (yielding INT)
* Enquiries: e.g. as "~" in the following
<syntaxhighlight algol68>IF ~ THEN ... FI</syntaxhighlight> and
<syntaxhighlight algol68>FROM ~ BY ~ TO ~ WHILE ~ DO ... OD etc</syntaxhighlight>
* Primaries of calls (e.g. sin in sin(x))
|colspan=4 bgcolor=ffee99|Examples:
<syntaxhighlight algol68>REF REF BOOL to BOOL
REF REF REF INT to INT</syntaxhighlight>
|-
!W<br>
e<br>
a<br>
k
||
* Primaries of slices, as in "~" in: <syntaxhighlight algol68>~[1:99]</syntaxhighlight>
* Secondaries of selections, as "~" in: <syntaxhighlight algol68>value OF ~</syntaxhighlight>
|colspan=5 bgcolor=aaeeaa|Examples:
<syntaxhighlight algol68>REF BOOL to REF BOOL
REF REF INT to REF INT
REF REF REF REAL to REF REAL
REF REF REF REF STRUCT to REF STRUCT</syntaxhighlight>
|-
!S<br>
o<br>
f<br>
t
|| The LHS of assignments, as "~" in: <syntaxhighlight algol68>~ := ...</syntaxhighlight>
|colspan=6 bgcolor=aaaaff| Example:
* deproceduring of: <syntaxhighlight algol68>PROC REAL random: e.g. random</syntaxhighlight>
|}
For more details about Primaries and Secondaries refer to [[Operator_precedence#ALGOL_68|Operator precedence]].
</div></div>
==See also== ==See also==
*[[Web 68]] *[[Web 68]]
@ -82,22 +273,13 @@ See [[:Category:ALGOL_68_Coercions|ALGOL 68 Coercions]] for more details.
* [[Action!]] * [[Action!]]
* [[Agena]] * [[Agena]]
* [[Draco]] * [[Draco]]
* [[RTL/2]]
* [https://en.wikipedia.org/wiki/S3_(programming_language) S3 for ICL 2900] * [https://en.wikipedia.org/wiki/S3_(programming_language) S3 for ICL 2900]
== Library code used in Rosetta Code samples == == Library code used in Rosetta Code samples ==
* [[ALGOL_68/prelude|Various (including the standard prelude)]] [https://rosettacode.org/wiki/ALGOL_68/prelude Various (including the standard prelude)]<br/>
* [https://rosettacode.org/wiki/Category:ALGOL_68-primes Prime related]<br/>
* [[:Category:ALGOL_68-bits|bit-manipulation related]] [https://rosettacode.org/wiki/Category:ALGOL_68-rows Row (array) related]<br/>
* [[:Category:ALGOL_68-files|File related]] [https://rosettacode.org/wiki/Category:ALGOL_68-l-system L-System related]
* [[:Category:ALGOL_68-l-system|L-System related]]
* [[:Category:ALGOL_68-primes|Prime related]]
* [[:Category:ALGOL_68-rows|Row (array) related]]
* [[:Category:ALGOL_68-sort|Sorting related]]
== Tools ==
[[Syntax_highlighting_using_Mediawiki_formatting#ALGOL 68|Format an upper-stropped Algol 68 source with Mediawiki markup]]<br/>
[[Compiler/Simple_file_inclusion_pre_processor#ALGOL 68|Implement ''read'' and ''include'' pragmatic-comments for compilers that don't support file inclusion]]
{{language programming paradigm|Concurrent}} {{language programming paradigm|Concurrent}}
{{language programming paradigm|Imperative}} {{language programming paradigm|Imperative}}

View file

@ -1 +0,0 @@
../../Task/100-prisoners/ALGOL-68

View file

@ -1 +0,0 @@
../../Task/21-game/ALGOL-68

View file

@ -1 +0,0 @@
../../Task/9-billion-names-of-God-the-integer/ALGOL-68

View file

@ -1 +0,0 @@
../../Task/Archimedean-spiral/ALGOL-68

View file

@ -1 +0,0 @@
../../Task/Arithmetic-geometric-mean-Calculate-Pi/ALGOL-68

View file

@ -1 +0,0 @@
../../Task/Bifid-cipher/ALGOL-68

View file

@ -0,0 +1 @@
../../Task/Bioinformatics-base-count/ALGOL-68

Some files were not shown because too many files have changed in this diff Show more