.TITLE MAPLIB .IDENT /V01.01/ .ENABL LC ; Enable lower case .NLIST BEX ; Don't list binary extensions .PAGE .SBTTL Macro Calls and Definitions .MCALL CRRG$S ; Create region .MCALL CRAW$S ; Create address window .MCALL DIR$ ; Execute directive .MCALL EXIT$S ; Exit to RSX .MCALL MAP$ ; Map a region .MCALL RDBBK$ ; Region definition block .MCALL WDBBK$ ; Window definition block .PAGE .SBTTL .SBTTL Data .SBTTL .PSECT MACIMP, RW, D .SBTTL Region and Window Definition Blocks RGBUF: RDBBK$ 1336,,,,177700 WIBUF: WDBBK$ 7,136,,,136, .PAGE .SBTTL Directive Parameter Blocks REMAP: MAP$ WIBUF .PAGE .SBTTL Tables OFFTAB: .WORD 0, 136, 274, 432, 570, 726, 1064, 1176, 1305 .PAGE .SBTTL Strings and Text S1: .ASCII /Failed to create mapping region, $DSW = / S1A: .ASCII /??? octal. Exiting./ S1L = . - S1 S2: .ASCII /Failed to create the address window, $DSW = / S2A: .ASCII /??? octal. Exiting./ S2L = . - S2 S3: .ASCII /Region mapping error, $DSW = / S3A: .ASCII /??? octal. Exiting./ S3L = . - S3 .EVEN .PAGE .SBTTL Variables MAPNUM: .WORD 0 .PAGE .SBTTL .SBTTL Code .SBTTL .SBTTL MAPSET .PSECT MAPSET, RO, I ; Attempt to create the mapping region MAPSET::CRRG$S #RGBUF BCC 1$ MOV #S1A, R0 ; Load output field address in R0 MOVB $DSW, R1 ; Load directive status word in R1 MOV PC, R2 ; No zero suppression CALL $CBTMG ; Convert byte to octal magnitude MOV #S1, TTYOUT+Q.IOPL ; Load output string address in QIO DPB MOV #S1L, TTYOUT+Q.IOPL+2 ; Load output string length in QIO DPB DIR$ #TTYOUT ; Print it on the terminal EXIT$S ; And exit to RSX ; Created the mapping region; attempt to create the mapping window 1$: MOV RGBUF+R.GID, WIBUF+W.NRID CRAW$S #WIBUF BCC 2$ MOV #S2A, R0 ; Load output field address in R0 MOVB $DSW, R1 ; Load directive status word in R1 MOV PC, R2 ; No zero suppression CALL $CBTMG ; Convert byte to octal magnitude MOV #S2, TTYOUT+Q.IOPL MOV #S2L, TTYOUT+Q.IOPL+2 DIR$ #TTYOUT EXIT$S 2$: RETURN .PAGE .SBTTL MAP .PSECT MAP, RO, I MAP:: MOV @2(R5), R0 CMP R0, MAPNUM BEQ 1$ MOV R0, MAPNUM DEC R0 ASL R0 MOV OFFTAB(R0), R0 MOV R0, WIBUF+W.NOFF DIR$ #REMAP BCC 1$ MOV #S3A, R0 ; Load output field address in R0 MOVB $DSW, R1 ; Load directive status word in R1 MOV PC, R2 ; No zero suppression CALL $CBTMG ; Convert byte to octal magnitude MOV #S3, TTYOUT+Q.IOPL MOV #S3L, TTYOUT+Q.IOPL+2 DIR$ #TTYOUT EXIT$S 1$: RETURN .END