X16: Demo
Home
Back

 

DAP16 assembly, load and execution of a program

A small program, written in the DAP16 assembly language, is assembled, linked and executed. The following four steps are presented on this page:

1) Convert the source hello.s to the file hello.src;
        DAP16 and the software of the 316/516 in general uses the TTY character set with the MSB of the ASCII characters set to 1.
        Also the assembler uses a particular input record format.
        A small program txt2src2.pl converts a nornal PC text file to the required source format.
2) Assemble with the DAP16 assembler the file hello.src to the object file hello.obj;
3) Load the object file hello.obj with the loadet LDR-APM into memory;
4) Execute the loaded program.

The console interaction for the execution of these four steps is show, with comments added between brackets [..].



H:\FTD2XX>perl txt2src2.pl hello.s
Convert hello.s to the ascii papertape hello.src
Start reading hello.s
* DEMO: HELLO WORLD ON TTY

     ORG    '1000
STRT LDA    N7
     TCA
     STA    0
LC   LDA    MESS,1
     ICA
     JST    ASRO
     ICA
     JST    ASRO
     IRS    0
     JMP    LC
     HLT              READY
     JMP    STRT      PRINT AGAIN
*
* MESSAGE TO PRINT
     BCI    6,HELLO WORLD
     OCT    '106612   CRLF
MESS EQU    *
N7 OCT    7 LENGTH IN WORDS
*
* TTY OUTPUT ROUTINE
ASRO DAC    **
     SKS    '104      WAIT FOR READY
     JMP    *-1
     OCP    '104      SET OUTPUT MODE
     OTA    '4        PRINT CHARACTER
     JMP    *-1       WAIT FOR READY
     JMP*   ASRO
     END

End of papertape conversion
30 lines read from hello.s
30 lines writtten to hello.src



[X16 on the FPGA is loaded before this session was started]
H:\FTD2XX>perl X16Panel-06.pl [start the Panel program]
X16 Panel, version 0.06 (32kW)
Reset USB1
USB1 device was already Closed
Open USB1 device
USB1 device is Open
Init JTAG
> mc [Master Clear]
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 000000 Xr 000000 H
> attach ptr dap16slst.ptp [Selfloading assembler at the PTR]
File dap16slst.ptp attached to device PTR
> boot [boot the assembler]
18732
CPU stopped: 18732 characters read from PTR
P 017633 IR 000000 A 000000 B 000000 C 1 Xm 013325 Xr 013325 H
> mc
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 013325 Xr 013325 H
> attach ptr hello.src [Source at the PTR]
File dap16slst.ptp detached from device PTR and closed
File hello.src attached to device PTR
> attach ptp hello.obj [assembler output papertape - still an empty file]
File hello.obj attached to device PTP
> de a 120420 [set A Register: 2-pass assembly IN=PTR OUT=PTP LIST=TTY]
Set A-Register to: 120420
P 000000 IR 000000 A 120420 B 000000 C 0 Xm 013325 Xr 013325 H
> deposit p 400 [set P Register to the start address of the assembler]
Set PC-Register to: 000400
P 000400 IR 000000 A 120420 B 000000 C 0 Xm 013325 Xr 013325 H
> run [start the 1st pass of the assembler]
Run, TTY switched to CPU


DDP-516 WITH 16K STORAGE [assembler massage; DAP16 does not run in Extend Mode]
P 006352 IR 000000 A 020420 B 000000 C 0 Xm 177777 Xr 177777 H
CPU stopped; TTY switched to Panel [1st pass ready]
20 ReadSwitches per second
> reset ptr [put the source papertape in the PTR again for the 2nd pass]
File hello.src reattached to device PTR
> run [start the 2nd pass; listing on TTY and object output on PTP are produced]
Run, TTY switched to CPU



                        * DEMO: HELLO WORLD ON TTY



0001                    * DEMO: HELLO WORLD ON TTY
0002                         ORG   '1000
0003 01000   0 02 01023 STRT LDA   N7
0004 01001   140407          TCA
0005 01002   0 04 00000      STA   0
0006 01003   1 02 01023 LC   LDA   MESS,1
0007 01004   141340          ICA
0008 01005   0 10 01024      JST   ASRO
0009 01006   141340          ICA
0010 01007   0 10 01024      JST   ASRO
0011 01010   0 12 00000      IRS   0
0012 01011   0 01 01003      JMP   LC
0013 01012   000000          HLT   READY
0014 01013   0 01 01000      JMP   STRT       PRINT AGAIN
0015                    *
0016                    * MESSAGE TO PRINT
0017 01014   144305          BCI   6,HELLO WORLD
     01015   146314
     01016   147640
     01017   153717
     01020   151314
     01021   142240
0018 01022   106612          OCT   '106612    CRLF
0019         001023     MESS EQU   *
0020 01023   000007     N7   OCT   7          LENGTH IN WORDS
0021                    *
0022                    * TTY OUTPUT ROUTINE
0023 01024   0 000000   ASRO DAC   **
0024 01025   34 0104         SKS   '104       WAIT FOR READY
0025 01026   0 01 01025      JMP   *-1
0026 01027   14 0104         OCP   '104       SET OUTPUT MODE
0027 01030   74 0004         OTA   '4         PRINT CHARACTER
0028 01031   0 01 01030      JMP   *-1        WAIT FOR READY
0029 01032  -0 01 01024      JMP*  ASRO
                             END

NO ERRORS IN ABOVE ASSEMBLY.

DAP-16 REV. E

AC
P 006352 IR 000000 A 120420 B 000000 C 0 Xm 177777 Xr 177777 H
CPU stopped; TTY switched to Panel
20 ReadSwitches per second
> mc
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 177777 Xr 177777 H
> detach ptp
File hello.obj detached from device PTP and closed
> attach ptr ldre16kslst.ptp
File hello.src detached from device PTR and closed
File ldre16kslst.ptp attached to device PTR [loader at the PTR]
> boot [boot the loader]
6821
CPU stopped: 6821 characters read from PTR
P 037633 IR 000000 A 000000 B 000000 C 0 Xm 037600 Xr 037600 H
> mc
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 037600 Xr 037600 H
> attach ptr hello.obj [object tape to load at the PTR]
File ldre16kslst.ptp detached from device PTR and closed
File hello.obj attached to device PTR
> deposit p 37000 [start address loader in P register]
Set PC-Register to:  037000
P 037000 IR 000000 A 000000 B 000000 C 0 Xm 037600 Xr 037600 H
> run [start the loader]
Run, TTY switched to CPU
P 037445 IR 000000 A 000001 B 000000 C 0 Xm 000000 Xr 000000 H TI
CPU stopped; TTY switched to Panel
21 ReadSwitches per second
> run [continue the loader; A Register set to 1 to read from PTR]
Run, TTY switched to CPU

LC [Loading Complete]
P 034306 IR 000000 A 000001 B 000000 C 0 Xm 000000 Xr 000000 H TI
CPU stopped; TTY switched to Panel
20 ReadSwitches per second
> mc
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 000000 Xr 000000 H
> deposit p 37002 [ask for the memory map from the loader]
Set PC-Register to:  037002
P 037002 IR 000000 A 000000 B 000000 C 0 Xm 000000 Xr 000000 H
> run
Run, TTY switched to CPU

*LOW   01000
*START 01000
*HIGH  01034
*NAMES 34045
*COMN  37700

LC
P 034306 IR 000000 A 000001 B 000000 C 0 Xm 000000 Xr 000000 H TI
CPU stopped; TTY switched to Panel
20 ReadSwitches per second
> mc
P 000000 IR 000000 A 000000 B 000000 C 0 Xm 000000 Xr 000000 H
> deposit p 1000 [start address of loaded program to P register]
Set PC-Register to:  001000
P 001000 IR 000000 A 000000 B 000000 C 0 Xm 000000 Xr 000000 H
> run [start the program]
Run, TTY switched to CPU
HELLO WORLD [program output on TTY]
P 001013 IR 000000 A 106612 B 000000 C 0 Xm 000000 Xr 000000 H
CPU stopped; TTY switched to Panel
20 ReadSwitches per second
>
 


 

Page last updated on: January 15 2010 | Contact: Info@theoengel.nl