声明常量字符串.DB字符串 [英] Declaration of constant strings .DB string

查看:100
本文介绍了声明常量字符串.DB字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



Hallo,

start:

mov ax, .title_msg
	mov bx, .footer_msg
	mov cx, 10011111b	; Colour
	
	call os_draw_background

	mov si, .message

	call os_print_string
	
	.message	db 'Hallo en welkom to pirom cloud server', 0
	
	.title_msg	db 'Pirom could Setup Systeem', 0
	.footer_msg	db 'Setup ...', 0





现在我想尝试打印一个字符串whit db arry





Now i wanne try do print a string whit db arry

      ;print the instructions
pmsg:   mov dl,16               ;col
        mov dh,6                ;row
        xor cl,cl
        mov si,intro            ;message pointer


 ;line length (including 0), Message, 0
intro:  db 16,'Deep Sea Fisher',0
        db 1,0
        db 39,'Catch a fish and reel it in for points',0
        db 49,'The deeper the fish, the more points it is worth',0
        db 43,'If a fish hits your line, you loose a hook',0
        db 45,'When you run out of hooks, the game is over!',0
        db 1,0
        db 45,'Up arrow raises hook, Down arrow lowers hook',0
        db 35,'Press Esc at any time to quit game',0
        db 1,0
        db 20,'Press Enter to start',0
es      db 0







但我收到错误:





test.asm:10:错误:符号`start.title_msg'undefined

test.asm:11:错误:符号`start.footer_msg'undefined



我尝试了什么:



代码现在是:



但页面黑色






but i get the error :


test.asm:10: error: symbol `start.title_msg' undefined
test.asm:11: error: symbol `start.footer_msg' undefined

What I have tried:

the code is now :

but the page black

;------------------------------------------------------
; Install screens 1 
;------------------------------------------------------
	BITS 16
	ORG 32768
	%INCLUDE "pirom_dev.inc"


pmsg:   mov dl,16               ;col
        mov dh,6                ;row
        xor cl,cl
        mov si,intro            ;message pointer
.loop   cmp cl,11    



start:
mov ax, .title_msg
	mov bx, .footer_msg
	mov cx, 10011111b	; Colour
	

	call os_draw_background
           ;number of lines in message
	
	
	
	
	.title_msg	db 'Pirom could Setup Systeem', 0
	.footer_msg	db 'Setup ...', 0




intro:  db 16,'Deep Sea Fisher',0
        db 1,0
        db 39,'Catch a fish and reel it in for points',0
        db 49,'The deeper the fish, the more points it is worth',0
        db 43,'If a fish hits your line, you loose a hook',0
        db 45,'When you run out of hooks, the game is over!',0
        db 1,0
        db 45,'Up arrow raises hook, Down arrow lowers hook',0
        db 35,'Press Esc at any time to quit game',0
        db 1,0
        db 20,'Press Enter to start',0
es      db 0

推荐答案

你正在使用 title_msg footer_msg 标签 格式...概率ably将使它们在本地和外部打印方法无法访问...
You are using the .label format for both the title_msg and footer_msg... It probably will make them local and unreachable from the external print method...


这篇关于声明常量字符串.DB字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆