Floopy wrote:
Wow thanks! .ORG, I'm also using the document on
http://exifpro.com/utils.html as a reference.
Note, however, that the version of the Kowalski simulator at that site is out-of-date.
Quote:
I think I've got it figured out, it's really nice! It's nice to see the explanation to the instructions show up as I type them.
If you search forum posts for
Kowalski you will turn up additional information. For example, here's a list of assembler pseudo-ops (aka directives) you can use:
Code:
IO_AREA ;define console I/O area address
.ASCII .BYTE .DB ;define static data, e.g., strings, tables, etc.
.ASCIS ;like .BYTE, but EOS defined with bit 7 set
.DBYTE .DD ;assembles big-endian word
.DCB ;equivalent to *=*+N, where N is arg to .DCB,...
;w/optional initialization pattern, e.g., .DCB 10,$FF
.DS .RS ;equivalent to *=*+N, where N is arg to .DS
.DW .WORD ;assembles little-endian word
.ELSE ;conditional assembly directive
.END ;marks end of source file, optional
.ENDIF ;marks end of conditional assembly
.ENDM ;marks end of macro definition
.ENDR ;marks end of repeated text
.ERROR ;emits error message & halts assembly
.EXITM ;halt continued macro expansion
.IF ;start conditional assembly
.INCLUDE ;insert contents of named source file
.IO_WND ;define I/O window size (cols, rows)
.MACRO ;marks start of macro definition
.OPT ;set assembly options
.ORG ;set start of assembly address, also * = <addr>
.PARAMTYPE ;determine macro parameter type
.REF ;determine if label/symbol was defined
.REPEAT .REPT ;repeat following text N times
.ROM_AREA ;set write-protected address range
.SET ;(re)defines variable value, e.g., .SET .=
.START ;sets simulator start of execution
.STR .STRING ;generates text string, 1st byte is length (0-255)
.STRLEN ;determines macro parameter string length
Incidentally, you can set the assembler's program counter with
.ORG or with
*=. You can also use
*=*+N to advance the program counter, where
N is the number of bytes to advance. Similarly,
*=*-N works in reverse.