Ypsilon.Emulation.Processor.YCPU.DisassembleXSG C# (CSharp) Method

DisassembleXSG() private method

private DisassembleXSG ( string name, ushort operand, ushort nextword, ushort address, bool showMemoryContents, ushort &instructionSize ) : string
name string
operand ushort
nextword ushort
address ushort
showMemoryContents bool
instructionSize ushort
return string
        private string DisassembleXSG(string name, ushort operand, ushort nextword, ushort address, bool showMemoryContents, out ushort instructionSize)
        {
            instructionSize = 2;
            bool push = (operand & 0x0100) != 0;
            int register = (operand & 0x0E00) >> 9;
            bool user = (operand & 0x8000) != 0;
            name = push ? "SSG" : "LSG";
            string reg;
            switch ((SegmentIndex)register) {
                case SegmentIndex.CS:
                    reg = user ? "CSU" : "CSS";
                    break;
                case SegmentIndex.DS:
                    reg = user ? "DSU" : "DSS";
                    break;
                case SegmentIndex.ES:
                    reg = user ? "ESU" : "ESS";
                    break;
                case SegmentIndex.SS:
                    reg = user ? "SSU" : "SSS";
                    break;
                case SegmentIndex.IS:
                    reg = user ? "???" : "IS";
                    break;
                default:
                    // operand does not include a valid segment index.
                    reg = "???";
                    break;
            }
            return $"{name,-8}{reg}";
        }