我对组装很陌生,我正在尝试构建一个小程序。我不知道如何使用 Easy68k 在汇编中插入换行符。例如,我开始编写基本的黑杰克模拟器,我需要在问候第一个玩家后进行换行。我尝试将“\n”合并到变量声明中,但它只是打印出来,好像它是文本的一部分。
根据 Easy 68K Help I/O 部分,我可以使用“LF EQU $0A New line (line feed)”,但我不知道如何实现。
START ORG $400 ; Start of program area
CLR.L D0 ; Clear D0
CLR.L D1 ; Clear D1
CLR.L D2 ; Clear D2
CLR.L D3 ; Clear D3
CLR.L D4 ; Clear D4
CLR.L D5 ; Clear D5
CLR.L D6 ; Clear D6
MOVE.L playerTotal, D2 ; Store Player total in D1
MOVE.L card, D3 ; Store current card in D2
MOVE.B playerAce, D4 ; Store number of aces player has in D3
MOVE #14, D0
LEA playerGreeting, A1 ; Load Player Greeting in A1
TRAP #15 ; Display Player Greeting
* insert line break
STOP #$2700 ; Stop execution
ORG $1000 ;Start of data area
playerTotal DS.L 1 ; Save 1 byte of memory for playerTotal
dealerTotal DS.L 1 ; Save 1 byte of memory for dealerTotal
card DC.L 5 ; Save 1 byte of memory for card dealt
keepPlaying DS.B 1 ; Save 1 byte of memory for Play again value
playerAce DS.B 1 ; Save 1 byte of memory to track player Aces
playerGreeting DC.B 'Hello Player 1!', 0 ; Message
LF EQU $0A
END START ; End of program and entry point