Looks to me like SEROUT2 or DEBUG with the SDEC modifier become the preferred serial output modes. They both allow modifiers like DEC and SDEC which plain SEROUT does not. They are also 'self contained' instructions and do not need any interrupt bit clearing like HSERIN/OUT requires.
Division is still an issue and whether the minus sign is just a convenience for human readers or can actually be used within a PBP calculation is still untested.
This code,
LongTest:
'Mult & Div
lw = 1234
lx = 4321
ly = LX * lw
lz = lx/lw
debug $0D, $0A, "Multiply & Divide A, B, (A*B), (A/B)", $0D, $0A
debug "Debug DEC ", dec lw, ",", dec lx, ", ", dec ly, ", ", dec lz , $0D, $0A
serout2 tx232, 84, [ "Serout2 DEC ", dec lw, ",", dec lx, ",", dec ly, ",", dec lz, $0D, $0A ]
debug "Debug SDEC ", sdec lw, ",", sdec lx, ", ", sdec ly, ", ", sdec lz , $0D, $0A
serout2 tx232, 84, [ "Serout2 SDEC ", sdec lw, ",", sdec lx, ",", sdec ly, ",", sdec lz, $0D, $0A ]
' Serout tx232, 2, ["Serout version ", dec lw, ",", dec lx, ",", dec ly, ",", dec lz, $0D, $0A ]
'Add & Subtr
lw = 65534
lx = 66000
ly = lw + lx
lz = lw - lx
debug $0D, $0A, "Add & Subtract A, B, (A+B), (A-B)" , $0D, $0A
debug "Debug DEC ", dec lw, ",", dec lx, ",", dec ly, ",", dec lz , $0D, $0A
serout2 tx232, 84, [ "Serout2 DEC ", dec lw, ",", dec lx, ",", dec ly, ",", dec lz, $0D, $0A ]
debug "Debug SDEC ", sdec lw, ",", sdec lx, ",", sdec ly, ",", sdec lz , $0D, $0A
serout2 tx232, 84, [ "Serout2 SDEC ", sdec lw, ",", sdec lx, ",", sdec ly, ",", sdec lz, $0D, $0A ]
' Serout tx232, 2, ["Serout version ", dec lw, ",", dec lx, ",", dec ly, ",", dec lz, $0D, $0A ]
Gives these results
Multiply & Divide A, B, (A*B), (A/B)
Debug DEC 1234,4321, 5332114, 3
Serout2 DEC 1234,4321,5332114,3
Debug SDEC 1234,4321, 5332114, 3
Serout2 SDEC 1234,4321,5332114,3
Add & Subtract A, B, (A+B), (A-B)
Debug DEC 65534,66000,131534,4294966830
Serout2 DEC 65534,66000,131534,4294966830
Debug SDEC 65534,66000,131534,-466
Serout2 SDEC 65534,66000,131534,-466
Bookmarks