0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MSX アセンブリで10進と16進表示

Posted at

16進表示

putx.asm
;10 bload "program.bin"
;20 def usr=&hd000:a=usr(&hf3):a=usr(&hc8)

	org	$d000

	inc	hl
	inc	hl
	call	put1
put1:
	xor	a
	rld
	cp	10
	sbc	a, $69
	daa
	rst	$18
	ret

10進表示

putd.asm
;10 bload "program.bin",r

	org	$d000
start:
	ld	hl, 59634
	ld	de, 10000
	call	put1
	ld	de, 1000
	call	put1
	ld	de, 100
	call	put1
	ld	e, 10
	call	put1
	ld	a, '0'
	add	a, l
	rst	$18
	ret
put1:
	ld	a, '0' - 1
L1:
	inc	a
	or	a
	sbc	hl, de
	jp	nc, L1
	add	hl, de
	rst	$18
	ret
end start

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?