.ENABL LC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; EXCHANGE program, DEC RSX-11M implementation
; these are assembly language modules to play
; with bytes in various places
; note: these routines require that the FORTRAN common blocks were
; compiled as 2 byte integers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
       .TITLE  EXCMAC
       .IDENT  /NC/

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; module EXCHPA
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
       .PSECT  EXCHOC,RW,D,GBL,OVR
EXCHOC:        .BLKW   382.

       .PSECT
EXCHPA::

       MOV     2(R5),R4        ; CHARS
       MOV     4(R5),R3        ; OUTBUF
       MOV     EXCHOC+380.,R2  ; how many
       BLE     67$

10$:   MOVB    (R4)+,(R3)+     ; move it
       INC     R4              ; integer addresses jump by 2
       SOB     R2,10$          ; done?
67$:   RTS     PC
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; module EXCHUN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
       .PSECT  EXCHIC,RW,D,GBL,OVR
EXCHIC:        .BLKW   17.

       .PSECT
EXCHUN::

       MOV     2(R5),R4        ; INPBUF
       MOV     4(R5),R3        ; CHARS
       MOV     EXCHIC+16.,R2   ; how many
       BLE     77$

10$:   MOVB    (R4)+,(R3)+     ; move it
       CLRB    (R3)+           ; clear top half
       SOB     R2,10$          ; done?
77$:   RTS     PC
       .END
