summaryrefslogtreecommitdiff
path: root/python-pyntel4004.spec
blob: adea135be51f7f0e24e6a5c2df6ffacf74597752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
%global _empty_manifest_terminate_build 0
Name:		python-Pyntel4004
Version:	1.2
Release:	1
Summary:	A Python software implementation of the Intel 4004 processor.
License:	MIT License
URL:		https://github.com/alshapton/Pyntel4004
Source0:	https://mirrors.aliyun.com/pypi/web/packages/fe/a9/0903f4af1b74574813d5caacc5181733bed1d8c6a58c92cc870d1ab4963b/Pyntel4004-1.2.tar.gz
BuildArch:	noarch


%description
# Pyntel4004

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/pyntel4004.svg)

[![Build Pipeline](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml/badge.svg)](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml)
[![Documentation Status](https://readthedocs.org/projects/pyntel4004/badge/?version=latest)](https://pyntel4004.readthedocs.io/en/latest/?badge=latest)
![GitHub](https://img.shields.io/github/license/alshapton/pyntel4004)
[![PyPI version](https://badge.fury.io/py/Pyntel4004.svg)](https://badge.fury.io/py/Pyntel4004)
![PyPI - Downloads](https://img.shields.io/pypi/dm/Pyntel4004)
[![Plant Tree](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Plant%20Tree&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://plant.treeware.earth/alshapton/pyntel4004)

[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=alshapton_Pyntel4004)

A Python software implementation of the Intel 4004 processor and the MCS-4 computer.

## General Information

-  Two pass assembler using the original mnemonics, directives and comments syntax
-  Disassembler
-  Monitor facility to step through code and examine registers, memory etc
-  Cross-assembler for Retroshield 4004 Arduino

## Requirements

* Python >= 3.8.2

<br>

## Installation Instructions
<br>

### PyPI

Pyntel4004 can be installed from PyPI by using the command:

```bash

    $ pip install Pyntel4004
```

### Source Code
Pyntel4004’s git repo is available on GitHub, which can be browsed [here](https://github.com/alshapton/pyntel4004) and cloned using:

```bash

    $ git clone https://github.com/alshapton/pyntel4004 pyntel4004
```

Verify the installation by running unit tests:
```bash

    $ cd pyntel4004/test
    $ pytest
```
## Questions, Answers and Issues

Please use the github discussion board for questions, to ensure the right people see them in a timely manner.

[Github Pyntel4004 Discussion Board](https://github.com/alshapton/Pyntel4004/discussions)

and the github issue tracker to raise any issues.

[Github Pyntel4004 Issues Board](https://github.com/alshapton/Pyntel4004/issues)

<br>

## Usage Instructions

To use this software implementation of the Intel 4004 from the command line, you should install the [Pyntel4004-cli](https://pypi.org/project/Pyntel4004-cli/) using
`
pip install pyntel4004-cli
`

The user instructions can be found [here](https://pyntel4004.readthedocs.io/en/latest/intro/usage.html
)

## Design goals

- As much of the internals as possible should be carried out using binary arithmetic and operations.
- No 3rd party libraries to be used (i.e. pure Python).
- Build a fully-working i4004 opcode emulator.
- Build a fully-working assembler which generates correct op-codes.
- Construct a fully-working software-based i4004 chip which can use the generated object code from the assembler.
- Enable code assembled with Pyntel4004 to be run on a real i4004 chipset
- Enable code assembled with Pyntel4004 to be run on a retroShield4004 for Arduino

## Status

22-MAY-2022     First release of configuration file support
20-MAR-2022:    Command Line functionality is now deprecated
02-MAR-2022:    Finalised split - Pyntel4004 is now the core library
21-FEB-2022:    Started to split into two - (chip, assembler, dissassembler) and CLI
04-FEB-2022:    Cross-assemble to retroShield4004 for Arduino, completing documentation
23-SEP-2021:    Publishing releases to [PyPi](https://pypi.org/project/Pyntel4004/)
<br>
10-SEP-2021:    Documentation building and hosted with [READTHEDOCS](https://pyntel4004.readthedocs.io/en/latest/)
<br>
12-JUN-2021:    Auto-build with GITHUB Actions implemented
<br>
18-MAY-2021:    Implementing full test suite
<br>
21-APR-2021:    Instruction Set functionally complete
                Entering Testing Phase

## Example

### Assembler Directives and other additions

Assembler directives are not part of the program itself, but can control things like starting address, and various environmental settings.

| Directive | Example | Meaning |
| :-:| :-:| :-|
| end | end | Indicating end of program, but not necessarily end of code |
| org | org 100 | Assemble and place object code commencing at address 100 |
| pin | pin 1 | Value of i4004's Pin 10 (test pin) |
|  / | / Author: ALS | A comment |
| label,| loop,| A label can be referred to in various control transfer statements. It MUST end in a comma (,)

![Assemble and Run](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/assemble-run.png)

## Monitor Commands

| Command | Example | Meaning |
| :-:| :-:| :-|
| "Enter" | "Enter"  | Execute the current instruction and move to the next |
|  acc    |   acc     | Show the current contents of the Accumulator |
|   b *n* |   b 71    | Create a breakpoint at address *n* |
|  carry  |  carry    | Show the current contents of the Carry Bit |
|  crb    |  crb     | Show the currently selected RAM Bank |
|  off    |  off     | Continue to execute the program with no trace |
|   pc    |   pc     | Show the Program Counter |
| pin10   | pin10    | Show the status of PIN10 on the i4004 chip (test pin)
|    q    |    q     | Quit the monitor without executing any further commands |
|  ram   |   ram     | Show the complete contents of RAM |
|  reg *n*  |  reg 7 | Show content of a specified register |
|  regs   |  regs    | Show all 16 registers |
|  rom    |   rom     | Show the complete contents of ROM |
| stack   |  stack   | Show the stack and the location of the stack pointer |


## Licence

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/alshapton/Pyntel4004) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

### Credits

-  Intel 4004 Design Team
-  Logo: [LouBeLou Print Shop](http://www.psloubelou.com)

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/blob/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/Pyntel4001_chip.png)


.. _Python: https://www.python.org


%package -n python3-Pyntel4004
Summary:	A Python software implementation of the Intel 4004 processor.
Provides:	python-Pyntel4004
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-Pyntel4004
# Pyntel4004

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/pyntel4004.svg)

[![Build Pipeline](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml/badge.svg)](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml)
[![Documentation Status](https://readthedocs.org/projects/pyntel4004/badge/?version=latest)](https://pyntel4004.readthedocs.io/en/latest/?badge=latest)
![GitHub](https://img.shields.io/github/license/alshapton/pyntel4004)
[![PyPI version](https://badge.fury.io/py/Pyntel4004.svg)](https://badge.fury.io/py/Pyntel4004)
![PyPI - Downloads](https://img.shields.io/pypi/dm/Pyntel4004)
[![Plant Tree](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Plant%20Tree&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://plant.treeware.earth/alshapton/pyntel4004)

[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=alshapton_Pyntel4004)

A Python software implementation of the Intel 4004 processor and the MCS-4 computer.

## General Information

-  Two pass assembler using the original mnemonics, directives and comments syntax
-  Disassembler
-  Monitor facility to step through code and examine registers, memory etc
-  Cross-assembler for Retroshield 4004 Arduino

## Requirements

* Python >= 3.8.2

<br>

## Installation Instructions
<br>

### PyPI

Pyntel4004 can be installed from PyPI by using the command:

```bash

    $ pip install Pyntel4004
```

### Source Code
Pyntel4004’s git repo is available on GitHub, which can be browsed [here](https://github.com/alshapton/pyntel4004) and cloned using:

```bash

    $ git clone https://github.com/alshapton/pyntel4004 pyntel4004
```

Verify the installation by running unit tests:
```bash

    $ cd pyntel4004/test
    $ pytest
```
## Questions, Answers and Issues

Please use the github discussion board for questions, to ensure the right people see them in a timely manner.

[Github Pyntel4004 Discussion Board](https://github.com/alshapton/Pyntel4004/discussions)

and the github issue tracker to raise any issues.

[Github Pyntel4004 Issues Board](https://github.com/alshapton/Pyntel4004/issues)

<br>

## Usage Instructions

To use this software implementation of the Intel 4004 from the command line, you should install the [Pyntel4004-cli](https://pypi.org/project/Pyntel4004-cli/) using
`
pip install pyntel4004-cli
`

The user instructions can be found [here](https://pyntel4004.readthedocs.io/en/latest/intro/usage.html
)

## Design goals

- As much of the internals as possible should be carried out using binary arithmetic and operations.
- No 3rd party libraries to be used (i.e. pure Python).
- Build a fully-working i4004 opcode emulator.
- Build a fully-working assembler which generates correct op-codes.
- Construct a fully-working software-based i4004 chip which can use the generated object code from the assembler.
- Enable code assembled with Pyntel4004 to be run on a real i4004 chipset
- Enable code assembled with Pyntel4004 to be run on a retroShield4004 for Arduino

## Status

22-MAY-2022     First release of configuration file support
20-MAR-2022:    Command Line functionality is now deprecated
02-MAR-2022:    Finalised split - Pyntel4004 is now the core library
21-FEB-2022:    Started to split into two - (chip, assembler, dissassembler) and CLI
04-FEB-2022:    Cross-assemble to retroShield4004 for Arduino, completing documentation
23-SEP-2021:    Publishing releases to [PyPi](https://pypi.org/project/Pyntel4004/)
<br>
10-SEP-2021:    Documentation building and hosted with [READTHEDOCS](https://pyntel4004.readthedocs.io/en/latest/)
<br>
12-JUN-2021:    Auto-build with GITHUB Actions implemented
<br>
18-MAY-2021:    Implementing full test suite
<br>
21-APR-2021:    Instruction Set functionally complete
                Entering Testing Phase

## Example

### Assembler Directives and other additions

Assembler directives are not part of the program itself, but can control things like starting address, and various environmental settings.

| Directive | Example | Meaning |
| :-:| :-:| :-|
| end | end | Indicating end of program, but not necessarily end of code |
| org | org 100 | Assemble and place object code commencing at address 100 |
| pin | pin 1 | Value of i4004's Pin 10 (test pin) |
|  / | / Author: ALS | A comment |
| label,| loop,| A label can be referred to in various control transfer statements. It MUST end in a comma (,)

![Assemble and Run](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/assemble-run.png)

## Monitor Commands

| Command | Example | Meaning |
| :-:| :-:| :-|
| "Enter" | "Enter"  | Execute the current instruction and move to the next |
|  acc    |   acc     | Show the current contents of the Accumulator |
|   b *n* |   b 71    | Create a breakpoint at address *n* |
|  carry  |  carry    | Show the current contents of the Carry Bit |
|  crb    |  crb     | Show the currently selected RAM Bank |
|  off    |  off     | Continue to execute the program with no trace |
|   pc    |   pc     | Show the Program Counter |
| pin10   | pin10    | Show the status of PIN10 on the i4004 chip (test pin)
|    q    |    q     | Quit the monitor without executing any further commands |
|  ram   |   ram     | Show the complete contents of RAM |
|  reg *n*  |  reg 7 | Show content of a specified register |
|  regs   |  regs    | Show all 16 registers |
|  rom    |   rom     | Show the complete contents of ROM |
| stack   |  stack   | Show the stack and the location of the stack pointer |


## Licence

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/alshapton/Pyntel4004) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

### Credits

-  Intel 4004 Design Team
-  Logo: [LouBeLou Print Shop](http://www.psloubelou.com)

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/blob/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/Pyntel4001_chip.png)


.. _Python: https://www.python.org


%package help
Summary:	Development documents and examples for Pyntel4004
Provides:	python3-Pyntel4004-doc
%description help
# Pyntel4004

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/pyntel4004.svg)

[![Build Pipeline](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml/badge.svg)](https://github.com/alshapton/Pyntel4004/actions/workflows/build-pipeline.yml)
[![Documentation Status](https://readthedocs.org/projects/pyntel4004/badge/?version=latest)](https://pyntel4004.readthedocs.io/en/latest/?badge=latest)
![GitHub](https://img.shields.io/github/license/alshapton/pyntel4004)
[![PyPI version](https://badge.fury.io/py/Pyntel4004.svg)](https://badge.fury.io/py/Pyntel4004)
![PyPI - Downloads](https://img.shields.io/pypi/dm/Pyntel4004)
[![Plant Tree](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Plant%20Tree&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://plant.treeware.earth/alshapton/pyntel4004)

[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=alshapton_Pyntel4004)

A Python software implementation of the Intel 4004 processor and the MCS-4 computer.

## General Information

-  Two pass assembler using the original mnemonics, directives and comments syntax
-  Disassembler
-  Monitor facility to step through code and examine registers, memory etc
-  Cross-assembler for Retroshield 4004 Arduino

## Requirements

* Python >= 3.8.2

<br>

## Installation Instructions
<br>

### PyPI

Pyntel4004 can be installed from PyPI by using the command:

```bash

    $ pip install Pyntel4004
```

### Source Code
Pyntel4004’s git repo is available on GitHub, which can be browsed [here](https://github.com/alshapton/pyntel4004) and cloned using:

```bash

    $ git clone https://github.com/alshapton/pyntel4004 pyntel4004
```

Verify the installation by running unit tests:
```bash

    $ cd pyntel4004/test
    $ pytest
```
## Questions, Answers and Issues

Please use the github discussion board for questions, to ensure the right people see them in a timely manner.

[Github Pyntel4004 Discussion Board](https://github.com/alshapton/Pyntel4004/discussions)

and the github issue tracker to raise any issues.

[Github Pyntel4004 Issues Board](https://github.com/alshapton/Pyntel4004/issues)

<br>

## Usage Instructions

To use this software implementation of the Intel 4004 from the command line, you should install the [Pyntel4004-cli](https://pypi.org/project/Pyntel4004-cli/) using
`
pip install pyntel4004-cli
`

The user instructions can be found [here](https://pyntel4004.readthedocs.io/en/latest/intro/usage.html
)

## Design goals

- As much of the internals as possible should be carried out using binary arithmetic and operations.
- No 3rd party libraries to be used (i.e. pure Python).
- Build a fully-working i4004 opcode emulator.
- Build a fully-working assembler which generates correct op-codes.
- Construct a fully-working software-based i4004 chip which can use the generated object code from the assembler.
- Enable code assembled with Pyntel4004 to be run on a real i4004 chipset
- Enable code assembled with Pyntel4004 to be run on a retroShield4004 for Arduino

## Status

22-MAY-2022     First release of configuration file support
20-MAR-2022:    Command Line functionality is now deprecated
02-MAR-2022:    Finalised split - Pyntel4004 is now the core library
21-FEB-2022:    Started to split into two - (chip, assembler, dissassembler) and CLI
04-FEB-2022:    Cross-assemble to retroShield4004 for Arduino, completing documentation
23-SEP-2021:    Publishing releases to [PyPi](https://pypi.org/project/Pyntel4004/)
<br>
10-SEP-2021:    Documentation building and hosted with [READTHEDOCS](https://pyntel4004.readthedocs.io/en/latest/)
<br>
12-JUN-2021:    Auto-build with GITHUB Actions implemented
<br>
18-MAY-2021:    Implementing full test suite
<br>
21-APR-2021:    Instruction Set functionally complete
                Entering Testing Phase

## Example

### Assembler Directives and other additions

Assembler directives are not part of the program itself, but can control things like starting address, and various environmental settings.

| Directive | Example | Meaning |
| :-:| :-:| :-|
| end | end | Indicating end of program, but not necessarily end of code |
| org | org 100 | Assemble and place object code commencing at address 100 |
| pin | pin 1 | Value of i4004's Pin 10 (test pin) |
|  / | / Author: ALS | A comment |
| label,| loop,| A label can be referred to in various control transfer statements. It MUST end in a comma (,)

![Assemble and Run](https://github.com/alshapton/Pyntel4004/raw/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/assemble-run.png)

## Monitor Commands

| Command | Example | Meaning |
| :-:| :-:| :-|
| "Enter" | "Enter"  | Execute the current instruction and move to the next |
|  acc    |   acc     | Show the current contents of the Accumulator |
|   b *n* |   b 71    | Create a breakpoint at address *n* |
|  carry  |  carry    | Show the current contents of the Carry Bit |
|  crb    |  crb     | Show the currently selected RAM Bank |
|  off    |  off     | Continue to execute the program with no trace |
|   pc    |   pc     | Show the Program Counter |
| pin10   | pin10    | Show the status of PIN10 on the i4004 chip (test pin)
|    q    |    q     | Quit the monitor without executing any further commands |
|  ram   |   ram     | Show the complete contents of RAM |
|  reg *n*  |  reg 7 | Show content of a specified register |
|  regs   |  regs    | Show all 16 registers |
|  rom    |   rom     | Show the complete contents of ROM |
| stack   |  stack   | Show the stack and the location of the stack pointer |


## Licence

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/alshapton/Pyntel4004) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

### Credits

-  Intel 4004 Design Team
-  Logo: [LouBeLou Print Shop](http://www.psloubelou.com)

![Pyntel 4004 Logo](https://github.com/alshapton/Pyntel4004/blob/4afcf04365d6169ca6c1a86a10d70997c7583da6/images/Pyntel4001_chip.png)


.. _Python: https://www.python.org


%prep
%autosetup -n Pyntel4004-1.2

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-Pyntel4004 -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2-1
- Package Spec generated