And if we are at it, here are real *BUGS* !!!
First a test progam "compbug.asm" to show the problem.
It compares the correct "LEQ" with the buggy "GTR" Macro.
===== 8< =====
maclib compbug
bdos equ 0005h
arg1 equ 005dh
arg2 equ 006dh
org 100h
mvi e,'1'
lda arg1
leq ,arg2,xleqa
dcr e
xleqa:
mvi d,'0'
lda arg1
gtr ,arg2,xgtra
inr d
xgtra:
xchg
shld msg1
mvi c,9
lxi d,msg1
call 5
ret
msg1: ds 2
db 0dh,0ah,'$'
===== 8< =====
MAC SELECT construct by Mr. Emmanuel ROCHE, France
--------------------
So, I made another search among the files of my Internet computer,and found a ZIP file containing the MAC macros.
I think that I am a little bit knowledgeable about CP/M and its utilities,but I have never heard of this bug.
MAC Section 9.3 errata
----------------------
Page 117, second paragraph from the bottom of the page:
"Upon encountering [THE] an ENDW statement in the source program, ..."
Page 123, third paragraph from the bottom of the page:
(...) the CR-LF on each i[N]teration, ..."
Page 128, bottom of SELECT macro:
select var
selnext ;; Automatically select case 0
ENDM
Page 134, bottom of Figure 51:the 3 listings of Figure 50 will no longer correspond with the ones of the MAC manual.
WRITE <so I^'^'m going back^!>
Of course, if you use SELECT with the SELNEXT line,
mac compbug.aaaCP/M MACRO ASSEM 2.0
load compbug
compbug 2 100
compbug 2 210
compbug 2 311
Yours Sincerely,
Mr. Emmanuel Roche, France
The correct version of the macro *is* the newer one without the SELNEXT line.
"Martin" <this.is.usenet@so.its.invalid> wrote:
The correct version of the macro *is* the newer one without the SELNEXT line.
? The MAC manual was published in 1977, then revised in 1980. In both versions, we find the following remark:
"At the end of the redefined SELECT macro, SELNEXT is invoked automatically to delimit the first case in the SELECT group (otherwise SELECT would have to be followed immediately by SELNEXT in the user program to generate the proper labels)."
So, it seems quite surprising that nobody at DRI would have noticed that the SELNEXT line was... er, redundant?
Also, why would later versions of the WHEN library contain this line, while only one copy found so far (presumed to be the oldest one) contains it?
At least, the MAC manual documents this line.
(Regarding your bugs, tomorrow, I am busy. So, I will investigate them later. Also, it would be more logical to use the SIMPIO library. Macros exist to make more high level assembly language programs, so why not use them?)
Yours Sincerely,
Mr. Emmanuel Roche, France
fig51
...
4) As you may have seen, macros are funny. So, I have more questions.
- Anybody knows how to change WRITE so that it does not convert all the strings to upper case?
- Anybody has a working FOR-NEXT construct?
- Anybody has an IF-THEN-ELSE construct? (Since these are "keywords" of MAC, one way would be to use the French words SI-ALORS-SINON. The closing ENDIF would then be ENDSI.)
Anybody knows how to change WRITE so that it does not convert all the strings to upper case?
fig42
fig44
fig46
fig48
fig51
That's All, Folks!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 286 |
Nodes: | 16 (2 / 14) |
Uptime: | 90:48:29 |
Calls: | 6,496 |
Calls today: | 7 |
Files: | 12,100 |
Messages: | 5,277,686 |