Assembly 如何使用命令提示符将文本文件(保存程序)组装到机器代码文件中?
下面的程序有效。然而,我需要将其转换为机器代码文件,为此,我尝试使用命令“jasm-apolled io.txt”。然而,这一点没有得到承认。我相信这可能是因为这个命令不是最新的(或者我错过了一些东西)。为了做到这一点,我希望能采取一些直接的步骤。提前谢谢 汇编代码->汇编程序->机器代码 该文本文件称为“polled io.txt” 该程序从键盘上读取10个字符,输入后将其全部打印出来。 下面是里面的内容:Assembly 如何使用命令提示符将文本文件(保存程序)组装到机器代码文件中?,assembly,system,command-prompt,cpu-architecture,machine-code,Assembly,System,Command Prompt,Cpu Architecture,Machine Code,下面的程序有效。然而,我需要将其转换为机器代码文件,为此,我尝试使用命令“jasm-apolled io.txt”。然而,这一点没有得到承认。我相信这可能是因为这个命令不是最新的(或者我错过了一些东西)。为了做到这一点,我希望能采取一些直接的步骤。提前谢谢 汇编代码->汇编程序->机器代码 该文本文件称为“polled io.txt” 该程序从键盘上读取10个字符,输入后将其全部打印出来。 下面是里面的内容: OSR EQU $E3 * Outp
OSR EQU $E3 * Output Status Register (OSR)
ODR EQU $E2 * Output Data Register (ODR)
ISR EQU $E1 * Input Status Register (ISR)
IDR EQU $E0 * Input Data Register (IDR)
ORG 0
MOVE #$00,B * count is storage for our
MOVE B,count * counter value
loop MOVE ISR,A * Get ISR
CMP #$00,A * is a char available?
BEQ loop * no - wait some more
MOVE IDR,A * read the char
MOVE count,B * the address to write the
ADD #data,B * value to is count+data
MOVE A,(B) * write the char in there
MOVE count,B * add 1 to count
ADD #$01,B *
CMP #$0A,B * and see if we have reached 10
BEQ gotchars * and move to next section if we have
MOVE B,count * otherwise write count back
JMP loop * and get another char
gotchars MOVE #$00,B * count is storage for our
MOVE B,count * counter value
write MOVE OSR,A * get OSR
CMP #$00,A * OSR 1 can print, OSR 0 can't print
BEQ write * not yet, wait some more
MOVE count,B * the address to read the
ADD #data,B * value from is count+data
MOVE (B),A * get the char in there
MOVE A,ODR * print the char
MOVE count,B * add 1 to count
ADD #$01,B *
CMP #$0A,B * and see if we have reached 10
BEQ done * and move to end if we have
MOVE B,count * otherwise write count back
JMP write * and write another char
done HALT * done
count DS.W $01 * the counter
data DS.W $0A * storage for our 10 characters
您是否安装了jasm?你使用的是什么操作系统?你知道你不能在普通的台式机/笔记本电脑上运行它,对吗?不管这是什么,它都必须在模拟器中。嗨,我是Windows10家庭版的。我不确定我是否安装了Jasm,尽管我有jasper。Peter Cordes,我明白你说的。书中没有告诉我,我从来不知道。如果有机会,你能澄清一下步骤吗?