-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathK13MANUA.TXT
2571 lines (1866 loc) · 95.9 KB
/
K13MANUA.TXT
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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Konpass #1.3
(C) Konamiman, 2022
Based on Compass 1.2.09
(C) 1998 Compjoetania The Next Generation
MSX, MSX-DOS and R800 are trademarks of the MSX Licensing Corporation.
Z80 is a trademark of ZILOG Corp.
MemMan is developed by the Msx Software Team.
Despite all the care taken by the production of this text, the author
can not be held responsible for any possible damage resulting from errors
contained in this document.
Preface
-------
In October 2021 Compass, the best assembler IDE ever made for MSX and
originally a paid product, was published for free including its source code.
I've been a huge fan of Compass since version 1.0 was published in 1995,
and it's my main tool when I'm developing (or debugging) directly on my MSX.
In the more than 20 years that have passed since the last version,
Compass 1.2.09, was published, I've had plenty of time to notice some small
quirks/bugs/annoyances on it. And with the source code available for everyone
I couldn't resist to put my hands on it and implement all the fixes and
improvements I always wanted to see in Compass. So I did and the result was
Konpass 1.3, a refresh of the good old product. No more, no less.
I hope that I have made Konpass an even better assembler IDE for MSX than the
awesome Compass. Please feel free to suggest further improvements (or even
submit pull requests!) in the Konpass repository I have created (address is in
section 1.1).
January 2022, Konamiman
Original preface for Compass 1.2.09
-----------------------------------
Why another MSX-Assembler? In the dark past many different assemblers were
produced for the MSX-system in addition to the already available CP/M
assemblers. Along with the advantages of these products, there were also a
lot of disadvantages.
Some of them had an integrated environment but weren't able of handling large
sources, others were very powerful but needed a separated editor causing a
waste of time when testing and debugging. Most of these programs didn't take
advantage of the new developments in the MSX-scene. Just to name a few of
them: Turbo R (the R800 instruction set), MemMan, DOS 2.xx (subdirectories).
There just wasn't an assembler which combined enough advantages to satisfy
almost everyone.
Compass is our attempt to create an easy-to-use, menu driven and extensive
package specifically designed for the MSX-system. The name "Compass" is an
contraption of the words "COMPjoetania ASSembler". We would like to thank
everybody who, one way or another, has contributed to the development of
Compass.
We hope you enjoy Compass.
September 1998, Compjoetania The Next Generation
Original concept and program by Compjoetania (1995):
*Remo Jongeneelen
*David Heremans
*Eric van Beurden
Compass #1.2 by Compjoetania The Next Generation (1997...)
*Jon De Schrijder: coding
*David Heremans : manual, disklabels
*Wouter Vermaelen: bughunter, did a great job
1. Preparations
---------------
It is important that you read this chapter before you proceed. It contains
important information about the program as a whole and the contents of the
package.
1.1 Getting Konpass
The latest version of Konpass is available in its GitHub repository:
https://github.com/Konamiman/Konpass
This is also the place to report bugs and suggest improvements. Please note
that Konpass is a hobbyist project, so bugs/suggestions will be looked at
whenever the author has some spare time (but you can always submit
pull requests yourself, of course!)
And this is the repository for Compass 1.2.09, in whose sources Konpass
is based:
https://github.com/turbor/compass-1.2-sources
See the version of this same file in that repository if you are curious about
what were the contact details and the available service options for the
original product. You can also take a look at the COMPASSV.TXT file for the
versions history of the original Compass (that file is no longer maintained
for Konpass).
1.2 Contents of the release
The Konpass release consists of the following files:
* The Konpass program itself:
KONPASS.COM
KONPASS.DAT
* This manual in TXT format:
K13MANUA.TXT
Note: once "Save configuration" is executed, and extra KONPASS.CFG file
will be created. See chapter 10.
Originally Compass was distributed on a floppy disk that contained additional
tools and technical information. If you are interested in those, please
visit the GitHub repository for Compass 1.2.09 (see section 1.1).
1.3 Configuration
Konpass runs on every MSX2, MSX2+ and MSX Turbo R computer with a memory
mapper of at least 128KB Ram, though for convenient use, we recommend a
memory capacity of at least 256KB. 'Fixed' rammodules (this is: not
mapped ram) are not supported. (And you'll need a double-sided disk drive
for the original floppy disk to work of course.)
Konpass supports the following configurations :
* MSX-DOS 2.xx: If you have DOS 2.xx you are able to browse through
subdirectories and you can take advantage of the DOS 2.xx Ramdisk.
* MEMORY MAPPER: Konpass supports multiple memory mappers.
* MSX TURBO-R: If you run Konpass on an MSX Turbo R you are able to switch
between the Z80 and R800 (ROM/DRAM) processor.
* HARDDISK: You are able to install Konpass on your harddisk, just place
the KONPASS.COM and KONPASS.DAT files in the same directory.
* MemMan 2.42: Konpass uses -if already installed- the memory management
routines provided by MemMan. This allows you to use TSR's while
you are using Konpass. If you don't use MemMan then Konpass will use the
routines provided by DOS 2.xx . If you don't use either of them, Konpass will
resort to its own memory routines. You can find MemMan 2.42 and the
accompanying programs in a packed archive on the disk.
* Nextor: If you run Nextor you have a couple of extra perks. Currently these
are: the ability to read and write sectors on any drive regardless of the
filesystem it contains, and seeing the real free disk space in drives with
a capacity of more than 32MB.
Konpass uses screen 0 in 80 columns mode. This mode is slightly altered to
display 26.5 lines and 4 colors. The assembler in Konpass also uses some Vram,
but this amount will never exceed the address space from #00000 up to #07FFF.
1.4 Booting Konpass
The version of Konpass that you'll find on the disk is a COM file which has
to be launched using MSX-DOS or Nextor. The two files that make up MSX-DOS are:
* MSXDOS.SYS and COMMAND.COM for MSX-DOS 1.xx
* MSXDOS2.SYS and COMMAND2.COM for MSX-DOS 2.xx
* NEXTOR.SYS (or MSXDOS2.SYS) and COMMAND2.COM for Nextor
These files are available in the original repository for Compass 1.2.09 (see
section 1.1). You can copy the files KONPASS.COM and KONPASS.DAT to a disk
containing these MSX-DOS files, or just launch MSX-DOS and swap the disks.
Alternatively you can copy the Konpass files to a directory on your hard disk.
When you have started MSX-DOS just type :
A>KONPASS [RETURN]
Konpass will first perform some hardware checks on your computer.
If your computer crashes here, then there is something wrong with your
hardware. (For example: random memory errors when working on a 7MHz MSX2.
These hardware problems are very difficult to trace.) If everything went
fine, you'll see the amount of mapped memory Konpass has detected.
Also what kind of memory management that will be used. Konpass can
run in four memory management conditions:
* DOS1: no memory management, Konpass will use its own routines.
* DOS1+MemMan: MemMan will take care of Konpass memory management. Due to some
unknown problems (probably MemMan) this setting will cause the computer to
crash. So we do not recommend to use MemMan in DOS1 environment.
* DOS1 + mapper support routines: if mapper support routines are installed
in DOS1 Konpass will use these as if it was running in DOS2.
The mapper support routines can be installed in DOS1 using the MSR.COM tool
available at Konamiman's MSX page (http://www.konamiman.com).
* DOS2: memory management performed by the DOS2 mapper support routines.
* DOS2+MemMan: memory management performed by MemMan.
If you use MemMan, we recommend to use the latest version of MemMan, version
2.42.
If it is the first time you start Konpass, the program will search for
available memory. Konpass needs at least five free pages of mapperram. And
two of them should be situated in the Primary Mapper. Four of them may not be
segments in the TPA because the Compas sprogram data will be stored there.
If one of these conditions is not met, the installation of Konpass will
abort, otherwise the program will allocate a maximum of 1536kB and make this
memory unreachable for other programs. Of course if you don't use any
memory manager, this memory is not unreachable for other programs and your
Konpass program and/or data may be overwritten by these programs.
Konpass will preferably allocate memory in other mappers than the Primary
Mapper. This might help to prevent the previous problem, although this will
make the program somewhat slower.
In some cases it can be useful not to use all available memory. You can limit
the memory allocation of Konpass by pressing the SHIFT key when you start
Konpass. Currently this limitation is set to 9 segments. In future versions
of Konpass this number will be changeable.
If you have performed a 'Main config' (see chapter 10) Konpass will try to
reinstall your saved memory configuration. If all used segments in this
memory configuration are not free, or when the Primary Mapper slot has changed
(for example: when you've placed an extra memory mapper into your MSX),
Konpass will try to allocate segments described as above.
Finally the Konpass program is loaded from (hard)disk and is launched. On
fast MSX systems startupmessages may disappear too fast. Hold down STOP
during loading if you want to pause these messages. Press this key again
to continue.
It is also possible to load an assemblerfile (ASM) from the command line.
Example:
A>KONPASS KY.ASM
The file KY.ASM will be loaded when Konpass is launched.
Note:
Konpass frequently uses Kbuf (#F41F: 318 bytes long). Make sure this part of
your memory is free and that your programs and/or TSRs don't affect this
memory. The printer buffer PB.TSR for instance can't be used because of this.
Also some Konpass code is stored in PLAYq ueues for channel B and C.
(#F9F5-#FAF4). Make sure these queues are not overwritten by other programs
or by executing a PLAY statement in BASIC for channel B or C.
2. General
----------
2.1 General screen layout
All parts of Konpass use a common screen layout to have a general look and
feel throughout the entire program.
* Status bar:
The upperline of the screen always contains the status bar. On the left of
this bar you will find the name Konpass followed by the main version number.
This number will change when a new mainversion is distributed.
(The complete version number can be obtained by displaying the KONPASS.COM or
KONPASS.DAT file in some textviewer, or in the "About" menu.)
On the right side the announcement '(C) 2022 Konamiman'. Between these two
messages you'll find the name of the currently selected program part of
Konpass.
* The empty line:
It's just here for ease of survey. Don't expect any messages here.
* Menu bar:
This menu bar is situated below the empty line. This bar will display the
available menus of the currently active program part. It can contain a maximum
of five menus. These can be reached using the function keys [F1] up to [F5].
* Desktop:
This occupies most of the screen. Here the real action takes place.
* Function bar:
Below the desktop you'll find a status bar. This bar is only present in the
assembler and contains important information about the current source and
settings. In the other parts of Konpass this function bar is suppressed and
the extra lines are used to extend the desktop.
2.2 Controls
Almost all functions in Konpass can be selected by means of the keyboard, the
mouse or the so-called shortcuts.
The menu bar contains the menus which can be activated using the function
keys or second mouse button (if mouse support is activated). When a menu is
activated a dropdown list will appear. You can select another menu by
clicking the appropriate function key or by using the cursor left and cursor
right keys to gain access to the other menus. Use the cursor keys up and down
to selected an item in the menu.
Your current choice will be indicated in a bar that uses the alternative
colors. Use the space bar to activate a choice. Pressing [ESC] will leave the
menus and bring you back in the active program part.
For your convenience a standard order is used throughout all parts of Konpass.
The function key [F1] will always activate the SYSTEM menu (see chapter 2.3)
and the second menu (use [F2]) will always be the CONFIGURATION menu. The
contents of these menus will of course be slightly altered depending on the
active part when the menu was summoned. The menus hidden under [F3] up to [F5]
are different for each part and may even be absent.
* Mouse control
A great effort has gone into enabling mouse support for Konpass. A lot of
options can be reached using the mouse without the need for keyboard
interaction. Of course a lot of actions, like searching, need keyboard input,
but a lot can be done without it.
If you're on the desktop you can use the right mouse button to reactivate the
last used menu. Use the left button to activate an item. The mouse can now be
used to walk through all options and menus. Instead of pressing [ESC] you can
use the right mousebutton in most of the cases. To move around with the
cursor on the desktop, you should hold down the left mouse button.
Remark: mouse control is disabled by default (see 'Main Install' in
chapter 10).
* Shortcuts
Shortcuts are key combinations which allow you to reach certain options in a
very fast way without using the regular menu selection which can be time
consuming if used a lot. In Konpass a shortcut consists in most of the cases
of the [CTRL] key combined with another key. All the shortcuts are listed
in appendix A. Most shortcuts are mentioned after the option in the menu. For
example: in the SYSTEM menu the disk option will be followed by ^D indicating
that [CTRL] and [D] pressed together is the shortcut for the diskmenu.
Another easy shortcut to use is the [STOP] key which switches you from one
program part to another one. This in the order: assembler, monitor, debugger,
assembler, monitor, ... etc.
2.3 System menu
This menu can always be reached by pressing [F1]. This menu differs very
slightly from program part to program part. The options of this menu are listed
below accompanied by the chapter number which deals with the topic.
Assembler chapter 3
Monitor chapter 4
Debugger chapter 5
Disk chapter 6
Memory chapter 7
Calculator chapter 8
Slotview chapter 9
Shell see below
Quit see below
About Display information about Konpass
The options SHELL and QUIT are closely related. The shortcut for SHELL is
[SHIFT]+[ESC]. The shortcut for QUIT is [CTRL]+[Q].
With SHELL you can leave the Konpass program and go back to the shell from
where you've last activated Konpass. You can return to Konpass by typing CMD
KONPASS [RETURN] from the MSX-BASIC prompt, by pressing [SHIFT]+[ESC] (DOS
and MSX-BASIC), and by running KONPASS.COM again.
If you return to Konpass, all settings are still preserved and if everything
went well you can just continue where you left. Neverthelesss certain
precautions should to be taken. When using DOS2 and/or MemMan the memory
blocks used by Konpass are reserved by these respective memory managers.
So if all other programs, started during this 'shell', use these
memory managers, there is no problem.
If you use a program that does its own memory management, then you can easily
destroy the data used by Konpass. If this happens your source can be destroyed
or Konpass can be become unstable. A simple trick that most of the time works,
is placing all the important memory blocks (sources) in the highly numbered
blocks and the less important (label buffers) in the lower memory blocks.
QUIT will terminate the Konpass program completely. All used memory will be
freed and you will return to the last activated shell. Make sure you save your
work before quitting! Otherwise there is no way to recover it.
3. Assembler
------------
After you have chosen the option ASSEMBLER from the SYSTEM menu you will end
up in the editor. The assembler consists of a very extensive editor and the
actual assembler.
Programming machine language directly in processor comprehensible byte code is
a very tedious job. When one instruction is inserted, all absolute addresses
in the code have to be recalculated and to do this yourself isn't very
enjoyable.
Besides, these instructions are made up of numbers, which aren't as easy to
remember as carefully chosen abreviations. The combination of these
(hexadecimal) numbers are called opcodes. For each opcode an easy to remember
word/sentence was standardized. These words are called mnemonics. Each
mnemonic represents an opcode and vice versa. The editor is used to write a
program with these mnemonics. The machine language written in mnemonics is
called an assembler source.
When this source is assembled it is translated into machine code instructions.
Each time you change something in the source, the source should be reassembled
before you can run the new program because all used addresses will probably
need recalculation.
* Labels
Most powerful feature of an assembler is the use of labels. These labels can
be used for different purposes and they help to make the sources more
comprehensible. They are mostly used to give constants a name and to help
calculating addresses when assembling. The length of these labels in Konpass
can vary between 6 and 20 characters. The following characters are allowed in
a label name:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789_-!?
There are a few restrictions. A label may not start with a digit. Neither
reserved words may be used as a label. An overview of these reserved words
can be found in Appendix C.
Programmers are used to place a colon behind a label when this label is
declared, but there is no need to do this in Konpass. If a label ends with two
colons then this label is declared public (see chapter 14).
3.1 Assembler screen and controls
The assembler screen is made up of a status bar, a menubar, the desktop and a
function bar. The menubar has five different menus, respectively the SYSTEM
menu, the CONFIGURATION menu, the OPTIONS menu, the ASSEMBLE menu and finally
the BLOCK menu. The desktop can be found below the menubar, which is an text
editor containing the sources. The functionbar can be found at the bottom of
the screen, displaying the linenumbers, INSert on/off, buffer used by BLOCK
and the number of the current source buffer.
The editor supports the mouse and most of the functions can be activated
using shortcuts. For a list of these shortcuts refer to appendix A. Of
course the regular keys like [BS], [DEL], [TAB] etc. work like one expects
them to do.
Pressing [GRAPH]+cursorkeys can be used to change casing state of letters.
The editor is line oriented. The line is stored in memory by pressing [RET]
and is displayed according to some simple guidelines.
If AUTO ALIGN is turned on:
Labels are placed at the left margin, the instruction is placed at the first
tab position and instructionparameters are placed at the second and third
tabpositions. All characters behind a semi-colon are ignored and are
positioned behind the last used tab position. This is used to enter remarks
about your program. The cursor is placed at the first tabposition on the next
line. An empty line is inserted if the RET INSERT is on.
If AUTO ALIGN is turned off:
No repositioning of the entered text will take place, the cursor will be
placed at the beginning of the next line. This is useful to edit/load normal
text documents.
3.2 The assembler menus
The menubar of the assembler consists of five menus:
System: see chapter 2.3
Configuration: see chapter 3.2.1
Options: see chapter 3.2.2
Assemble: see chapter 3.2.3
Block: see chapter 3.2.4
Most of these options can be reached by using the shortcuts, see Apendix A.
3.2.1 Configuration menu
Some assembler settings can be modified in this menu, which you can reach by
pressing [F2].
* SOURCEBUFFER:
Use this option to switch between the different available source buffers.
Konpass can use a maximum of four source buffers, each containig a maximum of
256 KB of text. This allows you to work with four sources at the same time!
Or you can use some source buffers to hold a text with technical reference
material etc. The number and size of the source buffers can be controlled
using the MEMORY option in the SYSTEM menu. In the right lower corner of the
screen the currently active buffernumber is displayed.
* CPU:
If you're running Konpass on a Turbo-R you can use this option to choose the
desired CPU mode: Z80-mode, R800 ROM mode and R800 DRAM mode. There isn't any
difference in speed between the R800 ROM and R800 DRAM mode since Konpass
doesn't use bios calls. Therefore we suggest to choose for the R800 ROM mode
since the DRAM mode uses 64kB of memory.
Note: on a MSX2 this will always display Z80 and no other selections are
available of course.
* LABEL LENGTH:
The length of the labels can vary from 6 to 20 characters. Use cursor keys to
alter the value when this option is chosen. Use [ESC] to cancel. See also the
assembler directive .LABEL (chapter 3.3.3)
* RET INSERT:
When this option is turned on, a new blank line will be inserted automatically
each time [RET] is pressed. If the cursor is at the end of a line, an empty line
is inserted after the current line. Otherwise the empty line is inserted before
the current line. In both cases the cursor is placed at the new line.
* AUTO ALIGN:
Turn this option off if you want to read and handle non-source ASCII files.
For more information see chapter 3.1.
* UPPER CASE:
This makes the assembler case sensitive if turned off. This only affects
label- and macron ames. Notice: no effects are visible in the editor.
If this is turned off, labels like Print (some printing routine) and prInt
(initialize the printer) are completely different labels. Be aware of the fact
that using this kind of labels can be very confusing later on, when you have
to re-read some old code or someone else has to maintain your code.
* MAIN INSTALL:
This affects the general setting for Konpass. For more info see chapter 10.
3.2.2 Options menu
In this menu, accessible using [F3] you'll find some options that are very
useful when editing a source.
* SHOW ERRORS:
If during assembling errors are encountered all these errors are placed in a
single error list. This option displays the errorlist and enables you to select
an error. When you press [SPACE] the editor will be placed on the line number
containing the error.
If the line number doesn't exist anymore a beep will be heard and the error
list will stay activated. The error list stays in memory until you assemble
the source again, start the program or do some disk operations.
If you press [ESC] you go back to the editor, when needed you can return to
the error list as often as you want. When inserting and removing lines in the
editor, the line numbers in the error list will be adjusted automatically. You
can find an overview of all the possible errors and their meaning in Appendix
B.
* SHOW LABELS:
When you assemble a source all the label names and their values will be
placed in the label list. When displaying this list using the SHOW LABELS
option, all labels will be displayed in alphabetical sequence. Use the
cursor keys to scroll through the labels. If you press [SPACE] you will jump
to to linenumber where the label is defined.
* SEARCH/REPLACE:
Use this to search for certain words and if necessary to replace them by other
words. [CTRL] + [Z] is the most easy way to reach this option. When activated
you will be asked for the string to search for. This field will contain the
value of the previous search.
When [ENTER] is pressed you can, if needed, type the replacement string. Leave
this field empty if no replacement is needed. Searching forward or backward is
possible. Case sensitivity can be altered. When the search is started there
are two possibilities. If the string is found then the cursor will go to the
line where the string is found. Otherwise the error message "String not
found!" will appear. Use SEARCH NEXT to find the next occurrence of the
string.
* SEARCH NEXT:
If you didn't get an error message you can start a new search/replace for the
same string. The shortcut is [CTRL] + [N].
* JUMP TO LINE:
Allows you to jump to a given line. After selecting this option a window will
appear, allowing you to enter the line number. When [RET] is pressed the
cursor is immediately placed on this line. The cursor will be placed on the
last line of the source if the linenumber doesn't exist.
* DELETE SOURCE:
This removes the source in the current source buffer. This option will ask
for confirmation. After you have confirmed the source will be gone and there
will be no way to recover it! So make sure you have saved the source if you
think that you'll need it again!
3.2.3 Assemble menu
You'll find everything you need to assemble your source in this menu,
accessible using [F4].
* ASSEMBLE:
Activate this to assemble the source in the current source buffer. Assembling
in Konpass is a so-called two-pass-assembling. First the entire source is
evaluated to find the values of all the labels and in a second pass the source
is assembled to memory.
Errors will be shown after the first, respectively second, pass. If an error
is found in the first pass, the assembler will not start the second pass. Use
the ERROR menu to locate the errors in the source, see chapter 3.2.2 and
Appendix B. If all went well the begin and end address will be shown.
* ASSEMBLE TO DISK:
Where the first option assembles to memory, with the possibility to change the
destination on the fly with the ORG directive, this option just writes the
bytes generated during assembling sequentially to a file. You can choose where
and with which name the source has to be assembled. The option save and load
are replaced by assemble. Use this option to start the actual assembling.
Assembling directly to disk enables you to write programs that are able to
reallocate themselves on execution. For example:
start equ #8000
org #0100
ld hl,program ;move program
ld de,start
ld bc,programend-start
ldir
jp start
program
org start
... ;reallocateable program comes here
programend
* ASSEMBLE TO TSR:
Assemble your source directly to a Terminate and Stay Resident program, to be
used with MemMan.
In this case assembling will take place in three passes. The actual code will
be written to disk during the third pass. For more info on TSR's we suggest
that you get a copy of the TSR development kit of MST. See chapter 13 for more
info on the .TSRHOOKS directive, needed for assembling a TSR.
* ASSEMBLE TO RELOCATEABLE:
This will compile the code into a relocateable file format. This file format
can be placed anywhere in memory or glued together with other programs using
a linker.
This can be very useful if you have a greater project. You can split your
source in different small modules. If you make a modification to one of these
modules, only this small module has to be reassembled instead of the entire
source.
For the moment it is still necessary to use an external linker program.
NOTE: when the disk menu is entered via "Assemble to disk/TSR/REL",
the keyboard shortcut [CTRL] + [X] is available to trigger the assembly
process as if the "Assemble" option had been selected.
* REGISTERS:
This option is used to alter the registers of the Z80/R800 before you use the
GO option to execute a program. The contents of the registers when the program
is finished are also stored so that you can use this option to examine to
values after excution.
For more info on how to change the values, see the chapter about the
disassembler; this window uses the same techniques as discussed there. For a
more thorough examination of the code as it is processed by the MSX, you
would be better off with the debugger itself.
* GO:
Use this to execute a program somewhere in memory. It uses the
register/interrupt settings as set with the REGISTERS menu. When activated
you will be asked for an address to 'call to'. Before the code is actually
executed the screen is placed in regular 24 line screen 0 mode and cleared.
When the program returns Konpass will reinitialize the VDP in 'Konpass mode'.
Be aware: your MSX may crash if the program to run is not stable! So make sure
you have saved the source before trying this option!
3.2.4 Block menu
You'll find all available block functions of the editor in this menu,
reachable by pressing F5. You can select only one block in one of the four
source buffers at the same time. Whether a block is selected or not is
displayed at the function bar: the number of the source buffer in which the
block is selected is displayed here.
You can recognize a selected block by its coloured borders: the first and last
position on these selected lines will have the colour of the menu bar.
* START BLOCK:
To select a desired block, you'll need to mark the begin and the end of the
block. Use this option to mark the begin when you're on the desired line.
* END BLOCK:
Use this option to mark the end when you're on the desired line.
* REMOVE BLOCK:
Use this option to deselect a selected block. The text itself is not removed,
only the begin and end marks!
* COPY BLOCK:
You can copy the selected block with this option to the line you're on. The
original block is not removed. Of course you can't copy a block to somewhere
in the selected block. You can also copy between different source buffers
with this option. You can copy the selected block as many times as your amount
of memory will allow you.
* MOVE BLOCK:
You can move the selected block with this option to the line you're on. The
original block is deleted. Of course you can't move a block to somewhere in
the selected block. You can also move text between different source buffers
with this option.
* DELETE BLOCK:
Use this option to delete the selected block. Be careful, because a deleted
block can't be restored!
* PRINT BLOCK:
The selected block will be sent to the printer. If your printer is not ready,
an error message will appear.
* COPY LABEL:
To use this option you should have selected a block beginning with a label. If
you activate this option the label will be copied to the cursor's current
position.
3.3 Special commands
The Konpass assembler contains a lot of extra commands for several purposes:
3.3.1 Exceptions
In addition to all standard Zilog/Mostek mnemonics some other mnemonics are
allowed:
PUSH reg1,reg2,reg3,... ;this is assembled as separate PUSH instructions
POP reg1,reg2,reg3,... ;this is assembled as separate POP instructions
EX AF,AF ;this is supported because of compatibility with other assemblers
EX AF,AF' ;standard Zilog mnemonic
LD A,"" ;the same as LD A,0
LD HL,"KL" ;the same as LD HL,#4B4C
LD B ;the same as LD A,B This works for all mnemonics with register A
DJNZ $-2 ;dollarsign is equal to the current address
LD A,%11 01 11 10 ;spaces are allowed between binary digits
The following is not allowed:
LD A,""" ;this should be done with LD A,'"'
LD A,char ;only character with an ASCII code below 128 are allowed
3.3.2 The R800 processor
A Turbo-R is equipped with a R800 processor in addition to the Z80. Almost all
mnemonics on this R800 were renamed, but the opcodes have remained. Konpass
only recognizes the old Z80 mnemonics, but does recognize the new mnemonics of
the new instructions. You're allowed to use these new instructions on MSX2,
but they won't work on Z80.
There are four new 8-bit instructions for multiplication. HL contains the
16bit result:
MULUB A,B ;opcode: ED C1
MULUB A,C ;opcode: ED CD
MULUB A,D ;opcode: ED D5
MULUB A,E ;opcode: ED DD
There are two new 16-bit instructions for multiplication. DE-HL contains the
32bit result:
MULUW HL,BC ;opcode: ED C3
MULUW HL,SP ;opcode: ED F3
There is a new instruction to read a port to the flags register. Only S and Z
are set according to the incoming data. H, N and P/V are reset.
IN F,(C) ;opcode: ED 70
Using half index registers on R800 is possible. These instructions were also
available on Z80, but not officially. They are called IXh, IXl, IYh, IYl.
3.3.3 Assembler directives
These are special commands needed for correct assembling, also called
pseudo-instructions.
ORG
Syntax: ORG address
With ORG you can select on which address the program must be compiled. That's
why you have to put in at the beginning of a program. If no ORG directive is
used, the program will be assembled at address #0100.
EQU (equals)
Syntax: label EQU value
Use this to define your constants.
Example: CHGET EQU #009F
END (End of assembly)
Syntax: END
Use this directive to indicate that assembling must be terminated here.
There's no need to put this directives at the end of your source. It's only
useful to stop assembling somewhere in the middle of source, for instance
when not all labels are defined yet and you want to compile the first part of
your source.
DEFB / DB (Define Byte)
Syntax: DB value,value,text,...
Use this directive to poke some 8bit values or text in your code.
Example: DB "This is great!",0
You can use numerical operations on the last character in a string:
Example: DB "This too!"+128 ;bit 7 of the last character (!) is set
DEFM / DM
Is exactly the same as DB. This directive was built in for compatibily.
DEFC / DC
Syntax: DEFC string
Is the same as DB, but bit 7 of the last character in the string is set.
Useful to recognize the end of a textfield in memory.
Example: DC "Hallo" ;bit 7 of the 'o' is set
Also numerical operations on the last character are allowed.
Example: DC "TNI"-2 ;same as "TNG" with bit 7 of G set.
DEFS / DS (Define Storage)
Syntax: DS number of bytes [,byte to fill with]
With this directive you can create empty memory areas in your program. Useful
for buffers, etc. If the 'byte to fill with' is omitted, the area will be
filled with zero.
Example: DS 100,"C" ;area with 100 bytes "C"
DS 4*20,13 ;area with 80 bytes #0D
DEFW / DW (Define Word)
Syntax: DW 16bitvalue,16bitvalue,...
Same as DB, but DW puts 16bit values in your code.
Example: DW #babe,label,20*5
TSRHOOKS
Syntax: TSRHOOKS
You'll need to put this directive in front of the hooks used by your TSR (at
the end of your TSR). For more info, see chapter 13.
.LABEL
Syntax: .LABEL length
You can tell the assembler how long the used labels can be in your source. So
you won't need to change this setting in the CONFIGURATION menu when you work
with several label lenghts. Of course this directive has to be placed at the
beginning of your source.
.UPPER
Syntax: .UPPER on/off
You can tell the assembler whether all text should be uppercased or not before
assembling starts. So you won't need to change this setting in the
CONFIGURATION menu when you work with several types of casing. Remark: your
source itself will not change to uppercased characters.
BREAKP
Syntax: BREAKP
If the assembler encounters this directive, the current address will be parsed
to the Debugger's breakpointtable. Easy to debug your own source. Remark: Your
previous breakpoint settings will be erased.
INCLUDE
Syntax: INCLUDE buffer[,filename]
This directive gives you the possibility to add external sources to your
current source. This other source should be in source buffer 'buffer'. If you
also enter a filename, the source will be loaded first in source buffer
'buffer'.
MACRO / ENDM / DEFL
These directives are necessary for working with macros. See chapter 11.
IF / COND /ELSE / ENDIF / ENDC
These directives are necessary for working with conditional assembly. See
chapter 12.
CSEG / DSEG / ASEG / PUBLIC / EXTRN / .PHASE / .DEPHASE
These directives are necessary for working with Relocateable files. See
chapter 14.
4. Monitor
----------
After you have chosen the option Monitor from the system menu you will be
faced with a new screen layout indicating that you have entered the monitor.
This monitor is completely real-time, meaning that the information on screen
is updated constantly to reflected possible changes in the memory as they
occur. Since this enables you to keep track of which bytes are changed in
memory this is a perfect way to get an understanding/insight of what a program
does or why a certain error occurs in your program.
4.1 Monitor screen and controls
The monitor screens is made up by a status bar, a menu bar and the desktop.
The menu bar has three different menus, respectively the SYSTEM menu, the
CONFIGURATION menu and finally the OPTIONS menu. Below the menu bar the
desktop can be found, which consist of, on the left side a hexadecimal dump
and on the right side, an ASCII dump.
The monitor supports the mouse and most of the functions can be activated
using shortcuts. For a list of the shortcuts refer to appendix A. You can
use the cursor keys to scroll trough the monitor. When you're using the
monitor you can alternate between the ASCII and hexadecimal dump by pressing
[TAB].
In the hexadecimal layout you can alter the value of the currently selected
address by pressing one of the number keys [0] to [9] and the [A]-[F] keys.
The pressed key will be displayed and the program will wait for the rest of
the number to be entered. At this point you can press [ESC] if you didn't
want to change the value. In this case the old value will be restored. If you
have entered just one key so far and press the cursor keys then the value
stored in the address will be changed with the just pressed figure and
afterwards the cursor movement will be processed. If you entered a second
digit the new value will be stored and the cursor will continue to the next
address.
In the ASCII layout you can change the current character be pressing any key.
The value will be altered to the key value you've pressed and the cursor will
automatically move to the next position. If you use the [BS] key then the
current address will be set to zero and the cursor will be moved to the
previous address.
By pressing the [SELECT] key you can rapidly switch between the monitor and
debugger, making it possible to quickly adapt values or keep track of larger
memory blocks when debugging. For the other available shortcuts, please have
a look at appendix A.
4.2 The monitor menus
The menu bar in the monitor contains 3 different menus:
System : see chapter 2.3
Configuration : see chapter 4.2.1
Options : see chapter 4.2.2
4.2.1 Configuration menu
A number of settings which are applicable to the monitor can be set in this
menu, which you can reach by pressing [F2].
* ADDRESS:
Use this option to set the current address which you'ld like to monitor. When
selected a popup window appears so you can enter an address. This address
can be explicit like #F3DE or 32894 but you can also use labels or calculate
an address on the fly like label+4*7. You can leave this window by pressing
[ESC] if you didn't want to change the address.
* CPU:
If you're running Konpass on a Turbo-R you can use this option to switch
between CPU mode: Z80, R800 ROM and R800 DRAM mode. Of course only Z80 mode