The assigned GOTO merely transfers control. The longjmp() not only transfers control, but attempts to put other parts of the execution context into place such as the stack pointer, the local variables, and other elements of the context.
PIE1:TXIE = 0 because we're not using interrupts.PIR1:TXIF = 1 because the initial state of the interface is idle.
TXREG needs no initialization.
TXSTA:TX9 = 1 because 8 bits plus parity is 9 bits.
TXSTA:TXEN = 1 so assignment to TXREG will start transmitter.
TXSTA:TRMT = 0 because the hardware queue is initially empty.
TXSTA:TX9D needs no initialization)TXIF and TRMT probably need no initialization in software because they are status bits reporting on hardware state information.
Part B: Write high level pseudocode for a function, TXPUTC, that outputs one character to the asynchronous serial port, using polling, transmitting 8-bits with mark parity.
TXPUTC( ch ) -- polling loop awaiting ready to transmit while PIR1:TXIF = 0 do nothing -- set parity bit appropriately TXSTA:TX9D = 1 -- send out data TXREG = ch done!