Lesson H6- Hello World on the Camputers Lynx

Post Reply
User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Lesson H6- Hello World on the Camputers Lynx

Post by akuyou » Sun Sep 01, 2019 9:42 pm



http://www.chibiakumas.com/z80/helloworld.php#LessonH6

The Camputers Lynx is one of the more odd 8 bits - getting Hello World on the screen is pretty easy, but due to a lack of tools, making a TAP file is not!

Lets learn how to make Hello World, and turn it into a valid tap file to run on our emulator
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

g0blinish
Posts: 4
Joined: Thu Sep 24, 2020 12:27 pm

Re: Lesson H6- Hello World on the Camputers Lynx

Post by g0blinish » Fri Sep 25, 2020 4:39 am

I used sjasm for building .TAP

Code: Select all

	device zxspectrum128

	org $6500-13
tap_b:
;name
	db $22,"NONAME",$22
;type
	db "M"
;program length
	dw end-begin
;load point
	dw begin
	org $6500
begin
	xor a					;By default lynx makes a noise
	out (%10000100),a		;so we mute the noise here!
	
	ld hl,Message			;Address of string
	call PrintString		;Show String to screen

	ret 					;return to basic
	
NewLine:
	ld a,13					;Carriage return
	jp PrintChar

PrintChar:
	rst 8
	ret
	
PrintString:
	ld a,(hl)				;Print a '255' terminated string 
	cp 255
	ret z
	inc hl
	call PrintChar
	jr PrintString

Message: db 'Hello World 323!',255

end

;calc checksum
    LUA
    local checksum
    checksum=0

    for i=sj.get_label("begin"),sj.get_label("end") do
    checksum=checksum+sj.get_byte( i )
    end
--	print("cs:",string.format("%08X",checksum))
	sj.insert_label("CSU", checksum%256)
    ENDLUA

;rest tail
checkd: db CSU,CSU ;checksum LSB two times
;execute point
	dw begin
;high byte of execute point
	db begin/256
tap_e:
;	display /d,end-begin

	savebin "hlw.tap",tap_b,tap_e-tap_b


Post Reply

Return to “Camputers Lynx Assembly Programming”