"Move R4 to R3" is clearly a poor, misleading comment. It should be "Copy
R4 to R3" 😉
Used to write a lot of assembler in both mainframe days and MS-DOS.
Would comment code like this:
; -------------------------------------------------------------------
; bdi_rcv - process received character interrupt
;
; entry: dx = io_base
; -------------------------------------------------------------------
bdi_rcv proc near
in al, dx ; Get the character
push ds ; save the DS register
lds bx, cs:rcv_bufint ; ds:bx -> next rcv byte
mov byte ptr [bx], al ; save the char
pop ds ; restore ds
inc bx ; bx -> next position
cmp bx, cs:rcv_bufsiz ; q. end of buffer?
jne bdi_rcv10 ; a. no .. continue
xor bx, bx ; .. else .. reset pointer
bdi_rcv10: cmp bx, cs:rcv_bufget ; q. overrun?
jne bdi_rcv90 ; a. no .. save ptr & leave
mov cs:rcv_ovfl,1 ; show an overrun occurred
ret ; .. and return to caller
bdi_rcv90: mov cs:rcv_bufput, bx ; save buffer pointer
ret
Learned the q: a: format while writing on mainframes. Answers the what and
why in most cases.
Bob
On Thu, Apr 30, 2020 at 12:34 PM Paul Gilmartin <
[email protected]> wrote:
> > On 2020-04-30, at 10:17:03, Phil Smith III wrote:
> >
> > Seymour J Metz wrote:
> >
> >> I can already figure out that the instruction will be executed; tell me
> >> *why* in the comment. How does it fit in the broader scheme of things?
> >> Where are the EX instructions and what is the significance of the
> >> lengths that they use?
> >
> I was quite frustrated when I had to modify some
> well-parameterized but adversely commented code
> (actually FOSS output from PL/S) which resembled:
>
> NROWS DC H'16'
> where I wanted to change NROWS, but I stumbled onto:
>
> MH R2,NROWS Multiply by 16
>
> Grrr. The code was parameterized, the comment wasn't.
>
> -- gil
>