Page 1 of 1

Lesson H6- Hello World on the Camputers Lynx

Posted: Sun Sep 01, 2019 9:42 pm
by akuyou


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

Re: Lesson H6- Hello World on the Camputers Lynx

Posted: Fri Sep 25, 2020 4:39 am
by g0blinish
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