********************************************************* * * * Program to reverse the order of transmission * * of ROW and COLUMN following the sequence ESC * * =. Patches itself into the jump table in the * * bios and patches the conout addr that was in * * jump table into this routine. * * (e.g. if the jump at 0 is to D603 (warm boot) * * then patches D60Ch to be a jump * * to this routine. Assemble this routine below * * the BDOS or CCP as desired. Patch something to * * jump into this routine. * * * * BY RONALD E. JACOBS October 21, 1983 * * * ********************************************************* ORG 09400h FALSE EQU 0 TRUE EQU 0FFh lda 2 ;high byte of base of bios mov h,a mvi l,0Dh ;hl points to conout jump in bios mov a,m ;patch conout addr in for calls and jumps sta conout+1 ;below inr l ;next byte mov a,m ;second byte of address sta conout+2 ;local console output vector dcr l ;hl points to conout in bios jump table lxi d,start mov a,e mov m,a ;patch conout jump to this program mov a,d ;store in XXODh inr l ;next byte mov m,a ;store in XX0Eh lhld 6 ;first 3 bytes of PAC MAN- in which a jump jmp 103h ;was placed to this routine (9400h) start: lda char1 ;has an ESC already been received ? cpi TRUE jz test2 ;if yes go to next test test1: mvi a,1Bh ;1Bh is ESC cmp c ;is this character an ESC ? jnz conout mvi a,TRUE sta char1 ;char1 indicates first character was ESC jmp conout ;send the ESC to terminal test2: lda char2 ;has an '=' already been received ? cpi TRUE jz test3 ;if yes go to next test mvi a,'=' cmp c ;is this character an '=' ? jnz notit mvi a,TRUE sta char2 ;char2 indicates first character was '=' jmp conout ;send the '=' to the terminal notit: mvi a,FALSE ;first char. was ESC but 2nd wasn't '=' sta char1 ;reset 1st character flag jmp conout ;send whatever character this is test3: lda char3 ;has char. following ESC = been received yet ? cpi TRUE jz output ;if yes go to routine to send characters,etc mvi a,TRUE sta char3 ;now the third character has been received mov a,c sta row ;save this char for xmit after next char rec'd ret ;return to program that called conout output: mvi a,FALSE ;reset all the flags sta char1 sta char2 sta char3 call CONOUT lda row ;get second character mov c,a ;ready to call conout CONOUT: jmp 0000 ;dummy bytes- addr patched by routine above CHAR1: DB 0 CHAR2: DB 0 CHAR3: DB 0 ROW: DS 1 END