private static string ConvertFileName(string fn) { ushort len = Str.GetLength(fn); Registers.SI = (ushort)(StringPtr.Get(fn) + 1); Registers.DI = (ushort)(StringPtr.Get(buffer) + 1); for (ushort i = 0; i < 11; i++) { new Inline("mov byte [cs:di], ' '"); Registers.DI++; } Registers.DI = (ushort)(StringPtr.Get(buffer) + 1); for (ushort i = 0; i < len; i++) { new Inline("mov al, [cs:si]"); Registers.AH = 0; Registers.SI++; char ch = (char)Registers.AX; if (ch == '.') { Registers.DI = (ushort)(StringPtr.Get(buffer) + 9); } else { new Inline("mov [cs:di], al"); Registers.DI++; } } return(buffer); }
public static ushort GetLength(string str1) { Registers.SI = StringPtr.Get(str1); new Inline("mov al, [si]"); new Inline("mov ah, 0"); return(Registers.AX); }
public static bool StartsWith(string str1, ushort str2ptr) { Registers.SI = StringPtr.Get(str1); new Inline("mov cl, [si]"); new Inline("mov ch, 0"); new Inline("inc si"); Registers.DI = str2ptr; new Inline("rep cmpsb"); return(Flags.E); }
public static void Write(string s) { Registers.SI = StringPtr.Get(s); new Inline("cs lodsb"); Registers.AH = 0; ushort len = Registers.AX; for (int i = 0; i < len; i++) { new Inline("cs lodsb"); Registers.AH = 0x0e; Registers.BX = 0; new Inline("int 0x10"); } }