Skip to content

Commit 8f5c001

Browse files
authored
Merge pull request #367 from boriel/feature/rename_modules
Feature/rename modules
2 parents 44ef939 + bbf171e commit 8f5c001

48 files changed

Lines changed: 145 additions & 216 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/zx48k/optimizer/asm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from .patterns import RE_OUTC, RE_INDIR16
44
from .helpers import single_registers
5-
from zxbasm import z80
5+
from libzxbasm import z80
66

77
# Dict of patterns to normalized instructions. I.e. 'ld a, 5' -> 'LD A,N'
88
Z80_PATTERN = {}

arch/zx48k/optimizer/memcell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .. import backend
77
from .asm import Asm
88
from api.utils import flatten_list
9-
from zxbasm import asmlex
9+
from libzxbasm import asmlex
1010

1111

1212
class MemCell(object):

arch/zx48k/translator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from api.errors import InvalidOperatorError
2222
from api.errors import InvalidBuiltinFunctionError
2323
from api.errors import InternalError
24-
from zxbpp import zxbpp
24+
from libzxbpp import zxbpp
2525

2626
from . import backend
2727
from .backend.__float import _float

docs/for.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,31 @@
1717

1818
##Description
1919

20-
A **For...Next** loop initializes _iterator_ to _startvalue_, then executes the _sentences_, incrementing _iterator_ by _stepvalue_ until it reaches or exceeds _endvalue_. If _stepvalue_ is not explicitly given it will set to 1.
20+
A **For...Next** loop initializes _iterator_ to _startvalue_, then executes the _sentences_, incrementing _iterator_ by
21+
_stepvalue_ until it reaches or exceeds _endvalue_. If _stepvalue_ is not explicitly given it will set to 1.
2122

2223
##Examples
2324

2425
```
26+
REM Counts from 1 to 10
2527
FOR i = 1 TO 10: PRINT i: NEXT
2628
```
2729

30+
### Counts downwards
31+
```
32+
FOR i = 10 TO 1 STEP -1: PRINT i: NEXT
33+
```
34+
35+
### Loops using odd numbers
36+
```
37+
FOR i = 1 TO 10 STEP 2: PRINT i: NEXT
38+
```
39+
2840
##Differences From Sinclair Basic
2941
* The variable name after the NEXT statement is not required.
3042

31-
* Note that variable types can cause issues with ZX Basic For...Next Loops. If the upper limit of the iterator exceeds the upper limit of the variable type, the loop may not complete.
43+
* Note that variable types can cause issues with ZX Basic For...Next Loops. If the upper limit of the iterator exceeds
44+
the upper limit of the variable type, the loop may not complete.
3245
For example:
3346
```
3447
DIM i as UByte
@@ -40,9 +53,23 @@ NEXT i
4053

4154
Clearly, since the largest value a byte can hold is 255, it's not possible for i in the above example to exceed 300.
4255
The variable will "wrap around" to 0 and as a result, the loop will not ever terminate.
43-
This can happen in much more subtle ways when STEP is used.
56+
This can happen in much more subtle ways when `STEP` is used.
4457
There has to be "room" within the variable type for the iterator to exceed the terminator when it is being
45-
incremented by "STEP" amounts.
58+
incremented by <step> amounts.
59+
60+
For example, this loop will neved end
61+
62+
```
63+
DIM i as UInteger
64+
65+
FOR i = 65000 TO 65500 STEP 100
66+
...
67+
NEXT i
68+
```
69+
70+
This loop will never end. `UInteger` type allows values in the range `[0..65535]` so apparently it's ok, because
71+
65500 fits in it. However `STEP` is 100, so 65500 + 100 = 65600 which fall out if such range. There will be an
72+
_overflow_ and the variable `i` will take the value 64 and the loop will continue.
4673

4774
##See Also
4875

docs/library/screen.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ PRINT AT 0, 0; "The character at 9, 10 is "; c$
4040

4141
* [ CSRLIN ](csrlin_.md)
4242
* [ POS](pos_.md)
43-
* [ AT ](at_.md)
43+
* [ AT ](../at.md)
44+

zxbasm/asm.py renamed to libzxbasm/asm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
# vim: ts=4:et:sw=4
44

5-
from zxbasm.z80 import Opcode, Z80SET
5+
from libzxbasm.z80 import Opcode, Z80SET
66
from api.errors import Error
77
import re
88

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from api.errmsg import warning
2727
from api import global_ as gl
2828
import api.utils
29-
from zxbpp import zxbpp
29+
from libzxbpp import zxbpp
3030
import outfmt
3131

3232
LEXER = asmlex.Lexer()
File renamed without changes.

0 commit comments

Comments
 (0)