corrected day 1 with varvara name

This commit is contained in:
sejo 2021-07-31 16:10:56 -05:00
parent ddfca16d0f
commit 8516156c5d
2 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
# uxn tutorial
a beginner's guide for programming the varvara {uxn} computer, and a slow-paced companion to the official documentation.
a beginner's guide for programming the varvara computer based on the {uxn} core, and a slow-paced companion to the official documentation.
=> https://wiki.xxiivv.com/site/uxn.html uxn technical documentation
@ -28,7 +28,7 @@ we also discuss working with shorts (2-bytes) besides single bytes in uxntal.
# day 3
here we introduce the use of the controller device in the varvara uxn computer: this allows us to add interactivity to our programs, and to start implementing control flow in uxntal.
here we introduce the use of the controller device in the varvara computer: this allows us to add interactivity to our programs, and to start implementing control flow in uxntal.
we also talk about logic and stack manipulation instructions in uxntal.

View File

@ -1,6 +1,6 @@
# uxn tutorial: day 1, the basics
hello! in this first section of the {uxn tutorial} we talk about the basics of the uxn computer, its programming paradigm, its architecture, and why you would want to learn to program it.
hello !in this first section of the {uxn tutorial} we talk about the basics of the uxn computer called varvara, its programming paradigm in a language called uxntal, its architecture, and why you would want to learn to program it.
we also jump right in into our first simple programs to demonstrate fundamental concepts that we will develop further in the following days.
@ -16,7 +16,7 @@ i invite you to read "why create a smol virtual computer" from the 100R site, as
=> https://100r.co/site/uxn.html 100R - uxn
so, uxn is a virtual (for the moment?) computer that is simple enough to be emulated by many old and new computing platforms. these platforms include running uxn with pen and paper :)
uxn is the core of the varvara virtual (for the moment?) computer. it is simple enough to be emulated by many old and new computing platforms, and to be followed by hand.
personally, i see in it the following features:
@ -36,7 +36,7 @@ the idea of this tutorial is to explore these two aspects and reveal how they pl
# postfix notation (and the stack)
uxn is inspired by forth-machines in that it uses the recombination of simple components to achieve appropriate solutions, and in that it is a stack-based machine.
the uxn core is inspired by forth-machines in that it uses the recombination of simple components to achieve appropriate solutions, and in that it is a stack-based machine.
this implies that it is primarily based on interactions with a "push down stack", where operations are indicated using what is called postfix notation.
@ -99,7 +99,7 @@ you'll start seeing how the use of the stack can be very powerful as it can save
we'll come back to postfix notation and the stack very soon!
# uxn computer architecture
# varvara computer architecture
one of the perks of programming a computer at a low-level of abstraction, as we will be doing with uxn, is that we have to know and be aware of its internal workings.
@ -123,9 +123,9 @@ all of these instructions operate with elements in the stack, either to get from
we'll be covering these instructions slowly over this tutorial.
## uxn memory
## memory
memory in the uxn computer consists in four separate spaces:
memory in a uxn computer consists in four separate spaces:
* main memory, with 65536 bytes
* i/o memory, with 256 bytes divided in 16 sections (or devices) of 16 bytes each: 8 bytes for inputs and 8 bytes for outputs.
@ -222,7 +222,7 @@ take a look at the available demos! (or not, and let's start programming ours!)
# uxntal and a very basic hello world
uxntal is the assembly language for the uxn machine.
uxntal is the assembly language for uxn machines.
we were talking before about the uxn cpu and the 32 instructions it knows how to perform, each of them encoded as a single 8-bit word (byte).
@ -305,7 +305,7 @@ the second line has several things going on:
* |0100 : you may remember this number from before - this is the initial value of the program counter; the address of the first byte that the cpu reads. we use this notation to indicate that whatever is written afterwards, will be written in memory starting at this address.
* LIT : this appears twice, and is an uxn instruction with the following actions: it pushes the next byte in memory down onto the stack, and makes the program counter skip that byte.
* 68 : an hexadecimal number, that corresponds to the ascii code of the character 'h'
* 18 : an hexadecimal number, that corresponds to an i/o address: device 1 (console), address 8.
* 18 : an hexadecimal number, that corresponds to an i/o address: device 1, port 8.
* DEO : another uxn instruction, that we could define as the following: output the given value (1 byte) into the given device address, both taken from the stack ( value address -- )
reading the program from left to right, we can see the following behavior:
@ -318,9 +318,9 @@ reading the program from left to right, we can see the following behavior:
and what is the i/o device with address 18?
looking at the devices table from the uxnemu reference, we can see that the device with address 1 in the high nibble is the console (standard input and output), and that the column with address 8 in the low nibble corresponds to "write".
looking at the devices table from the varvara reference, we can see that the device with address 1 in the high nibble is the console (standard input and output), and that the column with address 8 in the low nibble corresponds to the "write" port.
=> https://wiki.xxiivv.com/site/uxnemu.html uxnemu
=> https://wiki.xxiivv.com/site/varvara.html varvara
so, device address 18 corresponds to "console write", or standard output.
@ -447,13 +447,13 @@ even though right now we know that #18 corresponds to pushing the console write
the rune @ allows us to define labels, and the rune & allows us to define sub-labels.
for example, for the console device, the way you would see this written in uxn programs is the following:
for example, for the console device, the way you would see this written in uxntal programs for the varvara computer is the following:
```
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ]
```
we can see an absolute pad to address 10, that assigns the following to that address. because the address consists of one byte only, uxnasm assumes it is for the i/o memory space or the zero page.
we can see an absolute pad to address 10, that assigns the following elements to that address. because the address consists of one byte only, uxnasm assumes it is for the i/o memory space or the zero page.
then we see a label @Console: this label will correspond to address 10.
@ -594,7 +594,7 @@ these are the instructions we covered today:
well done!
in {uxn tutorial day 2} we start exploring the visual aspects of the uxn computer: we talk about the fundamentals of the screen device so that we can start drawing on it!
in {uxn tutorial day 2} we start exploring the visual aspects of the varvara computer: we talk about the fundamentals of the screen device so that we can start drawing on it!
however, i invite you to take a little break before continuing! :)