File: macro.asm

package info (click to toggle)
pasmo 0.5.2-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 932 kB
  • ctags: 1,503
  • sloc: cpp: 8,180; asm: 3,020; sh: 790; makefile: 111
file content (59 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;	macro.asm
; Test of MACRO and ENDM directives.
; Following a sample of the documentation of Digital Research MAC.
; For use with CP/M.

reboot	equ 0
tpa	equ 100h
bdos	equ 5
type	equ 2
cr	equ 0Dh
lf	equ 0Ah

_hola

chrout	macro
	ld c, type
	call bdos
	endm

typeout	macro ?message
	local pastsub
	jp pastsub
msgout:	ld e, (hl)
	ld a, e
	or a
	ret z
	inc hl
	push hl
	chrout
	pop hl
	jp msgout
pastsub:

; Redefine the typeout macro after the first invocation.
typeout	macro ??message
	local tymsg
	local pastm
	ld hl, tymsg
	call msgout
	jp pastm
tymsg:	db ??message, cr, lf, 0
pastm:
	endm

	typeout ?message

	endm

	org 100h

	typeout "Hello, \"macro\" world"

	typeout "\x30\7"

	typeout 'That''s all folks!'

	jp reboot

	end