Edt/Asm is a basic editor with integrated in-memory assembler. Edt/Asm was
designed so that it could be run from ROM. The default assembly is at 8000h,
with the text editor buffer at 1000h. In this configuration programs can be
assembled from 0000h-0FFFh. There are two ORG addresses in the Edt/Asm source.
The first specifies where Edt/Asm will be assembled, the second one (near the
end of the source file) specifies where Edt/Asm's data begins. Any memory
below the second ORG value is available for assembled programs.
A restart address is provided 3 bytes above the normal entry point. The
restart address resets the baud rate and nothing else. This entry can be used
either in non-volitile memory systems to recover the current edit buffer, or
can be used by assembly language programs to return control to Edt/Asm without
losing the editor contents.
Editor Commands:
----------------
A - Assemble the program
B - Move to bottom of buffer
D - Move down one line
,nD - Move down n lines
Itext - Insert text at current location
nItext - Move to line n, then insert text
I - Enter multi-line insert mode, end with
nI - Enter multi-line insert mode starting at line n,
end with
nG - Make line n the current line
K - Kill (delete) the current line
nK - Move to line n, and then delete line
,nK - Kill n lines starting from current line
n,mK - Kill m lines starting from line n, n becomes current
N - New file - clears buffer
P - Print the current line
nP - Print line n
,nP - Print n lines starting from current line
n,mP - Print m lines starting from line n
R - Run program
T - Move to top line of buffer
U - Move up one line
,nU - Move up n lines
Q - Quit to monitor (0F900h, or 08003h on Elf2K)
V - Switch to Visual/02 (Pico/Elf only)
Assembler Line Format:
----------------------
label: OPCODE ARGUMENTS ; Comments
Labels and comments are optional, and not all opcodes have arguments. In
addition to the 1802 instruction set, Edt/Asm provides 4 pseudo-opcodes:
ORG addr Specify address for assembly
DB b1,b2,...bn Define a list of bytes in memory
DB 'c1','c2'...'cn' Define a list of characters in memory. For example, 'A' or
DB ‘This is text’ Is also supported.
DW w1,w2,...wn Define a list of words in memory
END start End of assembly, also specifies atart address
Where addr,bn,wn can be a hex value such as 8000h or a decimal value such as 256.
A colon (:) is used to delimit a label.
Example Elf OS restart program
ORG 2000h ; start of program (where program will be loaded in memory)
BR START ; branch around header
DB 8Ch ; the 12th month of year with upper bit set on to indicate extended header
DB 25 ; the 25th day of the month
DW 2020 ; the year
DW 2 ; indicate that this is build 2 of the program
DB 'M','R' ; add some text for the Elf OS version command to display
DB 0 ; indicate end of ASCIIZ text string
START: LBR 0FF00h ;Elf-OS restart. Diskless return to EDTASM is 0B003h
END START ; indicate the entry point for the program
NOTE: A hex address or constant beginning with A-F must have a leading zero.
Edt/Asm currently only supports simple arguments, arithmetic expressions
cannot be used. When specifying registers, the register number may (but need
not) begin with R, for example: LDN R8
The high byte of a value can be obtained by adding .1 to the end of a label,
for example: LDI STACK.1 will load the high byte of the address of
STACK. .0 will obtain the low byte of a value, for example: LDI STACK.0
Source: cosmacelf@groups.io