1
0
mirror of https://github.com/livingcomputermuseum/UniBone.git synced 2026-02-23 15:42:54 +00:00
Files
livingcomputermuseum.UniBone/10.02_devices/3_test/cpu20/hello2.mac
Joerg Hoppe b2a79c5221 Cleanup
2019-12-19 10:30:45 +01:00

40 lines
762 B
Plaintext

.title Hello world program
; This program prints "Hello, world"
; (or any other string) on the serial console at 177650.
; Then it HALTs.
; On CONT, it repeats.
.asect
serial = 177560 ; base addr of DL11
.=0 ; incomplete
jmp @#start
.=2000
start:
mov #serial+4,r2 ; r2 points to DL11 transmitter section
mov #string,r1 ; r1 points to the current character
nxtchr:
mov (r1)+,r0 ; load xmt char into r0
beq done ; string ends with 0
movb r0,2(r2) ; xmt char
wait: tstb (r2) ; character transmitted?
bpl wait ; no, loop
br nxtchr ; transmit nxt char of string
done: halt
br start
string:
.word 110,145,154,154,157,054,040 ; "Hello, "
.word 167,157,162,154,144,041 ; "world!"
.word 15,12,0 ; CR, LF, NUL=end marker
.end