使用intel2gas进行NASM到GAS翻译会产生MISMATCH错误

时间:2015-11-18 09:03:46

标签: assembly nasm gas

我已经使用nasm很长一段时间但是为了我们的最后一次练习,我们被要求将我们的一个练习转换为gas。我使用intel2gas将nasm文件转换为gas,但有些部分出现 MISMATCH错误。

.data
MISMATCH: "        prompt db 'Enter minimum: '"
        .equ         promptLen, $-prompt
MISMATCH: "        space db ' '"

.bss
MISMATCH: "        minTens resb 1"
MISMATCH: "        minOnes resb 1"
MISMATCH: "        min resw 1"
MISMATCH: "        count resw 1"
MISMATCH: "        i resw 1"

1 个答案:

答案 0 :(得分:1)

gas has a complete manual记录您可以使用的所有汇编程序指令。例如<{1}}或public class Program { public delegate void NewLineCallback(string lineContent); public static void NewLineReceived(string lineContent) { if (lineContent != null) { Console.WriteLine("New line has been read from the file. Number of chars: {0}. Timestamp: {1}", lineContent.Length, DateTime.Now.ToString("yyyyMMdd-HHmmss.fff")); } else { Console.WriteLine("All the file content have been read. Timestamp: {0}", DateTime.Now.ToString("yyyyMMdd-HHmmss.fff")); } } public static async void ReadFile(NewLineCallback newLineCallback) { StreamReader fileInputStreamReader = new StreamReader(File.OpenRead("c:\\temp\\mytemptextfile.txt")); string newLine; do { newLine = await fileInputStreamReader.ReadLineAsync(); newLineCallback(newLine); } while (newLine != null); } public static void Main(string[] args) { ReadFile(NewLineReceived); Console.ReadLine(); // To wait for the IO operation to complete. } } 用于以空字符结尾(或非字符串)字符串。

正如迈克尔在评论中所说,使用.asciz,又名.ascii来保留BSS空间。 the bss section上的.space手册部分说明了这一点。