繁体   English   中英

如何使用easy68K编辑器/汇编器以“横幅”格式显示字母?

[英]How to display out the letters in 'banner' format using easy68K editor/assembler?

基本上,我需要使用此数据语句,当我输入 A 时,屏幕上将显示“横幅”格式的“A”字母。 我需要使用 2 个嵌套的 for 循环来做到这一点。 还有,str下的data语句是不能改的,比如dc.b '#',13,10,0 那怎么办呢? 在此处输入图片说明

这是我的尝试。 完全公开,我从来没有使用过easy68k,只有VASM 来为Neo Geo 组装。 所以我不知道你的 print 和 getKey 函数是如何工作的。

banner:
CLR.L D0        ;we'll clear this now to avoid problems later.
JSR getKeyPress
;some function that waits until a key is pressed
;   and returns ascii code of keyboard press into lowest 8 bits of D0.
CMP.B #'Z',D0
BEQ EXIT
CMP.B #'A',D0
BCS banner  ;if less than 'A', ignore input and go back to start

    CMP.B #'F'+1,D0
    BCC banner  ;if greater than or equal to 'G', ignore input and go back to start

;if we've gotten here the key input must have been good.

;array dimensions are 10 by 7 for each letter.
;the 'challenge' is that you can't add labels or modify the array of ascii art.
;but since each letter has the same dimensions we don't need to!

SUB.B #'A',D0   ;subtract 0x41, this gives us our map of A = 0, B = 1, C = 2, etc.
MOVE.W #70,D1   ;7 rows times 10 columns
MULU D1,D0      ;this product still fits into 16 bits. So the bottom half of D0 is our offset into str for the desired letter.
LEA str,A0
LEA (A0,D0),A1


MOVE.W #7-1,D5  ;inner loop for DBRA
outerloop:
MOVE.W #10-1,D4 ;outer loop for DBRA
innerloop:
    MOVE.B (A1)+,D0
    JSR PRINTCHAR           ;some routine that prints D0 to the screen.
    DBRA D4,innerloop       ;repeat for all chars in text.

    MOVE.B #13,D0           
    JSR PRINTCHAR
    MOVE.B #10,D0
    JSR PRINTCHAR           ;new line
    
    DBRA D5,outerloop       ;repeat for each row in letter      


JMP banner

exit:


暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM